Skip to main content
Glama

describe_tool

Retrieve detailed information and input schema for any tool, enabling you to see exact parameters before calling it.

Instructions

Get detailed information about a specific tool, including its input schema. Use this to see the exact parameters a tool expects before calling it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesTool name to describe

Implementation Reference

  • The handleDescribeTool function is the main handler for the describe_tool meta-tool. It extracts the 'name' argument, calls describeTool() to look up tool info, and returns the result as a JSON response.
    export async function handleDescribeTool(
      ctx: MCPServerContext,
      args: Record<string, unknown>,
    ): Promise<ToolResponse> {
      const name = args.name as string;
    
      if (!name || typeof name !== 'string') {
        return asTextResponse(
          JSON.stringify({ success: false, error: 'name must be a non-empty string' }),
        );
      }
    
      const toolInfo = describeTool(name, ctx);
    
      if (!toolInfo) {
        return asTextResponse(JSON.stringify({ success: false, error: `Tool not found: ${name}` }));
      }
    
      return asTextResponse(JSON.stringify({ success: true, tool: toolInfo }, null, 2));
    }
  • The describeTool() utility function looks up a tool by name using getToolInputSchema and getToolDescription, normalizing the name first. Returns the tool's name, description, and inputSchema, or null if not found.
    export function describeTool(
      toolName: string,
      ctx: MCPServerContext,
    ): { name: string; description: string; inputSchema: Tool['inputSchema'] } | null {
      const canonicalName = normalizeToolName(toolName);
      const schema = getToolInputSchema(canonicalName, ctx);
      if (!schema) {
        return null;
      }
    
      return {
        name: canonicalName,
        description: getToolDescription(canonicalName, ctx),
        inputSchema: schema,
      };
    }
  • The getToolInputSchema() function retrieves a tool's input schema by checking built-in tools, extension tools, and meta-tools in order, used by describeTool.
    export function getToolInputSchema(
      toolName: string,
      ctx: MCPServerContext,
    ): Tool['inputSchema'] | undefined {
      const canonicalName = normalizeToolName(toolName);
    
      const builtInTool = getAllToolsByName().get(canonicalName);
      if (builtInTool) {
        return builtInTool.inputSchema;
      }
    
      const extTool = ctx.extensionToolsByName.get(canonicalName);
      if (extTool) {
        return extTool.tool.inputSchema;
      }
    
      const metaTool = ctx.metaToolsByName.get(canonicalName);
      if (metaTool) {
        return metaTool.inputSchema;
      }
    
      return undefined;
    }
  • The getToolDescription() function retrieves a tool's description by checking built-in tools, extension tools, and meta-tools in order, used by describeTool.
    export function getToolDescription(toolName: string, ctx: MCPServerContext): string {
      const canonicalName = normalizeToolName(toolName);
    
      const builtInTool = getAllToolsByName().get(canonicalName);
      if (builtInTool?.description) {
        return builtInTool.description.split('\n')[0] || 'No description available';
      }
    
      const extTool = ctx.extensionToolsByName.get(canonicalName);
      if (extTool?.tool?.description) {
        return extTool.tool.description.split('\n')[0] || 'No description available';
      }
    
      const metaTool = ctx.metaToolsByName.get(canonicalName);
      if (metaTool?.description) {
        return metaTool.description.split('\n')[0] || 'No description available';
      }
    
      return 'No description available';
    }
  • Registration of the describe_tool meta-tool with its name, description, inputSchema (requiring a 'name' string), and handler reference (handleDescribeTool).
    {
      name: 'describe_tool',
      description:
        'Get detailed information about a specific tool, including its input schema. ' +
        'Use this to see the exact parameters a tool expects before calling it.',
      inputSchema: {
        type: 'object',
        properties: {
          name: { type: 'string', description: 'Tool name to describe' },
        },
        required: ['name'],
      },
      handler: handleDescribeTool,
    },
  • Meta-tools are populated into ctx.metaToolsByName for describe_tool lookups, ensuring describe_tool can find the meta-tools' schemas.
        // Populate metaToolsByName for describe_tool lookups (single source)
        ctx.metaToolsByName.set(def.name, {
          name: def.name,
          description: def.description.split('\n')[0] || def.description,
          inputSchema: def.inputSchema as Tool['inputSchema'],
        });
      }
    }
  • The normalizeToolName() helper strips the 'mcp__' prefix if present, used by describeTool to canonicalize tool names.
    export function normalizeToolName(name: string): string {
      const trimmed = name.trim();
      if (!trimmed.startsWith('mcp__')) {
        return trimmed;
      }
    
      const parts = trimmed.split('__');
      if (parts.length < 3) {
        return trimmed;
      }
    
      return parts.slice(2).join('__');
    }
Behavior3/5

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

No annotations provided; description accurately states it retrieves tool info and input schema, but offers no additional behavioral context.

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?

Single sentence, front-loaded with purpose, no redundant 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?

Sufficient for a simple tool with one parameter and no output schema; could mention return format but not essential.

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?

Parameter 'name' already described in schema (100% coverage); description adds no extra meaning beyond 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?

Clear verb 'Get' and resource 'detailed information about a specific tool', distinct from sibling tools like call_tool or search_tools.

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

Usage Guidelines4/5

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

Explicitly suggests using before calling another tool to inspect parameters, but lacks explicit when-not-to-use guidance.

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/vmoranv/jshookmcp'

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