Skip to main content
Glama

替换/上传图片

xiumi_set_image

Replace an image slot in a Xiumi component with a local file or network URL; the image is uploaded to Xiumi hosting and written into the layout.

Instructions

把组件内第 slotIndex 个图片槽替换成指定图片。支持本地文件(filePath)或网络图片(url);图片会先上传到秀米图床再写入排版。

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": {
      "compId": "<compId>"
    },
    "name": "xiumi_set_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNo网络图片 URL
compIdYes组件 ID,来自 xiumi_get_comps / xiumi_insert_template
filePathNo本地图片绝对路径(png/jpg/gif/webp)
slotIndexNo图片槽序号,从 0 开始,默认 0

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It does disclose a real side effect: the image is first uploaded to the Xiumi image hosting service and then written into the layout. Beyond that, it does not say whether an existing image is overwritten, what happens on upload or size failures, what authentication is required, or what the tool returns.

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?

It uses two dense sentences, with no filler: the first states the action and its target, and the second covers the source options and the upload side effect. It puts the key information first, so an agent can act on it immediately.

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 four-parameter mutation tool with no annotations and no output schema, the definition covers the essentials: slot targeting, source options, and the image-hosting step. Minor gaps remain around overwrite semantics, error behavior, and whether exactly one of filePath or url is required, but nothing critical is missing.

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 description coverage is 100%, so the baseline is 3. The description adds value beyond the schema by establishing that a call must supply either a local file (filePath) or a network image (url), a constraint the schema leaves open because only compId is marked required. It does not spell out mutual exclusivity when both are given.

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 description names a specific verb (替换, replace) and a precise target (the slotIndex image slot inside a component), which makes it easy to distinguish from other tools such as xiumi_fill_text or xiumi_set_meta. It never names a sibling tool and gives no explicit routing, so it stops short of the top mark.

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?

It implies when to use the tool: when relating to images, not text or metadata. It also explains the filePath-vs-url choice. However, it offers no explicit when-not guidance, no note about when to use the sibling tool xiumi_insert_template instead, and no prerequisites such as needing an existing compId or a login session.

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