Skip to main content
Glama

dm_crop

Crop a 2D rectangular region from an open DigitalMicrograph image into a new independent image; the source stays unchanged, and the result returns an image ID, calibration, and [y,x] shape.

Instructions

在 DM 内原生裁出二维独立子图,返回新图像 id、标定与 NumPy 轴序 shape[y,x];右下边界不包含。原图保持不变;不支持三维/四维直接裁剪。

Input Schema

NameRequiredDescriptionDefault
nameNo新图像名称,省略则自动命名
rectYes像素矩形 [x0, y0, x1, y1],必须完整位于图内,不舍入或裁夹
image_idNo图像 id(来自 dm_datasets),或 "front" 表示前台窗口

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does well: it declares the operation is non-destructive ('原图保持不变'), that the bottom-right boundary is exclusive, that a new image id plus calibration are produced, and that 3D/4D input is unsupported. It does not say how it behaves on invalid or out-of-bounds rectangles (schema covers that) or whether a new dataset is registered in the tree.

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?

One dense but well-ordered sentence: the action and return first, then the boundary rule, then the non-destructive guarantee and the 3D/4D restriction. No filler, and the most decision-relevant facts are front-loaded.

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 tool with no output schema, the description does cover the return payload (new image id, calibration, shape) and the core constraints, which is what an agent needs to call it. Minor gaps remain around error/failure behavior and whether the new image appears in the dataset listing.

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 genuinely useful semantics beyond the schema by specifying the return shape as shape[y,x], which helps an agent keep the [x0,y0,x1,y1] rect ordering straight against NumPy axis ordering.

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 gives a specific verb and resource (natively crop a 2D independent sub-image inside DM) and immediately states what it returns (new image id, calibration, NumPy shape[y,x]). The explicit 'does not support direct 3D/4D cropping' clause separates it from the 4D-STEM siblings.

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 plainly states a when-not condition: 3D/4D arrays cannot be cropped directly. However, it never names the alternative tool (e.g. dm_4dstem_virtual or dm_2d_capture) an agent should switch to when that limitation applies, so routing is inferred rather than explicit.

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