Skip to main content
Glama
syucream

Lightdash MCP Server

by syucream

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
NameRequiredDescriptionDefault
projectUuidYesThe UUID of the project. You can obtain it from the project list.
tableYes

Implementation Reference

  • 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),
          },
        ],
      };
  • 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),
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/syucream/lightdash-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server