get-latest-prompt
Retrieve the most recent version of a prompt, including its template, model configuration, and invocation parameters, to ensure accurate and up-to-date execution.
Instructions
Get the latest version of a prompt. Returns the prompt version with its template, model configuration, and invocation parameters.
Example usage: Get the latest version of a prompt named 'article-summarizer'
Expected return: Prompt version object with template and configuration. Example: { "description": "Initial version", "model_provider": "OPENAI", "model_name": "gpt-3.5-turbo", "template": { "type": "chat", "messages": [ { "role": "system", "content": "You are an expert summarizer. Create clear, concise bullet points highlighting the key information." }, { "role": "user", "content": "Please summarize the following {{topic}} article:
{{article}}" } ] }, "template_type": "CHAT", "template_format": "MUSTACHE", "invocation_parameters": { "type": "openai", "openai": {} }, "id": "promptversionid1234" }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt_identifier | Yes |
Implementation Reference
- Handler function that executes the get-latest-prompt tool by calling the PhoenixClient GET API to retrieve the latest prompt version.async ({ prompt_identifier }) => { const response = await client.GET( "/v1/prompts/{prompt_identifier}/latest", { params: { path: { prompt_identifier, }, }, } ); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } );
- js/packages/phoenix-mcp/src/promptTools.ts:273-297 (registration)Registration of the get-latest-prompt tool via server.tool() within initializePromptTools."get-latest-prompt", GET_LATEST_PROMPT_DESCRIPTION, getLatestPromptSchema.shape, async ({ prompt_identifier }) => { const response = await client.GET( "/v1/prompts/{prompt_identifier}/latest", { params: { path: { prompt_identifier, }, }, } ); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } );
- Input schema validation using Zod for the prompt_identifier parameter.export const getLatestPromptSchema = z.object({ prompt_identifier: z.string(), });