SQLite — 18 Operations for AI Agents
SQLite schemas live inside applications themselves — mobile apps, browsers, embedded systems, migration files. act101 reads tables, indexes, and triggers as structure, so agents evolve embedded schemas with full sight of what exists.
This page is the canonical reference an AI coding agent uses to refactor, query, and analyze SQLite code through the act MCP server. 18 operations available: 0 refactor, 18 query, 0 analysis. Each operation is callable from Claude Code, Cursor, Codex, OpenCode, or any MCP-compatible agent host. Click any operation for a stable anchor link suitable for citation.
Worked SQLite examples
act101 reads a SQLite file's DDL statements — CREATE TABLE, CREATE VIEW, CREATE INDEX, CREATE FUNCTION, CREATE TRIGGER, their DROP/ALTER counterparts, and each WITH-clause CTE — as declarations, plus a CREATE TABLE's own columns as property. Because tree-sitter-sequel gives a bare SELECT/INSERT/UPDATE/DELETE statement no name of its own, act101 falls back to the statement's own keyword — every DML statement in the file, at any nesting depth, shows up as a function literally named SELECT/INSERT/UPDATE/DELETE, including a SELECT buried inside a CREATE VIEW body or a CTE. symbols narrows the same file to just the table, view, index, and CTE definitions, dropping every DML statement and every column. Each example below is the verbatim output of the command shown, run against the file shown. Query outputs are pretty-printed with the timing block omitted.
Read the avalanche snowpit schema and its nested queries as a skeleton
snow-pits.sqlite defines the snow_pits table with five columns, an unstable_pits view over pits steeper than 30 degrees, an index on elevation_m, and a recent_pits CTE that counts pits observed since 2026-01-01 by aspect.
$ act query skeleton snow-pits.sqlite
Before
CREATE TABLE snow_pits (
pit_id INTEGER PRIMARY KEY,
aspect TEXT,
elevation_m INTEGER,
slope_angle_deg REAL,
observed_at TEXT
);
CREATE VIEW unstable_pits AS
SELECT pit_id, aspect, elevation_m
FROM snow_pits
WHERE slope_angle_deg > 30;
CREATE INDEX idx_snow_pits_elevation ON snow_pits (elevation_m);
WITH recent_pits AS (
SELECT * FROM snow_pits WHERE observed_at > '2026-01-01'
)
SELECT aspect, COUNT(*) AS pit_count
FROM recent_pits
GROUP BY aspect;
Output
{
"type": "Skeleton",
"declarations": [
{
"kind": "class",
"name": "snow_pits",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 1,
"column": 1,
"byte_offset": 0
},
"end": {
"file": "snow-pits.sqlite",
"line": 7,
"column": 2,
"byte_offset": 137
}
},
"name_range": {
"start": {
"file": "snow-pits.sqlite",
"line": 1,
"column": 14,
"byte_offset": 13
},
"end": {
"file": "snow-pits.sqlite",
"line": 1,
"column": 23,
"byte_offset": 22
}
}
},
{
"kind": "property",
"name": "pit_id",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 2,
"column": 3,
"byte_offset": 27
},
"end": {
"file": "snow-pits.sqlite",
"line": 2,
"column": 29,
"byte_offset": 53
}
},
"name_range": {
"start": {
"file": "snow-pits.sqlite",
"line": 2,
"column": 3,
"byte_offset": 27
},
"end": {
"file": "snow-pits.sqlite",
"line": 2,
"column": 9,
"byte_offset": 33
}
}
},
{
"kind": "property",
"name": "aspect",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 3,
"column": 3,
"byte_offset": 57
},
"end": {
"file": "snow-pits.sqlite",
"line": 3,
"column": 14,
"byte_offset": 68
}
},
"name_range": {
"start": {
"file": "snow-pits.sqlite",
"line": 3,
"column": 3,
"byte_offset": 57
},
"end": {
"file": "snow-pits.sqlite",
"line": 3,
"column": 9,
"byte_offset": 63
}
}
},
{
"kind": "property",
"name": "elevation_m",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 4,
"column": 3,
"byte_offset": 72
},
"end": {
"file": "snow-pits.sqlite",
"line": 4,
"column": 22,
"byte_offset": 91
}
},
"name_range": {
"start": {
"file": "snow-pits.sqlite",
"line": 4,
"column": 3,
"byte_offset": 72
},
"end": {
"file": "snow-pits.sqlite",
"line": 4,
"column": 14,
"byte_offset": 83
}
}
},
{
"kind": "property",
"name": "slope_angle_deg",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 5,
"column": 3,
"byte_offset": 95
},
"end": {
"file": "snow-pits.sqlite",
"line": 5,
"column": 23,
"byte_offset": 115
}
},
"name_range": {
"start": {
"file": "snow-pits.sqlite",
"line": 5,
"column": 3,
"byte_offset": 95
},
"end": {
"file": "snow-pits.sqlite",
"line": 5,
"column": 18,
"byte_offset": 110
}
}
},
{
"kind": "property",
"name": "observed_at",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 6,
"column": 3,
"byte_offset": 119
},
"end": {
"file": "snow-pits.sqlite",
"line": 6,
"column": 19,
"byte_offset": 135
}
},
"name_range": {
"start": {
"file": "snow-pits.sqlite",
"line": 6,
"column": 3,
"byte_offset": 119
},
"end": {
"file": "snow-pits.sqlite",
"line": 6,
"column": 14,
"byte_offset": 130
}
}
},
{
"kind": "class",
"name": "unstable_pits",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 9,
"column": 1,
"byte_offset": 140
},
"end": {
"file": "snow-pits.sqlite",
"line": 12,
"column": 27,
"byte_offset": 245
}
},
"name_range": {
"start": {
"file": "snow-pits.sqlite",
"line": 9,
"column": 13,
"byte_offset": 152
},
"end": {
"file": "snow-pits.sqlite",
"line": 9,
"column": 26,
"byte_offset": 165
}
}
},
{
"kind": "function",
"name": "SELECT",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 10,
"column": 1,
"byte_offset": 169
},
"end": {
"file": "snow-pits.sqlite",
"line": 10,
"column": 35,
"byte_offset": 203
}
},
"name_range": {
"start": {
"file": "snow-pits.sqlite",
"line": 10,
"column": 1,
"byte_offset": 169
},
"end": {
"file": "snow-pits.sqlite",
"line": 10,
"column": 7,
"byte_offset": 175
}
}
},
{
"kind": "variable",
"name": "idx_snow_pits_elevation",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 14,
"column": 1,
"byte_offset": 248
},
"end": {
"file": "snow-pits.sqlite",
"line": 14,
"column": 64,
"byte_offset": 311
}
},
"name_range": {
"start": {
"file": "snow-pits.sqlite",
"line": 14,
"column": 14,
"byte_offset": 261
},
"end": {
"file": "snow-pits.sqlite",
"line": 14,
"column": 37,
"byte_offset": 284
}
}
},
{
"kind": "function",
"name": "recent_pits",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 16,
"column": 6,
"byte_offset": 319
},
"end": {
"file": "snow-pits.sqlite",
"line": 18,
"column": 2,
"byte_offset": 396
}
},
"name_range": {
"start": {
"file": "snow-pits.sqlite",
"line": 16,
"column": 6,
"byte_offset": 319
},
"end": {
"file": "snow-pits.sqlite",
"line": 16,
"column": 17,
"byte_offset": 330
}
}
},
{
"kind": "function",
"name": "SELECT",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 17,
"column": 3,
"byte_offset": 338
},
"end": {
"file": "snow-pits.sqlite",
"line": 17,
"column": 11,
"byte_offset": 346
}
},
"name_range": {
"start": {
"file": "snow-pits.sqlite",
"line": 17,
"column": 3,
"byte_offset": 338
},
"end": {
"file": "snow-pits.sqlite",
"line": 17,
"column": 9,
"byte_offset": 344
}
}
},
{
"kind": "function",
"name": "SELECT",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 19,
"column": 1,
"byte_offset": 397
},
"end": {
"file": "snow-pits.sqlite",
"line": 19,
"column": 37,
"byte_offset": 433
}
},
"name_range": {
"start": {
"file": "snow-pits.sqlite",
"line": 19,
"column": 1,
"byte_offset": 397
},
"end": {
"file": "snow-pits.sqlite",
"line": 19,
"column": 7,
"byte_offset": 403
}
}
}
]
}
The skeleton reports thirteen declarations: snow_pits and unstable_pits as class, snow_pits's five columns as property, idx_snow_pits_elevation as variable, recent_pits as function, and three separate function declarations all literally named SELECT — one inside unstable_pits's view body, one inside recent_pits's CTE body, and the file's own outer SELECT.
List the table, view, index, and CTE as symbols
The same file defines exactly one table, one view, one index, and one CTE.
$ act query symbols snow-pits.sqlite
Before
CREATE TABLE snow_pits (
pit_id INTEGER PRIMARY KEY,
aspect TEXT,
elevation_m INTEGER,
slope_angle_deg REAL,
observed_at TEXT
);
CREATE VIEW unstable_pits AS
SELECT pit_id, aspect, elevation_m
FROM snow_pits
WHERE slope_angle_deg > 30;
CREATE INDEX idx_snow_pits_elevation ON snow_pits (elevation_m);
WITH recent_pits AS (
SELECT * FROM snow_pits WHERE observed_at > '2026-01-01'
)
SELECT aspect, COUNT(*) AS pit_count
FROM recent_pits
GROUP BY aspect;
Output
{
"type": "Symbols",
"symbols": [
{
"name": "snow_pits",
"kind": "class",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 1,
"column": 14,
"byte_offset": 13
},
"end": {
"file": "snow-pits.sqlite",
"line": 1,
"column": 23,
"byte_offset": 22
}
},
"visibility": "unknown"
},
{
"name": "unstable_pits",
"kind": "class",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 9,
"column": 13,
"byte_offset": 152
},
"end": {
"file": "snow-pits.sqlite",
"line": 9,
"column": 26,
"byte_offset": 165
}
},
"visibility": "unknown"
},
{
"name": "idx_snow_pits_elevation",
"kind": "variable",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 14,
"column": 14,
"byte_offset": 261
},
"end": {
"file": "snow-pits.sqlite",
"line": 14,
"column": 37,
"byte_offset": 284
}
},
"visibility": "unknown"
},
{
"name": "recent_pits",
"kind": "function",
"range": {
"start": {
"file": "snow-pits.sqlite",
"line": 16,
"column": 6,
"byte_offset": 319
},
"end": {
"file": "snow-pits.sqlite",
"line": 16,
"column": 17,
"byte_offset": 330
}
},
"visibility": "unknown"
}
]
}
symbols reports exactly these four — snow_pits and unstable_pits as class, idx_snow_pits_elevation as variable, recent_pits as function — dropping every SELECT statement and every column property that skeleton listed.
Query
18 query tools, the same on every supported language. Descriptions live in the shared reference: /docs/query-tools.
callers control_flow data_flow definition diagnostics effect_closure effect_summary fix_auto get_type graph import_organize interface mutations references repo_outline skeleton symbols symbols_batch