Skip to main content
Glama

gograph_constructors

Read-onlyIdempotent

Locate every factory and constructor function that returns a named Go struct. Use it to find canonical creation paths or to update all initialization sites before changing a struct.

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

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum rows per page; the byte budget may return fewer.
cursorNoOpaque next_cursor for the same graph snapshot and result selection.
structYesThe exact name of the target Go struct to find constructors for (e.g., 'User', 'Config')

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. Changed1 schema field changedv1.4.70
    • changedInput schema / properties / struct / description
      Previous value: -"The name of the struct (e.g., 'User')"New value: +"The exact name of the target Go struct to find constructors for (e.g., 'User', 'Config')"
  5. 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 declare readOnly/idempotent/non-destructive, so the safety profile is covered. The description adds valuable context beyond that: the freshness check before the call, refresh in the current analysis mode, and CHA/SSA retry after source changes, plus the empty-result behavior. It does not, however, detail pagination/cursor interaction beyond what the schema states.

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 core definition and organized into labeled WHEN TO USE / NOT TO USE / RETURNS blocks that make scanning easy. The freshness/retry sentence is dense and somewhat implementation-flavored, but it still earns its place as behavioral context.

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?

Although there is no output schema, the RETURNS section describes the return shape (constructor names with signatures, package paths, file locations; empty when none found). Combined with 100% schema coverage on inputs and the sibling routing, an agent has everything needed to call it correctly.

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 limit, cursor, and struct are all fully documented in the schema. The description adds no syntax or format detail for the struct parameter beyond the schema's own example. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

States a specific verb and resource: 'Find all factory and constructor functions that instantiate and return a named Go struct,' with a parenthetical defining the exact return-type condition. It explicitly disambiguates from the closest siblings (gograph_literals, gograph_fields), so the agent can route correctly without opening schemas.

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?

Provides explicit WHEN TO USE conditions (finding the canonical creation path, pre-modification impact checks) and NOT TO USE exclusions that name the correct alternative for each case (literals, fields). Nothing is left to inference about when this tool is the right pick.

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