Skip to main content

Module tools

Module tools 

Source
Expand description

MCP tool implementations. Each submodule defines a single tool by implementing SqliteServerTool and providing the associated input, output, error, and value types.

Modules§

backup_tool
The backup tool: creates a full backup of the database to a file path using rusqlite’s online backup API.
create_fts_index_tool
The create_fts_index tool: creates a full-text search virtual table backed by FTS5 over columns of an existing table.
database_info_tool
The database_info tool: returns metadata about the SQLite database including file size, page metrics, journal mode, WAL status, version, and object counts.
describe_table_tool
The describe_table tool: returns column metadata for a given table using SQLite’s PRAGMA table_info. Useful for inspecting schema details before writing queries.
execute_tool
The execute tool: runs a SQL query against the database and returns typed results. This is the primary tool exposed by the MCP server.
explain_query_tool
The explain_query tool: returns the EXPLAIN QUERY PLAN output for a SQL statement, showing how SQLite will execute the query.
list_foreign_keys_tool
The list_foreign_keys tool: returns all foreign key constraints defined on a given table. Each row from SQLite’s PRAGMA foreign_key_list becomes one entry in the result, so composite foreign keys appear as multiple entries sharing the same id.
list_indexes_tool
The list_indexes tool: returns index metadata for the database. When given a table name, only indexes on that table are returned; otherwise all indexes are listed. Each entry includes the index name, owning table, uniqueness flag, column list, and partial-index predicate (if any).
list_tables_tool
The list_tables tool: returns the names and schemas of all tables in the database. Useful for discovery before issuing queries.
list_triggers_tool
The list_triggers tool: returns all triggers in the database, or only those attached to a specific table. Each trigger includes its name, table, event, timing, and full SQL definition.
list_views_tool
The list_views tool: returns the names and defining SQL of all views in the database. Useful for discovery before issuing queries against views.
search_fts_tool
The search_fts tool: runs a full-text search query against an FTS5 virtual table, returning ranked results with highlighted snippets.
vacuum_tool
The vacuum tool: runs SQLite’s VACUUM command to reclaim unused space and defragment the database file.

Enums§

ToolError
The top-level error type returned by all MCP tools. Wraps errors common to every tool (connection pool failures, access control denials) and delegates to a tool-specific inner error for anything unique to the individual tool’s logic.