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 — configure it with update_data_widget, passing the calculated metric id from list_calculated_metrics as the single metric. 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. A failure comes back as an error result instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "data": {
      +      "additionalProperties": {},
      +      "description": "The 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).",
      +      "type": "object"
      +    },
      +    "success": {
      +      "description": "True when the call succeeded. A failure comes back as an error result instead.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "success"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only indicate readOnly=false and destructive=false, so the description carries meaningful behavioral disclosure: the widget initially shows demo data, is a table trended by date, returns a widget_id, and inherits editor layout properties. There is no contradiction with the annotations.

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?

Three dense sentences, each contributing unique information: creation semantics, return value and next step, and layout inheritance. There is no filler and no mere repetition of the tool title or schema content.

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 that an output schema exists and annotations are present, the description fully covers what the tool does, what it returns, what the initial widget state looks like, and how to proceed after creation. The agent can correctly invoke it and understand the expected follow-up actions.

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?

All three parameters are fully described in the schema at 100% coverage, so the schema is doing the heavy lifting. The description adds workflow context about update_data_widget and list_calculated_metrics, but does not deepen understanding of the three required parameters beyond what the schema already provides.

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 precise verb+resource combination: 'Add a Calculated Metric widget to a page' and characterizes the widget as a date-trended table with demo data until configured with a formula. This clearly identifies what is being created and differentiates it from the many add_*_widget siblings without needing to name them explicitly.

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 makes the use case explicit and provides a clear follow-up path: return the widget_id, then configure it with update_data_widget using a calculated metric id from list_calculated_metrics. It does not explicitly list when-not-to-use or compare against add_data_widget/add_custom_data_widget, so it stops short of full exclusion 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