Skip to main content
Glama
fgui-agent-bridge

fgui-agent-bridge

by Wilson520403

fgui_replace_references

Previews and then replaces all project-wide references from one FairyGUI resource to another; explicit execution is required because changes write directly to package XML and cannot be undone.

Instructions

把全工程对某个资源的所有引用替换成另一个资源(0.8.11+)。

先预览、再执行,这是硬要求而不是建议:编辑器原生 ReplaceReferences 直接改包 XML, 立即落盘、不进 Agent 撤销栈、没有 save 兜底,也没有 external_reload 可做—— 响应里 undoable=false 就是这个意思。默认 execute=false 只出预览, 确认 totalCount 与 references 明细后再显式传 execute=True。

与 fgui_replace_object_resource 分工:那个改「某一个对象的某一个属性槽」, 走文档模型、可撤销、有 save/verify/external_reload 梯子;这个改「全工程引用图」, 走原生批处理、不可撤销。两者不要互相替代。

执行后按引用图回读验证(源资源残留引用必须为 0),verification.scope 会标明 "reference-graph"——这是引用图口径,不宣称属性级一致:原生批量替换不会同步 image 元素的 fileName,落盘后该属性短暂滞后,warnings 字段会显式报出槽位数量, 这些节点下次经编辑器保存时自动补齐。

max_items、skip_package_open 同 fgui_query_references。

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": {
      "resource_url": "<resource_url>",
      "new_resource_url": "<new_resource_url>"
    },
    "name": "fgui_replace_references"
  }
}

Input Schema

NameRequiredDescriptionDefault
executeNo
max_itemsNo
resource_urlYes
new_resource_urlYes
skip_package_openNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.25

TDQS

A4.6/5.0
Behavior5/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: it discloses that the native ReplaceReferences path mutates package XML, writes to disk immediately, is absent from the agent undo stack, has no save fallback and no external_reload, and surfaces undoable=false in the response. It further explains the verification scope (reference-graph, not attribute-level), the known lag on image element fileName, and that warnings reports the affected slot count.

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 purpose, then the preview/execute rule, then sibling differentiation, then verification caveats — a sensible order. It is longer than typical, and the bolded emphasis plus the closing pointer to another tool's parameter docs are slightly padded, but nearly every sentence carries operational information.

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 destructive, non-undoable batch mutation this is complete: an output schema exists so return values need no explaining, yet the description still clarifies the meaning of undoable, verification.scope, and warnings. An agent has everything needed to call it safely and interpret the result.

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 0%, so the description must compensate. It explains execute well (default false = preview only) and implicitly establishes resource_url/new_resource_url as source and target, but max_items and skip_package_open are only deferred by reference to fgui_query_references rather than described, and no URL format or count-limit semantics are given.

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 and resource with explicit scope: replace all project-wide references to one resource with another. It also names the sibling fgui_replace_object_resource and draws a crisp boundary (whole reference graph vs. one property slot), so an agent can select between them without opening either schema.

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?

Gives an explicit precondition sequence: preview first with execute=false, confirm totalCount and the references detail, then explicitly pass execute=True. It also states when not to use it (do not substitute for fgui_replace_object_resource) and frames the preview as a hard requirement rather than advice.

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