Skip to main content
Glama

Rake

Decode Cortex-M fault registers

decode_cortex_m_fault
Read-onlyIdempotent

Decodes Arm Cortex-M fault status register values (CFSR, and optionally HFSR, MMFAR, BFAR, SFSR, SFAR, EXC_RETURN and the stacked PC) into the faults they record and the checks to make next. For Cortex-M3, M4, M7, M33, M55 and M85. Use it when firmware lands in HardFault, MemManage, BusFault, UsageFault or SecureFault and the register values are known.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cfsr": "<cfsr>"
    },
    "name": "decode_cortex_m_fault"
  }
}

Input Schema

NameRequiredDescriptionDefault
bfarNoBusFault Address Register, read from 0xE000ED38.
cfsrYesConfigurable Fault Status Register, read from 0xE000ED28.
hfsrNoHardFault Status Register, read from 0xE000ED2C.
sfarNoSecureFault Address Register, read from 0xE000EDE8. Cores with TrustZone only.
sfsrNoSecureFault Status Register, read from 0xE000EDE4. Cores with TrustZone only.
mmfarNoMemManage Fault Address Register, read from 0xE000ED34.
exc_returnNoThe value of LR at the first instruction of the fault handler, 0xFFFFFFxx.
stacked_pcNoThe PC value in the exception stack frame.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world behavior, so the safety profile is covered. The description adds genuinely new context: the output reports the faults recorded plus "the checks to make next," and it flags core-family and TrustZone-dependent register applicability. It does not say what happens on an unsupported core or a malformed register value.

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?

Two sentences, zero padding, with the decode action and register inventory front-loaded before the invocation trigger. Every clause carries information an agent needs.

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?

With no output schema, the description usefully states that results are the recorded faults plus recommended next checks, and it lists core coverage. Minor gaps remain: no statement of behavior for unlisted cores or for missing optional registers, but nothing essential for correct invocation is absent.

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 coverage is 100% and every parameter already documents its register name and read address, so the schema does the heavy lifting. The description adds only the "optionally" framing that implies CFSR alone is sufficient and the rest are supplements; it gives no format or validity guidance beyond what the pattern and descriptions already state.

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?

"Decodes Arm Cortex-M fault status register values" names a specific verb and resource, then enumerates the exact registers handled (CFSR, HFSR, MMFAR, BFAR, SFSR, SFAR, EXC_RETURN, stacked PC) and the supported cores. This is enough to distinguish it from architecture-specific siblings like decode_esp_panic and decode_riscv_trap without opening their schemas.

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?

"Use it when firmware lands in HardFault, MemManage, BusFault, UsageFault or SecureFault and the register values are known" gives a clear trigger condition plus a prerequisite (registers already captured). It stops short of naming an alternative tool or stating when not to use it, so it does not reach the top of the scale.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources