list_models
Retrieve available DeepSeek models to validate and select a model ID before using generation tools.
Instructions
List available DeepSeek models for model selection and validation. This tool takes no parameters. Use it before passing an explicit model ID to generation tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp-server.ts:336-362 (registration)Registration of the 'list_models' tool with the MCP server via server.registerTool(). Defines description, inputSchema (empty), readOnlyHint annotation, and the handler callback.
server.registerTool( "list_models", { description: "List available DeepSeek models for model selection and validation. This tool takes no parameters. Use it before passing an explicit model ID to generation tools.", inputSchema: emptyToolInputSchema, annotations: { readOnlyHint: true, }, }, async () => { try { const models = await options.client.listModels(); return { content: [ { type: "text", text: models.data.map((model) => model.id).join("\n") || "(no models returned)", }, ], structuredContent: models as unknown as Record<string, unknown>, }; } catch (error) { return makeToolErrorResult(error); } }, ); - src/mcp-server.ts:346-361 (handler)Handler function for 'list_models': calls options.client.listModels() and returns model IDs joined by newlines in the response content, plus the full structured response.
async () => { try { const models = await options.client.listModels(); return { content: [ { type: "text", text: models.data.map((model) => model.id).join("\n") || "(no models returned)", }, ], structuredContent: models as unknown as Record<string, unknown>, }; } catch (error) { return makeToolErrorResult(error); } }, - src/deepseek/client.ts:129-135 (helper)DeepSeekApiClient.listModels() method that makes a GET request to /models and returns a DeepSeekListModelsResponse.
async listModels(): Promise<DeepSeekListModelsResponse> { return this.requestJson<DeepSeekListModelsResponse>({ method: "GET", path: "/models", stream: false, }); } - src/deepseek/types.ts:156-159 (schema)DeepSeekListModelsResponse type definition with 'object' and 'data' (array of DeepSeekModel) fields.
export interface DeepSeekListModelsResponse { object: string; data: DeepSeekModel[]; } - src/deepseek/types.ts:148-154 (schema)DeepSeekModel type definition with 'id', 'object', 'owned_by', 'created', and additional unknown fields.
export interface DeepSeekModel { id: string; object: string; owned_by?: string; created?: number; [key: string]: unknown; }