Reference

get_architecture

get_architecture returns workspace architecture metrics (propagation cost, the cyclic core, per-role counts) and a deterministic 1-10 architecture score.

get_architecture reports how coupled a multi-repository system is and which services form its core. It reads the architecture metrics built over the workspace system graph, using structural edges only (co-change is excluded). The metrics are described in Architecture metrics.

This tool is workspace-only and off by default. Enable it with repowise mcp --tools +get_architecture or persist it with repowise config set mcp.tools standard,+get_architecture. See Tool profiles.

When to call

  • Before a cross-service refactor, to see how far a change can propagate and which services sit in the cyclic core.
  • To compare against an earlier snapshot after services were split or merged.

Parameters

None. get_architecture() takes no arguments.

Returns

FieldMeaning
scoreDeterministic 1 to 10 architecture score, higher means lower coupling and a smaller core. null when the graph's evidence cannot support a verdict
architecture_typecore-periphery, hierarchical or undetermined
propagation_cost_pctThe share of other services the average service reaches transitively, as a percentage
node_countServices in the system graph
core_sizeServices in the largest cyclic group
core_ratiocore_size over node_count, 0 to 1
core_membersUp to 25 core service ids
core_members_truncatedHow many core members are beyond the 25 listed
cycle_countDependency cycles found
cycle_count_cappedtrue when the enumeration budget stopped the count, so cycle_count is a floor
conformance_violationsDeclared-rule violations, as counted by get_conformance
role_breakdownServices per role: core, shared, control, peripheral
evidenceThe graph's evidence state (measured, partial or insufficient), a summary and the reasons
http_callsOnly when present: HTTP calls read in code but linked to no other service
summaryOne sentence with the score, type, propagation cost, core and cycle count

The score starts at 10 and subtracts: 5 times the propagation cost fraction, 3 times the core ratio, 0.5 per cycle (capped at 2) and 0.5 per conformance violation (capped at 2), clamped to 1 through 10. A system whose largest cyclic group holds at least 6% of its services is core-periphery; below that it is hierarchical.

Example

python
get_architecture()
json
{
  "score": 7.4,
  "architecture_type": "hierarchical",
  "propagation_cost_pct": 22.5,
  "node_count": 12,
  "core_size": 0,
  "core_ratio": 0.0,
  "core_members": [],
  "core_members_truncated": 0,
  "cycle_count": 0,
  "cycle_count_capped": false,
  "conformance_violations": 1,
  "role_breakdown": {"core": 0, "shared": 3, "control": 4, "peripheral": 5},
  "evidence": {"state": "measured", "determined": true, "summary": ""},
  "summary": "Architecture score 7.4/10 (hierarchical): propagation cost 22.5%, no cyclic core (acyclic structure), 0 dependency cycle(s)."
}

Things worth knowing

  • Workspace mode only. Outside a workspace the call returns an invalid_args error: get_architecture is only available in workspace mode.
  • Needs the system graph. Before repowise update --workspace has run, the call returns a no_index error that names that command.
  • No score over an unseen graph. When no dependency between services was detected, score is null and the summary says the architecture was not determined, with the reason. Zero edges means not seen, not decoupled.
  • Partial evidence keeps the score and appends the reason to the summary.
  • _meta carries the analysis time and the commit each repo was analyzed at.

Next

Hosted

Indexed on every push, with nothing to install.

Start free
Was this page helpful?
Report a problem with this pageUpdated