Skip to main content
Glama

gograph_query

Read-onlyIdempotent

Search the Go graph index for symbols, packages, files, and imports matching keyword substrings. Use it during initial exploration when you know a term but not its package.

Instructions

Search the graph index for symbols, packages, files, and import edges that match one or more keyword substrings. Multiple terms use OR semantics, matching CLI query term.... The MCP server refreshes source analysis before the call. Read-only; no persistent side effects. WHEN TO USE: During initial exploration when you have a keyword or feature name but do not know its package. NOT TO USE: When you already know the exact symbol (use gograph_source or gograph_node); for package dependency trees (use gograph_deps). RETURNS: Matching symbols, files, and imports; empty when no terms match.

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.
termNoOne keyword search term (e.g. 'AuthService' or a route path such as '/api/v1/users/{id}')
limitNoMaximum rows per page; the byte budget may return fewer.
queryNoAlias of term
termsNoOptional list of keyword terms combined with OR semantics
cursorNoOpaque next_cursor for the same graph snapshot and result selection.
no_testsNoExclude rows located in *_test.go files, matching CLI --no-tests
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 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 / no_tests
      Added value: +{
      +  "description": "Exclude rows located in *_test.go files, matching CLI --no-tests",
      +  "type": "boolean"
      +}
    • 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: -"One keyword search term (e.g. 'AuthService')"New value: +"One keyword search term (e.g. 'AuthService' or a route path such as '/api/v1/users/{id}')"
  2. Changed2 schema fields changedv1.7.5
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Opaque next_cursor for the same graph snapshot and result selection.",
      +  "maxLength": 128,
      +  "type": "string"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 100,
      +  "description": "Maximum rows per page; the byte budget may return fewer.",
      +  "maximum": 200,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  3. Addedv1.5.3
  4. Removedv1.5.3
  5. Changed3 schema fields changed
    • changedInput schema / properties / term / description
      Previous value: -"The keyword search term to locate in symbols, files, and imports (e.g., 'AuthService', 'token', 'router')"New value: +"One keyword search term (e.g. 'AuthService')"
    • addedInput schema / properties / terms
      Added value: +{
      +  "description": "Optional list of keyword terms combined with OR semantics",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "term"
      -]New value: +[]
  6. Changed1 schema field changedv1.4.66
    • changedInput schema / properties / term / description
      Previous value: -"The keyword to search for (e.g., 'Auth')"New value: +"The keyword search term to locate in symbols, files, and imports (e.g., 'AuthService', 'token', 'router')"
  7. 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 readOnly=true, idempotent=true, destructive=false, so the safety profile is pre-covered. The description still adds genuinely new behavior: the server refreshes source analysis before the call (implicit latency/freshness trait) and that results are empty when no terms match. 'Read-only; no persistent side effects' merely restates the annotations, which is the only wasted disclosure.

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 purpose, then a compressed WHEN/NOT/RETURNS block structure that is easy to scan. Minor waste in repeating 'Read-only; no persistent side effects' after the annotations already say so, and the CLI equivalence clauses are borderline redundant.

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 required fields and no output schema is a real complexity burden, but the description supplies a RETURNS section, term semantics, alternative routing, and the pre-call refresh caveat, so an agent can call it correctly. Nothing material is missing for a read-only search tool.

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 all nine parameters (root, term/query/terms aliases, limit, cursor, no_tests, intention, session_id) are already fully documented in structured data. The description adds only the OR-combination rule for multiple terms and the CLI `query term...` equivalence, which is useful but thin over an already-complete schema; baseline 3 applies.

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?

Specific verb and resource: 'Search the graph index for symbols, packages, files, and import edges' matched by keyword substrings. It goes further and names the sibling alternatives (gograph_source, gograph_node, gograph_deps) with the condition that selects each, so the tool is distinguishable without inspecting any 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?

Explicit WHEN TO USE ('initial exploration when you have a keyword or feature name but do not know its package') and NOT TO USE clauses naming two concrete alternative tools plus gograph_deps for dependency trees. Also states OR semantics for multiple terms, so routing and invocation behavior are both unambiguous.

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