Skip to main content
Glama

get-video-categories

Retrieve YouTube video categories by region using the MCP server. Specify a region code to fetch relevant categories for targeted search or content organization.

Instructions

Retrieve available video categories for a specific region

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionCodeNo

Implementation Reference

  • src/index.ts:525-558 (registration)
    Registration of the 'get-video-categories' tool, including input schema (regionCode optional string) and the complete handler function that uses the YouTube Data API v3 to list video categories for the specified region (default 'US'), formats them into id/title objects, and returns as JSON text content.
    server.tool(
      'get-video-categories',
      'Retrieve available video categories for a specific region',
      {
        regionCode: z.string().length(2).optional()
      },
      async ({ regionCode = 'US' }) => {
        try {
          const response = await youtubeService.youtube.videoCategories.list({
            part: ['snippet'],
            regionCode
          });
    
          const categories = response.data.items?.map(category => ({
            id: category.id,
            title: category.snippet?.title
          }));
    
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(categories, null, 2)
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: `Error fetching video categories: ${error}`
            }],
            isError: true
          };
        }
      }
  • The exact handler function implementing the tool logic: calls youtubeService.youtube.videoCategories.list with part 'snippet' and regionCode, maps items to {id, title}, returns JSON stringified in text content, handles errors.
    async ({ regionCode = 'US' }) => {
      try {
        const response = await youtubeService.youtube.videoCategories.list({
          part: ['snippet'],
          regionCode
        });
    
        const categories = response.data.items?.map(category => ({
          id: category.id,
          title: category.snippet?.title
        }));
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(categories, null, 2)
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Error fetching video categories: ${error}`
          }],
          isError: true
        };
      }
  • Input schema using Zod: optional regionCode as 2-character string.
    {
      regionCode: z.string().length(2).optional()
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves categories, implying a read-only operation, but lacks details on permissions, rate limits, error handling, or return format. This is a significant gap for a tool with zero annotation coverage, leaving the agent uncertain about operational traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part ('Retrieve available video categories for a specific region') contributes directly to understanding the tool's function, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 parameter, no output schema, no annotations), the description is incomplete. It lacks details on behavioral aspects, parameter usage, and output expectations, which are crucial for the agent to invoke it correctly. While concise, it doesn't provide enough context to fully understand the tool's operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'for a specific region', which hints at the 'regionCode' parameter, but with 0% schema description coverage and no details on parameter meaning, format, or constraints (e.g., region codes like 'US'), it adds minimal value beyond the schema. For a single parameter tool, this is insufficient to compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Retrieve') and resource ('available video categories'), with specificity about the scope ('for a specific region'). It distinguishes from siblings like 'get-channel-stats' or 'get-video-stats' by focusing on categories rather than statistics. However, it doesn't explicitly differentiate from all siblings, such as 'search-videos' which might also involve categories.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal guidance by implying usage when video categories for a region are needed, but it offers no explicit when-to-use rules, alternatives, or exclusions. For example, it doesn't clarify if this should be used instead of other tools like 'search-videos' for category-related queries or if there are prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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

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