Skip to main content
Glama

llm_get_models

Retrieves available language models from OpenAI-compatible LLM servers to identify options for testing, benchmarking, and chat operations.

Instructions

Obtiene la lista de modelos disponibles en el servidor LLM (compatible con OpenAI API: LM Studio, Ollama, vLLM, OpenAI, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseURLNoURL del servidor OpenAI-compatible (ej: http://localhost:1234/v1, http://localhost:11434/v1)
apiKeyNoAPI Key (requerida para OpenAI/Azure, opcional para servidores locales)

Implementation Reference

  • The core handler function for the 'llm_get_models' tool. It creates an LLMClient instance, lists available models from the server, and returns a JSON-formatted response with model IDs, owners, count, and baseURL.
    async llm_get_models(args: z.infer<typeof GetModelsSchema> = {}) {
      const client = getClient(args);
      const models = await client.listModels();
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify({
              models: models.map(m => ({
                id: m.id,
                owned_by: m.owned_by,
              })),
              count: models.length,
              baseURL: args.baseURL || defaultConfig.baseURL,
            }, null, 2),
          },
        ],
      };
    },
  • MCP tool registration entry defining the name, description, and input schema (connection properties like baseURL and apiKey) for 'llm_get_models'.
    {
      name: "llm_get_models",
      description: "Obtiene la lista de modelos disponibles en el servidor LLM (compatible con OpenAI API: LM Studio, Ollama, vLLM, OpenAI, etc.)",
      inputSchema: {
        type: "object" as const,
        properties: {
          ...connectionProperties,
        },
        required: [],
      },
    },
  • Zod schema for input validation of llm_get_models arguments, extending the base ConnectionConfigSchema.
    export const GetModelsSchema = ConnectionConfigSchema.extend({});
  • src/index.ts:52-53 (registration)
    Registration in the MCP server's CallToolRequest handler that dispatches to the llm_get_models tool handler based on the tool name.
    case "llm_get_models":
      return await toolHandlers.llm_get_models(args as any);
  • src/index.ts:42-44 (registration)
    MCP server handler for listing tools, which returns the tools array including 'llm_get_models'.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool is compatible with various LLM servers but does not describe behavioral traits such as whether it requires authentication (implied by the 'apiKey' parameter but not stated), rate limits, error handling, or what the output looks like (e.g., list format). This is a significant gap for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the purpose and adds compatibility context. It is appropriately sized and front-loaded with the core function. However, it could be slightly more structured by separating the compatibility note into a second sentence for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a tool to fetch models from various LLM servers), lack of annotations, and no output schema, the description is incomplete. It does not explain what the return value includes (e.g., model names, IDs, capabilities) or handle behavioral aspects like authentication needs. This leaves gaps for the agent to understand the tool fully.

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

Parameters3/5

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

The schema description coverage is 100%, so the input schema already documents both parameters ('baseURL' and 'apiKey') with descriptions. The description adds no additional meaning beyond what the schema provides—it does not explain parameter usage, dependencies, or examples. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Obtiene la lista de modelos disponibles en el servidor LLM' (Gets the list of available models on the LLM server). It specifies the verb ('obtiene') and resource ('lista de modelos'), but does not explicitly differentiate it from sibling tools like 'llm_status' or 'llm_test_capabilities', which might also involve server interaction. The mention of compatibility with various LLM servers (OpenAI API, LM Studio, etc.) adds useful context.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention sibling tools like 'llm_status' (which might check server status) or 'llm_compare_models' (which might compare models), leaving the agent to infer usage based on tool names alone. There is no explicit 'when' or 'when not' context provided.

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/ramgeart/llm-mcp-bridge'

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