Skip to main content
Glama

单步执行

step

Advance execution by one instruction or source line, with modes to enter, skip over, or exit functions. Handles SRAM dirty reads and interrupt handler limits for reliable source-level debugging.

Instructions

单步执行。mode 可选:'into'(单步进入)、'over'(单步跳过)、'out'(跳出)、'instruction'(指令级)。默认 'into'。注意:单步瞬间读 PC 可能读到 SRAM 脏值(已用 FLASH 区段过滤修复)。在中断/异常 handler 内单步或 SP/LR 回溯可能层数受限;'out' 在函数入口处不可靠(Keil 可能无法正确跳出),若卡住可改用 run_to_line 跳到函数返回行。需已进入调试且配置 .axf(source 级单步)。 【参数】必填: 无;可选: mode 【调用示例】{} 【风险】中——会改变目标状态或占用共享资源(调试态/串口/Keil 实例),必要时可回退。 【参数别名】mode ← kind/over_or_into/type。规范名以上方【参数】行为准;未列出的参数名会被拒绝,不会静默忽略

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNointo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.8

TDQS

A4.3/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=false, destructiveHint=false, and idempotentHint=false, so the description does not need to restate that. It does add valuable behavioral context: it warns about potential dirty PC values due to SRAM, limitations when stepping inside handlers, and the unreliability of 'out' at function entry. This goes beyond the annotations, providing critical runtime behavior details that an agent needs to know.

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 reasonably concise, with key information front-loaded (what it does and modes). It uses structured sections for parameters and risk, which aids scanning. However, it includes some redundant content like the list of modes repeated in the main description and later in the alias section, but that's minor. The warning about dirty PC is valuable and placed after the modes, which is acceptable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there is an output schema, the description does not need to explain return values. The tool is a complex debug operation, and the description covers preconditions ('需已进入调试且配置 .axf'), potential pitfalls (dirty PC, reliability issues), and fallback suggestions. It also provides risk level and parameter aliases, making it complete for an agent to use correctly.

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 coverage is 0%, so the description must compensate. The description explains the 'mode' parameter thoroughly, listing all possible values ('into', 'over', 'out', 'instruction') with their meanings and the default. It also explains the aliases for mode. This is comprehensive, despite the minimal schema.

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 the verb '单步执行' (single-step execution) and the resource (the target). It is clear that this tool executes one step in a debug session. However, it does not explicitly distinguish it from sibling tools like 'run' or 'run_to_line' (mentioned in the description but not present in the sibling list), which could confuse an agent about when to use step vs. run. The description does reference 'run_to_line' as an alternative, providing some differentiation.

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

Usage Guidelines5/5

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

The description gives explicit guidance on when to use each mode and when not to, including alternatives. It says 'out' is unreliable at function entry and suggests using 'run_to_line' as an alternative. It also states the precondition that the tool requires being in debug mode with an .axf configured. This is excellent usage guidance.

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