get-dashboard-by-name
Retrieve a specific dashboard by its fully qualified name, with options to include custom fields, filter by deletion status, and project selected data.
Instructions
Get dashboard by fully qualified name
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fqn | Yes | Fully qualified name (e.g. 'service.dashboardName') | |
| fields | No | Comma-separated fields to include | |
| include | No | ||
| extractFields | No | Comma-separated dotted paths to project from response (e.g. 'id,name,owner.name,columns.*.name'). Use `*` as wildcard for arrays/objects. Wrap field names with dots in backticks. Reduces response tokens dramatically on large entities. |
Implementation Reference
- src/tools/dashboards.ts:41-46 (schema)Zod schema for get-dashboard-by-name tool input validation. Defines parameters: fqn (required string, fully qualified name), fields (optional string), include (optional enum), and extractFields (optional string).
export const getDashboardByNameSchema = z.object({ fqn: z.string().describe("Fully qualified name (e.g. 'service.dashboardName')"), fields: z.string().optional().describe("Comma-separated fields to include"), include: z.enum(["non-deleted", "deleted", "all"]).optional(), extractFields: z.string().optional().describe(extractFieldsDescription), }); - src/tools/dashboards.ts:48-52 (handler)Handler function that executes the get-dashboard-by-name tool. Accepts parameters validated by getDashboardByNameSchema, constructs a GET request to `/dashboards/name/{fqn}`, and returns the dashboard data with optional field extraction using applyExtractFields.
export async function getDashboardByName(params: z.infer<typeof getDashboardByNameSchema>) { const { fqn, extractFields, ...query } = params; const data = await omClient.get(`/dashboards/name/${encodeURIComponent(fqn)}`, query); return applyExtractFields(data, extractFields ?? GET_DASHBOARD_DEFAULT_FIELDS); } - src/index.ts:262-270 (registration)Tool registration in the MCP server. The tool 'get-dashboard-by-name' is registered under the 'discovery' category with description 'Get dashboard by fully qualified name', using getDashboardByNameSchema for input validation and getDashboardByName wrapped in wrapToolHandler as the handler.
// --- Dashboards --- currentCategory = "discovery"; tool("list-dashboards", "List dashboards with pagination and service filtering", listDashboardsSchema.shape, wrapToolHandler(listDashboards)); tool("get-dashboard", "Get dashboard details by UUID", getDashboardSchema.shape, wrapToolHandler(getDashboard)); tool("get-dashboard-by-name", "Get dashboard by fully qualified name", getDashboardByNameSchema.shape, wrapToolHandler(getDashboardByName)); tool("create-dashboard", "Create a new dashboard", createDashboardSchema.shape, wrapToolHandler(createDashboard)); tool("update-dashboard", "Update a dashboard using JSON Patch operations", updateDashboardSchema.shape, wrapToolHandler(updateDashboard)); tool("delete-dashboard", "Delete a dashboard by UUID", deleteDashboardSchema.shape, wrapToolHandler(deleteDashboard)); - src/tools/dashboards.ts:1-6 (helper)Imports and constant GET_DASHBOARD_DEFAULT_FIELDS used by the handler. The handler uses applyExtractFields (imported from extract-fields.ts) with this default field set when extractFields is not provided.
import { z } from "zod/v4"; import { omClient } from "../client.js"; import { assertWriteAllowed } from "./utils.js"; import { applyExtractFields, extractFieldsDescription } from "./extract-fields.js"; const GET_DASHBOARD_DEFAULT_FIELDS = "id,name,fullyQualifiedName,description,owners,charts,tags";