Skip to main content
Glama

rename_function

Rename a binary function after identifying its purpose, such as encryption or login validation. This action persists the new name to a local knowledge base, preserving context across sessions.

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
nameYes新的函数名 (只能包含字母、数字、下划线,例如 'AES_Encrypt')
addressNo目标函数地址 (例如 '0x00401000' 或 'sym.main')。留空则默认为当前 seek 的位置。
session_idYes会话 ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.3

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and discloses important side effects: renaming persists automatically to a local knowledge base and survives session restarts. It also warns against fabricating paths or command results and instructs closing session_id when no longer needed, which is useful behavioral context.

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

Conciseness3/5

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

The description is organized with bracketed labels and rule sections, which helps structure. However, it repeats trigger scenarios and overuses phrases like '必须优先调用此工具' (must prioritize calling this tool), adding redundancy that could confuse an agent about when this tool is actually the right choice.

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?

For a mutating tool with no annotations and no output schema, the description covers the key operational details: when to invoke, what preconditions exist, persistence behavior, and session cleanup. Minor gaps remain around what the tool returns or whether renaming can be undone, but the description is sufficient for correct invocation.

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 baseline is 3. The description adds some meaning around session_id lifecycle and why the name parameter is used, but it does not clarify the address parameter and introduces a 'target file absolute path' rule that does not map cleanly to the actual schema parameters.

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 renames functions ('智能重命名函数') and specifies the exact condition for use: once the agent has identified a function's purpose. It also distinguishes itself from sibling tools like r2_disassemble or r2_list_functions by adding the persistence-to-knowledge-base behavior.

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?

The description provides explicit trigger scenarios, such as when the user asks about binary analysis, disassembly, or radare2, and gives a clear precondition that the user must supply the target file's absolute path. It does not name sibling alternatives or state when NOT to use this tool, 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.