Skip to main content
Glama

channels_getChannel

Retrieve detailed information about a YouTube channel by providing its channel ID using the YouTube MCP Server interface.

Instructions

Get information about a YouTube channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYesThe YouTube channel ID

Implementation Reference

  • The main handler function in ChannelService that fetches YouTube channel details using the YouTube Data API v3.
    async getChannel({ 
      channelId 
    }: ChannelParams): Promise<any> {
      try {
        this.initialize();
        
        const response = await this.youtube.channels.list({
          part: ['snippet', 'statistics', 'contentDetails'],
          id: [channelId]
        });
    
        return response.data.items?.[0] || null;
      } catch (error) {
        throw new Error(`Failed to get channel: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • src/server.ts:99-112 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining the tool name, description, and input schema.
    {
        name: 'channels_getChannel',
        description: 'Get information about a YouTube channel',
        inputSchema: {
            type: 'object',
            properties: {
                channelId: {
                    type: 'string',
                    description: 'The YouTube channel ID',
                },
            },
            required: ['channelId'],
        },
    },
  • Dispatch handler in the CallToolRequestSchema switch that calls the ChannelService.getChannel and formats the response.
    case 'channels_getChannel': {
        const result = await channelService.getChannel(args as unknown as ChannelParams);
        return {
            content: [{
                type: 'text',
                text: JSON.stringify(result, null, 2)
            }]
        };
    }
  • TypeScript interface defining the input parameters for the channels_getChannel tool.
    export interface ChannelParams {
      channelId: string;
    }
Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ZubeidHendricks/youtube-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server