Skip to main content
Glama

Get widget data

get_widget_data
Read-only

Read the numbers behind data widgets, for charting them. Requires one of: widget_ids for specific widgets, or source_id for every data widget on a report. Returns one entry per widget: its name, its saved chart type, its state, and — once its fetch has landed — the metric and dimension labels, the period totals, the previous period's totals, and the rows. chart is the visualization the widget is saved as and the one the app renders: draw it as that. score is a single KPI value (read it from summary, not the rows), table is a table, map is geographic, and the rest are line / area / bar / column / pie / donut / funnel. Stored variants map to their family — spline and areaspline are line and area, stacked_ and 3d_ prefixes are the type they name. chart is present while a widget is still fetching too, so a placeholder can take the right shape. Pass widget_ids for the widgets a call touched, or source_id for every data widget on a report. A widget in state "loading" is still fetching and carries no rows yet — call again for it. "demo" means the datasource is not linked to the client and the numbers shown in the app are placeholders; "error" means its last fetch failed, and error says why (kind) and what fixes it (fix: reconnect / edit / retry). Rows are capped at row_cap and truncated says whether any were cut. datasource_type says how to read the entry: a Static Value widget (CUSTOM_DATA) shows the value field and has no series; a GOALS widget plots its summary against the target, which list_goals holds; CALCULATION rows are keyed by the calculated metric id, whose name is the matching metric label. A metric that carries a symbol (percent, currency, decimal…) is formatted that way in the app.

Input Schema

NameRequiredDescriptionDefault
waitNoWait up to 15 seconds for in-flight fetches to land, returning as soon as they all have. Default true
row_capNoRows returned per widget (default 200)
source_idNoRead every data widget on this report instead (report id from list_reports)
widget_idsNoWidgets to read (ids from list_widgets, or widget_id from add_data_widget). Up to 200 — use source_id for a whole report

Output Schema

NameRequiredDescriptionDefault
dataNoOne entry per widget — its name, state, the `chart` it is saved as, the metric and dimension labels, this period's summary totals, the previous period's, and the rows (capped at row_cap, with `truncated` saying whether any were cut). A widget in state "loading" is still fetching and carries no rows yet.
successYesTrue when the call succeeded.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • changedOutput schema / properties / success / description
      Previous value: -"True when the call succeeded. A failure comes back as an error result instead."New value: +"True when the call succeeded."
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "data": {
      +      "description": "One entry per widget — its name, state, the `chart` it is saved as, the metric and dimension labels, this period's summary totals, the previous period's, and the rows (capped at row_cap, with `truncated` saying whether any were cut). A widget in state \"loading\" is still fetching and carries no rows yet."
      +    },
      +    "success": {
      +      "description": "True when the call succeeded. A failure comes back as an error result instead.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "success"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only cover read-safe (readOnlyHint=true, destructiveHint=false), but the description goes far beyond: it decodes widget states ('demo', 'error' with kind/fix), explains row capping via row_cap/truncated, lists chart-type families and variant mappings, and details datasource_type reading rules. This is unusually rich behavioral context that the annotations do not supply.

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?

Front-loaded with purpose and the input requirement, then organized into state/chart/datasource concerns. It is dense and slightly repetitive (the widget_ids vs. source_id rule is stated twice), but given the domain complexity most sentences earn their place.

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?

Despite an output schema existing, the description anticipates the hard parts an agent will hit—loading/error states, truncation, chart families, and CUSTOM_DATA/GOALS/CALCULATION interpretation—so nothing needed to call and interpret the tool is missing.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema: it clarifies when to prefer widget_ids vs. source_id, that chart is present even while fetching, and how row_cap/truncated interact. The wait parameter's semantics are left to the schema, keeping this just short of a 5.

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?

States a precise verb and resource ('Read the numbers behind data widgets, for charting them') and clearly separates this from sibling metadata tools like get_widget. The description enumerates exactly what is returned (name, chart type, state, labels, totals, rows), so an agent can distinguish it from query_data or get_widget without opening a schema.

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

Usage Guidelines4/5

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

Gives explicit routing between the two input modes ('Pass widget_ids for the widgets a call touched, or source_id for every data widget on a report') and tells the agent to re-call on 'loading' state. However, it never names a sibling alternative (e.g., get_widget for metadata or query_data for raw queries), so the broader when-not-to-use this tool decision is left implicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources