Skip to main content
Glama

Inspect SQLite schema

sqlite_schema
Read-onlyIdempotent

Inspect a SQLite database file to return table, index, view and trigger DDL plus PRAGMAs, version, path, size and mtime; optional row counts.

Instructions

Inspect a SQLite database file: schema-neutral, no interpretation of the data. File type is decided by the first 16 bytes, not the extension. Returns table/index/view/trigger DDL from sqlite_master, the journal_mode/page_size/page_count/encoding/user_version/application_id PRAGMAs, the sqlite3 version, whether -wal/-shm siblings exist next to the ORIGINAL file, plus path/size/mtime (UTC and local with numeric offset). A database with no journal (or an empty leftover one) is opened in place and leaves no new files behind; one with a real -wal is read from a private copy instead, cleaned up after the call — wal_copy/wal_copy_ms in the response say whether that happened and how long it took. Either way nothing is ever left next to the original. counts=true adds COUNT(*) per table, off by default — it is a full scan and can take minutes on a large database. counts_timeout_ms is a PER-TABLE budget covering the whole call (spawning sqlite3 and opening the file, not just the COUNT itself) — on a large database file a very small budget can time out even a tiny table. A table that does not finish is null in counts; every such table is listed in counts_incomplete.tables with one shared counts_incomplete.note, not a message repeated per table. The rest of the schema is always returned in full. Call once without counts first, then again with counts only if row counts are actually needed — the DDL comes back in full either way, so a second call re-sends everything already read, which matters on a database with a hundred tables.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
countsNoAdd COUNT(*) per table (full table scan each). Default false.
counts_timeout_msNoPer-table budget (covers spawning sqlite3 + opening the file + the COUNT), not a pool shared across tables. Default 60000, max 600000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already cover read-only/idempotent/non-destructive, yet the description adds substantial context: file type from the first 16 bytes rather than the extension, WAL databases read from a private copy cleaned up afterward, 'nothing is ever left next to the original', and the counts_incomplete reporting shape. This is far beyond what the annotations convey.

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 with purpose, then behavior, then the counts caveat — the ordering is logical. It is dense and long, and the counts-timeout explanation repeats part of the schema description, but nearly every sentence carries operational information an agent needs.

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?

With no output schema, the description carries the full burden of explaining returns, and it does: table/index/view/trigger DDL from sqlite_master, PRAGMA values, sqlite3 version, path/size/mtime, wal_copy fields, and counts_incomplete. Nothing material to correct invocation 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 67% and the description meaningfully deepens it: counts is a full table scan that 'can take minutes', and counts_timeout_ms is a per-table budget covering sqlite3 spawning and file opening, so 'a very small budget can time out even a tiny table'. It also compensates for the undocumented path parameter's role.

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?

States a specific verb and resource ('Inspect a SQLite database file') and immediately scopes it ('schema-neutral, no interpretation of the data'), which implicitly separates it from the sqlite_query sibling. It does not name that sibling explicitly, so differentiation requires a small inference.

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?

Gives explicit operational guidance: 'Call once without counts first, then again with counts only if row counts are actually needed', plus the warning that a second call re-sends the full DDL on a hundred-table database. It stops short of naming an alternative tool for data (not schema) reads, so it is strong but not complete routing guidance.

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