lightdash_get_metrics_catalog
Retrieve available metrics for a Lightdash project to enable data analysis and reporting. Provide the project UUID to access the metrics catalog.
Instructions
Get metrics catalog for a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectUuid | Yes | The UUID of the project. You can obtain it from the project list. |
Implementation Reference
- src/mcp.ts:320-349 (handler)Handler for the lightdash_get_metrics_catalog tool: parses arguments, calls Lightdash API endpoint /api/v1/projects/{projectUuid}/dataCatalog/metrics, handles errors, and returns JSON response as text.case 'lightdash_get_metrics_catalog': { const args = GetMetricsCatalogRequestSchema.parse( request.params.arguments ); const { data, error } = await lightdashClient.GET( '/api/v1/projects/{projectUuid}/dataCatalog/metrics', { params: { path: { projectUuid: args.projectUuid, }, }, } ); if (error) { throw new Error( `Lightdash API error: ${error.error.name}, ${ error.error.message ?? 'no message' }` ); } return { content: [ { type: 'text', text: JSON.stringify(data.results, null, 2), }, ], }; }
- src/mcp.ts:84-88 (registration)Tool registration in the ListTools response, including name, description, and input schema reference.{ name: 'lightdash_get_metrics_catalog', description: 'Get metrics catalog for a project', inputSchema: zodToJsonSchema(GetMetricsCatalogRequestSchema), },
- src/schemas.ts:59-66 (schema)Zod schema defining the input for the tool: requires a projectUuid (UUID string).export const GetMetricsCatalogRequestSchema = z.object({ projectUuid: z .string() .uuid() .describe( 'The UUID of the project. You can obtain it from the project list.' ), });