Get a dataset by name
getDatasetFetch metadata for a dataset by providing its name. Access dataset details from Langfuse.
Instructions
Fetch metadata for a dataset by its name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| datasetName | Yes |
Implementation Reference
- src/tools.ts:205-214 (handler)Tool registration and handler for 'getDataset'. Calls the Langfuse API at /api/public/v2/datasets/{datasetName} to fetch a dataset by name.
server.registerTool( "getDataset", { title: "Get a dataset by name", description: "Fetch metadata for a dataset by its name.", inputSchema: { datasetName: z.string().min(1) }, }, async ({ datasetName }) => asJson(await client.get(`/api/public/v2/datasets/${enc(datasetName)}`)), ); - src/tools.ts:210-210 (schema)Input schema for 'getDataset': requires a non-empty string 'datasetName'.
inputSchema: { datasetName: z.string().min(1) }, - src/tools.ts:205-214 (registration)The tool is registered via server.registerTool('getDataset', ...) inside registerTools().
server.registerTool( "getDataset", { title: "Get a dataset by name", description: "Fetch metadata for a dataset by its name.", inputSchema: { datasetName: z.string().min(1) }, }, async ({ datasetName }) => asJson(await client.get(`/api/public/v2/datasets/${enc(datasetName)}`)), ); - src/tools.ts:406-406 (registration)'getDataset' is also listed in the TOOL_NAMES array for enumeration purposes.
"getDataset", - src/tools.ts:6-10 (helper)The 'asJson' helper wraps the API response into MCP content format.
const asJson = (data: unknown) => ({ content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], }); const enc = encodeURIComponent;