Skip to main content
Glama

resolve_channel

Read-only

Convert any YouTube handle, URL, or ID into canonical channel info including ID, name, stats, and avatar. Use this to obtain a channel ID for further operations.

Instructions

Resolve a YouTube @handle, channel URL, video URL, or raw channel ID into canonical channel info (channel ID, name, handle, subscriber count, video count, avatar). Call this first when you only have a handle or URL but need a channel ID for the other channel-scoped tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes@handle (e.g. '@MrBeast'), channel URL, video URL, or UC... channel ID. All common forms are accepted.

Implementation Reference

  • Schema definition for the 'resolve_channel' tool, declaring its input parameter (a string 'input' for @handle, channel URL, video URL, or UC... channel ID) and description.
      name: "resolve_channel",
      description:
        "Resolve a YouTube @handle, channel URL, video URL, or raw channel ID into canonical channel info (channel ID, name, handle, subscriber count, video count, avatar). Call this first when you only have a handle or URL but need a channel ID for the other channel-scoped tools.",
      annotations: { title: "Resolve YouTube Channel", ...ANN.YT_READ },
      inputSchema: {
        type: "object",
        properties: {
          input: {
            type: "string",
            description:
              "@handle (e.g. '@MrBeast'), channel URL, video URL, or UC... channel ID. All common forms are accepted.",
            minLength: 1,
          },
        },
        required: ["input"],
      },
    },
  • The callUpstream function that serves as the handler for all tools, including resolve_channel. It forwards the tool name and arguments to the upstream MCP server (api.subdownload.com/mcp) via a POST request with Bearer auth.
    async function callUpstream(name, args) {
      if (!API_KEY) {
        throw new Error(
          "SUBDOWNLOAD_API_KEY env var is not set. Get one at https://subdownload.com/account, then run with -e SUBDOWNLOAD_API_KEY=<your-key>."
        );
      }
      const res = await fetch(UPSTREAM_URL, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Accept: "application/json, text/event-stream",
          Authorization: `Bearer ${API_KEY}`,
        },
        body: JSON.stringify({
          jsonrpc: "2.0",
          id: Date.now(),
          method: "tools/call",
          params: { name, arguments: args },
        }),
      });
      const text = await res.text();
      let body;
      try {
        body = JSON.parse(text);
      } catch {
        throw new Error(
          `Upstream returned non-JSON response (HTTP ${res.status}): ${text.slice(0, 200)}`
        );
      }
      if (body.error) {
        throw new Error(body.error.message || JSON.stringify(body.error));
      }
      return body.result;
    }
  • src/index.js:450-462 (registration)
    Registration of the CallToolRequestSchema handler which dispatches all tool calls (including resolve_channel) to callUpstream.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        return await callUpstream(
          request.params.name,
          request.params.arguments || {}
        );
      } catch (err) {
        return {
          content: [{ type: "text", text: err.message || String(err) }],
          isError: true,
        };
      }
    });
  • src/index.js:448-448 (registration)
    Registration of the ListToolsRequestSchema handler that returns the TOOLS array, which includes the resolve_channel tool definition.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
Behavior4/5

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

Annotations already indicate readOnlyHint=true, so the description doesn't need to restate safety. It adds value by detailing what the tool returns (channel ID, name, stats). No contradictions.

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?

Two efficient sentences: first explains functionality and output, second gives usage guidance. No wasted words.

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

Completeness5/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 fully covers purpose, output, and usage context. Minor omissions (e.g., error handling) are acceptable given the tool's simplicity.

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

Parameters3/5

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

The single parameter is fully described in the schema with examples. The tool description adds no additional meaning beyond the schema, so baseline 3 is appropriate.

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 tool resolves various input forms into canonical channel info, listing specific output fields. It distinguishes from sibling tools by focusing on resolution of handles/URLs to IDs.

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

Usage Guidelines5/5

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

Explicitly instructs 'Call this first when you only have a handle or URL but need a channel ID for the other channel-scoped tools,' providing clear when-to-use and linking to alternatives.

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/SubDownload/subdownload-mcp'

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