Skip to main content
Glama

channels_getChannel

Retrieve YouTube channel information using a channel ID to access details like statistics, content, and metadata from the YouTube Data API.

Instructions

Get information about a YouTube channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYesThe YouTube channel ID

Implementation Reference

  • Core implementation of channel retrieval using YouTube Data API v3 channels.list endpoint.
    async getChannel({ channelId }: ChannelParams): Promise<unknown> { 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)}`); } }
  • MCP tool registration including schema definition and wrapper handler delegating to ChannelService.
    server.registerTool( 'channels_getChannel', { title: 'Get Channel Information', description: 'Get information about a YouTube channel', annotations: { readOnlyHint: true, idempotentHint: true }, inputSchema: { channelId: z.string().describe('The YouTube channel ID'), }, }, async ({ channelId }) => { const result = await channelService.getChannel({ channelId }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } );
  • TypeScript interface defining input parameters for channel operations, used by ChannelService.
    export interface ChannelParams { channelId: string; }

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/sfiorini/youtube-mcp'

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