Skip to main content
Glama

cgis_suggest_packages

Suggest sub-package boundaries from dependency communities. Get modularity scores and split/consolidate verdicts to guide package restructuring.

Instructions

Suggest sub-package boundaries for a package from its dependency communities.

Returns JSON: modularity_q, divergence, direction (under/over/matched),
verdict (split/consolidate/aligned/leave/borderline/no_signal), the detected
communities (id + member files), the cross-community bridge edges (cost of
splitting), and the thresholds used. Default layer is IMPORTS; set
``with_calls`` for the combined import+call graph. Run ``cgis_ingest`` first.

A mis-rooted graph (import targets resolve to no internal file) returns
``no_signal`` with a diagnostic note rather than a silent clean verdict.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
min_qNoModularity threshold: at or above it, a package whose layout disagrees with its communities is flagged split (or consolidate, if over-split).
prefixNoFQN prefix of the package to analyse, e.g. cgis.query, matched on whole dot-segments. Needed in practice: without it the verdict is no_signal.
db_pathNoSQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.graph.db
with_callsNoUse the combined import + call graph instead of imports only.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.21.1
    • addedInput schema / properties / db_path / description
      Added value: +"SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path."
    • addedInput schema / properties / min_q / description
      Added value: +"Modularity threshold: at or above it, a package whose layout disagrees with its communities is flagged split (or consolidate, if over-split)."
    • addedInput schema / properties / prefix / description
      Added value: +"FQN prefix of the package to analyse, e.g. cgis.query, matched on whole dot-segments. Needed in practice: without it the verdict is no_signal."
    • addedInput schema / properties / with_calls / description
      Added value: +"Use the combined import + call graph instead of imports only."
  2. First observedv0.21.0

TDQS

A4.4/5.0
Behavior4/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, and it delivers: it discloses the exact return payload (modularity_q, divergence, direction, verdict, communities, bridge edges, thresholds), the default graph layer, and the mis-rooted-graph fallback (returns no_signal with a diagnostic note rather than a silent clean verdict). This is strong 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 the core purpose, then a compact return-value summary, then the default-layer and prerequisite notes, ending with a one-line caveat. Every sentence earns its place with zero waste.

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?

An output schema exists, and the description still explains the returned JSON fields and verdict values, names the prerequisite tool, and covers the failure mode (mis-rooted graph). An agent has everything needed to call it correctly; the only minor gap is not describing the shape of the communities/bridge-edge entries, but the output schema presumably covers that.

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 the baseline is 3, but the description adds practical value: it flags that prefix is 'Needed in practice: without it the verdict is no_signal' and warns that relative db_path resolves against the MCP server's working directory. These notes go beyond the schema text.

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 states a specific verb and resource ('Suggest sub-package boundaries for a package from its dependency communities') that clearly distinguishes this from siblings like cgis_ingest (graph construction), cgis_drift, and cgis_metrics. An agent can tell at a glance this is the community-detection/refactoring advisor.

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?

Explicitly names the prerequisite ('Run cgis_ingest first') and explains the default layer (IMPORTS) with how to switch it (with_calls). It doesn't enumerate exclusions or alternative tools, but the when-to-use context is clear and actionable.

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