Skip to main content
Glama

gograph_arity

Read-onlyIdempotent

Find Go functions and methods whose parameter count meets a minimum threshold to detect long-parameter-list code smells. Returns signatures, parameter counts, and file locations for audit.

Instructions

Find functions and methods with at least a threshold number of parameters — the long-parameter-list smell. The MCP server checks freshness before this call. Read-only; no side effects. min sets the inclusive minimum (default: 5; 0 includes zero-arity functions), matching CLI --min. WHEN TO USE: During code smell audits. NOT TO USE: For struct field counts (use gograph_fields or gograph_godobj). RETURNS: Functions meeting the threshold with parameter count, signature, and file location.

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

Input Schema

NameRequiredDescriptionDefault
minNoInclusive minimum argument count to report (default: 5; 0 includes zero-arity functions)
rootNoAbsolute 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.
intentionNoTechnical rationale, required for analytical calls selecting an active session.
session_idNoCaller selector returned by session_create. Omission means an independent caller; never inherits server environment or another caller's session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +}
  2. Changed2 schema fields changedv1.5.6
    • changedInput schema / properties / min / description
      Previous value: -"Minimum argument count to report (default: 5)"New value: +"Inclusive minimum argument count to report (default: 5; 0 includes zero-arity functions)"
    • changedInput schema / properties / min / type
      Previous value: -"number"New value: +"integer"
  3. Addedv1.5.4
  4. Removedv1.5.3
  5. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so 'Read-only; no side effects' largely restates structured data. What does add value is the note that the server checks freshness before the call and the description of the return payload (parameter count, signature, file location), which the agent would otherwise have to infer in the absence of an output schema.

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 purpose, then cleanly labeled WHEN TO USE / NOT TO USE / RETURNS blocks, which scan well. Minor waste: the 'Read-only; no side effects' clause duplicates the annotations, and the freshness sentence is vague about what actually happens.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a four-parameter, no-required-arg analysis tool with no output schema, the definition covers purpose, exclusions, threshold behavior, and return shape, so an agent can call it correctly. The only soft spot is the unexplained freshness-check remark, which does not affect invocation.

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 baseline is 3. The description restates the `min` threshold semantics already spelled out in the schema property and adds only the CLI --min correspondence; the root, intention, and session_id parameters are left entirely to the schema.

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 functions and methods with at least a threshold number of parameters') and ties it to a named smell, which tells an agent exactly what class of result to expect. It also distinguishes itself from the nearest similarly-shaped siblings by naming gograph_fields and gograph_godobj as the wrong tool for struct field counts.

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 ('During code smell audits') and NOT TO USE clauses with named alternatives make the routing decision unambiguous. This is the highest-value part of the definition given how many gograph_* analysis siblings exist.

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