get-prompt-version-by-tag
Retrieve a specific prompt version by its tag, including the template, model configuration, and invocation parameters. Example: Fetch the 'production' tagged version of prompt 'article-summarizer'.
Instructions
Get a prompt version by its tag name. Returns the prompt version with its template, model configuration, and invocation parameters.
Example usage: Get the 'production' tagged version of prompt '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 | ||
| tag_name | Yes |
Implementation Reference
- Handler function that fetches the prompt version by tag using PhoenixClient API call to /v1/prompts/{prompt_identifier}/tags/{tag_name} and returns the JSON-formatted response.async ({ prompt_identifier, tag_name }) => { const response = await client.GET( "/v1/prompts/{prompt_identifier}/tags/{tag_name}", { params: { path: { prompt_identifier, tag_name, }, }, } ); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], };
- Zod schema for input validation: requires prompt_identifier and tag_name as strings.export const getPromptVersionByTagSchema = z.object({ prompt_identifier: z.string(), tag_name: z.string(), });
- js/packages/phoenix-mcp/src/promptTools.ts:478-503 (registration)Registration of the 'get-prompt-version-by-tag' tool on the MCP server, including name, description, schema, and handler.server.tool( "get-prompt-version-by-tag", GET_PROMPT_VERSION_BY_TAG_DESCRIPTION, getPromptVersionByTagSchema.shape, async ({ prompt_identifier, tag_name }) => { const response = await client.GET( "/v1/prompts/{prompt_identifier}/tags/{tag_name}", { params: { path: { prompt_identifier, tag_name, }, }, } ); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } );