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. 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

TableJSON 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

TableJSON 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. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnlyHint and destructiveHint annotations, the description discloses substantial behavioral traits: the 'loading' state means a widget is still fetching with no rows, 'demo' and 'error' states are explained, row_cap truncation behavior is detailed, and datasource_type-specific reading rules are provided. It also explains chart type mapping and that 'chart' is present during fetch for placeholder rendering. This is rich, non-obvious context that materially improves correct usage.

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 long but every sentence earns its place for a complex tool. It is front-loaded with purpose, then logically segments selection criteria, return fields, state semantics, rendering guidance, and datasource-specific formatting. There is no filler or redundancy; the structure mirrors the mental model an agent needs to call and interpret the results correctly.

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?

For a tool with 4 parameters, an output schema, and several state-dependent behaviors, the description is exceptionally complete. It covers what is returned (name, chart, state, metrics, totals, rows), how to interpret states, how rows are capped, how to read different datasource types, and formatting conventions. Nothing an agent needs to invoke or consume the output is left undocumented.

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. The description adds meaning beyond the schema: it explains the mutual exclusivity of widget_ids vs source_id, the practical implications of wait (up to 15s for fetches to land), the row_cap effect on truncation, and how each parameter influences the result shape. This elevates it above the baseline, though the schema already names the fields clearly.

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 opens with a specific verb+resource ('Read the numbers behind data widgets') and a clear purpose ('for charting them'). It distinguishes itself from sibling tools like get_widget and list_widgets by focusing on the data values, not metadata, and clarifies the selection mechanism (widget_ids vs source_id). An agent can immediately tell what the tool does and how it differs from related calls.

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?

The description gives explicit guidance on how to invoke the tool: 'Pass widget_ids for the widgets a call touched, or source_id for every data widget on a report.' It also states the context for waiting behavior and row caps. While it does not explicitly name alternative tools to avoid, the usage pattern and return semantics are clear enough that an agent knows when this is the right read operation versus list_widgets or get_widget. Minor gap: no explicit 'when not to use' statement.

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