Skip to main content
Glama
mayjack0312
by mayjack0312

eda_pcb_math_polygon_trace_image

Converts an image into a vector SVG path for PCB polygon trace, with preview images and dimensions. Enables placing image-derived shapes in the PCB layout.

Instructions

pcb_MathPolygon.traceImage(options: { imageBlob?: Blob; imageWidth?: number; imageHeight?: number; quality?: 'low' | 'high'; tolerance?: number; simplify?: number; smoothness?: number; despeckle?: number; whiteAsTransparent?: boolean; antiphase?: boolean }) -> Promise<{ path: string; sourcePreviewUrl: string; previewUrl: string; width: number; height: number } | undefined> 将图片描摹为矢量路径(SVG path),并导出预览图 remarks: 纯预览接口,不触发任何放置工具(放置由临时接口 eda.pcb_ImageTool.startPlaceVectorImage 单独承担)。服务端内置读原始图片尺寸(扩展沙盒无 new Image()/canvas,无法提供原始尺寸),返回的 width/height 为原始自然尺寸(非描摹 bbox 尺寸)。首次调用需传 imageBlob(服务端缓存像素),之后拖动只传参数

ADD since EDA v5 returns: 描摹结果:path = SVG D 字符串(放置时回传给临时接口);sourcePreviewUrl = 原图预览 dataURL(缩放居中 300×300,对应旧世界 SourceCanvasPreview);previewUrl = 描摹结果预览图 dataURL(尺寸 ≤300×300);width/height = 描摹 bbox 归一最长边 300 基准的尺寸(pixel 语义,与原图分辨率/缩放无关,作为放置尺寸默认值的换算基准);空描摹(没有可描摹的轮廓)返回 undefined

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are present, so the description carries the burden; it discloses that the call is preview-only, caches image pixels server-side, cannot rely on browser Image/canvas APIs, and returns undefined for empty traces. However, the width/height semantics are internally contradictory — one remark says original natural size, while the returns section says trace-bbox normalized to a 300px base — which weakens the transparency.

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?

The description is long and dense, but it is structured around signature, remarks, version, and returns, with almost every sentence carrying operational value. Minor extras like the ADD since EDA v5 line and repeated no-placement clarification keep it from a 5, but it is well front-loaded with purpose and workflow.

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?

Given that there is no output schema, the description does a good job covering return fields, the undefined edge case, the caching/lifecycle behavior, and the placement handoff. The contradictory width/height explanation and the unexplained tuning parameters are the main remaining gaps.

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?

The schema only exposes an args array and windowId, so the description adds real value by listing the actual options and types and explaining the imageBlob lifecycle. Individual tuning parameters such as tolerance, simplify, smoothness, despeckle, and antiphase still lack definitions, units, or ranges, but the names and context provide reasonable guidance.

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?

The description states a specific action — '将图片描摹为矢量路径(SVG path),并导出预览图' — and explicitly differentiates this tool from placement tools by calling it a pure preview interface that does not trigger any placement operation. It also names the separate placement interface, distinguishing it clearly from siblings like eda_pcb_image_tool_start_place_vector_image.

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?

It gives concrete workflow guidance: first call must pass imageBlob, subsequent drag interactions pass only parameters, and placement is handled separately by eda.pcb_ImageTool.startPlaceVectorImage. It does not enumerate exclusions or compare with other image-processing siblings, but the context is clear and actionable.

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