Skip to main content
Glama

Partition Workspace into Architectural Clusters or Task Subgraph

get_workspace_clusters
Read-onlyIdempotent

Partition large multi-repo or monorepo workspaces into architectural clusters, expand a cluster via clusterName, or extract a ranked subgraph around seed services, routes, or tables.

Instructions

Partition large multi-repo or monorepo workspaces into deterministic architectural clusters (service clusters, structural fan-out pools such as integration connectors, and separated shared libraries), expand a single cluster or sub-cluster on demand (via clusterName), or extract a Personalized PageRank subgraph around 1-3 seed services, routes, or tables (via seeds). Use on large repositories (20+ projects or multi-repo workspaces) to inspect macro cluster boundaries without pulling hundreds of flat projects, pass clusterName to drill down into a cluster's internal units and boundary edges, or pass seeds to rank a tight task-focused repository slice; for a flat workspace inventory or Mermaid diagrams use get_architecture_map. Evaluates coarsened project dependencies, service calls, shared database tables, and messaging topics in .codeexplorer/graph.db with zero LLM dependency (applying manual overrides from .codeexplorer/clusters.json when present) and returns compact YAML.

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": "get_workspace_clusters"
  }
}

Input Schema

NameRequiredDescriptionDefault
seedsNoOptional list of 1-5 seed names (repository, project, service, '/endpoint/route', or database table) to extract a ranked Personalized PageRank subgraph slice instead of full workspace clustering.
maxUnitsNoMaximum number of ranked root units/repositories to return when seeds is specified for Personalized PageRank slicing (1 to 100, default: 10).
resolutionNoLeiden resolution parameter gamma controlling cluster granularity (0.1 to 5.0; higher yields smaller, tighter clusters; default: 1.0).
clusterNameNoOptional cluster or sub-cluster ID/name to expand in detail (e.g. 'billing-core', 'integration-service', or 'shared-libraries'). Omit to list all workspace clusters and boundary edges.
hubThresholdNoInbound dependent-unit ratio threshold (0.0 to 1.0) used to separate Shared Libraries / Platform Hubs before Leiden clustering (default: 0.15).
workspacePathNoOptional absolute path to the target workspace root directory. Omit to use the bound workspace, active client root, or sticky session workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.109.4
    • changedInput schema / properties / clusterName / description
      Previous value: -"Optional cluster or sub-cluster ID/name to expand in detail (e.g. 'plat-liam', 'integration-service', or 'shared-libraries'). Omit to list all workspace clusters and boundary edges."New value: +"Optional cluster or sub-cluster ID/name to expand in detail (e.g. 'billing-core', 'integration-service', or 'shared-libraries'). Omit to list all workspace clusters and boundary edges."
  2. Addedv1.109.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnly/idempotent/non-destructive/closed-world; the description adds substantial context beyond that: the data actually evaluated (coarsened project dependencies, service calls, shared DB tables, messaging topics), the backing store (.codeexplorer/graph.db), determinism, zero LLM dependency, manual override merging from .codeexplorer/clusters.json, and a compact YAML return format. It also explains the pre-clustering hub separation behavior via hubThreshold's role, which no annotation covers.

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?

Content is front-loaded with purpose and modes before the sibling redirect, and nearly every clause carries information. However, the description is delivered as one very long multi-clause sentence chain, which makes it dense to parse and slightly overstuffed relative to the tool's core modes.

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 no-output-schema tool, it covers the essential operational facts: three invocation modes, size preconditions, data sources, override behavior, and that the return is compact YAML. It stops short of describing the returned cluster/edge structure, which an agent would need to interpret output for a fairly complex analytical 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 the baseline is 3; the description earns above that by explaining the mutually exclusive parameter modes — clusterName expands a cluster's internal units and boundary edges, seeds switches the tool into a Personalized PageRank slice, and omitting both lists all clusters. It does not elaborate on resolution, hubThreshold, maxUnits, or workspacePath defaults semantics, leaving those purely 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 — partitioning a workspace into architectural clusters — and enumerates its three modes (full clustering, clusterName drill-down, seeds-based PageRank subgraph) with concrete scope like '20+ projects or multi-repo workspaces'. It explicitly contrasts itself with get_architecture_map for flat inventories and Mermaid diagrams, so an agent can distinguish it from a sibling without opening either 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?

Gives explicit when-to-use conditions ('Use on large repositories (20+ projects or multi-repo workspaces)'), mode-selection rules ('pass clusterName to drill down', 'pass seeds to rank a tight task-focused repository slice'), and names the alternative for the excluded case ('for a flat workspace inventory or Mermaid diagrams use get_architecture_map'). Both the positive and negative routing are covered.

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