Skip to main content
Glama
mayjack0312
by mayjack0312

eda_pcb_image_tool_process_image

Validates and compresses an image for PCB placement, returning its natural dimensions and a preview data URL for immediate use.

Instructions

pcb_ImageTool.processImage(file: File, options?: { maxBytes?: number; acceptableBytes?: number }) -> Promise<{ file: File; dataURL: string; width: number; height: number; msg: string | null }> 选图处理门面(弹窗内重选图片:校验/压缩/读尺寸/预览 dataURL 全由服务端完成) deprecated: 临时接口(插入图片 PCB 迁移打通流程用):等统一放置接口重构落地后删除替换,请尽快迁移,勿在新功能中继续依赖 remarks: ADD since EDA v5 returns: 处理结果:file 压缩后文件;dataURL 预览图 dataURL(decode 失败为空字符串);width/height 原始自然尺寸;msg 提示消息(有值需 toast,如「不能超过 50MB」「已压缩至小于2MB」) [已弃用]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNo按官方签名顺序排列的JSON参数数组
windowIdNo目标EDA窗口ID;省略时使用当前活动窗口

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description must carry behavioral disclosure. The description clearly states it performs validation, compression, dimension reading, and preview generation. It also includes return value behavior: file is compressed, dataURL may be empty on decode failure, and msg may need to be toasted. Deprecation status is disclosed. However, it does not mention side effects like whether it modifies the original file or requires permissions.

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 description is long with mixed Chinese and English, and includes the method signature, which is helpful but not front-loaded. The core purpose is stated early, but details like returns and remarks are embedded. It is not overly verbose, but the deprecation note takes space. It could be simplified.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a deprecated tool with no annotations, the description covers the purpose, behavior, and returns adequately. However, it lacks: the types of files accepted (e.g., formats), what maxBytes and acceptableBytes do exactly, and what happens if the file is invalid. Since the output schema is not provided, the description must explain return values, which it does. But the parameter prerequisites are not fully clear.

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?

The schema coverage is 100%, meaning all parameters are described in the schema, though the actual parameters (file, options) are not detailed in the schema (items are empty, only args and windowId are listed). The description adds the constraints maxBytes and acceptableBytes and explains their purpose implicitly via return messages. But it does not explain how to pass the file object (e.g., as a path or blob) or the meanings of maxBytes/acceptableBytes beyond size limits. Since coverage is high, baseline 3 is appropriate.

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 clearly states the purpose: processing an image (validate/compress/read dimensions/preview) for PCB image insertion. It specifies the resource (image file) and the operation (processImage). It distinguishes from siblings like eda_pcb_image_tool_start_place_true_color_picture and eda_pcb_image_tool_start_place_vector_image, which are about placing images, whereas this one is about processing a selected image. The Chinese text adds context about re-selecting images in a popup, but the English is sufficient.

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?

The description indicates this is used when re-selecting an image in a popup, for image processing before placement. It contrasts with sibling tools that start placing true color or vector images. However, it does not explicitly state when not to use this tool or provide alternatives; the deprecation note warns against new dependencies but does not name a replacement.

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