Skip to main content
Glama

edit_widget

Destructive

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

A4.6/5.0
Behavior5/5

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

Annotations only declare write/non-readOnly/destructive; the description adds substantial behavior on top: nothing changes on refusal, a before/after receipt with the previous configuration for restoring, previewToken valid 15 minutes and single-use, and that preview's `aiCost` attributes the AI charge. These are exactly the operational facts an agent needs before a destructive write.

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

Conciseness4/5

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

Front-loaded with purpose and validation contract, then ordered by operating mode (target selection, moves, text, budget table, AI cost, confirm flow). Dense but every sentence carries a distinct fact; a couple of mode-specific notes could be folded together to reduce length.

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 an 11-parameter tool with nested objects and no output schema, the description still covers the mutation model, the preview/confirm handshake with token lifetime, the deterministic vs AI paths, and what the return receipt contains. Nothing essential to a correct call is left unstated.

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 baseline is 3, but the description adds cross-parameter meaning not obvious from individual fields: widgetId pins the target else it is parsed from the instruction, granularity words (monthly/weekly/daily) drive chart time scale, and budgetLines replaces the COMPLETE list rather than merging. Minor gaps remain around how `channels` interacts with `plannedSource` beyond what the schema states.

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?

States a specific verb and resource ('Edit an existing report widget') plus the mechanism ('from a plain-language instruction') and the validation contract against add_widget's catalog. An agent can distinguish this from add_widget without opening either schema.

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 explicit routing conditions: use `move` for deterministic moves, `text` + `widgetId` for text widgets, `budgetLines` for Budget vs actual tables, and instruction otherwise; also states that omitting confirm:true yields a preview. It stops short of an explicit 'do not use this to create a widget – use add_widget' exclusion, and does not mention the remove_widget sibling even though instructions can remove widgets.

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