Skip to main content
Glama
adm-alvin-decruz

New Relic MCP Server

add_widget_to_dashboard

Add a new widget to an existing New Relic dashboard by providing the dashboard GUID and an NRQL query. Optional raw configuration controls advanced chart display settings.

Instructions

Add a widget to an existing dashboard (requires dashboard GUID and widget configuration).

Use the optional raw_configuration parameter to control advanced chart display settings. When provided, it is sent as rawConfiguration to NerdGraph and takes precedence over the typed configuration. The raw_configuration object should include nrqlQueries plus any display options.

IMPORTANT: nrqlQueries uses accountIds (array) not accountId (scalar): "nrqlQueries": [{"accountIds": [123456], "query": "SELECT ..."}] This is auto-populated from widget_query if omitted.

Fixed Y-Axis Range (left axis): {"yAxisLeft": {"min": 0, "max": 500, "zero": false}}

Dual Y-Axis (second axis on right): IMPORTANT: dual y-axis requires the COMPLETE rawConfiguration (not just yAxisRight). NR automatically appends an aggregation suffix to series names: percentile() → " (99%)", average() → no suffix. The alias in the query should NOT include the suffix — NR adds it. Use the rendered name in series[].name. Example — query alias is 'My Series', NR renders it as 'My Series (99%)' for percentile():

{
  "nrqlQueries": [{"accountIds": [123456], "query": "SELECT count(*) AS 'Left', percentile(duration, 99) AS 'My Series' FROM ... TIMESERIES"}],
  "chartStyles": {"lineInterpolation": "linear"},
  "facet": {"showOtherSeries": false},
  "legend": {"enabled": true},
  "markers": {"displayedTypes": {"criticalViolations": false, "deployments": true, "relatedDeployments": true, "warningViolations": false}},
  "platformOptions": {"ignoreTimeRange": false},
  "thresholds": {"isLabelVisible": true},
  "yAxisLeft": {"zero": true},
  "yAxisRight": {"zero": true, "series": [{"name": "My Series (99%)"}]}
}

Hide Legend: {"legend": {"enabled": false}}

Facet - show/hide Other series: {"facet": {"showOtherSeries": true}}

Ignore dashboard time picker: {"platformOptions": {"ignoreTimeRange": true}}

Threshold label visibility (shows/hides threshold labels on chart): {"thresholds": {"isLabelVisible": true}}

Chart line style: {"chartStyles": {"lineInterpolation": "linear"}} (or "step", "smooth")

Deployment markers: {"markers": {"displayedTypes": {"deployments": true, "relatedDeployments": true, "criticalViolations": false, "warningViolations": false}}}

Combined example (fixed range + no legend):

{
  "nrqlQueries": [{"accountIds": [123456], "query": "SELECT count(*) FROM Log TIMESERIES"}],
  "yAxisLeft": {"min": 0, "max": 1000, "zero": true},
  "legend": {"enabled": false}
}

Note: logarithmic scale is not supported by New Relic for line/area charts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
widget_typeNoType of widget (line, area, bar, pie, table, billboard, etc.)line
widget_queryYesNRQL query for the widget
widget_titleYesTitle for the widget
dashboard_guidYesGUID of the dashboard to add widget to
raw_configurationNoAdvanced chart display configuration sent as rawConfiguration to NerdGraph. Must include 'nrqlQueries' array with accountIds (array, not scalar). Supports: yAxisLeft ({min, max, zero}), yAxisRight ({zero, series:[{name}]}), legend ({enabled}), facet ({showOtherSeries}), platformOptions ({ignoreTimeRange}), thresholds ({isLabelVisible}), chartStyles ({lineInterpolation: linear/step/smooth}), markers ({displayedTypes: {deployments, relatedDeployments, criticalViolations, warningViolations}}). Note: logarithmic scale is NOT supported. Overrides the typed configuration when provided.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly. It discloses that raw_configuration is sent as rawConfiguration to NerdGraph, takes precedence over typed configuration, uses accountIds as an array, is auto-populated from widget_query, and includes caveats about NR aggregation suffixes and unsupported logarithmic scale.

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

Conciseness4/5

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

The description is long but front-loaded with the core purpose and then organized into practical, labeled examples. Some redundancy exists between the standalone JSON examples and the raw_configuration schema description, but each section serves a clear instructional purpose for a complex parameter.

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

Completeness5/5

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

Given the tool's complexity, nested raw_configuration object, and absence of both annotations and output schema, the description is highly complete. It covers required inputs, advanced configuration options, key New Relic-specific behaviors, and an explicit unsupported feature, leaving an agent well-equipped to invoke the tool correctly.

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

Parameters5/5

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

Although schema coverage is 100%, the description goes substantially beyond the schema by providing concrete JSON examples, clarifying the accountIds array vs accountId scalar, showing auto-population behavior, and demonstrating combinations like fixed y-axis with hidden legend. This is far more than the baseline schema documentation.

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 states a specific action: adding a widget to an existing dashboard, requiring a dashboard GUID and widget configuration. This clearly distinguishes it from sibling tools like create_dashboard or update_widget, since the target is an existing dashboard.

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

Usage Guidelines3/5

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

The description implies usage context by saying 'existing dashboard' and requiring dashboard_guid, but it does not explicitly contrast this tool with alternatives such as create_dashboard, update_widget, or get_dashboard_widgets. An agent can infer when to use it, but the guidance is not explicit.

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