lightdash_get_metadata
Retrieve metadata about a specific table from the Lightdash data catalog by providing the project UUID and table name.
Instructions
Get metadata for a specific table in the data catalog
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectUuid | Yes | The UUID of the project. You can obtain it from the project list. | |
| table | Yes |
Implementation Reference
- src/mcp.ts:410-438 (handler)The handler for the lightdash_get_metadata tool. Parses arguments with GetMetadataRequestSchema, calls the Lightdash API endpoint /api/v1/projects/{projectUuid}/dataCatalog/{table}/metadata, and returns the results as JSON text.
case 'lightdash_get_metadata': { const args = GetMetadataRequestSchema.parse(request.params.arguments); const { data, error } = await lightdashClient.GET( '/api/v1/projects/{projectUuid}/dataCatalog/{table}/metadata', { params: { path: { projectUuid: args.projectUuid, table: args.table, }, }, } ); 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/schemas.ts:86-94 (schema)The Zod schema for the lightdash_get_metadata tool's input parameters. Defines projectUuid (UUID string) and table (non-empty string) as required fields.
export const GetMetadataRequestSchema = z.object({ projectUuid: z .string() .uuid() .describe( 'The UUID of the project. You can obtain it from the project list.' ), table: z.string().min(1, 'Table name cannot be empty'), }); - src/mcp.ts:99-103 (registration)Registration of the lightdash_get_metadata tool in the server's tool list with its description and input schema.
{ name: 'lightdash_get_metadata', description: 'Get metadata for a specific table in the data catalog', inputSchema: zodToJsonSchema(GetMetadataRequestSchema), },