Skip to main content
Glama

edit_widget

Edit an existing report widget from a plain-language instruction, validated against the same catalog as add_widget: an impossible change is refused with a reason and nothing changes. Returns a receipt comparing the widget before and after, with the previous configuration for restoring it. widgetId (from get_report) pins the target; otherwise it is identified from the instruction. Granularity words (monthly, weekly, daily) set a chart's time scale. Moves (move, or an instruction naming an existing widget or section) and section operations are supported; a move result carries undo. A text widget is replaced exactly as given with text + widgetId, without AI. A Budget vs actual table takes widgetId + budgetLines. An instruction is read by AI; the preview's aiCost states who pays. Requires MCP write actions; without confirm:true it returns a preview.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "reportId": "<reportId>"
    },
    "name": "edit_widget"
  }
}

Input Schema

NameRequiredDescriptionDefault
moveNoMove the widget given by widgetId, deterministically (no AI; instruction is not needed and is ignored). A section moves with its widgets through an instruction instead.
textNoTEXT widgets only: the complete new body (HTML or plain text, at most 50,000 characters), replacing the body as given with no AI; unsafe markup is removed. Styling is carried by attributes, never inline styles: <span data-tone="muted|accent|positive|warning|negative"> (text colour), <span data-mark="lime|green|amber|rose"> (highlight), <span data-size="small|large">, <div data-callout="note|tip|warning|important"> (a tinted box around one block) and <hr> (a divider); each is painted with the report theme's own colours in light and dark mode and in the PDF.
confirmNoSet true to apply. Omit for a preview of what will be interpreted. With confirm:true, also pass the preview's previewToken.
channelsNoWith budgetLines: restrict to these channels, e.g. ["Google Ads", "Meta Ads"] (default every connected paid channel).
reportIdYesReport id (from list_reports).
widgetIdNoExact widget id (from get_report) to pin the target. Required with text.
budgetLinesNoBudget vs actual table (All channels), no AI: the product lines in order. A campaign goes to the FIRST line it matches; the rest shows as Not assigned. A month with no budget reads '—', never 0. add_widget builds the table (instruction names it); edit_widget with widgetId replaces the table's COMPLETE list.
instructionNoThe change, in plain language. Can also remove a widget ('remove the donut'). Required unless text is passed.
previewTokenNoWith confirm:true: the previewToken from this tool's preview (valid 15 minutes, once, for exactly the previewed arguments).
plannedSourceNoWith budgetLines: where the planned budget comes from. settings = the campaigns' own budgets (Google Ads, Meta), read daily, history from the first reading; manual (default) = the amounts given; settings+manual = settings, but a month with an amount given uses it. On edit_widget it can be sent alone.
budgetCurrencyNoWith budgetLines: the ISO currency the budgets are in, e.g. EUR. Optional: without it the table labels the accounts' dominant currency on each render and says so.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / text / maxLength
      Added value: +50000
  2. Changed5 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / budgetLines / items / additionalProperties
      Removed value: -false
    • addedInput schema / properties / budgetLines / items / properties / budgets / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / properties / move / additionalProperties
      Removed value: -false
  3. Changed2 schema fields changed
    • changedInput schema / properties / instruction / description
      Previous value: -"The change, in plain language. Can also remove a widget ('remove the donut'). Required unless you pass text."New value: +"The change, in plain language. Can also remove a widget ('remove the donut'). Required unless text is passed."
    • changedInput schema / properties / text / description
      Previous value: -"TEXT widgets only: the complete new body of the text widget given by widgetId, as HTML or plain text (at most 50,000 characters). Replaces the body as given, with no AI and no rewording; unsafe markup is removed. Title, width and hideTitle are kept."New value: +"TEXT widgets only: the complete new body (HTML or plain text, at most 50,000 characters), replacing the body as given with no AI; unsafe markup is removed. Styling is carried by attributes, never inline styles: <span data-tone=\"muted|accent|positive|warning|negative\"> (text colour), <span data-mark=\"lime|green|amber|rose\"> (highlight), <span data-size=\"small|large\">, <div data-callout=\"note|tip|warning|important\"> (a tinted box around one block) and <hr> (a divider); each is painted with the report theme's own colours in light and dark mode and in the PDF."
  4. Changed1 schema field changed
    • addedInput schema / properties / plannedSource
      Added value: +{
      +  "description": "With budgetLines: where the planned budget comes from. settings = the campaigns' own budgets (Google Ads, Meta), read daily, history from the first reading; manual (default) = the amounts given; settings+manual = settings, but a month with an amount given uses it. On edit_widget it can be sent alone.",
      +  "enum": [
      +    "manual",
      +    "settings",
      +    "settings+manual"
      +  ],
      +  "type": "string"
      +}
  5. Changed3 schema fields changed
    • addedInput schema / properties / budgetCurrency
      Added value: +{
      +  "description": "With budgetLines: the ISO currency the budgets are in, e.g. EUR. Optional: without it the table labels the accounts' dominant currency on each render and says so.",
      +  "maxLength": 3,
      +  "minLength": 3,
      +  "type": "string"
      +}
    • addedInput schema / properties / budgetLines
      Added value: +{
      +  "description": "Budget vs actual table (All channels), no AI: the product lines in order. A campaign goes to the FIRST line it matches; the rest shows as Not assigned. A month with no budget reads '—', never 0. add_widget builds the table (instruction names it); edit_widget with widgetId replaces the table's COMPLETE list.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "budgets": {
      +        "additionalProperties": {
      +          "type": [
      +            "number",
      +            "string"
      +          ]
      +        },
      +        "description": "Planned amount per month: {\"2026-10\": 1500}.",
      +        "type": "object"
      +      },
      +      "label": {
      +        "description": "Product line name, e.g. Krankenversicherung.",
      +        "maxLength": 60,
      +        "type": "string"
      +      },
      +      "match": {
      +        "description": "Campaign-name terms, case-insensitive, 'contains any'.",
      +        "items": {
      +          "maxLength": 100,
      +          "type": "string"
      +        },
      +        "maxItems": 20,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "monthly": {
      +        "description": "Default amount for a month without an entry.",
      +        "type": [
      +          "number",
      +          "string"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "label",
      +      "match"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 20,
      +  "type": "array"
      +}
    • addedInput schema / properties / channels
      Added value: +{
      +  "description": "With budgetLines: restrict to these channels, e.g. [\"Google Ads\", \"Meta Ads\"] (default every connected paid channel).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "maxItems": 8,
      +  "type": "array"
      +}
  6. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Goes well beyond the annotations: catalog validation with refusal-and-no-change semantics, a before/after receipt carrying the previous configuration for restore, preview token validity (15 minutes, single use, exact arguments), and aiCost attribution. The only tension is that destructiveHint=false while the tool can remove a widget, though the restore receipt partly justifies the flag.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads purpose and the validate/preview contract correctly, but the remaining sentences are a dense, unstructured run through move, text, budget table, AI cost and write-action prerequisites. An agent has to comb for mode-specific rules rather than reading them as a grouped list; several clauses could be trimmed.

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?

For an 11-parameter tool with no output schema, it covers the target-resolution inputs (widgetId from get_report, reportId from list_reports), all four operating modes, and what the receipt/preview returns. Remaining gaps are minor, such as how a move interacts with a confirm preview or rate/limit behavior.

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?

Schema coverage is 100% and every parameter already carries a rich description, so the baseline is 3. The description's added value is mostly cross-parameter: granularity words affecting chart time scale, `text` requiring `widgetId`, `budgetLines`+`widgetId` replacing the complete list, and `plannedSource` being sendable alone. Much of this restates what the schema already says.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Edit an existing report widget') and immediately scopes it ('from a plain-language instruction, validated against the same catalog as add_widget'), which distinguishes it from the creation sibling. It also carves out deterministic non-AI modes (move, text replacement, budgetLines) so an agent can tell it apart from add_text_widget and add_widget. It never contrasts with remove_widget even though it admits instructions can remove a 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?

Gives per-mode selection rules: `text`+`widgetId` for an exact text replacement, `widgetId`+`budgetLines` for a Budget vs actual table, `move` for deterministic moves, and instruction for AI-parsed changes. It also states the preview/confirm gate ('without confirm:true it returns a preview') and the MCP write-action prerequisite. It stops short of naming the alternative to call instead for deletion, leaving overlap with remove_widget unresolved.

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