Skip to main content
Glama

get-dashboard

Retrieve the full definition of a Datadog dashboard, including widgets, layout, and configuration details, using the dashboard ID for precise monitoring and tracing.

Instructions

Get the complete definition of a specific Datadog dashboard by its ID. Returns all widgets, layout, and configuration details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dashboardIdYes

Implementation Reference

  • The core execute function that handles the tool logic: extracts dashboardId, creates DashboardsApi instance, calls getDashboard API, and returns the response.
    execute: async (params: GetDashboardParams) => { try { const { dashboardId } = params; const apiInstance = new v1.DashboardsApi(configuration); const apiParams: v1.DashboardsApiGetDashboardRequest = { dashboardId: dashboardId }; const response = await apiInstance.getDashboard(apiParams); return response; } catch (error) { console.error(`Error fetching dashboard ${params.dashboardId}:`, error); throw error; } }
  • src/index.ts:134-146 (registration)
    Registers the 'get-dashboard' tool with MCP server, providing name, description, Zod input schema, and wrapper async handler that calls getDashboard.execute and formats response.
    server.tool( "get-dashboard", "Get the complete definition of a specific Datadog dashboard by its ID. Returns all widgets, layout, and configuration details.", { dashboardId: z.string() }, async (args) => { const result = await getDashboard.execute(args); return { content: [{ type: "text", text: JSON.stringify(result) }] }; } );
  • TypeScript type definition for the input parameters used by the getDashboard tool.
    type GetDashboardParams = { dashboardId: string; };
  • Initialization function that sets up the Datadog API client configuration with API keys and site.
    initialize: () => { const configOpts = { authMethods: { apiKeyAuth: process.env.DD_API_KEY, appKeyAuth: process.env.DD_APP_KEY } }; configuration = client.createConfiguration(configOpts); if (process.env.DD_SITE) { configuration.setServerVariables({ site: process.env.DD_SITE }); } },
  • src/index.ts:71-71 (registration)
    Calls initialize on getDashboard to setup the API client before tool usage.
    getDashboard.initialize();

Other Tools

Related 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/GeLi2001/datadog-mcp-server'

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