weavatrix-refactor-js

v0.1.6
io.github.sergii-ziborov/weavatrix-refactor-js Checked 9 hours ago Published 3 months ago

Transactional refactoring MCP with 11 evidence-backed tools, hash-bound previews, and rollback.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

graph_stats

Return summary statistics: node count, edge count, communities, versioned edge-provenance/legacy-confidence breakdowns, and graph build time vs repo HEAD (staleness).

ParameterTypeDescription
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

get_node

Get full details for a specific node by label or ID.

ParameterTypeDescription
label *stringNode label or ID to look up
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

get_neighbors

Get all direct neighbors of a node with edge details (1 hop, call sites deduped). For transitive impact use get_dependents; for the impact of your current branch changes use change_impact.

ParameterTypeDescription
label *string
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
relation_filterstringOptional: filter by relation type

query_graph

Explore a focused production-first graph around a concept or exact symbols (BFS/DFS). Exact seed files/symbols stay pinned; relation_filter and flow_direction support bounded event/data-flow views without a separate tool. Classified paths and unreferenced constant/field leaves stay suppressed unless explicitly requested.

ParameterTypeDescription
augment_seedsbooleanWith exact seeds, also add fuzzy question-derived seeds; false keeps traversal strictly pinned
context_filterarray
depthinteger
flow_directionstringTraverse outgoing, incoming, or both directions
include_classifiedbooleanAllow traversal through tests/e2e/generated/mocks/stories/docs/benchmarks/temp and explicitly excluded paths. An explicit class term in the question enables only that class.
include_low_signalbooleanInclude unreferenced constant/field leaf symbols that do not match a query term
modestring
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
questionstringOptional natural-language question or keyword search when exact seeds are not sufficient
relation_filterOptional relation allow-list, e.g. calls,references,imports
seed_filesarrayExact repo-relative file paths. Resolved exact seeds remain pinned unless augment_seeds is true
seed_symbolsarrayExact node IDs or unambiguous symbol labels; enables focused flows without fuzzy query seeds
token_budgetintegerHigher budget shows more nodes/edges

god_nodes

Rank production-code connectivity hubs by unique call/import/reference neighbors, with class/method ownership reported separately from runtime connectivity. Repeated call sites do not inflate the rank; classified tests, generated/build output and other non-product paths are excluded by default.

ParameterTypeDescription
include_classifiedbooleanInclude tests/e2e/generated/build output/mocks/stories/docs/benchmarks/temp and paths explicitly excluded by repository classification
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
top_ninteger

shortest_path

Find the shortest path between two concepts in the knowledge graph.

ParameterTypeDescription
source *string
target *string
max_hopsinteger
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

get_dependents

Transitive blast-radius of ONE node. JavaScript/TypeScript symbols use a cached on-demand EXACT_LSP point query by default, then traverse exact direct callers through the wider graph; incomplete precision is labelled and never silently presented as exact. Set precision=graph to skip LSP or include_container_importers for a conservative module-wide radius.

ParameterTypeDescription
label *stringNode label or ID
depthintegerMax reverse hops, default 3
include_container_importersbooleanAlso seed importers of the symbol containing file (broader, conservative; default false)
max_nodesintegerMax dependents to list, default 40
max_referencesinteger
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
precisionstringauto uses exact JS/TS point queries when precision is enabled; graph skips LSP; lsp forces an attempt
timeout_msinteger

change_impact

Verdict-first, symbol-aware blast radius. Parses a zero-context git diff and uses one bounded EXACT_LSP batch query for direct references to changed JavaScript/TypeScript symbols; transitive hops stay explicitly graph-backed. Additive exports do not inherit legacy file importers. Measured coverage is used when present; otherwise static reachability is labelled, not treated as coverage.

