Skip to main content
Glama

list_llm_models

Discover available LLM models for configuring agent preferences in the Letta system. Use this tool to identify models when setting up or modifying agents.

Instructions

List available LLM models configured on the Letta server. Use with create_agent or modify_agent to set agent model preferences.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelsYes

Implementation Reference

  • The core handler function that executes the list_llm_models tool by fetching available LLM models from the server's /models/ endpoint and returning them as JSON.
    export async function handleListLlmModels(server, _args) {
        try {
            const headers = server.getApiHeaders();
    
            // Use the specific endpoint from the OpenAPI spec
            const response = await server.api.get('/models/', { headers });
            const models = response.data; // Assuming response.data is an array of LLMConfig objects
    
            return {
                content: [
                    {
                        type: 'text',
                        text: JSON.stringify({
                            model_count: models.length,
                            models: models,
                        }),
                    },
                ],
            };
        } catch (error) {
            server.createErrorResponse(error);
        }
    }
  • Tool schema definition including name, description, and empty input schema (no parameters required).
    export const listLlmModelsDefinition = {
        name: 'list_llm_models',
        description:
            'List available LLM models configured on the Letta server. Use with create_agent or modify_agent to set agent model preferences.',
        inputSchema: {
            type: 'object',
            properties: {}, // No input arguments needed
            required: [],
        },
    };
  • Registration of the handler function in the main tool dispatch switch statement.
    case 'list_llm_models':
        return handleListLlmModels(server, request.params.arguments);
  • Output schema defining the expected structure of the tool's response, used for validation and enhancement.
    list_llm_models: {
        type: 'object',
        properties: {
            models: {
                type: 'array',
                items: {
                    type: 'object',
                    properties: {
                        name: { type: 'string' },
                        provider: { type: 'string' },
                        context_window: { type: 'integer' },
                        supports_functions: { type: 'boolean' },
                    },
                    required: ['name'],
                },
            },
        },
        required: ['models'],
    },
  • Import statement bringing in the handler and definition for registration.
    import { handleListLlmModels, listLlmModelsDefinition } from './models/list-llm-models.js';
Behavior3/5

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

The annotations provide a title but no behavioral hints (readOnlyHint, destructiveHint, etc.). The description adds useful context about what gets listed (LLM models configured on the server) and their purpose (for agent model preferences), but doesn't disclose behavioral traits like rate limits, authentication needs, or pagination behavior. With no annotations covering these aspects, the description provides basic context but lacks operational details.

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 with zero waste. The first sentence states the purpose, and the second provides usage guidelines. Every word earns its place, and the information is front-loaded with the core functionality stated immediately.

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 the tool's simplicity (0 parameters, no annotations, but has an output schema), the description is mostly complete. It explains what the tool does and when to use it. The output schema exists, so the description doesn't need to explain return values. However, it could benefit from mentioning any limitations (e.g., whether it lists all models or only available ones), slightly reducing completeness.

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 tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of parameters. The description appropriately doesn't add parameter information, which is correct for a parameterless tool. The baseline for 0 parameters is 4, and the description doesn't contradict or confuse this.

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 specific action ('List available LLM models') and identifies the resource ('configured on the Letta server'). It distinguishes from siblings like list_embedding_models or list_mcp_servers by focusing specifically on LLM models, not other types of models or servers.

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?

The description explicitly states when to use this tool: 'Use with create_agent or modify_agent to set agent model preferences.' This provides clear context about its purpose in the workflow and distinguishes it from other listing tools that serve different purposes (like list_agents or list_memory_blocks).

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/oculairmedia/Letta-MCP-server'

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