get-prompt-version
Retrieve a specific prompt version by its ID to access its template, model configuration, and invocation parameters for consistent AI interactions.
Instructions
Get a specific version of a prompt using its version ID. Returns the prompt version with its template, model configuration, and invocation parameters.
Example usage: Get a specific prompt version with ID 'promptversionid1234'
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_version_id | Yes |
Implementation Reference
- js/packages/phoenix-mcp/src/promptTools.ts:324-348 (registration)Registration of the 'get-prompt-version' tool on the MCP server, including the handler function that retrieves a specific prompt version by ID using the PhoenixClient API and returns the JSON response.server.tool( "get-prompt-version", GET_PROMPT_VERSION_DESCRIPTION, getPromptVersionSchema.shape, async ({ prompt_version_id }) => { const response = await client.GET( "/v1/prompt_versions/{prompt_version_id}", { params: { path: { prompt_version_id, }, }, } ); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } );
- The handler function for 'get-prompt-version' tool: takes prompt_version_id, calls PhoenixClient GET /v1/prompt_versions/{id}, and returns the data as text content.async ({ prompt_version_id }) => { const response = await client.GET( "/v1/prompt_versions/{prompt_version_id}", { params: { path: { prompt_version_id, }, }, } ); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; }
- Zod schema defining the input for 'get-prompt-version': requires a 'prompt_version_id' string.export const getPromptVersionSchema = z.object({ prompt_version_id: z.string(), });
- js/packages/phoenix-mcp/src/index.ts:40-40 (registration)Invocation of initializePromptTools which registers all prompt tools including 'get-prompt-version' on the MCP server.initializePromptTools({ client, server });