Skip to main content
Glama

00Widget

Publish several cards at once

upsert_cards_batch
DestructiveIdempotent

Create or replace up to 32 cards in one call. Always prefer this over repeated upsert_card when one snapshot produces several related cards: it makes a single widget-reload decision instead of burning WidgetKit's daily reload budget once per card. Set replacePrefix to your own id namespace and the snapshot also deletes what it no longer contains, which is the only way to stop reporting something without leaving a dead card behind.

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": {
      "cards": "<cards>"
    },
    "name": "upsert_cards_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
cardsYesEvery card from one producer snapshot, sent together. Ids must be unique within the batch. This is one coalesced widget-reload decision instead of one per card, which is why it is preferred over looping the single-card endpoint.
replacePrefixNoDelete this tenant's cards whose id starts with this prefix and that are absent from `cards`. Use the namespace you already publish under ("myapp-"), so one producer's snapshot can never remove another's cards. Every card in the batch must start with it, which is what stops a typo from deleting everything.

Output Schema

NameRequiredDescriptionDefault
cardsYes
removedNoIds deleted because they were under `replacePrefix` and absent from this snapshot. Present only when `replacePrefix` was sent.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, so the bar is lower, but the description still adds real value: it explains that the batch coalesces into one widget-reload decision against a daily budget, and that `replacePrefix` deletes absent cards — the deletion semantics behind the destructive flag. What it does not cover is failure behavior, which lives in the schema text.

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 sentences, front-loaded with the capability, then the reason to prefer it, then the destructive caveat. The reload-budget clause is justification rather than padding, and nothing repeats the schema.

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 two-parameter batch writer with an output schema and exhaustive nested parameter docs, the description covers the only things an agent could get catastrophically wrong: choosing the single-card loop, and setting `replacePrefix` to the wrong namespace.

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 the baseline is 3, but the description adds operational meaning the schema alone does not convey: that `replacePrefix` should be the producer's own id namespace, and that the all-cards-must-match rule is a typo guard against mass deletion.

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?

A specific verb and resource — 'Create or replace up to 32 cards in one call' — plus an explicit cap. It is immediately distinguishable from the sibling `upsert_card`, which the description names as the single-card alternative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States both when to use it ('when one snapshot produces several related cards') and what it replaces ('repeated upsert_card'), and gives the reason (reload budget). It also tells the agent when the destructive path activates: only when `replacePrefix` is set to its own namespace.

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.