Code

code: 7 operations.

Also for this capability: API · CLI · MCP · SDKs

code: 7 operations. Name one in "op" and pass that operation's own arguments in "input". describe returns an operation's input schema.

Toolcode
Addresshttps://api.hanzo.ai/v1/mcp
Methodtools/call (JSON-RPC 2.0)
Arguments2, 1 required
OperationGET /v1/code/ask · GET /v1/code/file · GET /v1/code/search · GET /v1/code/tree
Productcode

Arguments

FieldTypeRequiredDefaultValuesDescription
inputobject———arguments for the chosen op
opstringyes——one of the operations below

op — what each one does:

  • get_code_ask — Answers a question about the caller org's code with a CITED answer: retrieval packs grounding context, then the synthesizer writes the answer over exactly those spans, which come back alongside it.
  • get_code_file — Returns the INDEXED content of one file — read_file over the chunks the search tiers hold, for pulling up code an agent just found.
  • get_code_search — Finds code in the caller org's index across three orthogonal retrieval tiers fused by reciprocal-rank fusion: lexical (FTS5 trigram over code-tokenized text), symbolic (real definition and reference edges), and semantic (embedding cosine over AST-boundary chunks).
  • get_code_tree — Returns one repository's file structure with a per-file symbol count — get_repo_structure over the org's own index, with no git checkout involved.
  • create_code_ask — Answers a question about the caller org's code with a CITED answer, taking the question from the request BODY, for a question too long or too awkward to put in a URL.
  • create_code_context — Packs the most relevant code for a query into a token budget — THE primitive for a coding agent that has to decide what to put in a prompt.
  • create_code_index — (re)indexes a repository for the caller's org, incrementally: files whose content hash is unchanged are skipped, so re-sending a whole tree is cheap.

tools/list declares a type, a description, which fields are required and an enumerated value set for each field and nothing further, and every column above is MCP's own. This tool takes an operation name and that operation's arguments, so what the document constrains is what goes inside input, field by field, on the operation you name — ask describe for that. A — means MCP does not constrain the field.

Call it

A tools/call carries every argument in one flat object — nothing binds to a path or a query string. This call carries exactly the arguments the operation requires, so it is the smallest one that can run.

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "code",
         "arguments": {
           "op": "get_code_ask"
         }
       }
     }'

Values are the operation's own defaults and enumerated values where it declares them, and a <placeholder> where neither source declares one. tools/list needs no credential; tools/call does — called without one MCP answers HTTP 200 with a JSON-RPC result whose isError is set and whose text says what was missing. How to get a key →

The operation behind it

code dispatches to 7 operations. 4 of them MCP names exactly as the document ids them, and those are below; for the rest MCP has its own verb, which describe resolves.

OperationRouteProductSummary
get_code_askGET /v1/code/askcodeAnswers a question about the caller org's code with a CITED answer: retrieval packs grounding context, then the synthesizer writes the answer over exactly those spans, which come back alongside it.
get_code_fileGET /v1/code/filecodeReturns the INDEXED content of one file — read_file over the chunks the search tiers hold, for pulling up code an agent just found.
get_code_searchGET /v1/code/searchcodeFinds code in the caller org's index across three orthogonal retrieval tiers fused by reciprocal-rank fusion: lexical (FTS5 trigram over code-tokenized text), symbolic (real definition and reference edges), and semantic (embedding cosine over AST-boundary chunks).
get_code_treeGET /v1/code/treecodeReturns one repository's file structure with a per-file symbol count — get_repo_structure over the org's own index, with no git checkout involved.

The same capability over plain HTTP is in the code API reference, on https://api.hanzo.ai.


All 120 tools · MCP · API reference

Generated from tools/list on https://api.hanzo.ai/v1/mcp — 120 tools captured 2026-09-30.

Was this page useful?