Skip to main content
Glama

gograph_concurrency

Read-onlyIdempotent

Locate goroutine spawns, channel sends, and Mutex/WaitGroup/Once calls to audit race safety and understand async flow in Go code.

Instructions

Find indexed concurrency sites in the codebase: goroutine spawns (go statements), channel sends, and calls on sync.Mutex/RWMutex, sync.WaitGroup, and sync.Once. The MCP server checks freshness before this call and refreshes in the current requested analysis mode; precise and precise_fallback graphs retry CHA/SSA after source changes. Read-only; no side effects. Optional term filter (e.g., "mutex", "goroutine", "channel"). WHEN TO USE: When auditing race safety, understanding async flow, or locating synchronization points before a concurrency refactor. NOT TO USE: For standard sequential call flow analysis (use gograph_callers/gograph_callees). RETURNS: File locations, line numbers, and primitive kind for each indexed concurrency site; empty when no sites are found. Channel receives and select statements are not indexed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termNoOptional filter term (e.g., 'goroutine', 'mutex', 'channel')
limitNoMaximum rows per page; the byte budget may return fewer.
cursorNoOpaque next_cursor for the same graph snapshot and result selection.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +}
  2. Addedv1.5.3
  3. Removedv1.5.3
  4. 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 cover the read-only/idempotent/no-destruction profile, and the description goes further by disclosing the server-side freshness check and refresh-in-current-mode behavior, plus the CHA/SSA retry on source changes. The 'Read-only; no side effects' clause merely restates annotations, and the 'RETURNS' details about file/line/kind are useful but expected.

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 resource set, then cleanly sectioned into WHEN TO USE / NOT TO USE / RETURNS. Slightly over-long due to the redundant 'Read-only; no side effects' line and a dense freshness/refresh sentence, but overall well organized.

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 read-only discovery tool with no output schema, the description supplies the return shape (file locations, line numbers, primitive kind), the empty-result case, and the explicit exclusion of channel receives and select statements. Combined with annotations covering safety and the schema covering params, nothing an agent needs to call it correctly 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%, so the schema already documents term, limit, and cursor. The description only adds example filter terms ('mutex', 'goroutine', 'channel'), which is marginal value over the schema; baseline 3 is appropriate.

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 names a specific verb (Find) and enumerates the exact resource set: goroutine spawns, channel sends, and calls on sync.Mutex/RWMutex, WaitGroup, and Once. It further distinguishes itself from siblings by directing sequential-flow queries to gograph_callers/gograph_callees, so an agent can identify this tool 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?

Explicit WHEN TO USE (race-safety audit, async flow understanding, locating synchronization points before a concurrency refactor) and NOT TO USE (sequential call flow, with named alternatives gograph_callers/gograph_callees). Nothing is left to inference.

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