Skip to main content
Glama
Wilson520403

fgui-agent-bridge

by Wilson520403

fgui_verify_document

Verify FairyGUI document attributes by comparing expected properties against disk XML without saving. Supports single-target and tree comparisons, returns snapshots; refuses if unsaved changes exist.

Instructions

只读验证 target 的 expected 属性;默认比对磁盘 XML,不保存。无 expected 时仅返回快照。

expected 为纯属性对象时比对单个 target(必须提供 object_id/object_path/object_name)。expected 含 children 时执行对象树比对,可省略 target(默认根组件):每个节点用 id/name/type 断言或定位,children 为子节点 spec 数组;childrenMode 默认 "exact"(按位置全等,数量必须一致),"subset" 表示每个 spec 按 id/name/index 定位一个子节点、允许多余节点。

external_reload=True 会关闭并重新打开当前文档再比对——这是只读操作仍能达到的最强持久化证明。本命令不会保存,因此文档存在未保存改动时会拒绝执行。

Input Schema

NameRequiredDescriptionDefault
expectedNo
read_xmlNo
max_depthNo
object_idNo
object_nameNo
object_pathNo
external_reloadNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.6

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses read-only/non-saving behavior, the disk-XML comparison default, and a concrete refusal condition (aborts when the document has unsaved changes). external_reload's close/reopen semantics are explained as the strongest persistence proof. It leaves the read_xml=False path and the nature of the returned snapshot under-specified.

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 core purpose, followed by mode-specific rules and the external_reload caveat, with no obvious filler. It is dense and long, but the density is justified by a complex, seven-parameter tool with no schema documentation.

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 complex verification tool with an output schema already covering return values, the description supplies the mode selection logic, childrenMode semantics, and the unsaved-changes precondition. An agent has enough to invoke it correctly without opening the schema.

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 0%, so the description must compensate, and it does for most parameters: expected (single-target vs tree, children spec, childrenMode exact/subset), object_id/object_name/object_path, and external_reload are all explained. max_depth and read_xml receive no explicit meaning beyond hints ('默认比对磁盘 XML'), leaving two of seven params undocumented.

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+resource (只读验证 target 的 expected 属性) and clarifies it is a read-only verification that compares against disk XML without saving. An agent can distinguish this verification tool from read siblings like fgui_get_tree/fgui_get_active_document and write siblings like fgui_save_document.

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?

Clearly explains the two invocation modes and their conditions: a pure-attribute expected requires object_id/object_path/object_name, while expected containing children performs tree comparison and may omit target (defaults to root). It also states that no expected returns only a snapshot. It does not explicitly name alternative tools to use instead, so it stops short of 5.

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