Skip to main content
Glama
Arize-ai

@arizeai/phoenix-mcp

Official
by Arize-ai

get-dataset-examples

Retrieve dataset examples containing inputs, outputs, and metadata for testing or benchmarking applications and models.

Instructions

Get examples from a dataset.

Dataset examples are an array of objects that each include an input, (expected) output, and optional metadata. These examples are typically used to represent input to an application or model (e.g. prompt template variables, a code file, or image) and used to test or benchmark changes.

Example usage: Show me all examples from dataset RGF0YXNldDox

Expected return: Object containing dataset ID, version ID, and array of examples. Example: { "dataset_id": "datasetid1234", "version_id": "datasetversionid1234", "examples": [ { "id": "exampleid1234", "input": { "text": "Sample input text" }, "output": { "text": "Expected output text" }, "metadata": {}, "updated_at": "YYYY-MM-DDTHH:mm:ssZ" } ] }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
datasetIdYes

Implementation Reference

  • Handler function that fetches dataset examples from the Phoenix API endpoint /v1/datasets/{id}/examples using the provided datasetId and returns the JSON-stringified response as text content.
    async ({ datasetId }) => {
      const response = await client.GET("/v1/datasets/{id}/examples", {
        params: {
          path: { id: datasetId },
        },
      });
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(response.data, null, 2),
          },
        ],
      };
    }
  • Input schema for the tool, defining 'datasetId' as a required string parameter using Zod validation.
    {
      datasetId: z.string(),
    },
  • Registration of the 'get-dataset-examples' tool on the McpServer, specifying name, description, input schema, and handler function.
    server.tool(
      "get-dataset-examples",
      GET_DATASET_EXAMPLES_DESCRIPTION,
      {
        datasetId: z.string(),
      },
      async ({ datasetId }) => {
        const response = await client.GET("/v1/datasets/{id}/examples", {
          params: {
            path: { id: datasetId },
          },
        });
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      }
    );
  • Detailed description string for the get-dataset-examples tool, including usage instructions and example input/output formats.
    const GET_DATASET_EXAMPLES_DESCRIPTION = `Get examples from a dataset.
    
    Dataset examples are an array of objects that each include an input, 
    (expected) output, and optional metadata. These examples are typically used to represent 
    input to an application or model (e.g. prompt template variables, a code file, or image) 
    and used to test or benchmark changes.
    
    Example usage:
      Show me all examples from dataset RGF0YXNldDox
    
    Expected return:
      Object containing dataset ID, version ID, and array of examples.
      Example: {
        "dataset_id": "datasetid1234",
        "version_id": "datasetversionid1234",
        "examples": [
          {
            "id": "exampleid1234",
            "input": {
              "text": "Sample input text"
            },
            "output": {
              "text": "Expected output text"
            },
            "metadata": {},
            "updated_at": "YYYY-MM-DDTHH:mm:ssZ"
          }
        ]
      }`;
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool returns an object containing dataset ID, version ID, and an array of examples, including the structure of each example (id, input, output, metadata, updated_at). This provides good behavioral context about the return format, though it doesn't cover aspects like error handling, rate limits, or authentication needs.

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: it starts with the core purpose, explains what dataset examples are, provides an example usage, and details the expected return. Every sentence adds value, though the explanation of dataset examples could be slightly trimmed for a tool-focused description.

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 1 parameter, no annotations, and no output schema, the description does a good job of completeness. It explains the purpose, provides usage context, and details the return structure. However, it could improve by explicitly mentioning the parameter or addressing potential errors, making it not quite perfect.

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

Parameters3/5

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

The input schema has 1 parameter with 0% description coverage. The description doesn't explicitly mention the 'datasetId' parameter or add any semantic details about it (e.g., format, constraints). However, the example usage implies it's a required identifier, and the baseline is 3 since the schema coverage is low but the description compensates somewhat by showing usage.

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

Purpose4/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: 'Get examples from a dataset.' It specifies the resource (dataset examples) and the action (get/retrieve). However, it doesn't explicitly differentiate from siblings like 'get-dataset-experiments' or 'list-datasets,' which reduces it from a perfect score.

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

Usage Guidelines3/5

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

The description provides an example usage ('Show me all examples from dataset RGF0YXNldDox'), which implies this tool is for retrieving all examples from a specific dataset. However, it doesn't explicitly state when to use this tool versus alternatives like 'get-dataset-experiments' or 'list-datasets,' nor does it mention any prerequisites or exclusions.

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