Skip to main content
Glama
zeng-andrew

Instrument MCP Server

by zeng-andrew

save_learned_command

Save explored SCPI commands as reusable MCP tools, organized by instrument type for easy reuse and team sharing.

Instructions

将探索成功的 SCPI 命令保存为可复用的 MCP 工具。

保存规则:

  • 按 instrument_type 保存到 .instrument_mcp/{instrument_type}.yaml

  • 如果该仪器有内置 YAML,会先复制作为基础再追加

  • 同名命令会自动更新而非重复

  • 重启 MCP Server 后自动加载

使用场景:

  • 用 explore_scpi 发现新命令后保存

  • 为常用命令创建快捷方式

  • 团队协作时共享命令配置

参数格式示例:

  • params_json: '[{"name":"freq_hz","type":"number","description":"频率(Hz)","default":1000000000}]'

Args: name: 命令名称,如 "mxa_set_peak_threshold" description: 命令功能描述 scpi_template: SCPI 模板,如 "FREQ:CENT {freq_hz}" 或 "*IDN?" instrument_type: 仪器类型,如 "mxa"/"cmw"/"keysight_ps" params_json: 参数定义 JSON 数组字符串 is_query: 是否为查询命令(返回数据的命令)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
descriptionNo
scpi_templateNo
instrument_typeNogeneric
params_jsonNo[]
is_queryNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden. It details save rules (by instrument_type, backup behavior, update policy, auto-load on restart) and provides an example parameter format. However, it does not discuss error handling, file access permissions, or potential conflicts beyond automatic updates.

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 well-structured with headers (保存规则, 使用场景, 参数格式示例, Args) and front-loaded with the main purpose. While some repetition exists (Args parallels schema), it is necessary given the schema's lack of descriptions.

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?

The tool has an output schema, so omitting return value details is acceptable. However, given the tool's complexity (6 parameters, file I/O), additional information on error scenarios or file write failures would enhance completeness. The description covers the core save rules but lacks edge cases.

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 0%, but the description compensates effectively by explaining each parameter in the Args section and providing a concrete JSON example for params_json. This adds significant meaning beyond the schema's property titles and defaults.

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 clearly states the tool's purpose: saving discovered SCPI commands as reusable MCP tools. It uses specific verb+resource format and distinguishes itself from related tools like explore_scpi and list_learned_commands.

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 includes a '使用场景' section that provides context for when to use the tool (after exploration, for shortcuts, for sharing). It explicitly ties to explore_scpi but lacks explicit 'when not to use' or alternative tool comparisons.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zeng-andrew/instrument-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server