Skip to main content
Glama
syucream

Lightdash MCP Server

by syucream

lightdash_list_charts

Retrieve all charts from a Lightdash analytics project using its UUID to access and manage visualization data through the MCP server interface.

Instructions

List all charts in a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectUuidYesThe UUID of the project. You can obtain it from the project list.

Implementation Reference

  • Handler function for the 'lightdash_list_charts' tool. Parses input using ListChartsRequestSchema, calls the Lightdash API to fetch charts for a given projectUuid, and returns the results as JSON text.
    case 'lightdash_list_charts': {
      const args = ListChartsRequestSchema.parse(request.params.arguments);
      const { data, error } = await lightdashClient.GET(
        '/api/v1/projects/{projectUuid}/charts',
        {
          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),
          },
        ],
      };
    }
  • Zod schema for input validation of lightdash_list_charts tool, requiring a projectUuid.
    export const ListChartsRequestSchema = z.object({
      projectUuid: z
        .string()
        .uuid()
        .describe(
          'The UUID of the project. You can obtain it from the project list.'
        ),
    });
  • src/mcp.ts:64-68 (registration)
    Registration of the 'lightdash_list_charts' tool in the MCP server's listTools handler, including name, description, and input schema.
    {
      name: 'lightdash_list_charts',
      description: 'List all charts in a project',
      inputSchema: zodToJsonSchema(ListChartsRequestSchema),
    },

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