LiteDB desktop
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LITEDB_POLICY | No | read-only (the default for these variables), guarded or unrestricted. | |
| LITEDB_SQLITE_PATH | No | Path to a SQLite file. Leave both unset to follow the database open in the LiteDB desktop app. | |
| LITEDB_DATABASE_URL | No | postgres://, mysql:// or mariadb:// connection string. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Talks to the database currently open in the LiteDB desktop app, or to LITEDB_SQLITE_PATH / LITEDB_DATABASE_URL if those are set. Switch database or policy in the app and the next tool call follows, no restart. Quitting the app clears the handoff. If the app is in YOLO, this server maps that down to guarded. SQLite is the file on disk, not unsaved editor state, save first. Start with list_tables and describe_table, describe_table reports the values a low-cardinality column actually holds, which is usually the difference between a query that runs and one that is right. Writes are previewed; running them is a separate execute_approved call. Where the person has allowed it for a connection, the write tool runs a small bounded write in one call instead, and returns anything else as a preview.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_tablesA | Every table in the database, with its column count, approximate row count and primary key. The place to start. |
| describe_tableA | Columns and types for one table, with primary keys, NOT NULL, defaults, foreign keys, indexes, and, for low-cardinality text columns, the distinct values they actually contain. Read this before writing SQL against a table you have not seen. |
| queryA | Run SQL against the database. A read executes and returns rows. Anything that would change the database does NOT execute: it comes back classified, with the number of rows it would affect and the query plan, plus a single-use token for execute_approved. A statement the policy forbids is refused and says why. |
| execute_approvedA | Second step, after query. Runs the statements a previous |
| writeA | Run a write in one call, where the person has allowed that for this connection in LiteDB (Settings → Agents): an INSERT of listed rows, or an UPDATE or DELETE with a WHERE clause, that changes no more rows than the limit they set. The limit is checked before it runs and enforced while it runs. Anything else, or any write when it is not allowed, comes back as a preview with a token for execute_approved, exactly as from query, with the reason it did not run. |
| list_vector_columnsA | Vector columns in the database and their dimensions. PostgreSQL with the pgvector extension only. |
| semantic_searchA | Nearest-neighbour search over a pgvector column. Give |
| audit_logA | The most recent statements recorded against this database, newest first , from this server and from the LiteDB desktop app, which share the file. Shows what was proposed, what was approved, and what ran. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| schema | Every table and column in the database, as one document. Cheaper than calling describe_table for each table when you need the whole picture. |
TDQS
Scored across 8 tools
Each tool has a stated role, and the descriptions explicitly delimit the tricky boundaries: query previews writes, write only runs them when pre-authorised, and execute_approved runs them by token. The residual overlap is real (query and write can both end up producing the same preview/token, and semantic_search is a specialised query), but the documentation resolves it well enough that an agent should pick correctly.
All names are snake_case and mostly follow a verb_noun shape (describe_table, list_tables, list_vector_columns, audit_log, execute_approved). The minor deviations are the bare verbs `query` and `write` and the noun-first `audit_log`, which are readable but not strictly parallel.
Eight tools is well within a healthy range and each one maps to a distinct step in the read/write/approve workflow plus schema inspection, auditing and vector search. Nothing looks redundant or bolted on.
The surface covers schema discovery, reads, guarded writes with an approval lifecycle, and an audit trail, which is essentially full lifecycle for a desktop DB agent. Gaps are minor but present: no way to cancel or revoke a pending token, no transaction/connection controls, and no explicit index or DDL guidance beyond describe_table's output.