Skip to main content
Glama

pyocd_debug_stack_overflow_check

Detect thread stack overflow by comparing stack pointer to TCB bounds. Reports usage percentage and watermark integrity for embedded debugging.

Instructions

Check if a thread's stack has overflowed by comparing SP against the TCB's stack bounds. For RT-Thread: provide TCB address, offsets default to 0x24 (stack_addr) and 0x28 (stack_size). Reports usage percentage and watermark integrity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tcb_addressNoThread Control Block address (from .map file or symbol)
stack_addr_offsetNoOffset of stack_addr in TCB (RT-Thread=0x24)
stack_size_offsetNoOffset of stack_size in TCB (RT-Thread=0x28)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description must fully disclose behavior. It clearly explains the mechanism (comparing SP against bounds) and what the tool reports (usage percentage, watermark integrity). It does not explicitly state that the operation is non-destructive, but this is implied. Minor omission: no mention of error handling for invalid TCB addresses.

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?

The description is concise with two sentences. The first sentence states the core purpose and mechanism, the second provides RT-Thread specifics and output. No unnecessary words. It is front-loaded and efficient.

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?

Given that an output schema exists (not shown), the description need not detail return values, but it mentions 'usage percentage and watermark integrity', which is helpful. It covers the main workflow but could mention potential issues like invalid TCB address or non-RT-Thread configurations.

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 input schema provides 100% coverage with descriptions. The description adds value by explaining that tcb_address comes from .map file or symbol, and emphasizes the default offsets for RT-Thread (0x24, 0x28). This helps the user understand the context beyond the raw schema.

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: check if a thread's stack has overflowed by comparing SP against TCB stack bounds. It is specific and well-differentiated from sibling debug tools like pyocd_debug_backtrace or pyocd_debug_fault_analyze, which serve different functions.

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

Usage Guidelines3/5

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

The description implies when to use (stack overflow suspicion) and provides RT-Thread-specific defaults, but lacks explicit guidance on when not to use or alternatives. For example, it does not mention that other tools like pyocd_memory_read could also be used for stack inspection, or that this tool is read-only.

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/konbakuyomu/pyocd-debug-mcp'

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