Skip to main content
Glama

gograph_endpoint

Read-onlyIdempotent

Trace an HTTP route end-to-end to map its handler, downstream call chain, emitted SQL queries, and read environment variables for dependency and configuration audits.

Instructions

Build a full vertical slice for one HTTP route: the matched handler symbol, a BFS call chain downstream (default depth 5), all SQL queries emitted in that chain, and all env vars read. Constant nested Gin/Echo/Fiber Group prefixes and Chi Route closure prefixes are composed into final paths; dynamically computed prefixes remain unresolved and can still be queried by suffix or handler. WHEN TO USE: When auditing what an API endpoint does end-to-end — its downstream dependencies, database queries, and configuration reads. NOT TO USE: For listing all routes (use gograph_routes first to find the pattern); for raw handler source code only (use gograph_source). RETURNS: Array of endpoint slices with route, handler, call chain, SQL, and env fields; found:false with a suggestion when the query does not match any route. query accepts route pattern ("POST /api/users"), path fragment ("/users"), or handler name. depth controls call-chain BFS depth (default: 5).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "gograph_endpoint"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootNoAbsolute path of your checkout or worktree (alias cwd).
depthNoBFS depth for call chain traversal, clamped to 1-20 (default: 5)
queryYesRoute pattern ("POST /api/users"), path suffix ("POST /users"), or handler symbol name ("CreateUser"). Constant grouped prefixes are resolved; dynamic prefixes remain best-effort.
mermaidNoReturn Mermaid flowchart text instead of structured JSON
intentionNoRationale; required with an active session.
session_idNoSession from session_create; omit for none.
include_testsNoInclude routes registered in *_test.go files

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.7.21
    • changedInput schema / properties / intention / description
      Previous value: -"Technical rationale, required for analytical calls selecting an active session."New value: +"Rationale; required with an active session."
    • changedInput schema / properties / root / description
      Previous value: -"Absolute path of the checkout you are working in (your cwd or git worktree). Must be this server's repository or one of its git worktrees; the answer then comes from that checkout's own graph. A path elsewhere is refused. Alias: cwd. Omit only when the configured checkout is the one you mean."New value: +"Absolute path of your checkout or worktree (alias cwd)."
    • changedInput schema / properties / session_id / description
      Previous value: -"Caller selector returned by session_create. Omission means an independent caller; never inherits server environment or another caller's session."New value: +"Session from session_create; omit for none."
  2. Changed3 schema fields changedv1.7.18
    • addedInput schema / properties / intention
      Added value: +{
      +  "description": "Technical rationale, required for analytical calls selecting an active session.",
      +  "type": "string"
      +}
    • addedInput schema / properties / root
      Added value: +{
      +  "description": "Absolute path of the checkout you are working in (your cwd or git worktree). Must be this server's repository or one of its git worktrees; the answer then comes from that checkout's own graph. A path elsewhere is refused. Alias: cwd. Omit only when the configured checkout is the one you mean.",
      +  "type": "string"
      +}
    • addedInput schema / properties / session_id
      Added value: +{
      +  "description": "Caller selector returned by session_create. Omission means an independent caller; never inherits server environment or another caller's session.",
      +  "type": "string"
      +}
  3. Changed1 schema field changedv1.5.8
    • changedInput schema / properties / query / description
      Previous value: -"Route pattern (\"POST /api/users\"), final path suffix (\"POST /users\"), or handler symbol name (\"CreateUser\"). NOTE: Nested route-group prefixes are lost statically."New value: +"Route pattern (\"POST /api/users\"), path suffix (\"POST /users\"), or handler symbol name (\"CreateUser\"). Constant grouped prefixes are resolved; dynamic prefixes remain best-effort."
  4. Changed4 schema fields changedv1.5.6
    • changedInput schema / properties / depth / description
      Previous value: -"BFS depth for call chain traversal (default: 5)"New value: +"BFS depth for call chain traversal, clamped to 1-20 (default: 5)"
    • changedInput schema / properties / depth / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / include_tests / description
      Previous value: -"Include call-chain edges originating in *_test.go files"New value: +"Include routes registered in *_test.go files"
    • addedInput schema / properties / mermaid
      Added value: +{
      +  "description": "Return Mermaid flowchart text instead of structured JSON",
      +  "type": "boolean"
      +}
  5. Addedv1.5.3
  6. Removedv1.5.3
  7. Changed1 schema field changed
    • addedInput schema / properties / include_tests
      Added value: +{
      +  "description": "Include call-chain edges originating in *_test.go files",
      +  "type": "boolean"
      +}
  8. Changed1 schema field changed
    • changedInput schema / properties / query / description
      Previous value: -"Route pattern (\"POST /api/users\"), path fragment (\"/users\"), or handler symbol name (\"CreateUser\")"New value: +"Route pattern (\"POST /api/users\"), final path suffix (\"POST /users\"), or handler symbol name (\"CreateUser\"). NOTE: Nested route-group prefixes are lost statically."
  9. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, closed-world behavior, and the description adds real value on top: default BFS depth of 5, how constant Gin/Echo/Fiber Group and Chi Route closure prefixes are composed while dynamic prefixes stay unresolved and remain queryable by suffix, and the found:false-with-suggestion failure mode. It stops short of describing cost or performance characteristics of a depth-20 BFS traversal over a large checkout, which is the main remaining unknown.

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

Conciseness4/5

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

Front-loaded with the core purpose, then cleanly sectioned into WHEN TO USE, NOT TO USE, and RETURNS. It loses a little to redundancy — the accepted `query` forms and the depth default of 5 are stated twice, once in prose and once in the schema — but there is no filler.

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?

For a 7-parameter tool with no output schema, the description supplies the return shape (array of slices with route, handler, call chain, SQL, env fields), the negative-result behavior, and traversal semantics. Combined with full schema coverage and annotations, an agent has everything needed to invoke and interpret it correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so every parameter including mermaid, intention, session_id, and include_tests is already documented in the schema. The description's notes on `query` forms and `depth` default largely restate the schema text, adding only the nuance that dynamic prefixes are best-effort. Baseline 3 applies when the schema does the heavy lifting.

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?

States a specific verb and resource — build a vertical slice for one HTTP route — and enumerates the exact constituents: handler symbol, BFS call chain, emitted SQL, env vars. It is unmistakable against siblings like gograph_routes or gograph_source, which are named in the exclusions.

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

Usage Guidelines5/5

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

Contains explicit WHEN TO USE (end-to-end endpoint auditing) and NOT TO USE clauses that route to gograph_routes for route listing and gograph_source for raw handler source. The agent has a clear decision rule and named alternatives without needing to infer anything.

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