list_prompts
Discover available prompt templates, wizards, and workflows to streamline interactions with the Letta system.
Instructions
List all available prompt templates including wizards and workflows
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/prompts/list-prompts.js:6-37 (handler)The primary handler function for the 'list_prompts' tool. It retrieves all registered prompts from the promptRegistry, maps them to a simplified structure, and returns both a textual JSON representation and structured content with total count and prompt details.export async function handleListPrompts(server) { try { const prompts = Array.from(promptRegistry.values()).map((p) => ({ name: p.name, title: p.title || p.name, description: p.description, arguments: p.arguments || [], })); return { content: [ { type: 'text', text: JSON.stringify( { total_prompts: prompts.length, prompts, }, null, 2, ), }, ], structuredContent: { total_prompts: prompts.length, prompts, }, }; } catch (error) { return server.createErrorResponse(error, 'Failed to list prompts'); } }
- Tool definition including inputSchema (empty object, no arguments required) and detailed outputSchema specifying the structure of the response with total_prompts and an array of prompts.export const listPromptsToolDefinition = { name: 'list_prompts', description: 'List all available prompt templates including wizards and workflows', inputSchema: { type: 'object', properties: {}, }, outputSchema: { type: 'object', properties: { total_prompts: { type: 'integer', description: 'Total number of available prompts', }, prompts: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, title: { type: 'string' }, description: { type: 'string' }, arguments: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, title: { type: 'string' }, description: { type: 'string' }, required: { type: 'boolean' }, }, }, }, }, }, }, }, required: ['total_prompts', 'prompts'], }, };
- src/tools/index.js:217-218 (registration)Registration of the 'list_prompts' tool handler in the central tool dispatch switch statement within registerToolHandlers function.case 'list_prompts': return handleListPrompts(server, request.params.arguments);
- src/tools/index.js:136-136 (registration)Inclusion of listPromptsToolDefinition in the allTools array used for tool listing and enhancement.listPromptsToolDefinition,
- src/handlers/prompts.js:10-10 (helper)The promptRegistry Map used by the handleListPrompts function to store and retrieve registered prompts.export const promptRegistry = new Map();