ParameterTypeDescription
basestringBase ref, e.g. origin/main or HEAD~1 (default: first existing of origin/HEAD, origin/main, origin/master, main, master)
depthintegerMax reverse hops, default 2
diffstringOptional unified diff (prefer --unified=0) for a PR/change that is not checked out; enables symbol-level classification
filesarrayOptional repo-relative changed-file hints. Without diff evidence these are classified conservatively rather than guessed additive
max_nodesintegerMax impacted nodes to list, default 40
max_referencesinteger
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
precisionstring
timeout_msinteger

git_history

Behavioral architecture evidence from bounded local git history: churn × connectivity hotspots, hidden co-change coupling, and expected test/source coupling. Reads numstat only — never commit messages, authors, or source bodies.

ParameterTypeDescription
max_commitsinteger
max_pairsinteger
min_pair_countinteger
monthsinteger
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
top_ninteger

verified_change

Pre-commit, proof-carrying change safeguard. Given a natural-language task and current diff/files, returns compact edit contexts, bounded call-argument data-flow, blast radius, graph/architecture/duplicate/API ratchets, affected tests, and one PASS/BLOCKED/UNKNOWN verdict. Use this high-level workflow before manually composing lower-level checks. Package tests run only when explicitly requested and WEAVATRIX_ALLOW_TEST_RUNS=1.

ParameterTypeDescription
task *string
api_contractobject
base_refstring
data_flow_depthinteger
diffstring
duplicate_ratchetboolean
filesarray
impact_depthinteger
max_data_flow_edgesinteger
max_impact_nodesinteger
max_symbolsinteger
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
phasestring
precisionstring
run_testsboolean
test_timeout_msinteger
testsarray

trace_api_contract

Cross-repository HTTP, GraphQL, gRPC and event/topic contract, handler-liveness and blast-radius evidence. Joins static models with optional revision-bound runtime/OTLP evidence; unobserved dynamic URLs/topics/reflection remain explicit UNKNOWN. Medium/high-confidence external matches mark a handler/contract NOT_DEAD_EXTERNAL_USE. Repository paths stay local and runtime report paths are repository-contained.

ParameterTypeDescription
backend *stringBackend repository UUID or exact unambiguous registry label
clients *arrayClient repository UUIDs or exact unambiguous registry labels
auto_discover_wrappersbooleanDiscover only simple unambiguous functions that forward a URL parameter directly to a known object-style HTTP client
changed_filesarrayOptional backend repo-relative changed files; only endpoints declared in those files are traced
client_namesarrayExtra object-style clients whose .get/.post/... methods perform HTTP requests; persistent per-repo configuration belongs in .weavatrix.json httpContracts.clientNames
client_wrappersarrayFixed-method wrapper calls. Use call+method for get(url), or object+member+method for transport.send(url). url_argument is zero-based.
cursorstringOpaque nextCursor from the previous page; bound to repository revisions and filters.
include_testsboolean
max_affected_filesinteger
max_endpointsinteger
max_impact_depthinteger
max_matchesinteger
methodstring
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
page_sizeintegerMaximum HTTP/transport/uncertain evidence items returned on this page.
pathstringOptional full route or segment-aligned route fragment; /query matches /edgeAnalytics/query/... and {id}, :id and concrete parameter values are normalized
per_item_limitintegerCompact-mode sample limit for callsites, affected files, screens and modules per item.
response_detailstringCompact returns bounded samples and counts. Full is explicit opt-in and still paginated.
runtime_configobjectOptional non-secret static bindings for runtime URL prefixes, e.g. process.env.API_BASE. Values are used locally for this call and are not returned.
runtime_evidence_filesobjectOptional repository-label/UUID to repository-relative weavatrix.transport-runtime.v1 JSON path. Defaults to .weavatrix/transport-runtime.json or .weavatrix/reports/transport-runtime.json in each repos…
runtime_evidence_max_age_hoursintegerMaximum accepted age for a revision-matched runtime evidence report
top_ninteger
transportstringContract family to trace; all runs static and revision-bound runtime evidence for every supported transport

get_community

Get all nodes in a community by community ID (0-indexed by size).

ParameterTypeDescription
community_id *integerCommunity ID (0-indexed by size)
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

