fold/docs/mcp-tools.md
trvon 8ac9ddb175
docs: expand fold-sast skill; document call-graph decomposition + budgets
- skills/fold-sast: rename to skill-fold-sast and expand the scan/precision
  guidance for C++/Rust/Swift lanes
- docs/architecture: record call-graph phase decomposition and the
  optimization-loop TP/FP/TN/FN evidence policy
- docs/mcp-tools + README: update budget/per-query defaults (1800s/6000ms)
  and note the OpenGrep pre-push hook
2026-08-16 16:41:33 -06:00

4.6 KiB

Fold MCP tools

Fold advertises only canonical operations. Deprecated aliases remain callable through the next major-version compatibility checkpoint and return structured deprecation metadata.

Canonical operations

Tool Description
fold.scan Run source, binary, hybrid, Rust, or Swift analysis through the scan router. Stores findings in an in-memory session context for follow-up tools.
fold.scan_start Queue a source, binary, hybrid, Rust, or Swift router scan and return immediately with a job id.
fold.scan_status Return status for a queued/running/completed MCP scan job.
fold.scan_jobs List queued/running/completed MCP scan jobs in this server session.
fold.scan_job_findings Page findings from a completed MCP scan job without activating it.
fold.scan_activate Make a completed MCP scan job the current scan context for follow-up tools.
fold.get_scan_context Return the current in-memory scan context produced by fold.scan, fold.scan_project, fold.scan_rust, fold.scan_swift, or fold.scan_binary.
fold.get_findings Page findings from the current in-memory scan context. Optionally filter by backend provenance (source, binary, rust, swift).
fold.query_findings Query findings in the current scan context or a completed job using bounded fixed-string matching, typed filters, and deterministic pagination.
fold.suggest_merge For a clone / equiv / class-dup finding, return the source snippet of the first location as a candidate unified implementation.
fold.explain Render a human-readable explanation of a cached finding.

Generated scan option schema

fold.scan and fold.scan_start advertise this same analysis schema. Server configuration owns queue depth. background is accepted only as a deprecated, hidden fold.scan call alias for fold.scan_start.

Property Type Default Constraints Description
binary string minLength=1, maxLength=4096 Binary or firmware input path.
binary_detectors array maxItems=256 Binary-side hybrid detector override.
binary_max_functions integer 0 minimum=0, maximum=100000 Maximum binary functions to extract; zero means all.
budget_seconds integer 1800 minimum=0, maximum=3600 Total solver wall-clock budget in seconds.
clone_max_body_len integer 4096 minimum=0.0, maximum=100000 Maximum normalized clone body length.
clone_max_pairs integer 500 minimum=0.0, maximum=100000 Maximum pairwise checks per clone bucket.
compile_db string minLength=1, maxLength=4096 Path to compile_commands.json or its directory.
configuration_profile string minLength=1, maxLength=4096 Versioned runtime configuration profile for guarded callsites.
detectors array maxItems=256 Detector names or group aliases.
hybrid_binary_functions integer 0 minimum=0.0, maximum=100000 Maximum binary functions selected by source hints.
hybrid_source_candidates integer 0 minimum=0.0, maximum=100000 Maximum source candidates selected by binary hints.
hybrid_strategy string merge-only enum=["merge-only"], maxLength=4096 Hybrid routing strategy; only independent merge-only execution is implemented.
min_body_stmts integer 4 minimum=0.0 Minimum function body statement count.
mode string auto enum=["auto","source","binary","hybrid","rust","swift"], maxLength=4096 Scan router mode.
nullable_allocations boolean False Treat allocation results as nullable.
paths array maxItems=256 Source paths; positional on the CLI.
per_query_ms integer 6000 minimum=0, maximum=60000 Per-query solver timeout in milliseconds.
processes integer 0 minimum=0, maximum=32 Source worker process count; zero selects automatically.
source_detectors array maxItems=256 Source-side hybrid detector override.

Hidden compatibility aliases

Deprecated alias Canonical replacement
fold.get_job_findings fold.scan_job_findings
fold.activate_scan_job fold.scan_activate
fold.scan_project fold.scan
fold.scan_rust fold.scan
fold.scan_swift fold.scan
fold.scan_binary fold.scan
fold.find_duplicates fold.scan
fold.find_dead_code fold.scan
fold.find_duplicate_classes fold.scan
fold.find_security_issues fold.scan
fold.find_binary_security_issues fold.scan