gograph_concurrency
Find indexed concurrency sites—goroutine spawns, channel sends, and sync.Mutex/RWMutex/WaitGroup/Once calls—or inspect a function's lock scopes to audit race safety and plan refactors.
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. 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. LOCK SCOPE: pass function (a function or method selector) instead of term to parse that body now and list each Lock/RLock with its release (unlock lines, deferred until return, or not released) and the calls between lock and release; spans are lexical, and a call after an unlock in the same block (an early-return branch) is not listed.
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_concurrency"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | Absolute path of your checkout or worktree (alias cwd). | |
| term | No | Optional filter term (e.g., 'goroutine', 'mutex', 'channel') | |
| limit | No | Rows per page. | |
| cursor | No | next_cursor from the previous page. | |
| function | No | Function or method selector (e.g., 'Manager.startPass'); returns its lock scopes instead of the site list | |
| intention | No | Rationale; required with an active session. | |
| session_id | No | Session from session_create; omit for none. |