list_models
Retrieve available AI models to identify the best one for your specific query or find model IDs for chat interactions.
Instructions
Get all the models you can chat with. Each model has different strengths and expertise. Call this first to see which model is best for your question, or to find a specific model ID to use in the chat tool.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp-tools.ts:158-203 (registration)Registration of the 'list_models' tool using server.registerTool, including title, description, empty inputSchema, and inline handler function.server.registerTool( "list_models", { title: "See Available Models to Talk To", description: "Get all the models you can chat with. Each model has different strengths and expertise. Call this first to see which model is best for your question, or to find a specific model ID to use in the chat tool.", inputSchema: z.object({}), }, async () => { try { const models: ModelInfo[] = config.models.map((m) => ({ id: m.id, modelName: m.modelName, baseUrl: m.baseUrl, })); logger.debug("Listed models", { count: models.length }); return { content: [ { type: "text" as const, text: JSON.stringify({ models, }), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); logger.error( "List models tool error", error instanceof Error ? error : new Error(errorMessage) ); return { content: [ { type: "text" as const, text: `Error: ${errorMessage}`, }, ], }; } } );
- src/mcp-tools.ts:166-202 (handler)The handler function for list_models tool. It extracts model info from config.models, logs the count, and returns a JSON-stringified list of models in the MCP response format. Handles errors gracefully.async () => { try { const models: ModelInfo[] = config.models.map((m) => ({ id: m.id, modelName: m.modelName, baseUrl: m.baseUrl, })); logger.debug("Listed models", { count: models.length }); return { content: [ { type: "text" as const, text: JSON.stringify({ models, }), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); logger.error( "List models tool error", error instanceof Error ? error : new Error(errorMessage) ); return { content: [ { type: "text" as const, text: `Error: ${errorMessage}`, }, ], }; } }
- src/mcp-tools.ts:160-165 (schema)Tool schema definition including title, description, and inputSchema (zod object with no properties, as no input params are needed).{ title: "See Available Models to Talk To", description: "Get all the models you can chat with. Each model has different strengths and expertise. Call this first to see which model is best for your question, or to find a specific model ID to use in the chat tool.", inputSchema: z.object({}), },