Skip to main content
Glama

gograph_routes

Read-onlyIdempotent

List bounded pages of HTTP routes with methods, URL patterns, handlers, and source locations; filter by module or term to inventory a Go service and find routes before tracing handlers.

Instructions

List a deterministic bounded page of HTTP routes with methods, URL patterns, handler names, and source locations. Production routes are returned by default; include_tests=true adds *_test.go registrations. Optional term matches method/path, handler, or file. module selects an exact module path/directory, a unique nested-module directory basename, or the repository directory name for a root module. limit defaults to 100 and is restricted to 1-200; next_cursor continues the same filtered census. Each page is also bounded to 64 KiB so the result stays directly consumable instead of spilling to an out-of-band file. Constant nested Gin/Echo/Fiber Group prefixes and Chi Route closure prefixes are composed; Gin/Fiber use the final variadic argument as the terminal handler, while Echo uses the handler immediately after the path. Dynamically computed prefixes remain unresolved. The MCP server refreshes source analysis before this call. Read-only; no side effects. WHEN TO USE: To inventory one service/module or find a route before gograph_endpoint. NOT TO USE: For a handler's downstream call chain (use gograph_endpoint). RETURNS: gograph.routes.v1 JSON with total, returned, truncated, routes[], and next_cursor when more matches exist.

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_routes"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootNoAbsolute 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.
termNoOptional case-insensitive substring matched against method/path, handler, or file. Path parameters match in any spelling: :id, {id}, and *id are equivalent
limitNoMaximum rows in this page, 1-200 (default: 100); the 64 KiB byte budget may return fewer
queryNoAlias of term
cursorNoOpaque next_cursor from the previous gograph_routes result; reuse the same filters
moduleNoOptional exact module path/directory, unique nested-module directory basename, or repository directory name for a root module (for example identuum-idp)
intentionNoTechnical rationale, required for analytical calls selecting an active session.
session_idNoCaller selector returned by session_create. Omission means an independent caller; never inherits server environment or another caller's session.
include_testsNoInclude routes registered in *_test.go files; false by default

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 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 / query
      Added value: +{
      +  "description": "Alias of term",
      +  "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"
      +}
    • changedInput schema / properties / term / description
      Previous value: -"Optional case-insensitive substring matched against method/path, handler, or file"New value: +"Optional case-insensitive substring matched against method/path, handler, or file. Path parameters match in any spelling: :id, {id}, and *id are equivalent"
  2. Changed5 schema fields changedv1.7.5
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Opaque next_cursor from the previous gograph_routes result; reuse the same filters",
      +  "type": "string"
      +}
    • addedInput schema / properties / include_tests
      Added value: +{
      +  "description": "Include routes registered in *_test.go files; false by default",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Maximum rows in this page, 1-200 (default: 100); the 64 KiB byte budget may return fewer",
      +  "type": "integer"
      +}
    • addedInput schema / properties / module
      Added value: +{
      +  "description": "Optional exact module path/directory, unique nested-module directory basename, or repository directory name for a root module (for example identuum-idp)",
      +  "type": "string"
      +}
    • addedInput schema / properties / term
      Added value: +{
      +  "description": "Optional case-insensitive substring matched against method/path, handler, or file",
      +  "type": "string"
      +}
  3. Addedv1.5.3
  4. Removedv1.5.3
  5. First observedv1.0.0

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered by structured data and the trailing "Read-only; no side effects" largely repeats it. The description does add genuinely non-obvious behavior beyond annotations: a 64 KiB per-page cap that prevents out-of-band spilling, a source-analysis refresh before each call, deterministic paging, and specific prefix-composition rules (Gin/Echo/Fiber Group, Chi Route) with the caveat that dynamically computed prefixes stay unresolved. Return shape detail lives in the prose rather than an output schema, which adds value, but some of the length is spent restating parameters the schema already documents.

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 behavior, then structured into WHEN TO USE / NOT TO USE / RETURNS blocks that are easy to scan. A few sentences duplicate schema content (the limit range, the module resolution forms) and could be trimmed without loss.

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?

Nine parameters with no output schema, yet the RETURNS section names the payload contract (gograph.routes.v1 with total, returned, truncated, routes[], and next_cursor), and paging, byte budget, refresh timing, and unresolved-prefix limitations are all disclosed. Nothing an agent needs to call this correctly or interpret pagination is missing.

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%, and the description largely restates schema fields (term matching, limit range and default, module resolution forms, include_tests behavior). It adds some meaning beyond the schema, notably that next_cursor continues "the same filtered census" (filters must be reused), which the schema states only as "reuse the same filters." Baseline 3 is appropriate when the schema already carries the parameter detail.

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?

Opens with a specific verb+resource+scope: "List a deterministic bounded page of HTTP routes with methods, URL patterns, handler names, and source locations." It also explicitly distinguishes itself from gograph_endpoint, so an agent can choose between the two without opening either schema.

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 ("inventory one service/module or find a route before gograph_endpoint") and NOT TO USE ("for a handler's downstream call chain, use gograph_endpoint") sections naming the alternative and the condition that selects it.

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