Skip to main content
Glama
suthio

Redash MCP Server

by suthio

list_widgets

Retrieve a list of all widgets in Redash to manage and review visualizations across dashboards.

Instructions

List all widgets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the list_widgets tool. Calls redashClient.getWidgets() and returns the result as JSON text.
    async function listWidgets() {
      try {
        const result = await redashClient.getWidgets();
        return {
          content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
        };
      } catch (error) {
        logger.error(`Error listing widgets: ${error}`);
        return {
          isError: true,
          content: [{ type: "text", text: `Error listing widgets: ${error instanceof Error ? error.message : String(error)}` }]
        };
      }
    }
  • src/index.ts:2162-2169 (registration)
    Registration of the list_widgets tool in the ListToolsRequestSchema handler, defining name, description, and empty inputSchema.
    {
      name: "list_widgets",
      description: "List all widgets",
      inputSchema: {
        type: "object",
        properties: {}
      }
    },
  • src/index.ts:2512-2515 (registration)
    Dispatch case in CallToolRequestSchema handler that routes 'list_widgets' requests to the listWidgets() handler function.
    // Widget tools
    case "list_widgets":
      logger.debug(`Handling list_widgets`);
      return await listWidgets();
  • The getWidgets() helper method on RedashClient that makes the actual GET /api/widgets HTTP request to the Redash API.
    async getWidgets(): Promise<RedashWidget[]> {
      try {
        const response = await this.client.get('/api/widgets');
        return response.data;
      } catch (error) {
        logger.error(`Error fetching widgets: ${error}`);
        throw new Error(`Failed to fetch widgets: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • The RedashWidget interface defining the shape of widget data returned by the API.
    export interface RedashWidget {
      id: number;
      dashboard_id: number;
      visualization_id?: number;
      visualization?: RedashVisualization;
      text?: string;
      width: number;
      options: any;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It only states the function without disclosing behaviors like pagination, permissions, return format, or absence of side effects. While it implies a read operation, it lacks depth.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It is appropriately concise for its simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with no parameters and no output schema, the description is adequate but minimal. It does not specify the return type (e.g., list of IDs vs. full objects) or any defaults, leaving some ambiguity for the agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, with schema coverage at 100%. The description adds no parameter details, which is acceptable as no parameters exist. Baseline for zero parameters is 4, and the description aligns with the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List all widgets' clearly states the action (list) and resource (widgets). It is specific and distinguishes from sibling tools like get_widget (single widget retrieval) and create/update/delete widgets.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool instead of alternatives like get_widget or other list tools. The agent has no information about appropriate contexts or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/suthio/redash-mcp'

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