get_model_details
Look up pricing, context window, and capabilities for any LLM model. Fuzzy matching identifies models even without exact names.
Instructions
Look up pricing, context window, and capabilities for an LLM model. Uses fuzzy matching so you don't need the exact model key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_name | Yes | Model name to look up (e.g. 'claude-sonnet-4-5', 'gpt-4o', 'gemini-2.0-flash') |
Implementation Reference
- src/tools.ts:6-21 (registration)Registration of the 'get_model_details' tool in the tools array, defining its name, description, and input schema (requires model_name string).
{ name: "get_model_details", description: "Look up pricing, context window, and capabilities for an LLM model. Uses fuzzy matching so you don't need the exact model key.", inputSchema: { type: "object" as const, properties: { model_name: { type: "string", description: "Model name to look up (e.g. 'claude-sonnet-4-5', 'gpt-4o', 'gemini-2.0-flash')", }, }, required: ["model_name"], }, }, - src/tools.ts:87-89 (schema)Zod validation schema for get_model_details, requiring a non-empty model_name string.
const getModelDetailsSchema = z.object({ model_name: z.string().min(1), }); - src/tools.ts:236-260 (handler)Handler function for the get_model_details tool: parses args, fetches models, fuzzy-matches the model name, and returns formatted model details (pricing, context, capabilities).
case "get_model_details": { const { model_name } = getModelDetailsSchema.parse(args); const models = await getModels(); const { entry: model, isFineTuned } = fuzzyMatchWithMetadata(model_name, models); if (!model) { return { content: [ { type: "text", text: `No model found matching "${model_name}". Try a different name or use compare_models to browse available models.`, }, ], }; } const details = formatModelDetails(model); const note = isFineTuned ? `\nâ ď¸ Note: This is pricing for the base model (${model.key}). Fine-tuned models use the same pricing as their base model.` : ""; return { content: [{ type: "text", text: details + note }], }; } - src/tools.ts:177-228 (helper)Helper function that formats a ModelEntry into a human-readable string with pricing (including tiered and prompt caching), context window, and capabilities details.
function formatModelDetails(model: ModelEntry): string { const capabilities: string[] = []; if (model.supports_vision) capabilities.push("vision"); if (model.supports_function_calling) capabilities.push("function_calling"); if (model.supports_parallel_function_calling) capabilities.push("parallel_function_calling"); const hasTieredInput = model.input_cost_per_million_above_200k != null; const hasTieredOutput = model.output_cost_per_million_above_200k != null; const hasTiered = hasTieredInput || hasTieredOutput; const tieredLines: string[] = []; if (hasTiered) { tieredLines.push(``); tieredLines.push( `Tiered Pricing (above ${formatTokenCount(TIERED_PRICING_THRESHOLD)} tokens, per 1M):`, ); if (hasTieredInput) { tieredLines.push(` Input: ${formatCost(model.input_cost_per_million_above_200k ?? 0)}`); } if (hasTieredOutput) { tieredLines.push(` Output: ${formatCost(model.output_cost_per_million_above_200k ?? 0)}`); } } const cachingLines: string[] = []; if (model.cache_read_input_token_cost_per_million != null) { cachingLines.push(``); cachingLines.push(`Prompt Caching:`); cachingLines.push( ` Cached input: ${formatCost(model.cache_read_input_token_cost_per_million)} / 1M tokens`, ); } return [ `Model: ${model.key}`, `Provider: ${model.litellm_provider}`, `Mode: ${model.mode}`, ``, `Pricing (per 1M tokens):`, ` Input: ${formatCost(model.input_cost_per_million)}`, ` Output: ${formatCost(model.output_cost_per_million)}`, ...tieredLines, ...cachingLines, ``, `Context Window:`, ` Max Input: ${formatTokenCount(model.max_input_tokens)}`, ` Max Output: ${formatTokenCount(model.max_output_tokens)}`, ...(model.max_tokens !== null ? [` Max Tokens: ${formatTokenCount(model.max_tokens)}`] : []), ``, `Capabilities: ${capabilities.length > 0 ? capabilities.join(", ") : "none listed"}`, ].join("\n"); }