Skip to main content
Glama

get_video

Fetch complete metadata for a YouTube video by providing its ID. Returns snippet, status, statistics, and duration.

Instructions

Fetch full details for one video by ID — snippet, status, statistics, duration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
video_idYesYouTube video ID (the part after v= in the URL)

Implementation Reference

  • The handler function for get_video tool. Fetches video details by ID via client.getVideo() and returns the JSON result.
    async (args) => {
      const data = await client.getVideo(args.video_id);
      const video = data.items[0];
      if (!video) {
        return { content: [{ type: "text" as const, text: `Video not found: ${args.video_id}` }] };
      }
      return {
        content: [
          { type: "text" as const, text: JSON.stringify(video, null, 2) },
        ],
      };
    },
  • Input schema for get_video: takes a required video_id string field.
    const getVideoSchema = {
      video_id: z.string().describe("YouTube video ID (the part after v= in the URL)"),
    };
  • Registration of get_video tool on the MCP server using server.tool() with name 'get_video', description, schema, and handler.
    server.tool(
      "get_video",
      "Fetch full details for one video by ID — snippet, status, statistics, duration.",
      getVideoSchema,
  • YouTubeClient.getVideo() method that calls the YouTube Data API /videos endpoint with snippet, status, statistics, and contentDetails parts.
    getVideo(videoId: string): Promise<{ items: Video[] }> {
      return this.dataGet("/videos", {
        part: "snippet,status,statistics,contentDetails",
        id: videoId,
      });
    }
Behavior4/5

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

With no annotations, the description relies on the verb 'Fetch' to imply a read-only operation. It lists the returned fields, giving a clear behavioral expectation. However, it does not explicitly state that it is non-destructive or mention any authorization requirements.

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 sentence with a dash, front-loading the action and result. There is no redundancy or wasted words, making it highly efficient.

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

Completeness4/5

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

For a simple tool with one parameter and no output schema, the description sufficiently covers what the tool does and what it returns. However, it could be improved by mentioning any authentication needs or error conditions, but given the low complexity, it is adequate.

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

Parameters4/5

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

The schema already has 100% coverage with a description for video_id. The tool description adds meaningful context by noting that the ID is 'the part after v= in the URL', which provides practical usage guidance beyond the schema.

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

Purpose5/5

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

The description clearly states the verb 'Fetch full details' and specifies the resource 'video by ID'. It lists the returned data types (snippet, status, statistics, duration), distinguishing it from sibling tools like delete_video or list_my_videos.

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

Usage Guidelines3/5

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

The description implies usage when you have a specific video ID and need comprehensive details, but it does not explicitly state when to use this tool over alternatives like list_my_videos or list_comments, nor does it provide any exclusions.

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

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

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