lightdash_get_metadata
Retrieve table metadata from Lightdash's data catalog to understand structure, columns, and relationships for analysis.
Instructions
Get metadata for a specific table in the data catalog
Input Schema
TableJSON 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-437 (handler)Handler implementation for the lightdash_get_metadata tool. Parses input arguments using GetMetadataRequestSchema, makes an API call to retrieve metadata for a specific table in the project, handles errors, and returns the JSON-formatted results.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)Zod schema defining the input parameters for the lightdash_get_metadata tool: projectUuid (UUID string) and table (non-empty string). Used for validation in handler and inputSchema in registration.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)Tool registration in the listTools handler, specifying name, description, and input schema derived from GetMetadataRequestSchema.{ name: 'lightdash_get_metadata', description: 'Get metadata for a specific table in the data catalog', inputSchema: zodToJsonSchema(GetMetadataRequestSchema), },