Query [[mcp_query: Category]]Category
Tools that read the in-memory index directly — SQL over the workspace and a raw index dump.
Query SQL [[tool_query_sql: McpTool]]McpToolRun SQL Query Command 92%Query Your Markdown Graph HowTo 84%CLI CLI 81%
Run a read-only SQL SELECT over the workspace index.
- tool_name: qmdc_query_sql
- status: implemented
- args: path, sql
Description [[description: text]]textRun SQL Query ExtCommand 87%CLI CLI 84%Query Command 83%
Runs sql against the in-memory SQLite index built from the workspace. Two tables are available:
objects(__id, __kind, __label, __namespace, __file, __line, __parent, __level, data)edges(source_id, target_id, edge_type, source_field)
Call Describe Metamodel first to learn the kinds and fields. Passing #query_id runs the sql field of a stored Query object (parity with the LSP Run SQL Query command).
Read-Only Enforcement [[query_read_only: text]]textRun SQL Query Command 65%
Only SELECT-class statements are admitted (INV-2). The statement is parsed and checked against an allowlist before execution; anything else is rejected with a stable, content-free not-read-only code. As defense-in-depth the connection runs under SQLite PRAGMA query_only for the duration of the read. See Security and Force-Root.
Example [[example: text]]textQuery Your Markdown Graph HowTo 75%Run SQL Query Command 75%Query Command 71%
-- Count objects by kind
SELECT __kind, COUNT(*) AS n FROM objects GROUP BY __kind ORDER BY n DESC
-- Outgoing edges of an object
SELECT target_id, edge_type FROM edges WHERE source_id = 'users'
Results are returned as bounded rows (see Bounded Output).
Dump Index [[tool_dump_index: McpTool]]McpToolDump Index Command 88%index Command 78%Outline File McpTool 74%
Dump the entire parsed index as JSON.
- tool_name: qmdc_dump_index
- status: implemented
- args: path
Description [[description: text]]text
Debug-only: returns all objects and files in the index. Large and token-heavy — prefer Query SQL, Get Tree, or Describe Object for targeted reads. Output carries truncation metadata (see Bounded Output).