Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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'], }, };
  • 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);
  • Inclusion of listPromptsToolDefinition in the allTools array used for tool listing and enhancement.
    listPromptsToolDefinition,
  • The promptRegistry Map used by the handleListPrompts function to store and retrieve registered prompts.
    export const promptRegistry = new Map();

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