Skip to main content
Glama
mayjack0312
by mayjack0312

eda_sys_math_get_centroid

Calculates the centroid coordinates of a polygon in EasyEDA Pro. Use it to find the geometric center for component placement or design analysis.

Instructions

sys_Math.getCentroid(polygon: TSYS_MathPolygonInput) -> ISYS_MathPoint 计算多边形质心 returns: 质心坐标

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It does disclose the full call contract (input type TSYS_MathPolygonInput, output type ISYS_MathPoint) and makes clear this is a pure calculation with no side effects. However, it adds no behavioral context about coordinate units (mm/mil), polygon validity requirements, or edge cases (degenerate/self-intersecting polygons). The transparency is adequate for a stateless math function but not rich.

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 definition is appropriately tiny and the signature is front-loaded, which an agent can scan quickly. However, the two Chinese lines ('calculate polygon centroid' and 'returns: centroid coordinates') largely restate what the signature and tool name already convey, so not every sentence earns its place. Acceptable size, mild redundancy.

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 low-complexity pure math utility, the signature provides the essential call contract and return type. But the structure of TSYS_MathPolygonInput is undocumented in both the schema (empty items {}) and the description, and there is no output schema describing ISYS_MathPoint, nor any mention of coordinate units. An agent could invoke it at a high level but would have to guess the polygon argument shape.

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 coverage is 100% so the baseline is 3, but the schema's 'args' description is generic ('JSON parameter array in official signature order') with empty items ({}). The description's signature line compensates by naming the actual argument type (TSYS_MathPolygonInput) and return type (ISYS_MathPoint), adding real meaning beyond the schema. It still doesn't document the polygon's internal structure, but the type naming is valuable.

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 states a specific operation — '计算多边形质心' (calculate polygon centroid) — on a clear resource (polygon), and the embedded signature specifies the return type ISYS_MathPoint. Among the eda_sys_math_* siblings (get_bbox, calculate_area, calculate_perimeter, contains, etc.), centroid computation is clearly distinct, though the description never explicitly names a sibling to differentiate from.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives. With many sibling math tools (get_bbox, calculate_area, distance_to_point, eda_pcb_math_polygon_* operations), an agent gets no selection criteria, no prerequisites (e.g., closed/valid polygon), and no exclusions. The description is purely a statement of what the function does.

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