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
| Name | Required | Description | Default |
|---|---|---|---|
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: [], }, };
- src/tools/output-schemas.js:273-290 (schema)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'], },
- src/tools/index.js:74-76 (registration)Import statement bringing in the handler function and tool definition for registration.handleListEmbeddingModels, listEmbeddingModelsDefinition, } from './models/list-embedding-models.js';
- src/tools/index.js:191-192 (registration)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);