Skip to main content
Glama

sqlite_query

Run read-only SQL queries against a SQLite database with bound parameters and row limits to retrieve targeted data.

Instructions

以只读方式执行 SQL 查询。

Args: database: 数据库文件名或沙箱内的路径。 sql: 单条 SQL 查询语句(SELECT / WITH / PRAGMA 等)。 params: 绑定参数列表,使用 ? 占位符。 max_rows: 最多返回行数;0 表示使用配置上限。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "database": "<database>",
      "sql": "<sql>"
    },
    "name": "sqlite_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
paramsNo
databaseYes
max_rowsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/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 full burden. It does disclose the key safety trait that execution is read-only, and it explains max_rows=0 as falling back to a configured cap, which signals truncation. It says nothing about what happens on truncation, error or timeout behavior, or what a write attempt returns, so there are clear gaps for a zero-annotation tool.

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

Conciseness5/5

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

The purpose is front-loaded in one line, and the Args block then documents each parameter without repetition. Every sentence adds information, and the structure is scannable.

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?

An output schema exists, so return values needn't be described. For a 4-parameter SQL tool with no annotations, however, the definition should still route the agent to sqlite_execute for writes and say what happens when the row cap is hit. Those omissions leave the definition below complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description has to carry all parameter meaning, and it does: database as a filename or sandbox-relative path, sql as a single read statement, params as a bind list using ? placeholders, and max_rows with 0 meaning the configured limit. The only shortfall is that it doesn't specify types or ordering details beyond the placeholder convention.

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 gives a specific verb and resource: 执行 SQL 查询, and it immediately qualifies the operation as 以只读方式. This read-only qualifier is what lets an agent separate this tool from the write-path sibling sqlite_execute. It never names sqlite_execute, sqlite_list_tables, or sqlite_describe, so the differentiation must be inferred rather than read.

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 phrase 以只读方式 implies when this tool applies, namely for SELECT-style reads as opposed to writes. The sql arg listing SELECT / WITH / PRAGMA reinforces that boundary. There is no explicit guidance such as 'for writes use sqlite_execute', and no prerequisites, so the usage boundary is implied rather than stated.

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