# get_blast_radius

get_blast_radius lists the services in other repositories that a change to one service, repo or published symbol can reach, ranked by distance and path weight.

`get_blast_radius` walks the workspace system graph outward from one or
more services and returns every downstream service it reaches, across
repository boundaries. Structural dependencies (HTTP, gRPC, events,
packages) rank above behavioral co-change. The analysis behind it is
described in [Cross-repo blast radius](https://docs.repowise.dev/multi-repo/blast-radius).

This tool is workspace-only and off by default. Enable it with
`repowise mcp --tools +get_blast_radius` (a delta on the client's default
tools) or persist it with `repowise config set mcp.tools standard,+get_blast_radius`.
See [Tool profiles](https://docs.repowise.dev/agents/tool-profiles).

## When to call

- **Before changing a provider** with many consumers: an API, an event
  schema, a shared package.
- **Before changing one published symbol**: pass its symbol id to get the
  consuming files on the other side of each contract link.
- **Scoping a cross-service PR**: see which other repos to check or notify.

For impact inside one repository, use [get_risk](https://docs.repowise.dev/mcp/get-risk)
with `changed_files`.

## Parameters

| Name | Type | Default | Description |
|---|---|---|---|
| `targets` | string[] |  | Required. What changed. A system-graph node id ("repo" or "repo::service/path"), a repo alias (expands to every service in that repo), or the symbol id of a published symbol ("path/to/file.ts::Name"), which resolves to the service that publishes it. |
| `max_depth` | integer | `3` | How many hops to follow from the targets. Clamped to 1 through 8. |
| `include_behavioral` | boolean | `true` | Also follow co-change (behavioral) edges. Set false for structural dependencies only. |

## Returns

| Field | Meaning |
|---|---|
| `targets` | The node ids the walk started from |
| `target_repos` | The distinct repos of those targets |
| `impacted` | Up to 25 reached services, ranked: `id`, `repo`, `name`, `kind` (`service`, `frontend`, `worker`, `library`, `external`), `distance` (1 = direct dependent), `score` (0 to 1), `structural`, `edge_kinds` |
| `impacted_truncated` | How many reached services are beyond the 25 listed |
| `impacted_repos` | Repos in the impact set, excluding the targets' repos |
| `structural_count` | Reached services with an all-structural path (a real dependency) |
| `behavioral_count` | Reached services connected by co-change only |
| `max_distance` | Deepest hop reached |
| `total_impacted` | The true count of reached services |
| `unresolved_targets` | Targets that matched no service, repo or published symbol |
| `undetermined_targets` | Targets no edge touches, so their reach cannot be determined |
| `evidence` | The graph's evidence state and the reasons behind it |
| `impact_score_semantics` | What `impacted[].score` measures: a deterministic, uncalibrated 0 to 1 path rank |
| `symbol_targets` | Only when a target is a symbol id: per symbol, `symbol_id`, `nodes`, `contract_ids`, up to 10 `consumers` (`provider_repo`, `repo`, `file`, `contract_id`, `contract_type`, `match_type`, `confidence`, and `symbol_id` when known), `consumer_count`, `consumers_truncated`, and `tests` per cross-repo consumer with a `tests_summary` |
| `summary` | One sentence with the counts |

`impacted[].score` ranks paths. It is not a runtime-breakage probability,
and `impact_score_semantics` says so in the response.

## Example

```python
get_blast_radius(targets=["billing"])

get_blast_radius(
    targets=["billing::services/invoices"],
    max_depth=2,
    include_behavioral=False,
)

get_blast_radius(targets=["src/api/invoices.ts::createInvoice"])
```

```json
{
  "targets": ["billing::services/invoices"],
  "target_repos": ["billing"],
  "impacted": [
    {
      "id": "web::app",
      "repo": "web",
      "name": "app",
      "kind": "frontend",
      "distance": 1,
      "score": 0.9,
      "structural": true,
      "edge_kinds": ["http"]
    }
  ],
  "impacted_truncated": 0,
  "impacted_repos": ["web"],
  "structural_count": 1,
  "behavioral_count": 0,
  "max_distance": 1,
  "total_impacted": 1,
  "unresolved_targets": [],
  "undetermined_targets": [],
  "summary": "Changing 1 service(s) impacts 1 downstream service(s) across 1 other repo(s): 1 via a real dependency, 0 via co-change only."
}
```

## Things worth knowing

- **Workspace mode only.** Outside a workspace the call returns an
  `invalid_args` error: `get_blast_radius 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.
- **A target nothing touches is undetermined, not safe.** It lands in
  `undetermined_targets` and the summary says the impact could not be
  determined, with the reason from `evidence`.
- **Symbol targets** resolve to provider contracts only. A symbol id
  published in more than one repo carries `ambiguous_in_repos`.
- **`_meta`** carries the analysis time and the commit each repo was
  analyzed at, so an agent can tell how fresh the graph is.

## Next
- [Cross-repo blast radius](https://docs.repowise.dev/multi-repo/blast-radius) explains how the graph and the ranking are built.
- [get_risk](https://docs.repowise.dev/mcp/get-risk) covers impact inside one repository.
- [Workspace MCP mode](https://docs.repowise.dev/multi-repo/workspace-mcp) covers the `repo` parameter and the other workspace tools.
