Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Add 3 new YouTube tools: captions, trending, video categories
  • Enhance all existing YouTube tools with additional API parameters and response fields
  • Add live streaming details support to video_details
  • Add eventType filter and liveBroadcastContent to search
  • Update block definition with new operations and fields
  • Update documentation

Type of Change

  • New feature (non-breaking change which adds functionality)

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 29, 2026 3:00am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 29, 2026

Greptile Overview

Greptile Summary

This PR significantly expands YouTube integration by adding 3 new tools and enhancing all existing ones with better API coverage and error handling.

New Tools Added:

  • youtube_captions: Lists available caption tracks with language, type, and auto-generation status
  • youtube_trending: Fetches trending videos filtered by region and category
  • youtube_video_categories: Gets available video categories for different regions

Enhancements to Existing Tools:

  • youtube_search: Added 9 new filter parameters (eventType, videoCaption, videoDefinition, videoCategoryId, regionCode, relevanceLanguage, safeSearch, videoDuration, order) and liveBroadcastContent output field
  • youtube_video_details: Added comprehensive live streaming support (scheduled/actual start/end times, concurrent viewers, live chat ID) and metadata fields (categoryId, definition, caption, privacy status, languages)
  • youtube_channel_info: Added channel branding fields (customUrl, country, uploadsPlaylistId, bannerImageUrl, hiddenSubscriberCount)
  • youtube_comments: Added authorProfileImageUrl field
  • youtube_playlist_items: Added video owner channel fields (videoOwnerChannelId, videoOwnerChannelTitle)
  • All tools: Improved error handling, proper URL encoding with encodeURIComponent(), consistent null coalescing with ?? operator

Infrastructure Updates:

  • Block definition includes all new operations with comprehensive UI inputs including wand helpers for timestamp generation
  • Tool registry properly registers all new tools
  • Type definitions comprehensive and maintain type safety
  • Proper API key visibility (user-only) per custom rule 2851870a-bd1b-44d3-bc5b-1c7e716acec8

Quality Improvements:

  • Consistent error handling patterns across all tools
  • Proper parameter encoding to prevent URL injection issues
  • Version bumps reflect the enhancements (1.0.0 → 1.1.0/1.2.0)
  • Better descriptions and documentation

Confidence Score: 5/5

  • This PR is safe to merge - all changes follow established patterns, include proper type safety, error handling, and security practices
  • The implementation is high quality with consistent patterns, proper error handling, correct API key visibility per custom rules, appropriate URL encoding for security, comprehensive type definitions, and well-structured block configurations. All new tools follow the exact same patterns as existing tools.
  • No files require special attention - all implementations are consistent and follow best practices

Important Files Changed

Filename Overview
apps/sim/tools/youtube/captions.ts new tool to list available caption tracks for videos, follows patterns, correct API key visibility
apps/sim/tools/youtube/trending.ts new tool to fetch trending videos by region/category, includes proper pagination and statistics
apps/sim/tools/youtube/video_categories.ts new tool to get video categories for different regions, filters non-assignable categories correctly
apps/sim/tools/youtube/video_details.ts enhanced with live streaming details (scheduled/actual times, viewers, chat ID) and additional metadata fields
apps/sim/tools/youtube/search.ts significantly enhanced with 9 new filter parameters (eventType, videoCaption, videoDefinition, etc.) and liveBroadcastContent output
apps/sim/tools/youtube/types.ts comprehensive type definitions for all new tools and enhanced fields, maintains type safety across the module
apps/sim/blocks/blocks/youtube.ts block config updated with all 3 new operations and enhanced parameters including eventType, wand timestamp helpers, complete I/O definitions

Sequence Diagram

sequenceDiagram
    participant User
    participant Block as YouTube Block
    participant Registry as Tool Registry
    participant Tool as YouTube Tool
    participant API as YouTube Data API v3

    User->>Block: Select operation (search/trending/captions/etc)
    User->>Block: Configure parameters (apiKey, filters, etc)
    Block->>Block: Determine tool from operation
    Block->>Registry: Request tool execution
    Registry->>Tool: Execute with params
    Tool->>Tool: Build API URL with query params
    Tool->>Tool: Encode parameters (videoId, pageToken, etc)
    Tool->>API: GET request with API key
    API-->>Tool: JSON response
    Tool->>Tool: Transform response
    Tool->>Tool: Map fields with null coalescing (??)
    Tool->>Tool: Handle errors (data.error)
    Tool-->>Registry: Return ToolResponse
    Registry-->>Block: Return output
    Block-->>User: Display results (items, stats, pagination)
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@waleedlatif1 waleedlatif1 merged commit 1469e9c into staging Jan 29, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/youtube branch January 29, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants