Skip to main content
Glama

edit_text

Locates a widget by unique match, then updates plain text or rich-text runs; batch edits commit only if all pass, otherwise roll back and report before/after.

Instructions

改一个元件的文字:定位(唯一匹配或 locate 定位字段;多匹配报错列候选)→ 经 set-widget-text / set-widget-richtext 库导出写新链节点 → 新节点过 rp-read 三零(失败则坏节点保留 .rejected、链回退并报差异)。text=简单文本;richRuns=富文本段落/runs,可含段落行距、原生列表级别(list)、wrapping/trimming 及链接目标。edits 数组一次批量改多个元件,全部成功才提交,任一失败整批回退。返回逐条 before/after 与新链尾;GUI/预览需另验。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "edit_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNo
textNo
editsNo
targetNolocate 返回的定位字段对象(record+id [+container] 精确定位)或 {query[,page][,type]} 搜索(须唯一)或字符串(按名称/文本搜)
widgetNo
richRunsNo段落数组(同 set-widget-richtext 的 paragraphs),或 {paragraphs, defaults};支持 paragraph.lineSpacing/wrapping/trimming/list(布尔或 0-3 级原生列表)、run.link(page 或 HTTP(S) url,可选 window=current/new)及 style 全量键(含 weight/style/stretch/characterSpacing/baseline,键集合由该库校验)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.5

TDQS

A3.6/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false, openWorldHint=false), the description discloses atomic batch semantics ('全部成功才提交,任一失败整批回退'), failure artifacts (bad node retained as .rejected, chain rolled back, diff reported), and the return shape (per-item before/after plus new chain tail). It also warns that GUI/preview needs separate verification — context the annotations do not provide.

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?

It is front-loaded with the purpose and reasonably compact, but it is a single dense run-on paragraph mixing internal jargon ('rp-read 三零', '库导出写新链节点') that is opaque to an outside agent. Some of that phrasing costs more parsing effort than it returns.

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 mutation tool with six parameters, nested option objects, and no output schema, the description covers atomicity, rollback behavior, and return contents well. The remaining gaps are minor: the role of the top-level page/widget versus per-edit target, and preconditions such as permissions are not addressed.

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 description coverage is only 33%, but the schema itself carries inline descriptions for target and richRuns. The description adds real meaning by contrasting text (plain) with richRuns (paragraphs/runs, lineSpacing, list level, wrapping/trimming, links) and by explaining that edits is a batch array. It does not clarify how the top-level page/widget combine with array items or whether text and richRuns are mutually exclusive.

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 opening clause '改一个元件的文字' gives a specific verb plus resource, and the description goes on to describe the write pipeline (locate → writer library → rp-read validation). It mentions set-widget-text/set-widget-richtext only as underlying libraries rather than as alternatives to route between, so it stops short of full sibling differentiation.

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?

Usage is implied through the required ordering: you must locate a unique match, then the edit is written and validated, and batch use goes through edits. There is no explicit statement of when to prefer this over set_widget_text or when not to use it, so the agent must infer the boundary.

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