Skip to main content
Glama

See Available Models to Talk To

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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}`,
              },
            ],
          };
        }
      }
    );
  • 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}`,
            },
          ],
        };
      }
    }
  • 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({}),
    },
Behavior4/5

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

No annotations are provided, so the description carries full burden. It effectively describes the tool's behavior: retrieving all chat models, noting they have different strengths/expertise, and that the output can inform model selection. It doesn't mention rate limits or error handling, but covers core functionality well.

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?

Two concise sentences front-loaded with the core purpose, followed by usage guidance. Every sentence adds value: the first defines the tool, the second explains when and why to use it, with zero waste.

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 0 parameters, no annotations, and no output schema, the description provides sufficient context for a simple list operation. It explains the tool's role in the workflow and hints at output content (model IDs, strengths). A 5 would require more detail on output structure, but it's complete enough for basic use.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately adds context about the tool's purpose without redundant parameter details, exceeding the baseline of 3 for this scenario.

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 resource ('all the models you can chat with'), specifying it retrieves available chat models. It distinguishes from sibling tools by focusing on model listing rather than chatting or accessing history.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use: '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.' It provides clear alternatives (using the chat tool with a model ID) and timing guidance.

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/danielwpz/polybrain-mcp'

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