gograph_globals
Find package-level variable declarations and the functions that mutate them in a Go package to audit mutable global state, thread-safety hazards, and shared singletons before refactoring.
Instructions
Find package-level variable declarations (var blocks) and the functions that mutate them in a specific package. WHEN TO USE: When auditing mutable global state, identifying thread-safety hazards, or locating shared singleton variables before a concurrency refactor. NOT TO USE: For local-scope variables; for environment variable reads (use gograph_envs). RETURNS: Package-level variable names, types, and the functions that write to them; empty when the package has no package-level variables.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"package": "<package>"
},
"name": "gograph_globals"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | Absolute path of your checkout or worktree (alias cwd). | |
| limit | No | Rows per page. | |
| cursor | No | next_cursor from the previous page. | |
| package | Yes | Package to inspect: a path containing '/' (e.g., 'internal/config' or the full import path) selects that package exactly; a bare name matches package names by substring | |
| intention | No | Rationale; required with an active session. | |
| session_id | No | Session from session_create; omit for none. |