Skip to main content
Glama

gograph_godobj

Read-onlyIdempotent

Detect God Object anti-pattern candidates by scoring Go structs on method, field, and outgoing call counts, returning ranked monolithic structs to decompose during architecture reviews.

Instructions

Detect God Object anti-pattern candidates by scoring structs on method count, field count, and outgoing call count. Thresholds: methods (default: 5), fields (default: 8), calls (default: 15); top limits results (default: 10). Exceeding any enabled threshold qualifies a struct, and the combined excess determines rank. WHEN TO USE: During architecture reviews to find monolithic structs that should be decomposed. NOT TO USE: For general struct layout inspection (use gograph_fields); for single-function complexity (use gograph_complexity). RETURNS: Ranked candidates with method, field, and call counts; empty when no threshold is exceeded.

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_godobj"
  }
}

Input Schema

NameRequiredDescriptionDefault
topNoMaximum results to return (default: 10)
rootNoAbsolute path of your checkout or worktree (alias cwd).
callsNoMinimum outgoing call count (default: 15)
fieldsNoMinimum field count (default: 8)
methodsNoMinimum method count (default: 5)
intentionNoRationale; required with an active session.
session_idNoSession from session_create; omit for none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.7.21
    • changedInput schema / properties / intention / description
      Previous value: -"Technical rationale, required for analytical calls selecting an active session."New value: +"Rationale; required with an active session."
    • changedInput schema / properties / root / description
      Previous value: -"Absolute path of the checkout you are working in (your cwd or git worktree). Must be this server's repository or one of its git worktrees; the answer then comes from that checkout's own graph. A path elsewhere is refused. Alias: cwd. Omit only when the configured checkout is the one you mean."New value: +"Absolute path of your checkout or worktree (alias cwd)."
    • changedInput schema / properties / session_id / description
      Previous value: -"Caller selector returned by session_create. Omission means an independent caller; never inherits server environment or another caller's session."New value: +"Session from session_create; omit for none."
  2. Changed3 schema fields changedv1.7.18
    • addedInput schema / properties / intention
      Added value: +{
      +  "description": "Technical rationale, required for analytical calls selecting an active session.",
      +  "type": "string"
      +}
    • addedInput schema / properties / root
      Added value: +{
      +  "description": "Absolute path of the checkout you are working in (your cwd or git worktree). Must be this server's repository or one of its git worktrees; the answer then comes from that checkout's own graph. A path elsewhere is refused. Alias: cwd. Omit only when the configured checkout is the one you mean.",
      +  "type": "string"
      +}
    • addedInput schema / properties / session_id
      Added value: +{
      +  "description": "Caller selector returned by session_create. Omission means an independent caller; never inherits server environment or another caller's session.",
      +  "type": "string"
      +}
  3. Changed4 schema fields changedv1.5.6
    • changedInput schema / properties / calls / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / fields / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / methods / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / top / type
      Previous value: -"number"New value: +"integer"
  4. Addedv1.5.3
  5. Removedv1.5.3
  6. 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, and non-destructive behavior, and the description adds real substance: the qualification rule (exceeding any enabled threshold) and the ranking rule (combined excess). It also states the empty-result case, though it does not explain how thresholds can be disabled despite implying that with 'enabled'.

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 structure is front-loaded and scannable: scoring logic first, then WHEN/NOT TO USE, then RETURNS. It loses a little to redundancy, since the threshold defaults repeated in the text are already in the schema descriptions.

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?

With no output schema, the description carries the return contract itself ('Ranked candidates with method, field, and call counts; empty when no threshold is exceeded'), which is sufficient for a read-only analysis tool with no required parameters.

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 coverage is 100% and the schema already documents defaults for top, methods, fields, and calls, so the description largely restates them. The one added nuance is 'exceeding any enabled threshold', which hints thresholds are optional and their combination drives rank, but root, intention, and session_id get no explanation in the description.

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 gives a specific verb and resource ('Detect God Object anti-pattern candidates by scoring structs') and names the exact metrics used (method, field, call counts). It is immediately distinguishable from siblings such as gograph_fields and gograph_complexity.

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?

It contains explicit WHEN TO USE and NOT TO USE blocks, and routes the agent to concrete alternatives (gograph_fields for layout inspection, gograph_complexity for single-function complexity), so the selection criteria are unambiguous.

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