get-dataset-examples
Retrieve dataset examples including inputs, outputs, and metadata to test or benchmark model changes. Fetch structured data for application or model inputs in JSON format.
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
| Name | Required | Description | Default |
|---|---|---|---|
| datasetId | Yes |
Implementation Reference
- Handler function that fetches and returns dataset examples from the Phoenix API using the provided datasetId.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), }, ], }; }
- Zod schema defining the input parameter 'datasetId' as a required string.{ datasetId: z.string(), },
- js/packages/phoenix-mcp/src/datasetTools.ts:125-144 (registration)Registration of the 'get-dataset-examples' tool on the MCP server, including name, description reference, input schema, and handler."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), }, ], }; }