Skip to main content
Glama

decode_fault

Decode Cortex-M fault registers into plain-language diagnosis and troubleshooting steps when a device crashes or hits HardFault, flagging invalid addresses.

Instructions

解码 Cortex-M 故障寄存器,给出人话诊断 + 排查方向。

设备跑飞/进 HardFault 时用。传你从 fault handler 读到的原始值(任意组合): decode_fault(cfsr=0x8200, hfsr=0x40000000, bfar=0x40021000)

★ 会自动处理三类陷阱,别跳过它的结论: · BFARVALID/MMARVALID=0 时地址是垃圾值——工具会拒绝解读,不给假地址 · IMPRECISERR 时即使 valid,BFAR 也不可信(总线写延迟)——工具会标注 · FORCED=1 说明真因在 CFSR——工具会提示去读 CFSR 拿到可信地址后,用 symbol_lookup 反查是哪个函数。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
archNocortex-m
bfarNo
cfsrNo
hfsrNo
mmfarNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/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 so richly: it discloses that the tool refuses to interpret garbage addresses (BFARVALID/MMARVALID=0), flags IMPRECISERR as making BFAR untrustworthy, and emits a CFSR hint when FORCED=1. These are exactly the guardrails an agent must not skip, far beyond what a bare name would convey.

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?

Front-loaded with purpose, then the trigger, then an executable example, then the three caveats as a scannable bullet list. Every element earns its place; no preamble or filler.

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 5-param, no-required-args diagnostic tool with an output schema (so return values need not be explained), the description covers purpose, trigger, input semantics, default-behavior caveats, and the follow-up path. Nothing an agent needs to invoke it correctly 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?

Schema coverage is 0% and there are 5 params, so the description must compensate. It does so well by showing a concrete call example (cfsr/hfsr/bfar), stating 'any combination' is accepted (implying all optional), and explaining register-field interrelations (BFARVALID, MMARVALID, IMPRECISERR). It stops short of documenting the arch and mmfar parameters, so it is not fully complete.

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?

States a specific verb and resource (decode Cortex-M fault registers) and the value delivered (plain-language diagnosis + troubleshooting directions). It is clearly differentiated from siblings like decode_register/decode_register_svd by the fault-specific scope, and it explicitly routes follow-up work to symbol_lookup.

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?

States the exact trigger condition ('when the device crashes / enters HardFault') and names the follow-up alternative (symbol_lookup) once a trustworthy address is obtained. An agent knows when to reach for this tool and what to do next, without needing to open any schema.

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