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

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';

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