search_code

Full-text or regex search across the repo source (ripgrep-backed, Node fallback). The graph only stores structure — use this to find literal text/patterns, then get_node/get_neighbors for structure.

ParameterTypeDescription
query *stringtext or regex to search for
globstringoptional path glob, e.g. "*.js" or "src/**"
is_regexboolean
max_resultsinteger
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

read_source

Read the actual source of a node (by label/ID) or a repo-relative file path — the symbol's lines with context. The graph stores only locations, not source text. For a path read, pass start_line to anchor the window anywhere in the file (otherwise it shows the head).

ParameterTypeDescription
afterinteger
beforeinteger
labelstringnode label or ID
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
pathstringor a repo-relative file path
start_lineintegeranchor line: window = start_line-before .. start_line+after

inspect_symbol

Inspect one exact symbol with an on-demand TypeScript/JavaScript LSP reference query, grouped occurrence containers, graph blast radius, complexity facts and bounded local source context. Ambiguous labels fail closed; point queries never replace the broad precision overlay.

ParameterTypeDescription
label *stringExact node ID or unambiguous symbol label
context_linesinteger
max_containersinteger
max_referencesinteger
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
precisionstring
timeout_msinteger

context_bundle

Return one compact, bounded source bundle for an exact symbol: definition, production-first inbound/outbound containers, exact re-export sites, on-demand TS/JS reference evidence and diverse excerpts around call sites. Use before an edit when query_graph would be too broad.

ParameterTypeDescription
label *stringExact node ID or unambiguous symbol label
context_linesinteger
include_classifiedbooleanInclude test/e2e/generated/vendored/mock/story/docs/benchmark/temp callers after production callers
max_reexportsinteger
max_referencesinteger
max_relatedinteger
max_source_filesinteger
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
precisionstring
timeout_msinteger

find_duplicates

Content-based clone detection over production code (MOSS winnowing over method bodies). Supports high-confidence small clones down to 12 tokens when min_tokens is lowered. Tests, classified non-product paths, all-router framework boilerplate and immutable declarative catalogs are excluded by default; opt them in explicitly.

ParameterTypeDescription
include_boilerplatebooleanInclude clone groups made entirely of conventional *.router.js/ts router symbols
include_classifiedbooleanInclude generated/vendored/mock/story/docs/benchmark/temp and paths explicitly classified as excluded; tests still require include_tests
include_declarativebooleanInclude repeated immutable array/object catalogs that contain no executable control flow
include_stringsbooleanAlso clone-check large multi-line string literals
include_testsboolean
min_similarityinteger50-100, default 80 (ignored in semantic mode)
min_tokensintegermin fragment size, 12-400; default 50
modestring
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
top_ninteger

find_dead_code

Conservative review queue for statically unreferenced files, functions, methods and symbols. Returns confidence, reason, bounded evidence and explicit framework/dynamic/reflection/public-API caveats; never an auto-delete verdict. Tests, generated/vendored code, mocks, stories, docs, benchmarks and temporary roots are excluded by default.

ParameterTypeDescription
include_classifiedbooleanInclude generated/vendored/mock/story/docs/benchmark/temp and paths explicitly classified as excluded; tests still require include_tests
include_testsboolean
kindsarrayOptional candidate kinds; defaults to all
min_confidencestringMinimum confidence to include. low explicitly includes public/framework/dynamic review candidates
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
pathstringOptional repo-relative path prefix
top_ninteger

run_audit

Offline production-first repository Health review for structure, dependency declarations and lockfile integrity, bounded runtime-correctness/concurrency patterns, dead code and coverage. Vulnerability advisory matching and installed-dependency malware heuristics are separate explicit weavatrix-online tools. Unsupported Maven/Gradle import verification is NOT_SUPPORTED/PARTIAL, never a clean zero. Findings whose evidence is entirely test/e2e/generated/vendored/mock/story/docs/benchmark/temp or explicitly excluded are suppressed by default; opt them in with include_classified. category=dependenc…

