Skip to main content
Glama
Arize-ai

@arizeai/phoenix-mcp

Official
by Arize-ai

get-prompt-by-identifier

Retrieve the latest version of a prompt using its name or ID to access its template, model configuration, and invocation parameters.

Instructions

Get a prompt's latest version by its identifier (name or ID). Returns the prompt version with its template, model configuration, and invocation parameters.

Example usage: Get the latest version of a prompt with name '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 handler function for 'get-prompt-by-identifier' tool. It fetches the latest prompt version using the PhoenixClient API endpoint '/v1/prompts/{prompt_identifier}/latest' and returns the response as formatted JSON text content.
    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-prompt-by-identifier' tool on the MCP server using server.tool(), providing name, description, input schema, and handler function.
    server.tool(
      "get-prompt-by-identifier",
      GET_PROMPT_BY_IDENTIFIER_DESCRIPTION,
      getPromptByIdentifierSchema.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: a required 'prompt_identifier' string parameter.
    export const getPromptByIdentifierSchema = z.object({
      prompt_identifier: z.string(),
    });
  • Top-level initialization of prompt tools (including 'get-prompt-by-identifier') on the MCP server instance.
    initializePromptTools({ client, server });
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly describes the read operation ('Get') and specifies what is returned (prompt version with template, model configuration, and invocation parameters), including a detailed example. However, it doesn't mention potential errors (e.g., if identifier doesn't exist), authentication needs, rate limits, or whether the operation is idempotent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core functionality in the first sentence. The example usage and expected return with detailed JSON example are helpful but make it somewhat lengthy. Every sentence adds value, but the structure could be more concise by integrating the example more tightly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (single parameter read operation), no annotations, and no output schema, the description does a good job of explaining what the tool does, what it returns, and how to use it. The detailed return example effectively substitutes for an output schema. However, it lacks information about error conditions, authentication, or rate limiting that would be helpful for complete understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage for its single parameter 'prompt_identifier'. The description compensates by explaining that the identifier can be either a 'name or ID', which adds crucial semantic meaning beyond the schema's basic string type. It also provides an example usage showing how to use a name as the identifier. This significantly enhances understanding of the parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verb ('Get') and resource ('prompt's latest version by its identifier'), distinguishing it from siblings like 'get-prompt-version' (which likely requires a version ID) and 'get-latest-prompt' (which might not use an identifier). It specifies the exact resource being retrieved and the lookup method.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool (to get a prompt's latest version by identifier) and includes an example usage. However, it doesn't explicitly state when NOT to use it or name alternatives like 'get-prompt-version' (which might require a version ID) or 'get-latest-prompt' (which might have different parameters).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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