Skip to main content
Glama

get_model_info

Retrieve detailed LLM/VLM model information including pricing, benchmarks, capabilities, and API code examples to support informed model selection decisions.

Instructions

Get detailed information about a specific LLM/VLM model: pricing, benchmarks, capabilities, and ready-to-use API code example. Returns structured Markdown (~300 tokens).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel ID or partial name (e.g., "anthropic/claude-sonnet-4.6", "gpt-5.1", "gemini")
include_api_exampleNoInclude API usage code example (default: true)
api_formatNoAPI example format (default: openai_sdk)

Implementation Reference

  • The main handler function that executes get_model_info tool logic. It accepts model ID (with fuzzy matching), optional API example parameters, queries the ModelRegistry, and returns formatted model details with pricing, benchmarks, capabilities, and API usage examples.
    async ({ model, include_api_example, api_format }) => {
      await registry.ensureLoaded();
    
      const found = registry.getModel(model);
    
      if (!found) {
        const similar = registry.findSimilar(model);
        return {
          content: [
            {
              type: "text" as const,
              text: `Model "${model}" not found.${similar.length > 0 ? ` Did you mean: ${similar.join(", ")}?` : ""}`,
            },
          ],
          isError: true,
        };
      }
    
      const fetchedAt = registry.getCacheFreshnessMs();
      let output = formatModelDetail(found, fetchedAt);
    
      // Add API example
      if (include_api_example !== false) {
        const format = api_format ?? "openai_sdk";
        const example = getApiExample(format, found.id);
        if (example) {
          output += `\n\n### API Example (${format})\n\`\`\`${example.language}\n${example.code}\n\`\`\``;
        }
      }
    
      return {
        content: [{ type: "text" as const, text: output }],
      };
    }
  • Zod schema definition for get_model_info tool inputs. Defines three parameters: model (required string with partial name matching), include_api_example (optional boolean, default true), and api_format (optional enum: openai_sdk/curl/python_requests).
      model: z
        .string()
        .describe(
          'Model ID or partial name (e.g., "anthropic/claude-sonnet-4.6", "gpt-5.1", "gemini")'
        ),
      include_api_example: z
        .boolean()
        .optional()
        .describe("Include API usage code example (default: true)"),
      api_format: z
        .enum(["openai_sdk", "curl", "python_requests"])
        .optional()
        .describe("API example format (default: openai_sdk)"),
    },
  • Registers the get_model_info tool with the MCP server. Includes tool name, description, input schema, and the async handler function that processes requests and returns Markdown-formatted model information.
    export function registerModelInfoTool(
      server: McpServer,
      registry: ModelRegistry
    ): void {
      server.tool(
        "get_model_info",
        "Get detailed information about a specific LLM/VLM model: pricing, benchmarks, capabilities, " +
          "and ready-to-use API code example. Returns structured Markdown (~300 tokens).",
        {
          model: z
            .string()
            .describe(
              'Model ID or partial name (e.g., "anthropic/claude-sonnet-4.6", "gpt-5.1", "gemini")'
            ),
          include_api_example: z
            .boolean()
            .optional()
            .describe("Include API usage code example (default: true)"),
          api_format: z
            .enum(["openai_sdk", "curl", "python_requests"])
            .optional()
            .describe("API example format (default: openai_sdk)"),
        },
        async ({ model, include_api_example, api_format }) => {
          await registry.ensureLoaded();
    
          const found = registry.getModel(model);
    
          if (!found) {
            const similar = registry.findSimilar(model);
            return {
              content: [
                {
                  type: "text" as const,
                  text: `Model "${model}" not found.${similar.length > 0 ? ` Did you mean: ${similar.join(", ")}?` : ""}`,
                },
              ],
              isError: true,
            };
          }
    
          const fetchedAt = registry.getCacheFreshnessMs();
          let output = formatModelDetail(found, fetchedAt);
    
          // Add API example
          if (include_api_example !== false) {
            const format = api_format ?? "openai_sdk";
            const example = getApiExample(format, found.id);
            if (example) {
              output += `\n\n### API Example (${format})\n\`\`\`${example.language}\n${example.code}\n\`\`\``;
            }
          }
    
          return {
            content: [{ type: "text" as const, text: output }],
          };
        }
      );
    }
  • Helper function that formats a single model's data into structured Markdown. Outputs provider info, modality, pricing table, benchmarks table, percentile ranks, and capabilities. Used by get_model_info handler to generate the response text.
    export function formatModelDetail(model: UnifiedModel, fetchedAt?: number): string {
      const lines: string[] = [];
    
      lines.push(`## ${model.id}`);
      lines.push("");
      const metaParts = [
        `**Provider**: ${model.metadata.provider}`,
        `**Modality**: ${fmtModalities(model.capabilities.inputModalities)}→${fmtModalities(model.capabilities.outputModalities)}`,
      ];
      if (model.metadata.releaseDate) {
        metaParts.push(`**Released**: ${model.metadata.releaseDate}`);
      }
      if (model.metadata.isOpenSource) {
        metaParts.push("**Open Source**");
      }
      lines.push(metaParts.join(" | "));
    
      // Pricing
      lines.push("");
      lines.push("### Pricing");
      lines.push("| Metric | Value |");
      lines.push("|--------|-------|");
      lines.push(`| Input | ${fmtPrice(model.pricing.input)} /1M tok |`);
      lines.push(`| Output | ${fmtPrice(model.pricing.output)} /1M tok |`);
      if (model.pricing.cacheRead !== undefined) {
        lines.push(`| Cache Read | ${fmtPrice(model.pricing.cacheRead)} /1M tok |`);
      }
      if (model.pricing.reasoning !== undefined) {
        lines.push(`| Reasoning | ${fmtPrice(model.pricing.reasoning)} /1M tok |`);
      }
      lines.push(`| Context | ${fmtContext(model.capabilities.contextLength)} |`);
      if (model.capabilities.maxOutputTokens) {
        lines.push(`| Max Output | ${fmtContext(model.capabilities.maxOutputTokens)} |`);
      }
    
      // Benchmarks (only non-null)
      const benchEntries = Object.entries(model.benchmarks).filter(
        ([, v]) => v !== undefined && v !== null
      );
      if (benchEntries.length > 0) {
        lines.push("");
        lines.push("### Benchmarks");
        lines.push("| Benchmark | Score |");
        lines.push("|-----------|-------|");
        for (const [key, value] of benchEntries) {
          const label = benchmarkLabel(key);
          const formatted = key === "arenaElo" ? fmtElo(value as number) : fmtScore(value as number);
          lines.push(`| ${label} | ${formatted} |`);
        }
      }
    
      // Percentile ranks (only non-null)
      const percEntries = Object.entries(model.percentiles).filter(
        ([, v]) => v !== undefined && v !== null
      );
      if (percEntries.length > 0) {
        lines.push("");
        lines.push("### Percentile Ranks");
        lines.push("| Category | Percentile |");
        lines.push("|----------|------------|");
        for (const [key, value] of percEntries) {
          lines.push(`| ${percentileLabel(key)} | P${value} |`);
        }
      }
    
      // Capabilities
      const caps: string[] = [];
      if (model.capabilities.supportsTools) caps.push("Tools");
      if (model.capabilities.supportsReasoning) caps.push("Reasoning");
      if (model.capabilities.inputModalities.includes("image")) caps.push("Vision");
      if (caps.length > 0) {
        lines.push("");
        lines.push(`**Capabilities**: ${caps.join(", ")}`);
      }
    
      lines.push(freshnessFooter(fetchedAt));
    
      return lines.join("\n");
    }
  • Helper function that generates ready-to-use API code examples in different formats (OpenAI SDK, curl, Python requests). Returns templated code with the model ID substituted, used by get_model_info to include practical usage examples.
    export function getApiExample(
      format: string,
      modelId: string
    ): { code: string; language: string } | null {
      const example = EXAMPLES[format];
      if (!example) return null;
      return {
        code: example.template.replace(/\{\{MODEL_ID\}\}/g, modelId),
        language: example.language,
      };
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the output format (structured Markdown) and approximate size (~300 tokens), which is useful behavioral context. However, it lacks details on error handling, rate limits, authentication needs, or whether the operation is read-only (implied by 'Get' but not explicit).

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, well-structured sentence that efficiently conveys the tool's purpose, content, and output format without unnecessary words. It is front-loaded with the core action and resource, making it easy to scan and understand.

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?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is reasonably complete. It covers the purpose, output format, and content, but could improve by addressing behavioral aspects like error cases or usage guidelines relative to siblings. The lack of output schema means the description should ideally hint at return structure, which it does with 'structured Markdown (~300 tokens)'.

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 description coverage is 100%, so the schema fully documents the parameters. The description adds minimal value beyond the schema by mentioning 'pricing, benchmarks, capabilities, and ready-to-use API code example', which loosely relates to parameters but does not provide additional syntax or format details. Baseline 3 is appropriate as the schema handles the heavy lifting.

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 'Get' and the resource 'detailed information about a specific LLM/VLM model', specifying the content (pricing, benchmarks, capabilities, API code example) and output format (structured Markdown). It distinguishes from sibling tools like compare_models, list_top_models, and recommend_model by focusing on a single model's details rather than comparison, listing, or recommendation.

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?

The description implies usage when detailed information about a specific model is needed, with context about what information is returned. However, it does not explicitly state when to use this tool versus alternatives like compare_models for comparisons or list_top_models for overviews, nor does it provide exclusions or 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

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/Daichi-Kudo/llm-advisor-mcp'

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