Skip to main content
Glama

list_embedding_models

Retrieve available embedding models to configure agent embedding preferences within the Letta system.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes the tool logic: fetches embedding models from the server API endpoint '/models/embedding' and returns them as JSON in a structured MCP response.
    export async function handleListEmbeddingModels(server, _args) {
        try {
            const headers = server.getApiHeaders();
    
            // Use the specific endpoint from the OpenAPI spec
            const response = await server.api.get('/models/embedding', { headers });
            const models = response.data; // Assuming response.data is an array of EmbeddingConfig objects
    
            return {
                content: [
                    {
                        type: 'text',
                        text: JSON.stringify({
                            model_count: models.length,
                            models: models,
                        }),
                    },
                ],
            };
        } catch (error) {
            server.createErrorResponse(error);
        }
    }
  • Tool definition schema including name, description, and empty input schema (no parameters required). Used for tool registration.
    export const listEmbeddingModelsDefinition = {
        name: 'list_embedding_models',
        description:
            'List available embedding models configured on the Letta server. Use with create_agent or modify_agent to set agent embedding preferences.',
        inputSchema: {
            type: 'object',
            properties: {}, // No input arguments needed
            required: [],
        },
    };
  • Output schema defining the expected response structure: object with 'models' array containing name, provider, and dimensions.
    list_embedding_models: {
        type: 'object',
        properties: {
            models: {
                type: 'array',
                items: {
                    type: 'object',
                    properties: {
                        name: { type: 'string' },
                        provider: { type: 'string' },
                        dimensions: { type: 'integer' },
                    },
                    required: ['name'],
                },
            },
        },
        required: ['models'],
    },
  • Import statement bringing in the handler function and tool definition for registration.
        handleListEmbeddingModels,
        listEmbeddingModelsDefinition,
    } from './models/list-embedding-models.js';
  • Dispatch logic in the main tool call handler switch statement that routes 'list_embedding_models' calls to the specific handler.
    case 'list_embedding_models':
        return handleListEmbeddingModels(server, request.params.arguments);

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