Skip to main content
Glama

Add data widget

add_data_widget

Add a DATA widget to a page and configure it, applying the same rules as the report builder: the datasource's defaults, the generated name, sort and row limit, and validation of the metric/dimension/advanced combination. Discover ids with datasources → describe_datasource. Returns the new widget_id; the series is fetched in the background, so call get_widget_data with that id to read the numbers. Omit the config to drop in a default widget with demo data and configure it later. Position/size default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoDisplay name. Omit to use the generated one ("Clicks & Impressions by Date")
chartNoChart type: table, score (KPI), area, line, bar, column, pie, donut, funnel, or map. 'score' shows a single value, so it takes exactly one metric
filtersNoRow filters. Every row needs a field, an operator and a value
metricsNoMetrics to display, e.g. [{ value: "clicks" }] — ids from describe_datasource. Must belong to the chosen data view. Only `value` is required; the server fills the rest
page_idYesPage ID the widget will be placed on, from list_pages.
sort_byNoMetric or dimension id to sort rows by. Defaults to the first dimension
advancedNoDatasource-specific settings (Meta attribution, SEM Rush region, Mailchimp audience…). Several datasources require keys here — describe_datasource lists them per data view. Merges with existing settings
currencyNoPer-widget currency code override; falls back to the client currency
client_idYesClient ID the report belongs to (from list_clients).
data_viewNoDatasource data view (from describe_datasource), e.g. ACCOUNT. Changing it clears metrics and dimensions
row_limitNoRows to keep (default 'all')
source_idYesReport ID the widget belongs to (from list_reports).
date_rangeNoPer-widget date range (overrides the report range) — also set show_custom_date_range
dimensionsNoBreakdown dimensions, e.g. [{ value: "DATE" }] — ids from describe_datasource. A widget needs at least one; a dimension flagged `single` must be the only one
sort_orderNoSort direction (default 'asc')
datasource_idNoDatasource alias (from datasources), e.g. gadw. Changing it clears the data view, metrics, dimensions, filters and advanced settings, then applies that datasource's defaults. A datasource the client has not connected renders demo data until the connection is made — connected_datasources shows what is connected. The internal sources take no metrics/dimensions and are configured through `advanced` instead: 'CUSTOM_DATA' (Static Value — advanced.value), 'GOALS' (advanced.goal_id from list_goals), 'CUSTOM_IMPORT' (advanced.custom_data_id from list_custom_data), 'CALCULATION' (a calculated metric id as the single metric)
show_custom_date_rangeNoUse the widget date_range instead of the report range

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoThe data widget that was added — widget_id, the generated name, and the config as the builder resolved it. The series is fetched in the background; read it with get_widget_data using that widget_id.
successYesTrue when the call succeeded. A failure comes back as an error result instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

The description adds meaningful behavioral context beyond the annotations: it states that the series is fetched in the background and requires a follow-up call to get_widget_data, that omitting config yields a default widget with demo data, and that position/size default. These are not disclosed by the annotations (readOnlyHint false, destructiveHint false) and significantly help an agent set expectations.

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 about 80 words, starts with the core purpose, and each sentence adds a distinct piece of information: rules, id discovery, return value, background fetch, default behavior, and positioning default. It is front-loaded and avoids repeating schema details, making it efficient for an agent to parse.

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

Completeness4/5

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

Given the tool's complexity (17 parameters, nested objects, 100% schema coverage, and an output schema), the description covers the essential workflow and the most critical edge case (default demo widget). It does not enumerate all parameters, but the schema handles that. It could have mentioned the required client_id/page_id sources, but the schema already includes those descriptions, so the description is sufficiently complete for correct invocation.

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?

With 100% schema description coverage, the baseline is 3, but the description adds cross-cutting parameter context: 'applying the same rules as the report builder' explains how datasource defaults affect sort/row limit, and 'Discover ids with datasources → describe_datasource' tells agents where to obtain values for source_id, metrics, dimensions, and advanced settings. This adds meaning beyond individual parameter descriptions.

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 clearly states the action: 'Add a DATA widget to a page and configure it.' It distinguishes this tool from its siblings by explicitly naming the widget type (DATA) and describing configuration and the returned widget_id. The scope is precise and leaves no ambiguity about what the tool accomplishes.

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 provides a clear workflow: discover ids with datasources → describe_datasource, then add the widget, then call get_widget_data to read the numbers. It also gives an alternative use case (omitting config for a default demo widget). However, it does not explicitly contrast with other add_*_widget tools, so it lacks explicit when-not guidance.

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