Skip to main content
Glama
parh0m2007

localscope-mcp

by parh0m2007

Analyze change impact

localscope_impact
Read-onlyIdempotent

Identify which files and exported symbols break if you change or delete a target in your local repo. Uses the import graph to return direct and transitive dependents, entirely offline.

Instructions

Answer "where does X break if I change Y?" from the local import graph and symbol table — entirely offline.

Args:

  • target (string): file path relative to repo root (e.g. 'src/utils/parse.ts') OR a symbol name (e.g. 'parseConfig')

  • path (string): repo root previously indexed, default "."

  • max_depth (number): reverse-dependency walk depth 1-10, default 5

  • response_format ('markdown' | 'json'): default 'markdown'

Returns: Direct dependents (files importing the target), transitive dependents, and exported symbols at risk.

Use when: "what breaks if I refactor/delete this?", "who uses this function?". Requires localscope_index first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoRepository path (must match a previously indexed root).
targetYesFile path (e.g. 'src/utils/parse.ts') OR symbol name (e.g. 'parseConfig', 'UserService')
max_depthNoHow deep to walk the reverse dependency graph
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.9/5.0
Behavior4/5

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

The annotations already cover the read-only, idempotent, non-destructive safety profile, and the description adds valuable operational context: the analysis is entirely offline, requires a previously indexed repo, and walks the reverse-dependency graph. The 'what if I change Y' phrasing clearly refers to a hypothetical, not an actual mutation, so there is no contradiction.

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?

The main question is front-loaded, and the Args, Returns, and Use-when sections are clearly separated and easy to scan. It is somewhat repetitive with the input schema's parameter docs, but the structure and short sentences make the tool's invocation model easier to understand at a glance.

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?

Because there is no output schema, the description responsibly describes the return kinds: direct dependents, transitive dependents, and at-risk exported symbols. It also covers the indexing prerequisite and offline behavior; only exact result formatting and behavior for unindexed paths are left unstated, and those are reasonably expected from the schema and annotations.

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

Parameters3/5

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

Schema coverage is 100%, and the schema already documents all four parameters with types, defaults, and constraints. The description adds some useful framing, such as 'target' being relative to the repo root and 'path' being a previously indexed root, but it mostly restates what the schema already provides, so it meets rather than significantly exceeds the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly frames the tool as a change-impact analysis utility ('where does X break if I change Y?') over the local import graph and symbol table, which is specific and distinguishes it from the indexed/search/status siblings in name and behavior. It is clear, though it does not explicitly name or contrast sibling alternatives in prose.

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?

It provides concrete 'Use when' triggers such as 'what breaks if I refactor/delete this?' and 'who uses this?', plus the necessary prerequisite 'Requires localscope_index first'. What is missing is an explicit 'don't use this if...' or a direct pointer to a sibling tool for alternative query types.

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