ParameterTypeDescription
base_refstringOptional immutable Git baseline (for example HEAD~1 or origin/main). Enables honest new/existing/fixed debt comparison
categorystringOnly findings of this category; dependencies selects dependency manifest/import and dependency-integrity findings
changed_filesarrayOptional explicit repo-relative scope. Without base_ref this is changed-scope only; when omitted with base_ref, files are derived from the Git diff
debtstringBaseline comparison view. Defaults to genuinely new deterministic findings when base_ref is present
include_classifiedbooleanInclude findings whose evidence is entirely tests/e2e/generated/vendored/mocks/stories/docs/benchmarks/temp or explicitly excluded
max_findingsintegerMax findings to list, default 30
min_severitystringMinimum severity to include
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

coverage_map

Map a real existing coverage report onto the graph. If no report exists, return clearly labelled static test reachability (a test imports/reaches a source file) with actualCoverage=NOT_AVAILABLE; reachability is never presented as measured coverage.

ParameterTypeDescription
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
pathstringOptional repo-relative path prefix filter, e.g. src/query
top_nintegerMax risk hotspots to list, default 15

hot_path_review

Rank a focused production-symbol hot-path queue from parser-derived local complexity, inside-loop allocations/copies/scans/sorts/recursion, graph fan-in/fan-out, and measured coverage or clearly labelled static test reachability. The default score gate is 85 with a narrow strong-local fallback; set min_score=0 for the full diagnostic queue. This is not profiler data or interprocedural Big-O.

ParameterTypeDescription
call_thresholdinteger
cyclomatic_thresholdinteger
include_classifiedbooleanInclude generated/vendored/mock/story/docs/benchmark/temp and explicitly excluded paths; tests still require include_tests
include_testsboolean
loop_depth_thresholdinteger
min_scoreintegerFocused default is 85; lower explicitly to broaden, or use 0 for every threshold-matching diagnostic candidate
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
pathstringOptional repository-relative path prefix
time_rank_thresholdinteger
top_ninteger

list_communities

List graph communities named by their dominant folder (largest first) with sample files — a readable module overview; feed the list position into get_community.

ParameterTypeDescription
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
top_nintegerMax communities to list, default 20

module_map

First orientation view for understanding an unfamiliar application with little context: a production-first folder architecture map with file/symbol counts and strongest module dependencies, separating runtime, TypeScript type-only and language compile-only coupling.

ParameterTypeDescription
include_non_productbooleanInclude tests, fixtures, benchmarks, generated output, docs and other classified non-product files; false by default
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
top_nintegerMax modules to list, default 25

list_endpoints

Inventory of HTTP endpoints defined in the repo (Express/Fastify/Nest/Flask/FastAPI/Go mux/Rust axum and actix-web/Spring MVC and WebFlux): declared and reachable composed paths, static mount provenance, confidence, handler, file:line, and Spring conditional/default-active state.

ParameterTypeDescription
include_classifiedbooleanInclude test/e2e/generated/mock/story/docs/benchmark/temp and explicitly excluded targets
max_resultsintegerMax endpoints to list, default 100
methodstring
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
pathstringOptional exact composed path or segment-aligned suffix

trace_endpoint

Resolve one exact reachable HTTP endpoint, prove its router mount chain, bind its handler symbol, and return a bounded production-only multi-hop call graph with call-site excerpts. This is a focused projection of the repository graph, not text-search inference.

ParameterTypeDescription
path *stringExact composed path; a suffix is accepted only when unambiguous
context_linesinteger
handler_filestringRepo-relative file path (or unambiguous path suffix) declaring the handler; use after an AMBIGUOUS_HANDLER result.
include_classifiedbooleanInclude test/e2e/generated/mock/story/docs/benchmark/temp and explicitly excluded targets
max_depthinteger
max_excerptsinteger
max_nodesinteger
methodstring
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

rebuild_graph

