List datasets
listDatasetsRetrieve a paginated list of datasets from Langfuse to view and manage your dataset configurations.
Instructions
List datasets configured in Langfuse.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number (default 1) | |
| limit | No | Items per page (default 50, max 100) |
Implementation Reference
- src/tools.ts:195-203 (registration)Tool registration for 'listDatasets' using server.registerTool. It registers the tool with an input schema based on paginationShape (page/limit).
server.registerTool( "listDatasets", { title: "List datasets", description: "List datasets configured in Langfuse.", inputSchema: { ...paginationShape }, }, async (args) => asJson(await client.get("/api/public/v2/datasets", args)), ); - src/tools.ts:202-202 (handler)Handler function for listDatasets: makes a GET request to /api/public/v2/datasets with pagination arguments, returning JSON results via asJson helper.
async (args) => asJson(await client.get("/api/public/v2/datasets", args)), - src/schemas.ts:3-12 (schema)paginationShape definition used as inputSchema for listDatasets - provides optional 'page' (positive int) and 'limit' (1-100) parameters.
export const paginationShape = { page: z.number().int().positive().optional().describe("Page number (default 1)"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Items per page (default 50, max 100)"), }; - src/tools.ts:6-8 (helper)asJson helper function used by the handler to wrap response data into MCP text content format.
const asJson = (data: unknown) => ({ content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], }); - src/tools.ts:405-420 (helper)TOOL_NAMES constant array includes 'listDatasets' for tool enumeration/registration reference.
"listDatasets", "getDataset", "listDatasetItems", "getDatasetItem", "listDatasetRuns", "getDatasetRun", "getMetrics", "getDailyMetrics", "listModels", "getModel", "listProjects", "listComments", "getComment", "getMedia", "getHealth", ] as const;