Roam MCP tools

August 7, 2026 · View on GitHub

The complete tool list for Roam's Model Context Protocol server. This page is generated from the @_tool decorations in src/roam/mcp_server.py by dev/build_readme_counts.py — edit the tool docstrings, not this file.

244 tools · 17 in the default core preset · 8 selectable presets (core, review, refactor, debug, architecture, compliance, compile-curated, full).

pip install "roam-code[mcp]"
roam mcp

Most tools are read-only index queries; side-effect tools are explicitly annotated. Set ROAM_MCP_PRESET=full roam mcp for the complete toolset, or call roam_expand_toolset mid-session to widen from core without a restart.

Default preset: core (17 tools: 16 core + roam_expand_toolset meta-tool).

Core preset tools: roam_alerts, roam_ask, roam_batch_search, roam_coupling, roam_dead_code, roam_deps, roam_diagnose_issue, roam_fetch_handle, roam_file_info, roam_grep, roam_metrics, roam_prepare_change, roam_search_symbol, roam_taint, roam_understand, roam_uses.

See Using Roam via MCP for the first-run flow and the canonical agent sequence, and the README for the preset overview.

MCP tool list (all 244)

ToolDescription
roam_adrsDiscover Architecture Decision Records (ADRs) and link them to code modules. Scans well-known ADR directories (docs/adr/ / architecture/decisions/ / ...) for markdown files matching ADR naming patterns, parses each ADR's title / status / date / file refs, then cross-references mentioned files against the symbol index. Different from roam_doc_staleness (inline docstring drift) -- this is the prose-decision-document discoverer.
roam_adversarialFrame architectural issues in changed files as challenges the developer must defend: CRITICAL (new cyclic dependencies), HIGH (layer violations, high-confidence anti-patterns), WARNING (cross-cluster coupling, high fan-out), INFO (orphaned symbols). Composes cycles + clusters + layers + catalog + dead + complexity. Different from roam_diff (blast-radius facts) -- this is the architecture-review framing for code-review agents.
roam_adversarial_reviewAdversarial architecture review: challenges about cycles, anti-patterns, coupling.
roam_affectedMonorepo impact analysis: find all affected packages/modules from changes.
roam_affected_testsList the tests you actually need to run after editing a symbol or file. Use when user asks 'which tests do I run?', 'what tests cover X?', or after Edit/Write. Walks reverse-dependencies with hop distance — closer hops run first. For a full pre-commit check (blast radius + fitness + tests), use roam_prepare_change.
roam_agent_contextExtract a single agent's partition from the full agent plan: write scope, read-only dependencies, interface contracts, coordination instructions, and key symbols. Different from roam_agent_plan (full multi-agent view) and roam_orchestrate (operational dispatch with merge order) -- this is the focused per-worker packet for one agent.
roam_agent_exportGenerate AI agent context file (CLAUDE.md/AGENTS.md/.cursorrules) from index.
roam_agent_optDetect weak agent-contract shape in roam's tool descriptions and envelopes and recommend the stronger shape.
roam_agent_planDecompose partitions into dependency-ordered multi-agent tasks: per-task write scope, read-only dependencies, interface contracts, phase schedule, and merge sequencing. Supports plain / json / claude-teams output formats. Different from roam_partition (raw analytical manifest) and roam_orchestrate (operational dispatch) -- this is the dependency-ordered phase schedule.
roam_agent_scoreAggregate runs from the local ledger and score each agent on a 0..100 composite (run completion, gate adherence, preflight compliance, blast accuracy, replay survival). Empty state (no runs / no matching runs) returns a clean envelope with state: "no_data" -- never empty stdout, never a crash. Different from roam_runs_verify (HMAC tamper-detection) -- this is the per-agent quality score across runs.
roam_ai_ratioEstimate AI-generated code percentage from git commit heuristics.
roam_ai_readinessAI readiness score (0-100): how effectively AI agents can work on this codebase.
roam_alertsActive health alerts: thresholds breached on tangle, complexity, churn, or coverage.
roam_algoDetect suboptimal algorithms with better alternatives and complexity analysis.
roam_annotate_symbolAdd persistent annotation to a symbol/file for future agent sessions.
roam_apiList the public API surface — exported public symbols with signatures and docs.
roam_api_changesDetect breaking and non-breaking API changes vs a git ref.
roam_api_driftDetect field drift between Laravel/PHP models and TypeScript interfaces. Triggers: 'where do API contracts diverge?', 'find drift between PHP $fillable fields and TypeScript types', 'audit frontend API types'. Pair with roam_endpoints for full route inventory.
roam_architecture_driftCompute per-week growth rates for symbols / edges / cycles across a sliding window of persisted .roam/snapshots/ and classify overall direction as improving / degrading / stable. Different from roam_graph_diff (point-in-time delta between two commits) and roam_trends (metric-level time series) -- this is the snapshot-based architectural-trajectory report.
roam_article_12_checkRun a 6-item EU AI Act Article 12 readiness checklist over the indexed repo: audit-trail directory, audit-trail records, retention policy doc, technical docs, attestation surface, high-risk classification heuristic. Emits a structured envelope mapping each item to its Article (12, 18, 19) or Annex (III). Different from roam_audit_trail_conformance_check (per-record chain integrity) -- this is the repo-level governance-readiness assessment. Per the agentic-assurance guardrails: 'maps to' / 'supports evidence for', never 'certifies' / 'makes compliant'.
roam_askNatural-language codebase question dispatcher. Examples: 'is it safe to delete X?', 'where does login validate?', 'what just broke?', 'who owns module Y?'. Routes intent to one recipe in the graph-aware 31-recipe registry. One call replaces Grep+Read for most questions. Run this FIRST when the user asks a code-comprehension question.
roam_atShow the code AT a file:line with its enclosing symbol + callers. Targeted alternative to Read-ing the whole file. location is 'file:line'.
roam_attestProof-carrying PR attestation: evidence bundle + merge verdict.
roam_auditRun a one-shot codebase architecture audit: bundles health, debt, dead-code, risk, test-pyramid, coverage, and API-surface signals into a single envelope. Designed as the structured artifact a written audit report attaches. Different from roam_health (single 0-100 score) and roam_report (preset-driven Markdown report) -- this is the verdict-first audit packet for governance and onboarding.
roam_audit_trail_conformance_checkScore the audit trail against an EU AI Act Article 12 checklist.
roam_audit_trail_exportExport the audit trail as markdown / json / csv for procurement review.
roam_audit_trail_verifyVerify SHA-256 chain integrity of a roam audit trail.
roam_auth_gapsFind endpoints lacking auth / authorization checks ranked by confidence. Triggers: 'which routes are unprotected?', 'show me auth gaps', 'audit handler protection'. Pair with roam_taint for taint-source reachability over the unprotected surfaces.
roam_batch_getGet details for up to 50 symbols in one call. Replaces 50 sequential roam_symbol calls.
roam_batch_searchSearch up to 10 patterns in one call. Replaces 10 sequential roam_search_symbol calls.
roam_bisect_blameFind snapshots that caused architectural degradation, ranked by impact.
roam_boundarySurface public-by-accident exports + changed-range layer violations. Two closed-enum kinds: public_by_accident (warning, _-prefixed name in all) and wrong_direction_import (high, lower-layer module imports from higher-layer caller).
roam_breaking_changesDetect breaking API changes between git refs: removed exports, changed signatures.
roam_briefCompose a one-page agent briefing covering five sections: next (what roam next would recommend), highlights (stack / top danger zones / top mined laws from roam agents-md), pr_bundle (current PR-bundle status on the active branch), mode (active agent mode and its allow-list size), and runs (the N most-recent runs from the ledger). Designed as the FIRST command an agent runs when joining a roam-indexed repo. Different from roam_next (single-command router) -- this is the verdict-first session kickoff packet.
roam_budget_checkCheck changes against architectural budgets (cycles, health floor, complexity).
roam_bus_factorScore knowledge-concentration risk per directory: Shannon entropy over unique authors, primary-author share, last activity, and a staleness factor. Flags CRITICAL / HIGH / MEDIUM / LOW per module. Different from roam_owner (per-file blame) and roam_congestion (too-many-authors merge-conflict risk) -- this measures knowledge-loss risk.
roam_capsule_exportSanitized structural graph export without code bodies (privacy-safe).
roam_catalogReturn the full machine-readable list of every roam MCP tool currently registered, including title, description, and capability flags (core / read_only / destructive). Use this once at session start to discover what's available without enumerating tools.
roam_causal_graphBuild per-symbol causal graphs: edges from inputs (parameters / globals / env reads) to sinks (side-effecting calls / return / raise / mutation). Six causal kinds: param_to_effect, param_to_return, global_to_effect, global_to_mutation, env_to_effect, param_to_raise. Heuristic line-level text scan -- false negatives expected. Different from roam_taint (cross-symbol taint propagation) -- this is intra-symbol dataflow only.
roam_cga_emitEmit a Code Graph Attestation — in-toto v1 statement whose predicateType is the identifier https://roam-code.com/spec/CodeGraph/v1 (or https://roam-code.com/spec/CodeGraph-AIBOM/v1 with --aibom). Those are in-toto TypeURIs, not fetchable pages; the predicate schema is documented at https://roam-code.com/docs/architecture. Merkle root over symbol fingerprints + edge-bundle digest. Optional cosign keyless or offline signing.
roam_cga_verifyVerify a Code Graph Attestation — re-derives the Merkle root + edge-bundle digest from the live DB and compares to the bundled predicate, AND verifies the cosign signature on the sibling .bundle. Fails closed (exit 5) when no bundle is present unless no_cosign=True is passed to acknowledge predicate-only verification.
roam_changelogList commits since last tag, optionally formatted as a markdown CHANGELOG draft.
roam_check_rulesRun 10 built-in structural rules: cycles, fan-out, complexity, tests, god classes, layer violations.
roam_cleanRemove orphaned index entries (files deleted from disk) without full rebuild.
roam_clonesDetect near-duplicate code via AST structural hashing (Type-2 clones).
roam_closureMinimal set of changes needed for rename/delete/modify (exact files + lines).
roam_clustersShow Louvain code clusters and directory mismatches. Returns per-cluster size, cohesion, conductance, modularity Q, mega-cluster sub-group breakdowns, and inter-cluster coupling. Different from roam_layers (dependency-layer violations) -- this groups by community detection, not by topological depth.
roam_codeownersCODEOWNERS coverage, ownership distribution, unowned files, drift detection.
roam_commandsList the repo's own runnable build/test/lint commands, classified by kind/scope/cost with evidence.
roam_compareDiff two roam indices structurally: reports symbols added/removed/moved, per-file complexity deltas above a threshold, language counts, and a one-line health verdict (improved / regressed / sideways). Different from roam_graph_diff (commit-range graph delta from one index) -- this is the cross-index structural delta for release-vs-release comparisons.
roam_compatibilityDetect outbound surface regressions vs a baseline snapshot. Closed-enum verdicts: no regressions / surface additions / surface drift / baseline stale / breaking changes. Compares commands, flags, envelope summary fields, MCP tools, MCP tool parameters, and preset counts; does NOT compare parameter types, defaults, tool descriptions, command categories or runtime behavior. Capture the baseline via CLI: roam compatibility --write-baseline PATH.
roam_compileCompile a freeform coding task into a structured envelope an AI agent can consume. Returns the ArtifactSelector verdict (facts / lean / full envelope) plus the deterministic plan. Empirically validated on Opus 4.8 (2026-05-28): FactsEnvelope delivers 99% of vanilla quality at 54% of vanilla cost. Different from roam_plan (symbol-centric execution plan) -- this is the freeform-task compiler.
roam_completePrefix completion for symbols / file paths / commands. Faster than search; returns just names.
roam_complexity_reportFunctions ranked by cognitive complexity above threshold.
roam_congestionDetect developer congestion: files with too many concurrent authors within a sliding time window. Combines author count, churn intensity, and complexity into a congestion score that predicts merge conflicts and coordination failures. Different from roam_bus_factor (knowledge-loss risk) and roam_owner (per-file blame breakdown) -- this measures too-many-cooks contention.
roam_contextGet the minimum files + line ranges needed to understand or modify a symbol. Use when user says 'show me X', 'I need to change Y', 'how does Z work?'. Returns targeted reads ranked by PageRank — cheaper than Read'ing whole files. For pre-change safety (blast radius + tests + effects), use roam_prepare_change instead.
roam_conventionsAuto-detect codebase naming, file, import, and export conventions with outliers.
roam_couplingUse for: 'what files change together?' / 'find hidden coupling not visible in imports' / 'which sibling file should I also update?'. Pick over reading git log manually — surfaces co-change partners the call graph misses. Use roam_fan for structural connectivity, roam_dark_matter for the latent variant.
roam_coverage_gapsFind unprotected entry points: top-level exported functions / methods that have no call-graph path to a required gate symbol (auth / permission / validation). Supports exact gate names, regex patterns, framework presets (python / javascript / go / java-maven / rust), and a .roam-gates.yml sidecar config. Different from roam_auth_gaps (PHP/Laravel source analysis) and roam_test_gaps (untested symbols in changed files) -- this walks the call graph to verify every entry reaches a required gate.
roam_critiquePost-edit patch verifier. Pass git diff output as diff_text. Catches clones-not-edited (sibling duplicates the agent missed) and high-blast-radius edits. Grounded in the indexed graph, not heuristics. Triggers: 'review my patch', 'is this PR safe?', after generating any non-trivial diff.
roam_cutFind fragile domain boundaries via minimum-cut analysis. Computes the thinnest edge cuts between architectural clusters and the highest-impact 'leak edges' whose removal would best improve domain isolation. Different from roam_split (decomposes a single file) -- this finds boundaries between clusters.
roam_cut_analysisMinimum cut analysis: fragile domain boundaries, highest-impact leak edges.
roam_cyclesShow import/call cycles (Tarjan strongly-connected components) of the symbol graph. Returns per-cycle size, member files/symbols, and an actionable flag (spans >=2 distinct non-test files). The focused counterpart to the cycles section of roam_health; sibling of roam_clusters / roam_layers.
roam_dark_matterFile pairs that co-change without structural links (hidden coupling).
roam_dashboardUnified single-screen codebase status: health, hotspots, bus factor, dead code, AI rot.
roam_dead_codeUse for: 'what can I safely delete?' / 'find dead code' / 'list unused exports'. Pick over manual grep sweeps — filters out entry points and framework lifecycle hooks, ranks candidates by deletion safety. Pair with roam_safe_delete for per-symbol deletion verdicts.
roam_debtRank files by tech-debt score with SQALE remediation-cost estimates. Triggers: 'where's the worst debt?', 'what should we refactor next?', 'estimate cleanup cost'. Pair with roam_complexity_report for per-function brain-method targeting.
roam_delete_checkGate the diff (working / staged / PR / HEAD) on surviving references to deleted symbols and files. Per-deletion verdict: SAFE (no surviving references), LIKELY-SAFE (survivors only in tests / docs / unreachable code), or BREAK-RISK (survivors in reachable code). Different from roam_critique (PR-wide diff review) -- this targets the deletion surface specifically with CI-gate semantics (overall BREAK-RISK trips the gate).
roam_depsUse for: 'what does file X import?' / 'which files depend on module Y?' / 'show me the importers of Z'. Pick this for file/module-level coupling before refactors; symbol-level lookups belong in roam_uses. Set multi=True to get imports + importers + git co-change coupling in ONE envelope (do this instead of shelling out to roam deps --multi or hand-querying the index). Run in parallel with roam_coupling for the biggest token win.
roam_describeAuto-generate a project description for AI coding agents: multi-section Markdown report covering overview, directories, entry points, key abstractions, architecture, and testing. Different from roam_understand (compact codebase overview) -- this is the comprehensive prose description for CLAUDE.md / AGENTS.md / .cursor/rules. The wrapper emits to stdout; on-disk writes are deferred to the CLI (roam describe --write) so the MCP surface stays read-only.
roam_dev_profileDeveloper behavioral profiling: commit time patterns, change scatter (Gini), burst detection.
roam_diagnoseRoot cause analysis: upstream/downstream suspects ranked by composite risk.
roam_diagnose_issueRoot-cause triage for a failing symbol. Pass the suspect symbol. Ranks upstream / downstream callers by risk + lists side effects + transactional boundaries. Replaces manual call-graph Grep+Read. Triggers: 'X is broken', 'test Y fails', 'why does Z return null?'.
roam_diffShow the blast radius of your edits BEFORE you commit. Run after Edit/Write tools to see affected symbols, files, tests, plus coupling and fitness warnings. Use when user asks 'what did my change break?', 'safe to commit?'. Replaces ad-hoc git diff --stat inspection with graph-aware impact data. For PR-level risk verdict, use roam_pr_risk.
roam_disambiguateList every symbol matching a name with file/line/kind/signature/PageRank — pick the right overload.
roam_doc_intentLink documentation to code: find drift, dead refs, undocumented symbols.
roam_doc_stalenessRun a semantic docstring-drift audit: flag documented parameters, returns, or raises that no longer match code. Pass include_prose_drift to include optional blame-only summary drift. Different from roam_docs_coverage (missing docs ranked by PageRank) and roam_stale_refs (dangling doc links) -- this audits concrete claims in existing docs.
roam_docs_coverageDoc coverage + stale-doc drift with PageRank-ranked missing docs.
roam_doctorSetup diagnostics: Python version, tree-sitter, git, index existence, freshness, SQLite.
roam_dogfoodOne-shot full-stack run: audit + pr-analyze + audit-trail + conformance.
roam_dogfood_aggregateTriage view over the dogfood eval corpus: totals, per-command findings count, by-status / by-severity / by-type breakdowns. Reads internal/dogfood/evals/ (or an override path). Useful for agents auditing roam-code itself; mostly a no-op on consumer repos that have no dogfood corpus.
roam_driftOwnership drift detection: declared CODEOWNERS vs actual time-decayed contributors.
roam_duplicatesDetect semantically duplicate functions via structural similarity.
roam_effectsSide effects of functions: DB writes, network, filesystem (direct + transitive).
roam_endpointsList all REST/GraphQL/gRPC endpoints with handlers, methods, and locations.
roam_entry_pointsCatalog every entry point into the codebase: HTTP routes, CLI commands, scheduled jobs, event handlers, message consumers, main functions, and exports. Reports per-entry reachability coverage -- what fraction of symbols each entry transitively reaches through the call graph.
roam_eval_retrieveRun the retrieval eval harness over a labeled task set. Reports recall@K, mean reciprocal rank, and per-task diagnostics. Supports a weight sweep and CodeRAG-Bench / BEIR emit formats for public leaderboard submission.
roam_evidence_diffDiff two ChangeEvidence packets: shows hash drift, schema drift, added/removed refs, missing evidence, and changed verdicts. Useful for reviewing PR re-runs, comparing replay windows, or auditing whether a fresh evidence packet has improved or regressed against a stored baseline. Different from roam_compare (two-index structural delta) -- this is the two-packet evidence delta.
roam_evidence_doctorDiagnose a ChangeEvidence packet's health: schema validity, closed-enum conformance, content_hash integrity, completeness banner tier (STRONG / PARTIAL / INSUFFICIENT), declared redactions, and actionable next steps for partial / missing evidence questions. Read-only.
roam_evidence_oscalEmit an OSCAL v1.2 document. Default kind='control-mapping' compiles the roam control map (maps roam evidence to EU AI Act, ISO/IEC 42001, NIST AI RMF, NIST AI 600-1, NIST SP 800-218A, SOC 2, internal AI-change policy). kind='assessment-results' compiles a per-run AR document from a ChangeEvidence packet (requires evidence_path); AR mandates an Assessment Plan reference — pass import_ap_ref for an external AP or omit it to inline a synthesized stub AP. Supports evidence for the listed frameworks — does not certify compliance. Two roam-specific concepts (authority_refs, redactions) surface as OSCAL prop extensions under the urn:roam:oscal:v1 namespace.
roam_expand_toolsetList available tool presets or show contents of a preset. Presets: core (minimal), review, refactor, debug, architecture, compliance, compile-curated, and full (every tool). Pass a preset name to list its tools.
roam_exploreCodebase exploration bundle: understand overview + optional symbol deep-dive in one call.
roam_fanShow fan-in / fan-out: the most-connected symbols or files. Flags hub / spreader / HIGH-RISK structural hotspots based on cross-file import / call edges. Different from coupling (co-change frequency) -- this measures structural connectivity.
roam_fetch_handleFetch all or part of a large payload by handle — supports byte slice, section pick, jq projection.
roam_file_infoFile skeleton: all symbols with signatures, kinds, line ranges.
roam_findings_countShow per-detector finding counts. Useful for spotting which detectors have migrated to the central registry vs which are still only emitting to their detector-specific tables.
roam_findings_listList rows from the central findings registry, optionally filtered by detector or subject. Cross-detector view -- every migrated detector (clones, dead, complexity, smells, n1, missing-index, ...) emits here behind one schema.
roam_findings_showShow full detail for a single finding by its stable finding_id_str. Returns the detector version, subject, confidence tier, claim, evidence JSON, and any suppressions.
roam_fingerprintTopology fingerprint for cross-repo comparison or structural drift tracking.
roam_fitnessRun architectural fitness functions from .roam/fitness.yaml. Rule type is a closed set: dependency (also how layering is enforced -- forbid the edge), metric, naming, trend; any other type is reported ERROR and exits non-zero rather than being skipped (W1450). Different from roam_preflight (compound 6-signal pre-edit gate) -- this is the dedicated fitness surface with per-rule output, baseline / delta mode, and trend regression guards.
roam_flag_deadDetect potentially stale feature-flag code: flags referenced only once, flags always checked with the same boolean default, and flags clustered in a single file. Recognises LaunchDarkly, Unleash, Split, generic feature_flag(...) calls, and FEATURE_* env-var patterns. Different from roam_dead_code (graph-unreachable symbols) -- this targets code that is alive in the graph but gated behind flags that may never fire.
roam_fleet_planPlan a multi-agent fleet for a goal — graph-aware partition (Louvain + co-change) emits .roam-fleet.json for Composio / Copilot CLI / raw.
roam_fn_couplingShow function-level temporal coupling: symbol pairs that change together across commits. Different from roam_coupling (file-level pairs) -- this drills into co-changing symbols inside and across files, with optional structural-edge filtering.
roam_for_bug_fixCompound: diagnose + affected_tests + diff + context for a symbol you're about to debug.
roam_for_new_featureCompound: understand + search + context + complexity for an area you're about to add code to.
roam_for_refactorCompound: preflight + impact + complexity_report + clones for a symbol you're about to refactor.
roam_for_security_reviewCompound: taint + vuln + critique + adversarial for a security review pass.
roam_forecastPredict when metrics will exceed thresholds (Theil-Sen regression).
roam_full_couplingComposite coupling report for ONE file in a single envelope: top-N temporal coupling pairs touching the file + structural imports/importers + top-N file symbols. Use instead of chaining roam_coupling + roam_deps + roam_file_info.
roam_generate_planStructured execution plan for code modification: read order, invariants, tests.
roam_get_annotationsRead annotations for symbols, files, or project. Filter by tag/date.
roam_get_invariantsImplicit contracts for symbols: signature stability, usage spread, breaking risk.
roam_graph_diffShow the structural graph delta between two snapshots. Surfaces new / removed symbols, edge churn, degree shifts, new cycles, layer migrations, and likely renames. Reads persisted snapshots from .roam/snapshots/ -- capture one with --save-snapshot.
roam_graph_statsReport graph-level invariants: density, connected components, average in/out degree, top in-degree symbols, and approximate diameter. One overview number for 'how dense, connected, and cyclic is this codebase'.
roam_grepRun index-aware grep across the codebase. Returns matches with their enclosing symbol, reachability badge, PageRank, clone-class, and bridge annotations. Supports multi-pattern, source-only / test-only filters, reachable-from / unreachable filters, co-occurrence across patterns, and rank-by importance. Request bounded context packets or whole enclosing symbols to replace the usual grep-then-read loop.
roam_guardCheck breaking-change risk for a symbol before editing: 0..100 risk score with component breakdown (blast radius, complexity, centrality, test gap, layer analysis) plus caller / callee lists and covering tests -- all within a ~2K-token budget. Different from roam_preflight (file / staged / coupling / convention / fitness composite) -- this is the per-symbol quantified risk score for sub-agent dispatch.
roam_guard_cleanPrune the verdict log at .roam/verdict-log.jsonl to its last N entries (default 500). Atomic rewrite — concurrent appenders never see a partial file. Pair dry_run=True for a probe.
roam_guard_diffVerdict diff between two bundle snapshots (or the two most-recent verdict-log entries via from_log=True). Returns the verdict delta + reasons added/resolved + file/check counts. Answers 'did my last commit help?'
roam_guard_doctorRoam Guard preflight: 8 health checks (.roam dir, bundles, rule pack, command graph, git, GitHub token, verdict log, yaml lib). Run once before adopting Roam Guard in CI.
roam_guard_historyList past Roam Guard verdicts on this repo (reads .roam/verdict-log.jsonl fast-path when present, falls back to scanning .roam/pr-bundles/). Supports --verdict and --limit filters.
roam_guard_prAggregate Roam Guard PR check: auto-collect bundle, compose AgentChangeProofBundle v1, render verdict (pass/pass_with_warnings/needs_review/blocked), optionally POST a GitHub Check Run. The headline tool — drop this into a CI step to gate any PR.
roam_guard_rulesInspect or validate a Roam Guard rule pack. Subcommands: show (default) renders the pack, validate checks schema, test matches a path against the pack.
roam_healthCodebase health score (0-100) with issue breakdown, cycles, bottlenecks.
roam_history_grepRun git pickaxe (-S / -G) through commit history. Returns commits that introduced or removed the literal string, with author, date, short SHA, and summary per commit.
roam_hotspotsShow runtime hotspots: symbols ranked by static analysis vs real production traces (requires roam ingest-trace to have populated runtime_stats). Each row is tagged UPGRADE (runtime-critical but statically safe), CONFIRMED (both agree), or DOWNGRADE (statically risky but low traffic). Different from roam_why_slow (top-N by latency alone) -- this classifies static vs runtime mismatch.
roam_hoverOne-line architectural summary for a symbol — kind, location, blast-radius bucket, top caller, top callee.
roam_idempotencyClassify symbols by retry safety: idempotent (pure, read-only I/O, write-with-check patterns like mkdir(exist_ok=True) / INSERT OR IGNORE / UPSERT / if not exists: create), non_idempotent (naive writes, mutations, appends), or unknown (process spawn / unreadable body). Composes on top of roam_side_effects. Different from roam_tx_boundaries (transaction correctness) -- this answers is it safe to retry?.
roam_impactBlast radius for 'is it safe to change?' — symbols + files affected, in 5 lines. Compact decision-support output. Round 4 / S: the right default tool for safety-checks; preflight is heavier.
roam_ingest_traceIngest runtime traces (OTel/Jaeger/Zipkin), match spans to symbols.
roam_initInitialize roam and build the first index. Task-mode for non-blocking setup.
roam_intentLink documentation to code: find which docs mention which symbols, and detect doc-to-code drift (references to non-existent symbols). Different from roam_docs_coverage (PageRank-ranked missing-docstring hotlist) and roam_doc_staleness (stale docstring content) -- this is the prose-doc-to-symbol linker plus drift detector.
roam_invariantsDiscover implicit contracts for a symbol or the public API surface: signature shape, parameter count and ordering, usage spread across files, dependency set. Different from roam_check_rules (explicit governance rules) -- this is the AUTO-discovered implicit-contract surface so agents know what must stay stable when modifying a symbol.
roam_layersShow topological dependency layers and violations. Returns each layer's symbol count, directory breakdown, and any back-edges that violate the topological order. Different from roam_clusters (community detection) -- this measures dependency depth.
roam_llm_smellsRun LLM-API integration linter over indexed files: detects unpinned model versions, missing max_tokens, prompt injection via user-input concatenation, unvalidated json.loads on LLM output, and missing temperature. Different from roam_vibe_check (AI-generated code shape) and roam_smells (structural anti-patterns) -- this is the production gate for human-authored LLM-using code.
roam_mapShow project skeleton: directory tree, entry points, top symbols by PageRank, language counts. Different from roam_describe (prose description) and roam_minimap (sentinel-block one-pager for CLAUDE.md) -- this is the structured skeleton with directories, entry points, and ranked symbols for agent onboarding.
roam_metricsShow unified per-file or per-symbol metrics: cognitive complexity, fan-in / fan-out, SNA centrality vector (PageRank / betweenness / closeness / eigenvector / clustering coefficient), composite debt score, churn, test coverage, and comprehension difficulty in a single view.
roam_metrics_pushPush metrics-only summary to Roam Cloud Lite. Default is dry-run.
roam_migration_planGenerate an ordered migration plan with risk + blast-radius per step from a target-architecture YAML spec or inline --move SYMBOL=path/to/new/file directives. Each step is annotated with caller count and a derived risk score so agents can decide where to stop or insert tests. Stops at the first step exceeding max_risk. Different from roam_simulate (counterfactual single-move analysis) -- this is the ordered multi-step plan with a risk gate.
roam_migration_safetyDetect non-idempotent database migrations unsafe to re-run. Triggers: 'audit migration safety', 'find non-idempotent migrations', 'which DDL would break on replay?'. Pair with roam_tx_boundaries for transaction-correctness analysis.
roam_minimapGenerate a compact ~20-line codebase minimap for CLAUDE.md injection: tech stack, annotated directory tree, key symbols by PageRank, high-fan-in symbols to avoid, hotspots, detected conventions. Different from roam_describe (long-form prose) and roam_map (structured skeleton) -- this is the sentinel-block one-pager. The wrapper emits to stdout; on-disk updates are deferred to the CLI (roam minimap --update / --init-notes) so the MCP surface stays read-only.
roam_missing_indexDetect queries hitting non-indexed columns flagged as slow-query risks. Triggers: 'find slow queries', 'audit database indexes', 'where are the N+1 candidates?'. Pair with roam_n1 for per-property iteration patterns.
roam_moduleShow directory contents: exported symbols, signatures, external imports / importers, internal cohesion percentage, and API surface ratio. Different from roam_describe (project-wide) -- this analyses a single directory.
roam_mutateAgentic editing: move/rename/add-call/extract symbols with auto-import rewrite.
roam_n1Detect N+1 I/O patterns in ORM code (Laravel/Django/Rails/SQLAlchemy/JPA).
roam_nextSuggest the next roam command based on cheap repo-state signals: index presence, staleness, working-tree dirtiness, recent envelope, and recent memory. Emits one imperative recommendation in <200ms. Different from roam_brief (multi-section session kickoff) and roam_workflow (curated multi-step recipes) -- this is the single-command router.
roam_observability_optDetect code that leaves systems hard to debug (raw debug prints, ...) and recommend the structured-logging shape.
roam_onboardGenerate a new-developer onboarding guide for the codebase.
roam_oracle_batchRun multiple oracle queries in one call. Items: [{name, oracle, max_hops?}, ...] where oracle is one of symbol-exists, route-exists, is-test-only, is-reachable-from-entry, is-clone-of.
roam_oracle_is_clone_ofAnswer the boolean oracle question: does this symbol have persisted clone siblings in the clone_pairs table? Returns a yes/no verdict envelope with the matched clone class size. Different from roam_clones (full clone-pair enumeration) -- this is the cheap boolean lookup for one symbol's clone status.
roam_oracle_is_reachable_from_entryAnswer the boolean oracle question: is the symbol reachable from any entry point via the call graph (BFS up to max_hops depth)? Useful for sniffing orphans and production-vs-tooling code. Different from roam_dead_code (broad dead-symbol detection) and roam_entry_points (entry-point enumeration) -- this is the cheap boolean lookup for one symbol's reachability.
roam_oracle_is_test_onlyAnswer the boolean oracle question: are ALL callers of this symbol in test files? Useful for sniffing test fixtures and dead-but-test-only helpers. Different from roam_dead_code (broad dead-symbol detection) -- this is the cheap boolean lookup for one symbol's test-only status.
roam_oracle_route_existsAnswer the boolean oracle question: does a route handler match this URL path? Returns a yes/no verdict envelope with the matched handler's file + kind when found. Different from roam_endpoints (full endpoint enumeration) -- this is the cheap boolean lookup for one route precondition check.
roam_oracle_symbol_existsAnswer the boolean oracle question: does a symbol with this name exist in the index? Returns a yes/no verdict envelope with the matched symbol's file + kind when found. Different from roam_search_symbol (top-N ranked hits) -- this is the cheap boolean lookup for agent precondition checks.
roam_oracle_test_onlyAlias of roam_oracle_is_test_only — preserves the shorter name agents sometimes guess.
roam_orchestratePartition codebase for parallel multi-agent work with exclusive write zones.
roam_orphan_importsList imports that don't resolve to any indexed module or installed package -- catches typo'd local imports, missing packages, and dangling relative imports. Covers Python (default), JavaScript / TypeScript, and Go. Different from roam_dead_code (unused symbols) -- this targets import-statement orphans.
roam_orphan_routesFind backend routes lacking a frontend consumer — the dead-endpoint surface. Triggers: 'which routes can we delete?', 'find unused endpoints', 'audit API surface coverage'. Pair with roam_dead_code for symbol-level dead-export detection.
roam_over_fetchModels serializing too many fields (data over-exposure risk).
roam_ownerShow code ownership computed from git blame: per-author line counts, percentages, last-active dates, and a fragmentation index. Works on a file or a directory prefix. Different from roam_codeowners (which reads the CODEOWNERS file) -- this measures actual ownership.
roam_partitionMulti-agent work partitioning: split codebase into independent work zones.
roam_path_coverageCritical call paths with zero test protection, ranked by risk.
roam_patternsDetect positive architectural patterns: Singleton, Factory, Observer, Repository, Middleware, Strategy, and Decorator. Different from roam_smells (negative anti-patterns) -- this discovers intentional design patterns.
roam_planGenerate a structured execution plan for modifying code: read-order (call-graph BFS), invariants (mined contracts), blast-radius preview, and per-task heuristics. Five task types: refactor / debug / extend / review / understand. Different from roam_plan_refactor (refactoring-specific simulation) and roam_preflight (blast-radius gate) -- this is the general-purpose work plan for any task type.
roam_plan_refactorBuild an ordered refactor plan for one symbol using risk/test/simulation context.
roam_postmortemReplay current detectors against past commits: walks a git commit range, runs roam critique against each commit's diff, and reports which findings would have surfaced pre-merge. Useful for retrospective replay -- 'would today's detector set have caught the incidents already in history?' Different from roam_pr_replay (one PR replay) -- this is the range-replay over historical commits.
roam_pr_analyzeAgent-aware PR risk verdict — INTENTIONAL / SAFE / REVIEW / BLOCK.
roam_pr_comment_renderRender a markdown PR comment from a pr-analyze JSON envelope.
roam_pr_diffStructural graph delta of code changes: metric deltas, layer violations.
roam_pr_prepOne-shot pre-PR fitness check: bundles diff blast radius + critique + pr-risk into a single envelope with a ready_to_open verdict. Different from roam_pr_risk (composite risk score alone) and roam_critique (clones-not-edited + blast-radius alone) -- this is the three-section pre-PR rollup with the go/no-go verdict.
roam_pr_riskRisk score (0-100) for pending changes with per-file breakdown.
roam_preflightPre-change safety check: blast radius, tests, complexity, fitness. Call BEFORE modifying code.
roam_prepare_changePre-change safety gate. Run before any non-trivial edit — returns blast radius, affected tests, and fitness gates.
roam_proof_bundleCompose AgentChangeProofBundle v1 from the active pr-bundle. Returns the structured verdict envelope an agent can attach to a PR. Supports markdown / json / sarif output formats.
roam_py_modernPython modernisation signal: walrus, match, PEP 604/585, f-strings vs legacy.
roam_py_typesPython type-annotation health: % public fns fully typed, Any usage, legacy typing.
roam_pytest_fixturespytest fixture chain: top fixtures by dependent count, or per-symbol dependency walk.
roam_reachability_triageClassify vulnerability-flow findings as reachable or not reachable from entrypoints through local call-graph evidence. This MCP tool is read-only: it does not write or move the reachability baseline; use the CLI for baseline management.
roam_recommendSurface symbols related to a given symbol via three signal sources combined: call-graph neighbours (1-hop in + out), git co-change (other symbols whose files changed in the same commits), and persisted clone siblings (when roam clones --persist was run). Each candidate gets a score that's the normalised sum of the three contributions. Different from roam_impact (transitive blast radius) and roam_neighbours (graph-only 1-hop neighbours) -- this fuses co-change + clones into the ranking.
roam_refs_textAudit literal strings across the project and emit a per-string verdict: SAFE-TO-REMOVE / REVIEW / LOAD-BEARING. Groups every reference by surface (code, test, docs, config, generated, vendored) and annotates reachability for code hits.
roam_reindexIncremental or force reindex. Task-mode + elicited confirmation for force runs.
roam_relateHow symbols connect: shared deps, call chains, conflicts, cohesion score.
roam_repo_mapCompact project skeleton with key symbols per file, by PageRank.
roam_reportRun a compound report preset (built-ins: first-contact, security, pre-pr, refactor, guardian) that orchestrates multiple analysis commands into one rendered report. Different from roam_audit (single fixed bundle) -- this is the preset-driven multi-command roll-up with optional Markdown output and strict exit-code gating.
roam_resetDelete index DB and rebuild from scratch. Requires force=True. Recovery for corrupted indexes.
roam_retrieveGraph-aware context for free-form tasks: FTS5 + structural rerank (PageRank + clones) + token budget.
roam_review_changeChange review bundle: pr-risk + breaking changes + structural diff in one call.
roam_riskRank symbols by domain-weighted risk: combines static risk (fan-in + fan-out + betweenness) with domain criticality weights so financial / auth / data-integrity symbols rank higher than UI symbols. Different from roam_fan (raw fan-in/out degree) and roam_hotspots (runtime hotspot classification) -- this is the semantic-domain-weighted risk heatmap.
roam_rules_checkEvaluate custom governance rules from .roam/rules/ YAML files.
roam_rules_validateLint a .roam/rules.yml for shippability before customers see it.
roam_runtime_hotspotsRuntime hotspots where static and runtime rankings disagree (UPGRADE/DOWNGRADE).
roam_safe_deleteFuse dead-code, blast-radius, and test-coverage signals into a single deletion verdict: SAFE / REVIEW / UNSAFE. Reports direct callers (non-test), transitive dependents, affected files, and a public-API bump that flips SAFE -> REVIEW for exported symbols whose name matches a common public-API prefix. Different from roam_dead_code (all unreferenced symbols) and roam_impact (transitive blast radius) -- this is the single go/no-go gate.
roam_safe_zonesClassify the refactor containment zone around a symbol or file: ISOLATED (no external connections), CONTAINED (<=5 boundary symbols), or EXPOSED (>5). Reports strictly-internal vs boundary symbols and external caller / callee counts per boundary. Different from roam_impact (unbounded reverse blast radius) and roam_closure (exact locations needing modification) -- this maps the bounded zone where it is safe to refactor freely.
roam_sbomEmit a Software Bill of Materials (CycloneDX 1.7 by default, or SPDX 2.3) enriched with call-graph reachability — distinguishes phantom dependencies from those actually exercised. Pair with --aibom for the AIBOM extension required by EU AI Act Art. 50.
roam_search_semanticFind symbols by natural language query (hybrid BM25 + vector + framework packs).
roam_search_symbolUse for: 'where is X defined?' / 'find function Y' / 'locate class Z'. Pick over Bash grep for function/class/method lookups — PageRank-ranked file:line + qualified names, no string/comment false positives. For 3+ symbols use roam_batch_search; for callers use roam_uses.
roam_secretsScan for hardcoded secrets, API keys, tokens, passwords (25 patterns).
roam_semantic_diffStructural change summary: what symbols were added/removed/modified.
roam_session_metricsLocal-only telemetry: per-tool invocation counts grouped by outcome (success / rate_limited / error). Helps answer "which tools are agents actually using?" and "which tools are dead weight?". Never phones home — counters live in the MCP server process and reset on restart.
roam_side_effectsClassify symbols by side-effect bucket: none (pure), io_read (disk / network / DB read), io_write (disk / network / DB write), mutation (global / module state mutation), process (subprocess / thread / async), or unknown. Coarse five-bucket taxonomy designed for agent decisions. Different from roam_effects (finer 11-kind taxonomy + transitive propagation) -- this is the agent's go/no-go classifier for can I retry this safely?.
roam_simulatePredict metric deltas from move/extract/merge/delete operations.
roam_simulate_departureSimulate knowledge loss if a developer leaves the team.
roam_sketchRender a compact structural skeleton of a directory: every file's exported symbols with kind, signature, line range, and first-line docstring. Different from roam_understand (broader project overview) and roam_file_info (one-file skeleton) -- this is the directory-level API surface in a single view, with optional full=True to include private symbols.
roam_smellsRun 24 deterministic code-smell detectors over the indexed codebase: brain methods, god classes, deep nesting, shotgun surgery, feature envy, long parameter lists, large classes, dead params, low cohesion, message chains, data clumps, type switches, cross-layer clones, parallel hierarchies, and more. Different from roam_vibe_check (AI-rot pattern regex) and roam_patterns (positive design patterns) -- this surfaces negative structural anti-patterns from DB queries.
roam_spectralSpectral bisection: Fiedler vector partition tree and modularity gap.
roam_splitAnalyse a file's internal call / reference graph and propose natural decomposition groups via Louvain community detection. Reports per-group isolation %, internal vs cross-group edges, and ranked extraction candidates (groups with >=3 symbols and >=50% isolation). Different from roam_clusters (repo-wide module partitioning) -- this analyses ONE file's internal seams.
roam_stale_refsFind dangling file references — markdown links / HTML href-src / backtick paths whose target is missing. v12.48 adds anchor validation, confidence-tagged hints, --diff branch filter, --fix preview/apply, and --sort-by ranking. Set enrich_with_llm=True for LLM-sampled hints on findings the deterministic providers couldn't resolve.
roam_statsAggregate high-level statistics: language / role / kind counts plus a recent-commit activity counter over a configurable window. Different from roam_metrics (per-symbol static-metric report) and roam_graph_stats (graph-wide topology stats) -- this is the language-and-role inventory snapshot.
roam_suggest_refactoringRank proactive refactoring candidates using complexity/coupling/churn/smells.
roam_suggest_reviewersSuggest optimal code reviewers for changed files.
roam_supply_chainDependency risk dashboard: pin coverage, risk scoring, supply-chain health.
roam_symbolSymbol definition, callers, callees, PageRank, fan-in/out metrics.
roam_syntax_checkTree-sitter syntax validation. Finds ERROR/MISSING AST nodes. No index needed.
roam_taintGraph-reach taint analysis. Returns OpenVEX-shaped findings (spec-legal status + justification — never code_not_reachable). 10 starter rule packs: sqli, xss, ssrf, path-traversal, command-injection, deserialization, open-redirect, urllib, socketio, fileupload. Pair with --ci to gate on findings (exit 5).
roam_taint_classifyRun roam taint then ask the agent's own LLM (via MCP sampling) to classify each reachable finding as IDOR/AUTHZ/SQLI/XSS/CMD_INJECTION/etc. with confidence + reasoning. Counter to Semgrep Multimodal — same LLM-reasoning narrative without a hosted API key.
roam_test_gapsFind changed symbols missing test coverage, ranked by severity.
roam_test_hermeticityDetect non-hermetic test patterns that cause CI flakiness. Six closed-enum kinds: network, time, random, filesystem, env, subprocess. AST-driven (not regex) with module-level suppression for monkeypatch / freezegun / responses / random.seed.
roam_test_impactTests transitively reachable from changed symbols — sharper scope than affected_tests.
roam_test_mapMap a symbol or file to its current test coverage: direct test edges (test file calls the symbol), file-level importers (test file imports the symbol's module), and convention-based matches (Salesforce <Name>Test / <Name>_Test classes). Different from roam_test_gaps (untested symbols in changed files) and roam_affected_tests (forward trace from changes to affected tests) -- this is the lookup for what currently exercises a given symbol.
roam_test_pyramidCount indexed test files by kind (unit / integration / e2e / smoke / unknown) using path and name conventions, and flag inverted pyramids (when e2e + integration > unit). Different from roam_test_gaps (missing coverage) -- this measures the shape of the existing test suite for slow-CI risk.
roam_test_scaffoldGenerate a test-file skeleton for a source file or symbol (functions, classes, methods) with the right imports and per-symbol stub blocks. Supports pytest / unittest (Python), jest / mocha / vitest (JS/TS), Go testing, JUnit4 / JUnit5 (Java), and RSpec / Minitest (Ruby). Dry-run by default; pair with roam_test_map first to confirm no existing coverage. Skips symbols that already have tests in the target file.
roam_timelineChronological commits that touched the file owning a symbol — author, date, lines added/removed.
roam_tourCodebase onboarding guide: reading order, entry points, architecture roles.
roam_traceShortest dependency path between two symbols with hop details.
roam_trendsHistorical metric tracking: record and query health metric trends over time.
roam_tx_boundariesClassify functions by transactional safety: transactional (begin matched by commit/rollback, all mutations inside scope), partial_transactional (mutations both inside AND outside scope), unsafe_mutation (mutations OUTSIDE any transaction wrapper -- latent bug), unmatched_begin (begin without commit/rollback -- leak), unmatched_commit, non_transactional, or unknown. Composes on top of roam_side_effects. Different from roam_idempotency (retry safety) -- this gates transaction correctness.
roam_understandCodebase briefing in one call. Returns stack + architecture layers + entry points + hotspots + conventions in ~2-4K tokens. Triggers: 'what is this repo?', 'where do I start?', 'give me the lay of the land'. Run this FIRST in an unfamiliar repo — Glob/Grep around comes later.
roam_usesUse for: 'who calls X?' / 'where is Y referenced?' / 'what breaks if I rename Z?'. Pick over multi-pattern grep — graph-resolved callers, importers, and subclasses grouped by edge type, zero comment/string-literal false positives. For 3+ symbols use roam_batch_get; for counts only, roam_impact.
roam_validate_planPre-apply validator for a multi-step change plan. Returns blockers, warnings, advice per operation.
roam_verdictCompute a closed-enum verdict (pass / pass_with_warnings / needs_review / blocked) from the active pr-bundle. Pure judgment layer — no rendering, no log, no GH POST.
roam_verification_contractCompute the minimal {required, skipped} verification set for the current changed_files × risk × mode × policy. Surfaces what an agent MUST run before its PR can pass.
roam_verifyRun the post-edit proof gate over every changed file.
roam_verify_importsHallucination firewall: validate import statements resolve to indexed symbols.
roam_vibe_checkAI rot score (0-100): 8-pattern taxonomy of AI code anti-patterns.
roam_visualizeGenerate Mermaid/DOT architecture diagram with smart filtering.
roam_vuln_mapIngest vulnerability scanner reports (npm/pip/trivy/osv), match to symbols.
roam_vuln_reachVulnerability reachability through call graph: paths, hops, blast radius.
roam_weatherChurn x complexity hotspot ranking: highest-leverage refactoring targets.
roam_whyExplain why a symbol matters: role classification (Hub/Bridge/Leaf), transitive reach, critical-path membership, cluster cohesion, and a one-line verdict. Accepts multiple symbol names for batch triage. Different from roam_fan (raw connectivity ranking) and roam_preflight (blast-radius gate before edit) -- this is the per-symbol role explainer for triage and onboarding.
roam_why_failTriage a failing test/symbol: recently-changed symbols transitively reachable from it.
roam_why_slowRank runtime hotspots by cost = log10(call_count + 1) * p99_latency_ms. Reads runtime_stats populated by roam ingest-trace. Optionally restricts to symbols in changed files vs a base ref. Different from roam_hotspots (static-vs-runtime classification) -- this is the pure latency-weighted ranking.
roam_workflowInspect a workflow recipe DAG, list available recipes, or suggest what to run next given a prior command. Useful as an agent navigation aid: 'I just ran roam impact -- what should I run next?' Different from the heavyweight analytical recipes -- this is the metadata-only recipe browser.
roam_ws_contextCross-repo augmented context for a symbol spanning multiple repos.
roam_ws_understandMulti-repo workspace overview: per-repo stats, cross-repo connections.
roam_x_langShow cross-language symbol bridges: Protobuf .proto -> generated Go/Java/Python stubs, Salesforce Apex -> Aura/LWC/Visualforce, REST API frontend -> backend route, template variable -> source, and env-var read -> .env definition. Call this tool to list every registered bridge type.