Skip to main content
Glama

list_models

Read-only

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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);
        }
      },
    );
  • 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);
      }
    },
  • 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,
      });
    }
  • DeepSeekListModelsResponse type definition with 'object' and 'data' (array of DeepSeekModel) fields.
    export interface DeepSeekListModelsResponse {
      object: string;
      data: DeepSeekModel[];
    }
  • 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;
    }
Behavior3/5

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

The annotations already declare readOnlyHint=true, so the description does not need to emphasize safety. The description adds that the tool takes no parameters, which is accurate. However, it does not disclose other behavioral aspects like caching or rate limits.

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 two sentences, front-loaded with the primary purpose, and contains no extraneous information. Every sentence is informative and earns its place.

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?

The description covers the tool's purpose, usage context, and parameter behavior. Given the tool's simplicity (no parameters, read-only), this is adequate. It could optionally mention the return format, but it's not critical.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has no parameters, and the description explicitly states 'takes no parameters', which adds clarity beyond the empty schema. This compensates for the lack of parameter descriptions.

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 tool's purpose: listing available DeepSeek models for model selection and validation. It uses a specific verb ('list') and resource ('available DeepSeek models'), and distinguishes it from sibling generation and balance 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?

The description provides explicit usage guidance: 'Use it before passing an explicit model ID to generation tools.' This tells when to use the tool and implies it's a prerequisite for generation, though it does not explicitly state when not to use it.

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/DMontgomery40/deepseek-mcp-server'

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