Skip to main content
Glama

Add calculated metric widget

add_calculated_metric_widget

Add a Calculated Metric widget to a page: a table trended by date, showing demo data until it points at a formula. Returns the new widget_id — point it at a formula with update_calculated_metric_widget, using an id from list_calculated_metrics. Position, width and height match the editor's Calculated Metric card.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_idYesPage ID the widget will be placed on, from list_pages.
client_idYesClient ID the report belongs to (from list_clients).
source_idYesReport ID the widget belongs to (from list_reports).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoThe calculated metric widget, still on demo data until a formula is picked, that was added — widget_id, plus the stored row with the defaults the server filled in (position, width, height).
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.5/5.0
Behavior5/5

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

Beyond the annotations, the description discloses important behavioral traits: the widget displays demo data until attached to a formula, the returned widget_id is required for follow-up updates, and position/width/height match the editor's Calculated Metric card. This gives the agent an accurate model of what happens when the tool is invoked.

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 three concise sentences, each earning its place: the first defines the tool and behavior, the second explains the return value and next step, and the third clarifies layout semantics. It is front-loaded with the core action and contains no filler.

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 create-widget operation with annotations, a 100%-covered schema, and an output schema present, the description covers the essential flow: what is created, what the widget shows, what the return value is, and how to proceed. Nothing critical is missing for an agent to invoke and continue the workflow correctly.

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

Parameters3/5

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

The input schema already provides 100% parameter coverage with source values from list_reports, list_pages, and list_clients. The description adds workflow context but does not introduce additional parameter meaning beyond what the schema documents, so the baseline score of 3 is appropriate.

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 names a specific verb and resource ('Add a Calculated Metric widget to a page') and characterizes the widget as a date-trended table showing demo data until linked to a formula. This clearly distinguishes it from the many sibling widget-creation tools, especially add_data_widget and add_custom_data_widget.

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 a clear usage context: create the widget first, then point it at a formula using update_calculated_metric_widget, pulling the formula id from list_calculated_metrics. It does not explicitly state when not to use this tool or name alternatives among sibling widget creators, but the workflow is concrete and actionable.

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