gograph_sql
Audit PostgreSQL database interactions by returning bounded pages of static SQL literals with operation, access type, tables, enclosing function, module, and source location.
Instructions
Return one bounded gograph.sql.v1 page of static PostgreSQL query literals with operation, read/write/DDL access, referenced tables, enclosing function, module ownership, and source location. Extraction covers direct literals plus statically resolvable local or same-file package const/var declarations, straight-line assignments, and bounded string concatenations. Filters in different categories AND-compose; repeated values within tables, verbs, and accesses OR-compose. Tests remain included by default for backward compatibility; set no_tests=true for production-only results. CTEs resolve to their actual operation, data-modifying CTEs retain write access/table evidence, PostgreSQL UPSERT remains INSERT, and unsupported classification is explicit rather than guessed. WHEN TO USE: Audit database interactions, write paths, or queries touching a table. NOT TO USE: For ORM struct mappings (use gograph_schema) or runtime-generated SQL that is not a static literal. RETURNS: A deterministic page with total/returned/truncated/next_cursor and queries[].
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "gograph_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | Absolute path of your checkout or worktree (alias cwd). | |
| term | No | Optional case-insensitive raw SQL substring filter | |
| limit | No | Page size from 1 to 200; defaults to 100 | |
| verbs | No | Optional PostgreSQL operation filters; values OR-compose | |
| cursor | No | Opaque next_cursor from the previous gograph_sql page; reuse the same filters | |
| module | No | Optional exact module path/directory, unique nested basename, or repository basename for a root module | |
| tables | No | Optional PostgreSQL table selectors; values OR-compose and may be table or schema.table | |
| accesses | No | Optional statement access classes; values OR-compose | |
| function | No | Optional case-insensitive enclosing-function substring | |
| no_tests | No | Exclude SQL facts from *_test.go files; tests are included by default | |
| intention | No | Rationale; required with an active session. | |
| session_id | No | Session from session_create; omit for none. |