Skip to main content
Glama

dm_run_script

Runs DM-Script inside DigitalMicrograph to invoke native algorithms such as filtering, drift correction, EELS/EDS quantification, SI processing, and batch macros, then reports newly created or deleted image IDs for follow-up quantification.

Instructions

在 DM 内执行 DM-Script(等价于脚本窗口)。用于调用 DM 原生算法:滤波、漂移校正、EELS/EDS 定量、SI 处理、批量宏等。执行后会自动比对图像集合,报告新产生/被删除的图像 id,便于接着用其它工具量化。默认关闭,需环境变量 DM_MCP_ALLOW_DMSCRIPT=1。

Input Schema

NameRequiredDescriptionDefault
scriptYes完整 DM-Script 源码
expect_new_imageNo声明该脚本应当产生新图像;若没有则返回 warning

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.2/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 burden and does disclose key behavior: the tool is disabled by default behind an env var, it auto-diffs the image collection after execution, and reports newly created and deleted image ids. It implies destructive potential (deleted images) but does not warn that arbitrary script execution can mutate or destroy open documents, nor does it mention timeouts or failure modes.

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?

The purpose and equivalence to the script window are front-loaded, the algorithm examples justify the tool's niche, and the post-execution diff behavior and env-var gate follow in a logical order. No sentence is redundant.

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 two-parameter tool with no output schema, the description covers the prerequisite gate and what the return reports (new/deleted image ids, warnings), which is what an agent needs to chain into other tools. Remaining gaps are error/timeout behavior and the risk profile of arbitrary code execution.

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% for both parameters, so the schema already documents 'script' (full DM-Script source) and 'expect_new_image' (warning if no new image appears). The description alludes to the image-diff behavior but adds no syntax, size limits, or usage detail beyond the schema, so baseline 3 applies.

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 verb and resource (execute DM-Script inside DM, equivalent to the script window) and scopes it to native algorithms the other dm_* wrappers don't expose (filtering, drift correction, EELS/EDS quantification, SI processing, batch macros). This clearly distinguishes it from the specialized siblings like dm_fft, dm_stats, or dm_spectrum.

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 a clear context for use: call native DM algorithms and batch macros not covered by other tools, then continue quantifying with other tools. It also states the prerequisite gate (DM_MCP_ALLOW_DMSCRIPT=1). It does not explicitly name which sibling to prefer over this one for a given task, so it falls short of full when/when-not routing.

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