gograph_constructors
Find all factory and constructor functions that instantiate a named Go struct. Use to update all construction paths before modifying struct initialization.
Instructions
Find all factory and constructor functions that instantiate and return a named Go struct (functions whose return type includes the struct name). 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. WHEN TO USE: When looking for the canonical way to create a struct, or before modifying struct initialization to ensure all construction paths are updated. NOT TO USE: For direct composite-literal sites (use gograph_literals); for struct fields (use gograph_fields). RETURNS: List of constructor function names with signatures, package paths, and file locations; empty when no factory functions are found.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| struct | Yes | The exact name of the target Go struct to find constructors for (e.g., 'User', 'Config') |