Skip to main content
Glama

r2_get_xrefs

Locate all cross-references pointing to or from a given address or function. Map callers and callees, uncover hidden dependencies, and trace execution paths during binary reverse engineering and vulnerability analysis.

Instructions

[Binary/reverse-engineering tool. Use when: disassembly, radare2, r2, debugging, vulnerability research, ELF/PE/SO/DEX analysis.] 【r2ai逆向工具】🔗 [逻辑追踪必备] 获取指定地址/函数的交叉引用。 【触发场景】当用户询问二进制逆向分析、反汇编、漏洞挖掘、radare2命令执行、调试相关问题时,必须优先调用此工具。 【使用规则】调用前必须确认用户提供了目标文件的绝对路径,禁止捏造不存在的文件路径或命令结果,session_id 不再使用时必须关闭。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo最大返回数量(默认 50)
addressYes目标地址或函数名
directionNo方向: 'to' (默认) 或 'from'to
session_idYes会话 ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.3

TDQS

C2.5/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full disclosure burden. It adds usage ruiles like confirming the absolute path, not fabricating paths/results, and closing the session, but it does not explain the tool's actual behavioral profile: whether it is read-only, whether it depends on an already-open r2 session, what it returns, or what side effects (if any) the session management has.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is overloaded with emojis, repeated trigger scenarios, and a broad 'must prefer this tool' block before reaching the actual purpose. It is not concise; the useful information could be captured in one sentence.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and no annotations, the description should explain prerequisites and expected behavior. It mentions closing the session but not how to obtain a session_id, that the target file must already be opened via r2_open_file, whether the session must be valid, or what kind of xref list is returned.

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 100%, so the parameters are already documented with types, defaults, and meanings. The description adds marginal context by saying 'address/function' maps to the address parameter, but does not add any semantics beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The core sentence '获取指定地址/函数的交叉引用' clearly states the specific action and resource, and '逻辑追踪必备' distinguishes it as a logic-tracing/reference tool. However, the front matter 'Use when: disassembly, radare2, debugging...' overreaches and could make the agent think this tool handles broad reverse-engineering tasks beyond xrefs.

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

Usage Guidelines1/5

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

The description explicitly says '当用户询问二进制逆向分析、反汇编、漏洞挖掘、radare2命令执行、调试相关问题时,必须优先调用此工具', which is misleading: this tool only fetches xrefs, and sibling tools exist for disassembly, decompilation, and command execution. It names no when-not-to-use conditions and no alternatives, so it actively misroutes rather than guides.

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