query_rules
Retrieve active coding rules for a project across its scope hierarchy using SQL filters or semantic search when a text query is set.
Instructions
Query active rules visible to a project across its full scope hierarchy (most-specific scope first), via plain SQL filtering or — when query_text is set and embeddings exist — semantic search.
Access level: read. Returns: a JSON or TOON array of matching rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Comma-separated tags; matched by exact tag equality, not substring. | |
| detail | No | 'summary': metadata only. 'full': also includes rule text (may return STALE_INDEX per row if its source file changed since indexing). | summary |
| format | No | Output format: 'json' or 'toon' (compact tabular). | json |
| category | No | Filter by rule category, e.g. 'quality', 'security', 'architecture'. | |
| severity | No | Filter by severity: 'low' | 'medium' | 'high' | 'critical'. | |
| project_id | Yes | Project id (with or without the 'project-' prefix). | |
| query_text | No | Free-text query. When set and ChromaDB has embeddings, enables semantic (RAG) search instead of plain SQL filtering. | |
| include_deprecated | No | Include deprecated rules. Only affects plain SQL filtering — deprecated rules are removed from the semantic (query_text) index on deprecation, so this does not revive them there. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |