Skip to main content
Glama
sqlite-mcp-server

sqlite-mcp-server

by mismi

Query Rows

sqlite_query
Read-onlyIdempotent

Run read-only SELECT or WITH queries against a SQLite database, using paged results via limit/offset and named parameters for safe value binding.

Instructions

Run one read-only SQL statement (SELECT or WITH) against the SQLite database.

Results are paged at the SQL level: pass limit/offset rather than writing your own LIMIT when you need to page through many rows. Use named placeholders ($name) and params for values instead of interpolating them into the SQL.

Examples:

  • "How many books are there?" -> SELECT COUNT(*) AS books FROM books

  • "Books by author 3" -> sql: SELECT title FROM books WHERE author_id = $author_id, params: {"author_id": 3}

  • "Top 5 orders" -> sql: SELECT * FROM orders ORDER BY total DESC LIMIT 5

SQLite errors come back as tool errors naming the available tables or columns. This tool cannot modify data; use sqlite_execute or sqlite_insert_row for that.

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": {
      "sql": "<sql>"
    },
    "name": "sqlite_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesA single SELECT or WITH statement. Named placeholders look like $author_id.
limitNoMaximum rows to return
offsetNoNumber of rows to skip, for pagination
paramsNoValues for named placeholders, keyed without the "$": SELECT * FROM books WHERE author_id = $author_id -> {"author_id": 1}
response_formatNo'markdown' for readable text, 'json' for structured datamarkdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

The annotations already cover the safety profile (readOnlyHint, idempotentHint, destructiveHint), but the description adds genuinely non-obvious behavior: the query is wrapped so limit/offset page results at the SQL level, only one statement is accepted, and SQLite errors are surfaced as tool errors that name available tables or columns. That error-behavior disclosure is exactly the kind of operational context annotations cannot express.

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

Conciseness4/5

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

Front-loaded statement, then paging and parameter rules, then worked examples — a sensible ordering with no filler sentences. There is slight tension in the third example ("Top 5 orders" using an inline LIMIT 5) against the earlier instruction to prefer limit/offset over writing your own LIMIT, which adds a small amount of ambiguity for the cost of a useful illustration.

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

Completeness5/5

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

For a five-parameter read tool with a nested params object, no output schema, and full schema coverage, the description covers the decisions an agent must make: statement type, placeholder binding, paging mechanism, error surface, and where to go for writes. Return formatting is delegated to the response_format enum in the schema, so nothing essential is missing.

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 coverage is 100%, so the per-parameter documentation already carries the baseline. The description still adds meaning by explaining the placeholder convention ($name) end to end with a keyed params example, and by framing limit/offset as the intended paging mechanism rather than something the agent should hand-roll into SQL.

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?

Opens with a specific verb and resource: "Run one read-only SQL statement (SELECT or WITH) against the SQLite database." The scope constraint (single statement, read-only) and the closing pointer to sqlite_execute and sqlite_insert_row let an agent distinguish this tool from its write-capable siblings without opening another schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use guidance (paging should go through limit/offset), an explicit how (named placeholders plus params rather than string interpolation), and explicit when-not-to-use routing to two named alternatives for writes. The only omission is guidance on when to prefer sqlite_describe_table or sqlite_list_tables for schema discovery, which is a minor gap against otherwise complete routing.

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