Skip to main content
Glama

sqlite_query

Executes SQL queries on Android SQLite databases via system sqlite3, enabling inspection of private app data with root access. Use LIMIT to control output size.

Instructions

[Binary/reverse-engineering tool. Use when: disassembly, radare2, r2, debugging, vulnerability research, ELF/PE/SO/DEX analysis.] 【r2ai逆向工具】🗄️ [数据库] 使用系统内置 sqlite3 工具执行 SQL 查询。支持 Root 权限,可直接读取 /data/data 下的私有数据库。请务必使用 LIMIT 限制返回行数,防止输出过大。 【触发场景】当用户询问二进制逆向分析、反汇编、漏洞挖掘、radare2命令执行、调试相关问题时,必须优先调用此工具。 【使用规则】调用前必须确认用户提供了目标文件的绝对路径,禁止捏造不存在的文件路径或命令结果,session_id 不再使用时必须关闭。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes要执行的 SQL 语句 (如 'SELECT * FROM user LIMIT 10;')
db_pathYes数据库文件的绝对路径 (如 /data/data/com.xxx/databases/msg.db)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.3

TDQS

B3.4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral disclosure burden. It adds value by stating '支持 Root 权限,可直接读取 /data/data 下的私有数据库' (supports root, can read private databases), warns about output size via '请务必使用 LIMIT 限制返回行数,防止输出过大', and includes honesty rules like '禁止捏造不存在的文件路径或命令结果'. These go beyond the schema and help the agent anticipate behavior. The 'session_id' instruction is irrelevant and slightly confusing, so not a 5.

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 long, repetitive, and poorly organized. It opens with an irrelevant list of reverse-engineering triggers, then buries the actual SQLite purpose in the middle. The trigger scenarios and usage rules are redundant, and 'session_id' is mentioned without any corresponding parameter. The core function is not front-loaded, and several lines of text could be cut without losing information. This is under-specification disguised as verbosity.

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

Completeness3/5

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

Given the tool's simplicity and full schema coverage, it is mostly complete for invocation: it says what it does, how to use it safely (LIMIT, absolute path), and what capabilities it has (root access). However, there is no output schema and the description does not describe the return format or error behavior. The confusing 'session_id' instruction and the off-topic intro also detract. It is adequate but not comprehensive.

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 coverage is 100% (both parameters have descriptions). The description adds minimal meaning beyond the schema: it reiterates the need for LIMIT and mentions reading /data/data (which maps to db_path being an absolute path). The root-access capability hints at what paths are valid, but this is marginal. Baseline 3 is appropriate because the schema already documents the parameters well and the description does not significantly enrich them.

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 purpose is stated: '使用系统内置 sqlite3 工具执行 SQL 查询' (use system sqlite3 to execute SQL queries). This clearly identifies it as a SQLite query tool, distinct from the r2_* siblings. However, the introductory section listing reverse-engineering triggers (disassembly, radare2, etc.) introduces noise and could mislead an agent into thinking this tool handles tasks it does not, so it loses the top score.

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 gives explicit when-to-use guidance: '当用户询问二进制逆向分析、反汇编、漏洞挖掘、radare2命令执行、调试相关问题时,必须优先调用此工具' (must call first for reverse-engineering questions). However, this is overly broad and not tied to specific SQLite-query scenarios, and no alternatives are named or contrasted. The operational rules (LIMIT, confirm path, close session) are useful but not selection criteria, so it's adequate but not strong.

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