Skip to main content
Glama

symbol_lookup

Resolve firmware fault addresses to function names and offsets to locate crashing code. Use ELF symbol tables for accurate bounds; sparse maps or missing symbols yield explicit warnings or not-found.

Instructions

把地址反查成「函数名+偏移」。fault 地址定位代码的关键一步。

symbol_lookup("build/app.elf", ["0x08004a2c"]) ★优先给 .elf 而不是 .map:.elf 的 .symtab 带真实 st_size,能判断 「地址还在不在这个函数内」;.map 只能靠「下一个符号 − 本符号」推断。 ★GNU ld(GCC/STM32CubeIDE/ESP-IDF)默认不往 .map 里写符号表, 同一份固件的 .map 可能只有个位数条目(实测 3 个,而 .elf 有 31 个)。 此时反查会命中段符号给出假函数名——所以本工具遇到这种稀疏 map 会 明确提示,并把同目录的 .elf 摆出来让你换源。 找不到符号时明确报"未找到",不给猜测的函数名——猜出来的名字比没名字更害人。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
addressesYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/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 well: it discloses the sparse-.map failure mode that yields 'fake function names', states that it emits an explicit warning and offers a replacement source, and guarantees a hard 'not found' rather than guessed names. It omits permission/rate-limit or performance characteristics, but for a pure lookup the disclosed edge-case behavior is meaningful.

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 core purpose and routing advice are front-loaded, and the ★ markers separate the operational guidance from the failure-mode caveats. It is somewhat long and re-states the sparse-map problem across several lines, but nearly every sentence carries actionable information for this tool's tricky failure modes.

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?

An output schema exists, so return-value explanation is not required, and the description instead covers the input requirements, the sparse-map edge case, and error semantics. For a 2-parameter tool with an output schema this is close to complete; only address-format specificity is missing.

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 description coverage is 0%, so the description must compensate. The inline example symbol_lookup("build/app.elf", ["0x08004a2c"]) clarifies that `path` is a firmware artifact and `addresses` is a list of hex address strings, which adds real value. However, it never specifies accepted path variants or address string formats ('0x' prefix required? decimal allowed?), leaving notable gaps.

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 first line states a specific verb+resource+transform: reverse-lookup an address into 'function name + offset', and the following line frames it as the key step in fault-to-code localization. This clearly distinguishes it from siblings like parse_map, decode_fault and stack_unwind, which the agent can tell apart without opening 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?

It gives strong conditional guidance: prefer .elf over .map, and explains the reason (real st_size in .symtab enables in-function checks). It also tells the agent the tool will surface a same-directory .elf when a sparse map is detected. It does not explicitly name sibling alternatives (e.g., parse_map), so it falls short of a 5.

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