Rebuild the active full-repository graph and report a structural delta. Omitted mode/precision preserve the active graph; a first build uses full and the startup precision setting (lsp unless WEAVATRIX_PRECISION=off). The local TypeScript/JavaScript LSP overlay validates bounded ambiguous edges; precision:off is an explicit fallback. With scope, build an isolated diagnostic graph without replacing or diffing the full graph.

ParameterTypeDescription
modestringBuild mode; omit to preserve the active mode (or use full for a first build)
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
precisionstringSemantic precision; omit to preserve the active mode (or use the startup setting for a first build)
scopestringOptional isolated diagnostic path prefix; never replaces the active full graph

graph_diff

Structural graph diff: compare the current graph with an immutable Git-ref baseline (base_ref such as HEAD~1 or main), or with graph.prev.json from the last rebuild when base_ref is omitted. Reports architecture drift, cycle changes and symbols that lost their last caller.

ParameterTypeDescription
base_refstringOptional immutable Git baseline to build in isolation, e.g. HEAD~1, main or origin/main; never checks out or mutates the working tree
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
pathstringOptional node-id/path prefix to scope the diff, e.g. src/query

get_architecture_contract

Read the owner-approved architecture target or safely bootstrap one. With action=preview, returns an adaptive candidate, observed-but-not-enforced dependency directions, verification, exact file content/hash and a short-lived confirmation token. action=approve creates the local contract only after explicit token confirmation and never overwrites an active target.

ParameterTypeDescription
actionstringOmit to read; preview is dry-run only; approve requires the preview token
baseline_modestringWhether preview should materialize current violations as an explicit ratchet baseline
candidate_contractobjectOptional reviewed candidate to normalize and verify during preview
confirm_tokenstringOne-time token returned by preview; required for approve
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

prepare_change

Select active target-architecture rules for an intended set of changed files. Run before a non-trivial edit.

ParameterTypeDescription
files *array
intentstring
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

verify_architecture

Verify the fresh graph against the active target contract and ratchet; separates new, existing, fixed and excepted debt.

ParameterTypeDescription
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

explain_architecture_violation

Explain one active architecture violation and the governing rule.

ParameterTypeDescription
fingerprint *string
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

propose_architecture_exception

Prepare, but never apply, a bounded exception proposal for human review.

ParameterTypeDescription
fingerprint *string
reason *string
expiresstringOptional YYYY-MM-DD
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

open_repo

OFFLINE RETARGET: switch this server to another local Git repository, building its graph when missing. This explicit tool call changes the active repository boundary; pass build:false to probe without building. Omitted mode/precision preserve an existing graph; a new graph uses full and the startup precision setting (lsp unless WEAVATRIX_PRECISION=off). Omit the retarget capability at registration to pin one repository.

ParameterTypeDescription
path *stringAbsolute path to a Git working tree
buildbooleanBuild the graph when missing (default true)
modestringOptional build mode override; omit to preserve an existing graph
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope
precisionstringOptional semantic precision override; omit to preserve an existing graph or use the startup setting for a new graph

list_known_repos

OFFLINE RETARGET: list every registered local repository graph from the global per-user registry, regardless of parent folder.

ParameterTypeDescription
output_formatstringtext returns only the concise TextContent summary; json also returns and mirrors the stable structuredContent envelope

apply_edit_plan

Apply a weavatrix.edit-plan.v1 envelope (from a weavatrix-refactor-js plan producer or weavatrix-online plan_refactor) to the active repository. mode="preview" (default) verifies hashes and before-texts and issues a single-use confirm_token; mode="apply" consumes the token and writes atomically with an automatic rollback bundle. Requires WEAVATRIX_ALLOW_SOURCE_EDITS=1 to write. Only EXACT_LSP/RESOLVED/EXTRACTED/LEXICAL_EXACT edits are ever applied; uncertain references are reported, never guessed.

ParameterTypeDescription
plan *objectThe weavatrix.edit-plan.v1 envelope, verbatim as produced by the planning tool
confirm_tokenstringRequired for mode="apply"; issued by the preview step, single-use, 5-minute TTL
modestring
output_formatstringtext returns concise TextContent; json also returns the stable structuredContent envelope

