Skip to main content
Glama

gograph_fields

Read-onlyIdempotent

Extract field names, Go types, and struct tags from a Go struct to map JSON/DB serialization or inspect layouts before adding fields.

Instructions

Extract all declared fields from a named Go struct: field names, Go types, and raw struct tag strings (json, db, yaml, gorm, etc.). 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 mapping JSON/DB serialization tags, inspecting struct layouts, or enumerating fields before adding a new one. NOT TO USE: For methods on the struct (use gograph_node or gograph_source); for all struct initialization sites (use gograph_literals). RETURNS: Array of field entries with name, type, and tag string; empty when the struct is not 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 struct to inspect fields for (e.g., 'Config', 'User')

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 struct to inspect fields for (e.g., 'Config', 'User')"
  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 readOnlyHint, idempotentHint, and destructiveHint=false, so the bare safety profile is covered. The description adds genuinely non-obvious behavior: a freshness check performed server-side, refresh in the requested analysis mode, and CHA/SSA retry for precise/precise_fallback graphs after source changes. It also states the empty-result case, though it does not discuss rate limits or how pagination interacts with graph snapshots.

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?

The labeled WHEN TO USE / NOT TO USE / RETURNS structure makes it scannable and front-loads the core action. It is somewhat dense with implementation detail about freshness and CHA/SSA retries, but each sentence carries routing or behavioral value; little is filler beyond the redundant 'Read-only; no side effects.'

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?

There is no output schema, so the description correctly supplies the return shape (array of {name, type, tag}) and the empty/not-found case. Combined with schema-documented pagination and the annotations covering safety, an agent has everything needed to call and interpret this tool.

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 struct, limit, and cursor including bounds and byte-budget caveats. The description only implies the 'struct' argument's role ('named Go struct') and adds no syntax or format detail beyond the schema. Baseline 3 is correct 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?

The description opens with a specific verb and resource ('Extract all declared fields from a named Go struct') and enumerates exactly what is returned: field names, Go types, and raw tag strings. It further distinguishes this from sibling tools by naming gograph_node/gograph_source for methods and gograph_literals for initialization sites, so an agent can route without opening another 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 clause covers three concrete scenarios (mapping serialization tags, inspecting layouts, enumerating fields before adding one), and the NOT TO USE clause names both alternatives and the conditions that select them (methods vs. initialization sites). 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.