Skip to main content
Glama

SQLite Query

sqlite_query
Destructive

Execute SQL statements on a local SQLite database, returning rows for queries or change count for data modifications.

Instructions

Run a SQL statement against a local SQLite database file and return the rows or change count. Use this to query or modify structured data instead of inventing values.

To explore an unfamiliar database, first run: SELECT name FROM sqlite_master WHERE type='table'.

Args:

  • db_path (string): Path to the .sqlite/.db file (created if missing unless read_only).

  • sql (string): A single SQL statement. SELECT/PRAGMA return rows; INSERT/UPDATE/DELETE return a change count.

  • params (array): Optional positional parameters for ? placeholders.

  • read_only (boolean): Open read-only (default false).

Returns rows (for SELECT) or { changes, lastInsertRowid }.

Example: { "db_path": "~/data/app.db", "sql": "SELECT * FROM users WHERE age > ?", "params": [18] }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
db_pathYesPath to SQLite database file
sqlYesSingle SQL statement
paramsNoPositional params for ? placeholders
read_onlyNoOpen read-only
Behavior4/5

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

Annotations indicate destructiveHint=true and readOnlyHint=false, and the description adds specific behaviors: file creation unless read_only, return type differences (rows for SELECT, change count for DML), and the role of the read_only parameter. This goes beyond annotations to clarify mutation behavior and output format.

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 description is concise: one defining sentence, a tip for exploration, bullet-pointed parameters, return format, and an example. Each element is necessary and front-loaded, with no redundant or vague language.

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?

Given the complexity of a SQL query tool and the lack of an output schema, the description adequately covers parameters, return format, and a usage example. It lacks explicit error handling or path resolution details, but these are minor gaps for typical usage.

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% with parameter descriptions, and the description adds value by explaining the creation behavior of db_path, the return type implications for sql, and clarifying that params are optional. This extra context justifies a score above the baseline of 3.

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 'Run a SQL statement against a local SQLite database file and return the rows or change count,' specifying the verb (run), resource (SQLite database), and output. It distinguishes from sibling file tools by focusing on structured data and provides an exploration tip for unfamiliar schemas.

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 advises using this tool to 'query or modify structured data instead of inventing values,' giving clear context. It includes an exploration SQL and differentiates from other tools implicitly (e.g., not for raw file reads). However, it does not explicitly exclude cases like large imports or non-SQLite operations, so it misses a perfect score.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/highercomve/mcptools'

If you have feedback or need assistance with the MCP directory API, please join our Discord server