Skip to main content
Glama

set_widget_richtext

Rewrite native RichTextBlock paragraphs and runs to set font, size, line spacing, alignment, native list levels, wrapping, and trimming in an editable RP prototype.

Instructions

整段重写原生 RichTextBlock 的段落与 runs(字体/字号/行距/对齐/原生列表级别/wrapping/trimming 及 run 全量键)。具名调用省略宿主源/输出即使用会话链;原始 args 用 session:true 并省略这两个参数(多源工具保留导入源)。显式路径不推进链。 登记证据 gui-roundtrip,只适用 capabilities.md 的已验样本。CLI: node set-widget-richtext.mjs source.rp new.rp richtext.json

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": {
      "args": "<args>"
    },
    "name": "set_widget_richtext"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsYes
sessionNotrue 时 args 省略宿主源和输出,由当前链注入;多源工具仍传导入源。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.5

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, and openWorldHint=false, so the safety profile is mostly covered, but the description still adds real context. It discloses the replacement semantics ("整段重写", a full rewrite rather than a patch), the session-chain side effects, and the precondition that the tool is restricted to gui-roundtrip-verified samples. What it does not say is what happens to existing runs that the new data does not cover, or how errors are reported.

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?

The definition is front-loaded with what the tool writes, followed by invocation modes, constraints, and a concrete CLI example. Each sentence adds a distinct fact (schema fields, session semantics, chain behavior, verification scope, CLI form), and every sentence carries a specific fact, so it reads densely but without padding.

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 a two-parameter mutation tool with no output schema and annotations already covering the safety profile, the definition covers the essential invocation paths, the chain side effect, and the scope restriction. The remaining gaps, namely error behavior, whether unmentioned runs are cleared, and explicit routing against set_widget_text, are minor but real.

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?

With schema coverage at 50%, only the session parameter has a schema description, and the definition meaningfully extends it by stating that, when session:true, both the host source and the output must be omitted and injected by the current chain. The CLI line ("set-widget-richtext.mjs source.rp new.rp richtext.json") supplies the positional meaning of the opaque args string array: a source file, a target file, and a JSON payload.

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?

The definition gives a specific verb and resource: "整段重写原生 RichTextBlock 的段落与 runs" (wholly rewrite the paragraphs and runs of a native RichTextBlock), then lists the fields it controls (font, size, line spacing, alignment, native list level, wrapping, trimming, full run keys). An agent can distinguish it from plain text setters such as set_widget_text or edit_text through the phrase "整段重写" (whole-segment rewrite), but the definition never names a sibling tool explicitly.

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

Usage Guidelines3/5

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

The definition gives conditional invocation mechanics: perform a named call that omits the host source and output, or use raw args with session:true and omit both, while multi-source tools keep the import source. It also states that explicit paths do not advance the chain and that the tool only applies to samples verified in capabilities.md. However, it never says when to prefer this tool over alternatives such as set_widget_text; the choice is left to inference.

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

Deploy Server

Other Tools