Skip to main content
Glama

退出调试模式

exit_debug
Idempotent

Exit Keil debug mode and release the host COM port, allowing other tools to access the serial interface. Stop the target first to avoid rejection.

Instructions

自动退出 Keil 调试模式(UV_DBG_EXIT)。注意:目标处于运行状态时退出会被拒(status=11),需先 stop 再 exit_debug。退出成功后会顺带释放宿主机串口监听占用的 COM 口(否则调试完了串口还占着,Keil 串口窗口/其他工具打不开,WinError=5);释放只放端口,已收日志仍保留、serial_read 继续可读,需要接着采集重新 serial_monitor_start() 即可。 【参数】无(直接调用) 【调用示例】{} 【风险】中——会改变目标状态或占用共享资源(调试态/串口/Keil 实例),必要时可回退。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.8

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations, the description discloses important behavioral details: rejection while the target is running, automatic release of the host COM port, retained logs, serial_read remaining readable, and the WinError=5 failure mode. It also labels the risk level, which is genuinely useful context.

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 longer than minimal but every sentence carries operational value: precondition, error behavior, side effect, recovery, and risk. The section markers also make it scannable, though it could be tightened slightly.

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?

For a no-argument state-changing tool with an output schema, this description is complete: it covers when to call it, what to do first, what side effects occur, how to recover, and the risk profile. Nothing material needed for correct invocation is missing.

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 tool has zero parameters and the schema documents this completely. The description reinforces it with '无(直接调用)' and an empty call example, which is sufficient for the no-parameter baseline.

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 names a specific action and resource: 'automatically exit Keil debug mode (UV_DBG_EXIT)'. It also clearly distinguishes this from sibling operations like enter_debug, run, and stop by describing the exit transition and its side effects.

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 gives clear usage context: stop the target first if it is running, otherwise exit is rejected with status=11. It also instructs the agent that serial_monitor_start() can be restarted if continued collection is needed, but it does not explicitly name alternative tools or state when not to use exit_debug.

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