rollback_last_apply

Restore the repository files from the most recent apply_edit_plan rollback bundle. All-or-nothing: if any target file changed after the apply, nothing is restored and the drifted files are reported. Requires WEAVATRIX_ALLOW_SOURCE_EDITS=1.

ParameterTypeDescription
output_formatstringtext returns concise TextContent; json also returns the stable structuredContent envelope

rename_symbol

Complete cross-language rename workflow: EXACT LSP backend for JS/TS, SQL schema backend for .sql, graph+lexical backend for Rust/Python/Go/Java/C#/Solidity. Default mode="preview" proves the byte-exact edits and returns a single-use confirm_token; repeat the same call with mode="apply" and that token for an atomic write with rollback. Requires WEAVATRIX_ALLOW_SOURCE_EDITS=1 only for apply.

ParameterTypeDescription
new_name *string
symbol *stringExact symbol id (file#name@line)
confirm_tokenstringRequired for mode="apply"; single-use and bound to the exact generated plan and working tree
modestringpreview verifies the generated plan and returns a confirm_token; apply recomputes the same plan and consumes that token
output_formatstringtext returns concise TextContent; json also returns the stable structuredContent envelope

move_file

Relocate a JS/TS file: rewrites the moved file own imports and every importer specifier, and reports the architecture dry-run (WOULD_VIOLATE/WOULD_IMPROVE). A review plan the agent applies (it renames a file), not an apply envelope.

ParameterTypeDescription
from *string
to *string
output_formatstringtext returns concise TextContent; json also returns the stable structuredContent envelope

move_symbol

Dry-run for moving a declaration to another file: predicts introduced/removed runtime cycles and architecture violations plus the blast radius. PROJECTED from graph edges — no byte-exact edits; apply the mechanical move yourself and run verified_change.

ParameterTypeDescription
symbol *string
to_file *string
output_formatstringtext returns concise TextContent; json also returns the stable structuredContent envelope

delete_readiness

Per-symbol deletion verdict {safe: true|false|UNPROVEN, knownReferences, unknownDynamicUsages, confidence, reason} plus the deletion span. Exported symbols cap at UNPROVEN; always REVIEW_REQUIRED, never auto-delete.

ParameterTypeDescription
symbol *string
output_formatstringtext returns concise TextContent; json also returns the stable structuredContent envelope

change_signature

Add or remove a function/method parameter (JS/TS) with byte-exact call-site argument surgery. Always PARTIAL (call sites from graph edges); spread/value-add reported UNCERTAIN. operation: {kind:"add_parameter",name,default?} | {kind:"remove_parameter",index}.

ParameterTypeDescription
operation *object
symbol *string
output_formatstringtext returns concise TextContent; json also returns the stable structuredContent envelope

edit_symbol

Symbol-anchored edit over the parser source range (all languages): replace_symbol_body | insert_before_symbol | insert_after_symbol. JS/TS results are parse-gated.

ParameterTypeDescription
content *string
operation *string
symbol *string
output_formatstringtext returns concise TextContent; json also returns the stable structuredContent envelope

bulk_replace

Two-stage occurrence-selective pattern replace over the indexed universe. Preview (no selection) returns stable occurrence ids; then pass occurrence_ids or expected_count to plan. literal:true by default.

ParameterTypeDescription
pattern *string
replacement *string
expected_countinteger
flagsstring
literalboolean
occurrence_idsarray
output_formatstringtext returns concise TextContent; json also returns the stable structuredContent envelope
path_prefixstring

organize_imports

Removes provably-unused named imports from a JS/TS file (a binding is removed only when its name occurs once in the file). Default/namespace imports are reported UNCERTAIN, never removed; sorting is left to the formatter.

ParameterTypeDescription
file *string
output_formatstringtext returns concise TextContent; json also returns the stable structuredContent envelope