Skip to main content
Glama

generate_from_image

Converts local UI screenshots or layered specs into native editable Axure RP 9/11 .rp prototypes using OCR and component recognition, with optional text replacement and offline asset output.

Instructions

高层图片转原型入口:从本地 UI 截图(或已提取的分层 spec)自动执行 Apple Vision OCR、几何卡片/分割线/图标媒体切片识别、可选文案替换(replace),并在 RP9 / RP11 下离线直接写出真实可编辑二进制 .rp(文字、矩形、卡片、圆、分割线为独立原生元件,复杂矢量/图表/裁剪媒体为独立透明 PNG ImageBox,素材持久保存在 .assets 目录),同时记录 .baseline.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": {
      "output": "<output>"
    },
    "name": "generate_from_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNo生成的目标页面/画板名称,默认「图片还原页」。
specNo可选:已校对的分层 trace spec 路径或对象(用于二次校对后重建)。
imageNo本地截图文件绝对路径(PNG/JPG)。
scaleNo截图逻辑像素缩放比(如 1 表示 1x,2 表示 Retina 2x);省略时默认 2。
baseRpNo可选:上次生成的 .rp 路径;若检测到已有原生改稿且 prefer=fail,则拒绝静默覆盖。
outputYes新生成的二进制 .rp 绝对路径(只写新文件,不覆盖)。
preferNo当 baseRp 有原生改稿时的保护策略,默认 fail。
previewNo可选:传入真实 Axure 预览截图路径(或布尔值)进行宿主预览与薄页/原图的像素差分。
replaceNo可选:OCR 文本修正规则列表,每项为 "旧文本=新文本" 或 {old, new}。
versionNo目标 Axure 版本,默认 9;9 和 11 都离线直接写出二进制 .rp(11 需本机 RP11 空白模板)。
guiPasteNo当 version=11 时改为走 Axure RP 11 GUI 粘贴(默认 false,走离线原生写入)。

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?

Annotations only declare write/non-destructive/closed-world; the description adds substantial context beyond them — offline binary .rp emission, which elements become native widgets vs transparent PNG ImageBoxes, an `<output>.assets` sidecar directory, and a `<output>.baseline.json` with a validation summary. It stays consistent with destructiveHint=false by noting only-new-file writing, but omits environment prerequisites (Apple Vision implies macOS) and failure/runtime behavior.

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?

The entry point is front-loaded correctly, but the body is a single long run-on sentence with deeply nested parentheticals, making it hard to scan. Every clause carries information, yet the lack of sentence breaks or structure costs readability.

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 an 11-parameter, multi-stage generation tool with no output schema, the description does cover the outputs (assets directory, baseline.json, validation summary) and the fidelity model (native vs image elements). What remains missing is the prerequisite environment and how the spec-rebuild path relates to the review tool, but nothing an agent needs to call it correctly is absent.

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 100% and the parameter descriptions are already detailed (scale defaults, prefer enum semantics, version 9/11 template requirement). The description adds little parameter-level meaning beyond restating the optional replace rules and spec path, so the baseline 3 applies.

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 opens with a specific verb+resource framing ('高层图片转原型入口') and enumerates the concrete pipeline (Vision OCR, geometry/media slicing, offline .rp writing). An agent can tell this is the image-to-Axure-prototype generator rather than a generic builder, though it never names the sibling it is not (e.g. generate_prototype or review_image_structure).

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 only implied: the mention of an already-extracted '分层 spec' for '二次校对后重建' hints at the review-then-generate workflow, but there is no explicit statement of when to choose this over generate_prototype or when to run review_image_structure first. No exclusions or prerequisites are given.

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