list-prompts
Retrieve all available prompt templates for LLM input messages, including metadata such as IDs, names, and descriptions, to manage and organize your prompt templates effectively.
Instructions
Get a list of all the prompts.
Prompts (templates, prompt templates) are versioned templates for input messages to an LLM. Each prompt includes both the input messages, but also the model and invocation parameters to use when generating outputs.
Returns a list of prompt objects with their IDs, names, and descriptions.
Example usage: List all available prompts
Expected return: Array of prompt objects with metadata. Example: [{ "name": "article-summarizer", "description": "Summarizes an article into concise bullet points", "source_prompt_id": null, "id": "promptid1234" }]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Implementation Reference
- Handler function that executes the list-prompts tool: fetches list of prompts from PhoenixClient API endpoint /v1/prompts with optional limit parameter and returns the JSON stringified data as text content.async ({ limit }) => { const response = await client.GET("/v1/prompts", { params: { query: { limit, }, }, }); return { content: [ { type: "text", text: JSON.stringify(response.data?.data, null, 2), }, ], }; }
- Zod schema defining the input parameters for the list-prompts tool: optional 'limit' number between 1 and 100, default 100.export const listPromptsSchema = z.object({ limit: z.number().min(1).max(100).default(100), });
- js/packages/phoenix-mcp/src/promptTools.ts:249-270 (registration)MCP server tool registration for 'list-prompts', specifying name, description reference, schema shape, and inline handler function.server.tool( "list-prompts", LIST_PROMPTS_DESCRIPTION, listPromptsSchema.shape, async ({ limit }) => { const response = await client.GET("/v1/prompts", { params: { query: { limit, }, }, }); return { content: [ { type: "text", text: JSON.stringify(response.data?.data, null, 2), }, ], }; } );
- Multiline string description used for the list-prompts tool documentation and MCP tool metadata.const LIST_PROMPTS_DESCRIPTION = `Get a list of all the prompts. Prompts (templates, prompt templates) are versioned templates for input messages to an LLM. Each prompt includes both the input messages, but also the model and invocation parameters to use when generating outputs. Returns a list of prompt objects with their IDs, names, and descriptions. Example usage: List all available prompts Expected return: Array of prompt objects with metadata. Example: [{ "name": "article-summarizer", "description": "Summarizes an article into concise bullet points", "source_prompt_id": null, "id": "promptid1234" }]`;