Skip to main content
Glama
Arize-ai

@arizeai/phoenix-mcp

Official
by Arize-ai

get-latest-prompt

Retrieve the current version of a prompt with its template, model configuration, and invocation parameters for consistent AI interactions.

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

TableJSON Schema
NameRequiredDescriptionDefault
prompt_identifierYes

Implementation Reference

  • The core handler function for the 'get-latest-prompt' tool. It uses the PhoenixClient to fetch the latest version of the specified prompt via the API endpoint "/v1/prompts/{prompt_identifier}/latest" and returns the response data as formatted JSON text.
    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), }, ], }; }
  • Registers the 'get-latest-prompt' tool on the MCP server, providing the name, description, input schema, and handler function.
    "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), }, ], }; } );
  • Zod schema defining the input for the tool: requires a 'prompt_identifier' string (name or ID of the prompt).
    export const getLatestPromptSchema = z.object({ prompt_identifier: z.string(), });
  • Calls the initialization function that registers the prompt tools, including 'get-latest-prompt', on the MCP server instance.
    initializePromptTools({ client, server });

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/Arize-ai/phoenix'

If you have feedback or need assistance with the MCP directory API, please join our Discord server