Skip to main content
Glama

cgis_audit_reachability

Find sources that never reach a required checkpoint (e.g., route handlers without an ownership check) to surface authorization gaps and unreachable code paths.

Instructions

Reachability/authorization audit — which sources never reach a checkpoint.

The headline use is **IDOR/authz coverage**: list every route handler that does
NOT transitively reach an ownership check. Reachability follows behavioral edges
(CALLS *and* FastAPI ``Depends()`` DEPENDS_ON), so a guard wired via DI counts.

Select sources with ``from_type`` (a NodeType like ``ROUTE_HANDLER`` /
``API_ENDPOINT`` / ``FUNCTION``) and/or ``from_prefix`` (FQN prefix) — at least
one is required. Returns JSON ``{target, covered, gaps}`` where each gap carries
``fqn``/``file``/``line``. Generalizes to validators, event tracking, or
service-layer-boundary rules by pointing ``target`` at the required node.

A selection that matches no source returns a ❌ message, not an empty
``{covered: [], gaps: []}`` that would read as a passing audit (#467).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
depthNoMaximum reachability depth; a longer path is reported as a gap.
targetYesFQN of the checkpoint every source must reach, e.g. an ownership check. A unique dot-boundary suffix also resolves.
db_pathNoSQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.graph.db
from_typeNoNodeType of the sources to audit, e.g. ROUTE_HANDLER, API_ENDPOINT or FUNCTION (any case). Give this, from_prefix, or both.
from_prefixNoOnly audit sources at or under this FQN prefix, matched on whole dot-segments. A selection matching no source is an error naming the whole-segment prefixes it may have meant. Combined with from_type when both are given.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.21.4
    • changedInput schema / properties / from_prefix / description
      Previous value: -"Only audit sources at or under this FQN prefix, matched on whole dot-segments — a partial segment selects nothing and returns an empty audit, not a clean one. Combined with from_type when both are given."New value: +"Only audit sources at or under this FQN prefix, matched on whole dot-segments. A selection matching no source is an error naming the whole-segment prefixes it may have meant. Combined with from_type when both are given."
  2. Changed5 schema fields changedv0.21.1
    • addedInput schema / properties / db_path / description
      Added value: +"SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path."
    • addedInput schema / properties / depth / description
      Added value: +"Maximum reachability depth; a longer path is reported as a gap."
    • addedInput schema / properties / from_prefix / description
      Added value: +"Only audit sources at or under this FQN prefix, matched on whole dot-segments — a partial segment selects nothing and returns an empty audit, not a clean one. Combined with from_type when both are given."
    • addedInput schema / properties / from_type / description
      Added value: +"NodeType of the sources to audit, e.g. ROUTE_HANDLER, API_ENDPOINT or FUNCTION (any case). Give this, from_prefix, or both."
    • addedInput schema / properties / target / description
      Added value: +"FQN of the checkpoint every source must reach, e.g. an ownership check. A unique dot-boundary suffix also resolves."
  3. First observedv0.21.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full behavioral burden and does so thoroughly: it discloses that reachability follows CALLS and DEPENDS_ON edges, that DI-wired guards count, that output is {target, covered, gaps}, and that no-match selections raise a ❌ error rather than an empty passing result. It also warns of a known edge case (#467). This is more transparency than typical.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but tightly packed: each paragraph covers one concern (headline use, selection, output/edge case) and the main verb appears in the first line. No filler or repetition of schema defaults. The front-loaded headline sentence makes the tool's purpose instantly scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity, the description covers purpose, use cases, source selection, edge behavior, and return shape; the output schema and parameter descriptions fill in return and depth details. The only mild omission is explicit sibling guidance, but the rich use-case section compensates. The definition gives an agent enough to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers all five parameters, so the baseline is 3, and the description adds real meaning: it explains the at-least-one-of from_type/from_prefix selection constraint, how prefixes are matched on whole dot-segments, and that target points at the checkpoint. It does not add much for depth or db_path, but those are already well documented in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description defines a specific verb and resource: it audits reachability to a checkpoint and lists sources that never arrive. It names a concrete headline use (IDOR/authz coverage) and distinguishes its traversal semantics (CALLS plus Depends()) from a plain graph query. This is enough to separate it from siblings like cgis_trace_flow or cgis_find_orphans.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly frames when to use the tool: for IDOR/authz coverage audits, and it generalizes to validators, event tracking, and service-layer-boundary rules. It also gives selection rules (from_type and/or from_prefix) but does not name sibling tools to avoid or state a when-not-to-use condition. That is clear context without exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.