scry_sql
Execute read-only SQL queries against the scry project database to discover project state, search documentation, check coverage, and inspect anchors. Supports SELECT and WITH (CTE) queries.
Instructions
Execute a read-only SQL query against the scry project database. Use this to discover project state, search docs, check coverage, inspect anchors.
Supports SELECT and WITH (CTE) queries only. All mutator keywords (INSERT, UPDATE, DELETE, DROP, etc.) are blocked.
Key tables: scry__doc — knowledge graph entries (@scry.entry markers) columns: id, kind, status, weight, summary, rationale, applies, current_path, ephemeral, missing_since, content_hash, extras (JSON1; NULL when absent), created_at, updated_at extras: single-depth scalar map per scry-spec FR4.B (v1.1.0+). Query with JSON1, e.g. SELECT id, json_extract(extras, '$.cost_usd') AS cost FROM scry__doc WHERE kind = 'deliverable' ORDER BY cost DESC scry__doc_tag — tags as a join table: doc_id, tag scry__doc_seeded_question — seeded questions: doc_id, ordinal, question scry__anchor — named code location bookmarks: id, doc_id, description, content_hash, created_at, updated_at scry__anchor_seeded_question — anchor seeded questions: anchor_id, ordinal, question scry__bind — binding markers (@scry.bind): id, source_doc_id, source_local_id, target_id, target_fragment, comment, content_hash, created_at, updated_at scry__rel — typed edges between docs: from_id, to_id, predicate (depends_on|implements|supersedes|satisfies), fragment scry__file — universal file body index: path, doc_id, body, content_hash, last_modified scry__bind_fts — full-text search over bindings (source_local_id, target_id, comment) scry__warning — lint-style warnings: id, kind, marker_kind, marker_id, file_path, message, detected_at (kinds: misplaced_doc, depends_on_cycle) scry__doc_fts — full-text search over docs (id, summary, rationale, applies, current_path) scry__doc_tag_fts — full-text search over tags (tag, doc_id UNINDEXED) scry__doc_seeded_question_fts — full-text search over seeded questions (question, doc_id UNINDEXED) scry__anchor_fts — full-text search over anchors (id, description) scry__file_fts — full-text search over file bodies (path, body); prefer scry_grep tool
Returns JSON: {"results": [...], "row_count": N}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |