Skip to main content
Glama

resolve_channel

Read-only

Resolve a YouTube @handle, channel URL, video URL, or channel ID into canonical channel information: ID, name, handle, subscriber count, video count, and avatar. Obtain the channel ID needed for other channel-scoped tools.

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

  • Tool definition/schema for 'resolve_channel' in the TOOLS array. Declares name, description, annotations, and inputSchema (accepts an 'input' string: @handle, URL, or channel ID).
    {
      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"],
      },
    },
  • Generic handler that forwards any tool call (including 'resolve_channel') to the upstream MCP server via 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,
        };
      }
    });
  • Generic upstream proxy function that forwards tool calls to https://api.subdownload.com/mcp with authentication.
    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:448-448 (registration)
    Tool registration via ListToolsRequestSchema — returns the TOOLS array (which includes resolve_channel) when the client lists tools.
    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. Description adds details on returned fields (channel ID, name, handle, subscriber count, video count, avatar) and accepted input forms, providing useful behavioral context beyond annotations.

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 concise sentences, front-loaded with purpose and output, followed by usage guidance. No wasted words.

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 resolver with good annotations, no output schema, and clear single parameter, the description adequately covers input, output, and usage context. Minor lack of error/rate limit info but not critical for this tool.

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?

Schema coverage is 100%; the schema description already explains accepted input forms. The description adds no new meaning beyond restating what the schema provides, so baseline 3.

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?

Description clearly states verb 'resolve' and resource 'canonical channel info', enumerates input forms, and distinguishes from siblings with 'Call this first when you only have a handle or URL but need a channel ID for other channel-scoped tools'.

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 states when to use ('when you only have a handle or URL but need a channel ID') and implies it's a prerequisite for sibling tools.

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