Skip to main content
Glama

place_widget

Displays charts, tables, metrics, code, logs, and other interactive widgets on the human's mcp-screen canvas, letting terminal agents show visual results instead of raw JSON.

Instructions

Show something to the human on their mcp-screen canvas (a browser tab next to the terminal). Returns the widget id. Widget kinds and their data:

  • markdown {markdown}

  • text {text} (monospace log/output)

  • table {columns: string[], rows: cell[][]} (sortable; row clicks become the widget selection)

  • chart {type: "bar"|"line", labels: string[], values: number[], unit?, linkTo?: tableId} (bar clicks become the selection and filter the linked table)

  • metric {value, label?, delta?}

  • kv {items: {key: value}}

  • status-list {items: [{label, status: "ok"|"fail"|"pending"|"unknown", detail?}]}

  • diff {before, after, path?, language?} or {patch: "unified diff / git diff text"}, mode?: "split"|"unified" (syntax highlighted)

  • diagram {mermaid: "flowchart TD A[Start] --> B{Ok?} B -->|yes| C"} (Mermaid flowchart subset) or {direction?: "TD"|"LR", nodes: [{id, label, shape?}], edges: [{from, to, label?}]}

  • image {path: "/abs/file.png"} (local png/jpg/gif/webp/svg, served safely) or {url: "https://..."}; alt?, caption?

  • log {lines: string[], maxLines?} (terminal tail; update_widget {data:{append:["more lines"]}} appends; a live command/url source with parse:"text" tails it)

  • checklist {items: [{id?, label, status: "todo"|"doing"|"done"|"failed"|"skipped", detail?}]} (progress bar; update_widget {data:{set:{"": "done"}}} changes single items)

  • code {code, language?, filename?, startLine?, highlight?: lineNumbers[]} (syntax highlighted, copy button)

  • map {markers: [{lat, lon, label, value?, color?}], bounds?: [west, south, east, north]} (offline world map, no tiles)

  • timeline {items: [{at: ISO date or label, title, detail?, status?: "ok"|"fail"|"pending"|"info"}]}

  • livemap {root?, nodes: [{id, label, globs: string[], layer?, description?}], edges: [{from, to, label?}]} (architecture diagram; file edits matching a node's globs light it up live)

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": {
      "kind": "<kind>",
      "title": "<title>",
      "data": "<data>"
    },
    "name": "place_widget"
  }
}

Input Schema

NameRequiredDescriptionDefault
hNoHeight in grid rows (150px each), 1-4.
wNoWidth in grid columns (300px each), 1-4.
xNoOptional canvas position in pixels (top-left). Omit to use the first free spot.
yNo
idNoOptional stable id, e.g. "ci-failures".
dataYesPayload matching the kind (see description).
kindYes
titleYes
canvasNoNamed canvas (project). Default: the git root of the agent's cwd, or MCP_SCREEN_CANVAS.
sourceNoOptional live source, re-run server-side every intervalMs with no LLM. {type:"command", argv:[...], cwd?, parse?:"json"|"text"} (no shell) | {type:"url", url, parse?} | {type:"mcp", tool, arguments?} (wrap mode only). NOTHING runs until the human clicks Approve on the canvas; approved sources go on a persistent allow-list. Output must match the widget data shape (or be text for markdown/text/metric).
intervalMsNoRefresh interval for a live source, min 2000, default 30000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.1.1
    • addedInput schema / properties / canvas
      Added value: +{
      +  "description": "Named canvas (project). Default: the git root of the agent's cwd, or MCP_SCREEN_CANVAS.",
      +  "type": "string"
      +}
    • changedInput schema / properties / h / description
      Previous value: -"Height in grid rows, 1-4."New value: +"Height in grid rows (150px each), 1-4."
    • changedInput schema / properties / kind / enum
      Previous value: -[
      -  "markdown",
      -  "text",
      -  "table",
      -  "chart",
      -  "metric",
      -  "kv",
      -  "status-list",
      -  "livemap"
      -]New value: +[
      +  "markdown",
      +  "text",
      +  "table",
      +  "chart",
      +  "metric",
      +  "kv",
      +  "status-list",
      +  "diff",
      +  "diagram",
      +  "image",
      +  "log",
      +  "checklist",
      +  "code",
      +  "map",
      +  "timeline",
      +  "livemap"
      +]
    • changedInput schema / properties / w / description
      Previous value: -"Width in grid columns, 1-4."New value: +"Width in grid columns (300px each), 1-4."
    • addedInput schema / properties / x
      Added value: +{
      +  "description": "Optional canvas position in pixels (top-left). Omit to use the first free spot.",
      +  "type": "number"
      +}
    • addedInput schema / properties / y
      Added value: +{
      +  "type": "number"
      +}
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden and does substantial work: it discloses the live-source approval gate ('NOTHING runs until the human clicks Approve on the canvas; approved sources go on a persistent allow-list'), the refresh interval minimum, and that local images are 'served safely'. The main undisclosed behavior is what happens when a widget with an existing id is placed again (replace vs. error).

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 the one-line purpose and return value, then a dense kind-by-kind reference where each line earns its place with a distinct payload shape. It is long, but the length is load-bearing for a 16-variant discriminated union; a few parenthetical notes (e.g. 'offline world map, no tiles') could be trimmed without loss.

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 tool with 16 kinds, nested objects, a live-source mode, and 11 parameters, the description covers payload shapes, selection semantics (row/bar clicks become the widget selection), append/set update paths, and the approval model. Combined with a schema that documents the layout and canvas parameters, an agent has enough to call it correctly.

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?

The schema only says data is 'Payload matching the kind (see description)', so the per-kind payload contracts (table columns/rows, chart linkTo/tableId, diff before/after or patch, map bounds, livemap globs) are documented exclusively in the description and are essential. It adds little for x/y/w/h/canvas/intervalMs, but those already have schema descriptions, so the gap is minor at 73% coverage.

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?

Opens with a concrete verb+resource+destination: 'Show something to the human on their mcp-screen canvas (a browser tab next to the terminal)' and states the return value ('Returns the widget id'). The enumerated kind list makes the scope unmistakable and separates it from siblings like read_widget/remove_widget by naming update_widget for the mutation path.

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?

Usage is conveyed per-kind rather than as a general when-to-use rule: log says 'update_widget {data:{append:["more lines"]}} appends', checklist says 'update_widget {data:{set:{...}}} changes single items', and image documents local-vs-url. That implicitly routes the agent between create and update. It never explicitly says when to prefer place_widget over post_report or ask_form, so it stops short of full alternative routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.