Skip to main content
Glama

structural_query

Run structural audits to identify undocumented exports, long functions, and unused context parameters, supporting code review and refactor preparation.

Instructions

Run a curated structural check over the topology index — find symbols by SHAPE, not name. Complements topology_search (find by name) and search_in_files (find by text) with audits useful for review and refactor prep. Named queries (no raw tree-sitter queries are exposed): "undocumented-exports" (exported functions/methods/types/constants with no doc comment), "long-functions" (functions over min_lines, default 80), "unused-context" (Go functions taking context.Context whose body never references it). Results are approximate (source=topology) and confidence-labelled where the check is heuristic. Returns a clear message when the index is disabled or empty.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of findings to return. Default 50.
queryNoWhich structural check to run: "undocumented-exports", "long-functions", or "unused-context".
languageNoOptional filter by language (e.g. 'go', 'python'). unused-context is Go-only regardless.
min_linesNoFor long-functions: minimum line span to flag. Default 80.
Behavior5/5

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

No annotations are provided, so the description carries the full burden. It discloses that results are approximate (source=topology), confidence-labelled for heuristics, that no raw tree-sitter queries are exposed, and that a clear message appears when the index is disabled or empty. This is comprehensive behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a clear purpose, uses a single well-structured paragraph, and every sentence adds value—from sibling differentiation to query examples to behavioral caveats. No redundancy or filler.

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 4-parameter tool with no annotations or output schema, the description covers purpose, usage, alternatives, behaviors, parameter details, and an edge case (disabled/empty index). Missing are the general return format and permission requirements, but these are less critical for a read-style query tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds significant meaning beyond schema fields: it explains the named query options with concrete definitions (undocumented-exports, long-functions, unused-context), notes that unused-context is Go-only, and clarifies the default for min_lines. This extra context elevates the score.

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 begins with a specific verb+resource combination ('Run a curated structural check over the topology index') and explicitly contrasts with sibling tools ('Complements topology_search (find by name) and search_in_files (find by text)'). It clearly distinguishes the tool's shape-based search purpose from name- or text-based alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description names the primary alternatives and explains the tool complements them by providing structural audits useful for review and refactor prep. While it doesn't exhaustively list every possible 'when not to use' scenario, the contrast with topology_search and search_in_files gives clear contextual guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/plumbkit/plumb'

If you have feedback or need assistance with the MCP directory API, please join our Discord server