Skip to main content
Glama

r2_close_session

Close an active Radare2 session by its session ID to free up resources and prevent dangling processes, ensuring a clean analysis environment.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes会话 ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.3

TDQS

C2.9/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It adds a useful behavioral rule against fabricating paths or command results, and reminds that sessions must be closed when no longer needed. However, it does not disclose important close-session behavior such as whether the session is permanently invalidated, whether unsaved state is lost, or what happens after closing.

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 padded with generic boilerplate ('Binary/reverse-engineering tool', 'r2ai逆向工具', broad trigger scenarios) and repetitive brackets. Only the core close-session sentence and the 'close when unused' rule are directly relevant. Several sentences actively mislead tool selection and should be removed.

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?

For a simple one-parameter tool, the description does not explain where session_id comes from (e.g., from r2_open_file or session creation). It also includes an irrelevant rule about confirming a target absolute file path, even though this tool takes no path parameter. The close-when-unused hint is helpful, but the tool's invocation context is incomplete.

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?

The input schema already describes the only parameter, session_id, as '会话 ID', so schema coverage is high. The description does not add extra meaning beyond '必须在不再使用时关闭', which is a lifecycle note rather than parameter format, origin, or usage detail. Baseline 3 is appropriate.

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 description clearly states the primary action: '关闭指定的 Radare2 会话' (close the specified Radare2 session), which is a specific verb and resource. However, the surrounding '触发场景' lines claim this tool must be prioritized for all binary reverse-engineering questions, which muddles tool selection and blurs the distinction from sibling tools like r2_open_file, r2_run_command, and r2_disassemble.

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

Usage Guidelines2/5

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

There is some valid usage guidance: 'session_id 不再使用时必须关闭' (must close when the session_id is no longer used). But the description also instructs the agent to call this tool first for any disassembly, debugging, or vulnerability analysis question, which is misleading for a close-session operation. No alternatives or exclusions are named.

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