Skip to main content
Glama

gograph_tests

Read-onlyIdempotent

Find tests that statically exercise a Go symbol, including transitive paths, or select the tests to run for uncommitted changes or a Git ref with ready go test commands.

Instructions

Find test functions in *_test.go files that statically exercise a named symbol, or list all attributed test edges when no symbol is given. Direct mode accepts Receiver.Method (including pointer receivers) or a full stable symbol ID. By default this preserves the direct-edge result contract. Set transitive=true with a required symbol to return gograph.tests.v1 reverse attribution: a summary of every reaching test by depth and resolution, then one page (default 50, nearest first, with total, truncated and next_cursor) of tests with exact/possible resolution, depth, and a representative stable-ID path; max_depth keeps only nearby tests; exact_only omits uncertain paths and package disambiguates the selected product symbol. WHEN TO USE: To choose which tests to run after an edit (uncommitted=true); before editing a function — use transitive=true for router/callback-mediated coverage and direct mode for concrete test call sites. NOT TO USE: For test helper infrastructure (use gograph_fixtures); for running tests or proving runtime coverage. Set uncommitted=true, since=, or select=true with a symbol to get gograph.test_selection.v1: the tests to run for a change, grouped per package, each with an anchored go test -run pattern and ready go test commands (with the graph's build tags). RETURNS: Direct result rows by default, or a versioned reverse-transitive report or test selection when requested.

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

Input Schema

NameRequiredDescriptionDefault
rootNoAbsolute path of your checkout or worktree (alias cwd).
limitNoWith transitive=true: tests per page, nearest first (default 50; 0 returns all)
sinceNoGit ref (e.g. 'main', 'HEAD~1'): select the tests to run for all changes since this ref (gograph.test_selection.v1)
cursorNoWith transitive=true: next_cursor from the previous page
selectNoWith symbol: return gograph.test_selection.v1, the tests to run grouped per package with an anchored go test -run pattern and ready commands
symbolNoThe symbol name to find tests for (optional)
packageNoWith transitive=true or select=true, optional exact Go package name used to disambiguate the selected symbol
intentionNoRationale; required with an active session.
max_depthNoWith transitive, select, uncommitted or since: keep tests whose shortest call path is at most this long; 0 or omitted is unlimited
exact_onlyNoWith transitive=true, omit paths containing possible edges
session_idNoSession from session_create; omit for none.
transitiveNoReturn reverse-transitive test attribution; requires symbol
uncommittedNoSelect the tests to run for all uncommitted changes (gograph.test_selection.v1)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv1.7.21
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "With transitive=true: next_cursor from the previous page",
      +  "type": "string"
      +}
    • 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."
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "With transitive=true: tests per page, nearest first (default 50; 0 returns all)",
      +  "type": "integer"
      +}
    • addedInput schema / properties / max_depth
      Added value: +{
      +  "description": "With transitive, select, uncommitted or since: keep tests whose shortest call path is at most this long; 0 or omitted is unlimited",
      +  "type": "integer"
      +}
    • changedInput schema / properties / package / description
      Previous value: -"With transitive=true, optional exact Go package name used to disambiguate the selected symbol"New value: +"With transitive=true or select=true, optional exact Go package name used to disambiguate the selected symbol"
    • 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)."
    • addedInput schema / properties / select
      Added value: +{
      +  "description": "With symbol: return gograph.test_selection.v1, the tests to run grouped per package with an anchored go test -run pattern and ready commands",
      +  "type": "boolean"
      +}
    • 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."
    • addedInput schema / properties / since
      Added value: +{
      +  "description": "Git ref (e.g. 'main', 'HEAD~1'): select the tests to run for all changes since this ref (gograph.test_selection.v1)",
      +  "type": "string"
      +}
    • addedInput schema / properties / uncommitted
      Added value: +{
      +  "description": "Select the tests to run for all uncommitted changes (gograph.test_selection.v1)",
      +  "type": "boolean"
      +}
  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. Changed3 schema fields changedv1.7.5
    • addedInput schema / properties / exact_only
      Added value: +{
      +  "description": "With transitive=true, omit paths containing possible edges",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / package
      Added value: +{
      +  "description": "With transitive=true, optional exact Go package name used to disambiguate the selected symbol",
      +  "type": "string"
      +}
    • addedInput schema / properties / transitive
      Added value: +{
      +  "description": "Return reverse-transitive test attribution; requires symbol",
      +  "type": "boolean"
      +}
  4. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare this read-only, idempotent and non-destructive, and the description goes well beyond that: it discloses that transitive=true requires a symbol, the default direct-edge result contract, pagination defaults (50, nearest first, total/truncated/next_cursor), and that exact_only omits uncertain paths. It also clarifies the three distinct return contracts rather than leaving the agent to infer them.

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?

The caps-labeled WHEN TO USE / NOT TO USE / RETURNS blocks make it easy to scan and the routing guidance is front-loaded. It is still dense, and the default result contract is stated twice ("preserves the direct-edge result contract" and again in RETURNS), which costs some efficiency.

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

Completeness4/5

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

For a 13-parameter, multi-mode tool with no output schema, the description covers all three return shapes and the mode-switching parameters well. Field-level detail for the direct result rows is thinner than for the transitive and selection reports, so it is not fully complete.

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 coverage is 100%, so the baseline is 3, but the description adds meaning the schema does not fully convey: how transitive, symbol, max_depth, exact_only and package interact, and that uncommitted/since/select switch the tool to gograph.test_selection.v1. The added value is real though largely a restatement of per-parameter descriptions.

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 opening sentence names a specific verb and resource ("Find test functions in *_test.go files that statically exercise a named symbol") and explicitly covers the no-symbol fallback ("list all attributed test edges"). It also distinguishes direct vs. transitive modes, so an agent can tell what the tool returns without opening the 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?

It has explicit WHEN TO USE guidance tied to concrete moments (after an edit, before editing a function, router/callback-mediated coverage) and a NOT TO USE section that names the sibling gograph_fixtures for helper infrastructure. It also states the boundary that it does not run tests or prove runtime coverage.

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