Skip to content
Canopy is in pre-release. These docs describe the product at its public launch — commands, tool names, and integration examples reflect what you'll see once binaries ship. Join the waitlist →

canopy_answer Reference

Canopy exposes one tool over the Model Context Protocol: canopy_answer. One natural-language question goes in; one answer comes out. Routing, retrieval, and synthesis run server-side in a single call.

The v1 catalog of 31 granular tools (canopy_search, canopy_extract_symbol, canopy_prepare, …) was removed in v2. It is history, not surface — see the changelog.


canopy serve starts the MCP stdio server for a repository. It speaks JSON-RPC 2.0 on stdin/stdout.

Terminal window
canopy serve <repo> # stdio MCP server
canopy serve <repo> --answer # implies --watch; bootstraps the full-text index if missing
canopy serve <repo> --print-mcp-config # print the wiring snippet and exit (does not start the server)
  • --print-mcp-config emits the exact config block for your agent; --client claude (default), cursor, or zed selects the format.
  • --answer only governs index bootstrap and watching. The tool surface is always the single canopy_answer tool, with or without the flag.
  • canopy setup wires every detected MCP editor automatically during onboarding.

See the CLI Reference for all serve flags.


NameTypeRequiredDescription
questionstringyesThe natural-language question. Keep backticks around file paths, directories, and symbol names (e.g. `src/lib.rs`, `MyStruct`) so the classifier can locate them. Name the entity type — “the function foo”, not just “foo”. Phrasing picks the recipe.
formatstringnoOutput density. "concise" (default): ~200–500 chars. "standard": fuller answer with citations.
max_internal_callsintegernoCap on internal tool-handler calls (default 3, max 8).

Example:

{ "question": "what depends on `src/api/handler.ts`?", "format": "standard" }

Phrasing picks the recipe. A precise shape beats a vague “how does X work”. The recognized shapes:

AskRecipeReturns
where is the function/struct/class `Sym` defined?locateWhere the symbol is defined
show `Sym` in `path`extractThe symbol’s source code
what does `path` do?explainWhat the file does
public surface of `path`public surfaceThe file’s public API
what depends on `path`? / what calls `Sym`?dependentsDependents / callers — blast radius
what does `path` import?importsThe file’s imports
who last changed `path`?ownershipWho last changed it
what tests cover `path`? / coverage of `path`tests / coverageTests covering it, coverage data
is `path` reachable / dead code?wiringReachable-or-dead verdict
are there import cycles?cyclesImport cycles in the graph
what should I know before editing `path`?pre-edit dossierCombined pre-edit briefing for the file
list functions defined in `dir/`filtered symbolsSymbols under a directory, filtered by kind
architecture overviewarchitectureModule-level overview of the repo
how does <concept> work?semantic fallbackWeakest shape — prefer a specific one above

Routing is deterministic: a corpus-validated classifier maps the question to a recipe. No LLM call, no network. It scores 360/360 on its labelled regression corpus.


When nothing clears the relevance floor (cross-encoder-calibrated), the answer is “No strong match in this repository for …” — not a relay of tangential files. An empty answer is signal, not noise.


Tiercanopy_answer behavior
CommunityKeyword recipes over the local AST + full-text index
Solo and aboveAdds semantic (embedding-backed) recipes

canopy answer "<question>" is the same routed call from a shell. The repo is auto-detected from the current working directory; pass an optional path to override. See CLI Reference.