MCP · 12. Tool reference, part 1

This is the complete contract for the first 70 of the daemon's 118 MCP tools, grouped exactly as the code groups them. The remaining 49, coordination, GitHub, substrate, features, traces, approvals, orchestrators and punchcards, are in chapter 13. Nothing has been summarised away.

This chapter is reference. For how the catalogue is filtered, what token_budget does when omitted, and what the four JSON-RPC methods are, read chapter 11 first.

12.0 How to read these tables

Grouping follows the section banners in crates/crux-mcp/src/tools/mod.rs, which is also the order list_tools_with_flags() emits.

ColumnMeaning
DefinitionLine in crates/crux-mcp/src/tools/mod.rs where the ToolDefinition literal starts
HandlerThe arm call_tool() dispatches to (mod.rs:2881 onward)
Surface[local] or [hosted], from marker_for_tool (tool_surface.rs:215). Only three tools are [hosted]; everything else defaults [local] (tool_surface.rs:212)
token_budgetrequired means it is in the schema's required[] and the call fails without it. default N means it is optional and silently defaults. unbounded means it is accepted and does not bound the result. - means the schema has no such parameter
FlagThe environment variable gating the tool, with its default. - means always on

Capability. Unless a group says otherwise, the RCX capability string for a tool is crux-mcp.<tool_name> (mod.rs:2713). The one exception in this chapter is retrieval, 12.5. Where a tool is a loopback proxy onto the daemon's own HTTP API, the HTTP scope it presents is named in the group's preamble.

Envelope. Every response is additionally wrapped in the standard MCP {"content": [{"type":"text", …}]} envelope. The "Output" lines below describe what is inside it, and reproduce tool_output_docs() (mod.rs:2728), the canonical machine-readable output contract, also served through get_bootstrap(topic="tool-output").

Flag parsing is not uniform. Six incompatible dialects decide what counts as "on". FLAG=yes enables one tool and disables another. Before setting anything in the Flag column, read chapter 15, section 15.1.

12.1 Session handshake

ToolDefinitionHandlerSurfacetoken_budgetFlag
cuecrux_sessionmod.rs:163cuecrux_session.rs:62[local]-,

Opens a CueCrux session and returns a typed capability plan covering retrieval, proofing, memory, journaling and audit, for both local and hosted deployments.

It is listed first on purpose (mod.rs:125), and every other tool's description carries a pointer back to it via CUECRUX_SESSION_HINT (mod.rs:119, appended at :2454).

Schema, cuecrux_session.rs:32. additionalProperties: false at both levels.

ParamTypeRequiredDefaultConstraints
intentstringno-Free text. Recorded per-passport and re-read by the next tools/list for dynamic surface shaping. Only five values carry weight, see 11.10
hintsobjectno-additionalProperties: false
hints.prefer_bulkbooleanno-
hints.max_capabilitiesintegerno-minimum: 0
hints.want_parent_chainbooleanno-
hints.hide_exclusionsbooleannofalseSuppresses the capability graph's excluded list

Output: a SessionPlan of plan_id, session_id, passport, channels (bulk optional, mcp), capability_graph[], receipt (hash, signature optional, signer_kid optional, mode), budget, minted_at, session_ttl_s.

Side effect: calls passport::auto_issue_if_mapped(ctx) first, idempotent, and a no-op when CORECRUXD_AGENT_PASSPORTS is off or the agent is unmapped. Requires ctx.daemon_base_url; returns INTERNAL_ERROR if the MCP server was not wired to corecruxd.

12.2 Autonomy contract

ToolDefinitionHandlerSurfacetoken_budgetFlag
autonomy_contractmod.rs:169autonomy.rs:244[local]unboundedCORECRUXD_FEATURE_AUTONOMY_CONTRACT, default off

Returns the calling passport's per-tool {allowed, scope, cost_credits, why_denied?} matrix against the current RCX capability token. Metadata only; it reads no memories.

Schema, autonomy.rs:67. additionalProperties: false.

ParamTypeRequiredDefaultConstraints
token_budgetintegerno-minimum: 1. Approximate, and ignored when 0. Omitted means no trim, the full matrix is returned (autonomy.rs:218)

Output: {feature_enabled, passport_id, tier, token_id, token_hash, capabilities: [{name, allowed, scope, backend_id, mode, cost_credits, why_denied?}], summary: {total_tools, returned, allowed, denied, truncated_by_token_budget}}. With the flag off: feature_enabled: false and an empty capabilities.

Passport-attributed: it reflects only the calling passport. You cannot enumerate another's. Reserved-prefix tools come back allowed: false with why_denied: "reserved-prefix tool" for non-operator callers.

12.3 Reuse check

ToolDefinitionHandlerSurfacetoken_budgetFlag
reuse_checkmod.rs:175reuse.rs:55[local]-CORECRUXD_FEATURE_REUSE_CHECK, default off

"Does this already exist?", ranked reuse candidates for a one-line description of what you are about to build, fused from the tenant retrieval index and the Features lens.

ParamTypeRequiredDefaultConstraints
tenant_idstringyes-Tenant for the scoped search
descriptionstringyes-One line: what you are about to build
limitintegerno5Maximum candidates per source
min_scorenumberno-Minimum relevance threshold

Output: {schema, verdict, retrieval_candidates: [{result_id, rank, score, doc_length_tokens}], capability_candidates: [{id, name, system, maturity, files, overlap_terms}], guidance} where verdict is reuse-candidate-found or nothing-found. With the flag off: CAPABILITY_DENIED (reuse.rs:47).

Note the asymmetry: this tool has no token_budget despite being a retrieval fan-out. Bounding is via limit only.

12.4 Engrams: pre-execution overlays

ToolDefinitionHandlerSurfacetoken_budgetFlag
engram_resolvemod.rs:199engrams.rs:53[local]-CORECRUXD_FEATURE_ENGRAM_MCP, default off

Resolves pre-execution behavioural overlays from the local catalog. Two modes: omit names for the content-free manifest, which is the session-discovery path; pass names for full content when the caller's capability class allows it.

ParamTypeRequiredDefaultConstraints
namesarray<string>no-name@version entries, maximum 20. Omit for manifest mode
model_idstringno-Caller model id; derives the capability class (fast, capable, frontier)
intent_bucketstringno-Filter to one intent bucket
tenant_idstringnolocal

Output, manifest mode: {schema, capability_class, engram_manifest}. Resolve mode: {schema, capability_class, engrams: [{name, version, intent_bucket, content, prompt_hash, applicable_why}], engram_set_hash, manifest_hash}. With the flag off: CAPABILITY_DENIED.

12.5 Retrieval

ToolDefinitionHandlerSurfacetoken_budgetFlag
querymod.rs:223query.rs:22[local]unbounded-
query_scanmod.rs:245query.rs:174[local]not in schema-
query_expandmod.rs:264query.rs:257[local]-,

Capability: all three share corecrux.query.local, not crux-mcp.<name>, the one special case in rcx_capability_for_tool (mod.rs:2717). A grant of one is a grant of all three.

Omitting token_budget on query returns unbounded results (query.rs:120). There is no default and no clamp. See 11.11.

query

Lexical and graph fusion. Returns scored results with query coverage.

ParamTypeRequiredDefaultConstraints
tenant_idstringyes-
querystringyes-Natural-language query
limitintegerno10
token_budgetintegerno-"Optional token budget for result trimming". Omitted means no trimming at all
min_scorenumberno-

Output: {results: [{doc_id, score, segment_index, token_count}], coverage: {score, gaps, below_floor}, meta: {backend, took_ms, segments_searched}}.

query_scan

Metadata-only scan, no content. Use it to decide what to expand.

ParamTypeRequiredDefault
tenant_idstringyes-
querystringyes-
limitintegerno20

Output: {results: [{doc_id, score, token_count}], meta: {took_ms, segments_searched}}, plus tokens_returned and budget_truncated (query.rs:227).

No token_budget parameter exists in this tool's schema. The handler reads one if it is passed (query.rs:202), so passing it works and is not an error, but no schema advertises it, and omitting it applies no trim.

query_expand

Expands prior result ids to full content.

ParamTypeRequiredDefault
tenant_idstringyes-
result_idsarray<string>yes-

Output: {results: [{doc_id, content, token_count}]}. Also no token_budget.

All four retrieval-shaped tools, the three above plus query_facts, advertise the CRC-v1 output contract via x-crux-output-schema (crc_v1.rs:380).

12.6 Facts

ToolDefinitionHandlerSurfacetoken_budgetFlag
store_factmod.rs:286facts.rs:113[local]-,
query_factsmod.rs:317facts.rs:422[local]unbounded-
delete_factmod.rs:347facts.rs:615[local]-,
list_entitiesmod.rs:361facts.rs:651[local]-,
get_bootstrapmod.rs:372facts.rs:829[local]-,
fact_historymod.rs:398facts.rs:375[local]-,

store_fact

Writes one fact.

ParamTypeRequiredDefaultConstraints
entitystringyes-
keystringyes-
valuestringyes-
source_receiptstringno-CROWN receipt reference
confidencenumberno1.00 to 1
privatebooleannofalseScopes the fact to the calling agent under an __agent::<name>:: prefix
horizon_classstringno-One of volatile, medium, stable, none. Omit for the entity-prefix default
freshness_horizonstringno-Free-text horizon line, parsed to a horizon_class when horizon_class is omitted
supersedesarray<string>no-fact_ids this write explicitly retires, across entities. Each must exist and be visible to the caller, else the call is rejected. Reversible

Output: {fact_id, entity, key, version, superseded_fact_ids: [string]}.

query_facts

Ranked by effective confidence: a fact past its freshness horizon is demoted to half its stored confidence for ranking only, a binary stale-demotion, not a continuous decay curve. Stored confidence is never mutated. Emits the audit envelope when CORECRUXD_FEATURE_AUDIT_ENVELOPE is on.

ParamTypeRequiredDefaultConstraints
querystringno-Keyword search across values, keys and entities
entitystringno-Filter to one entity, exact match
top_kintegerno10
token_budgetintegerno-Omitted means the whole top_k is returned untrimmed
include_supersededbooleannofalseWhen true, retired facts are returned and superseded_by is exposed
as_ofstringno-RFC 3339 bi-temporal filter: facts whose valid-time interval contains the instant, regardless of when they were learned
min_effective_confidencenumberno-Floor from 0 to 1 on recall-time effective confidence. structuredContent.filtered_below_threshold distinguishes "no facts" from "nothing above the floor"

Output: {rows: [{fact_id, entity, key, value, confidence, effective_confidence, horizon_class, freshness, age_hours, superseded_by?}]}.

The schema has no required[] array at all, every parameter is optional, so a bare {} is a valid full-store scan.

There is no entity_prefix parameter and no key parameter. Both are silently dropped if passed; the handler hardcodes entity_prefix: None (facts.rs:487). An unfiltered top-10 comes back and reads like an answer. This is drift item 1 in chapter 15.

delete_fact

Soft delete; the receipt is preserved.

ParamTypeRequired
fact_idstringyes

Output: {deleted, fact_id}.

list_entities

No parameters, the schema declares properties: {}.

Output: {entities: [string]}, sorted, deduplicated, entities holding at least one active fact.

get_bootstrap

Queries bootstrap knowledge under the __bootstrap__:: entity prefix. Topic taxonomy and content sources are in 11.12.

ParamTypeRequiredDefaultConstraints
topicstringno-Normalised at facts.rs:882. doc and docs become doc; pattern and patterns become pattern; error, errors, resolution, resolutions become resolution; tool, tool-output, tool-outputs become tool-output. Anything else passes through verbatim
querystringno-Narrowing search term

Output: {facts: [{entity, key, value}], total_tokens}, rendered one line per fact as [entity] key = value (facts.rs:854).

There is no token_budget parameter (mod.rs:378); the handler hardcodes top_k: 100, token_budget: None (facts.rs:844). Passing one is ignored, not rejected. This is drift item 3 in chapter 15.

fact_history

Full version chain for one (entity, key) pair.

ParamTypeRequired
entitystringyes
keystringyes

Output: {versions: [{fact_id, value, version, supersedes, confidence, stored_at, deleted}]}.

12.7 Acknowledged memory use

ToolDefinitionHandlerSurfacetoken_budgetFlag
memory_acknowledge_usemod.rs:416memory_use.rs:119[local]-CORECRUXD_FEATURE_MEMORY_ACK, default off

Declares which stored fact ids were consulted while producing the current turn, so a host can render "I used this" annotations. Requires an authenticated passport. Emits the audit envelope.

ParamTypeRequiredDefaultConstraints
turn_idstringyes-Opaque per-host turn identifier
fact_idsarray<string>no-Fact ids consulted. Reserved-prefix entries (__agent::, __ops::, __bootstrap__::) are stripped
intentstringnoanswerOne of answer, decision, tool_call, implicit, documented in the description, not enforced as a JSON-Schema enum
retrieved_chunk_idsarray<string>no-Paid tier only; ignored on the free tier
confidencenumberno-0 to 1
notestringno-

Output: {turn_id, intent, feature_enabled, receipt_ref, memories_used: [{fact_id, topic, age_days}], filtered_count, redacted_count, not_found_count, not_visible_count}.

12.8 Verifiable output receipts

ToolDefinitionHandlerSurfacetoken_budgetFlag
output_attestmod.rs:453output_attest.rs:236[local]admission gateCORECRUXD_FEATURE_C2PA_OUTPUT, default off

Binds a produced artefact to a CROWN receipt as a C2PA manifest. Reuses the daemon's existing Ed25519 CROWN signer, no new key class. Verifiable offline via corecruxctl output-verify and online at /v1/output/verify.

ParamTypeRequiredDefaultConstraints
content_bytes_base64stringsee note-Base64 content
content_pathstringsee note-Local path the daemon reads
content_typestringno-MIME type
receipt_idstringyes-The CROWN receipt this artefact binds to
claim_generatorstringnocuecrux/<version>
token_budgetintegerno-Soft cap on content size in tokens, roughly bytes divided by 4

Note: one of content_bytes_base64 or content_path is required in practice, but the schema's required[] lists only receipt_id. Supplying neither fails in the handler, not in schema validation.

token_budget here is an admission gate, not a trimmer (output_attest.rs:285): content larger than the budget is rejected with -32602 and the message content size N bytes (~M tokens) exceeds token_budget B. Omitting it means no size gate.

Output: {content, manifest: {manifest_id, spec_version, manifest_jumbf_base64, content_hash_blake3_hex, crown_receipt_id, signer_key_id, signer_passport, verify_url, verify_command, ai_act_notice}}.

Signer mode has its own flag, CORECRUXD_FEATURE_C2PA_X509_SIGNER, default off (output_attest.rs:72), together with CORECRUXD_C2PA_SIGNER_BACKEND, _KEY_ID and _SIGNING_KEY_B64.

12.9 Scoped forget

ToolDefinitionHandlerSurfacetoken_budgetFlag
memory_forgetmod.rs:480forget.rs:381[local]unboundedCORECRUXD_FEATURE_SCOPED_FORGET, default ON
memory_forget_dry_runmod.rs:514forget.rs:316[local]unboundednone, always available

The dry-run tool is explicitly not flag-gated: "Always available, does not require the feature flag" (mod.rs:518). Preview before you erase.

memory_forget's own catalogue description is wrong about its own flag. The description at mod.rs:484 states the tool "requires … feature flag CORECRUXD_FEATURE_SCOPED_FORGET=1", implying default-off. The code defaults it ON, forget.rs:76 ends .unwrap_or(true). An operator reading the tool description will believe a live erasure tool is disabled. Trust the code. Full disclosure in chapter 15.

The parser is strict (v == "1" || v.eq_ignore_ascii_case("true")), so setting the flag to yes or on disables the tool. CORECRUXD_FEATURE_SCOPED_FORGET=0 is the correct way to disable it.

Recovery window: CORECRUXD_FORGET_RECOVERY_WINDOW_DAYS, default 7, minimum 1 (forget.rs:79).

memory_forget

ParamTypeRequiredDefaultConstraints
scopeobjectyes-Typed selector, oneOf five shapes, each requiring type and value: entity_prefix, key_glob, passport_id, before_timestamp (a date-time value), tenant_id
reasonstringyes-Audit-record requirement
tenant_idstringnodefaultThe tenant the receipt is attributed to
token_budgetintegerno-Caps the number of facts the resolver touches. Omitted means the resolver touches everything in scope

Output: {content, forget_receipt_id, facts_affected, recovery_window_seconds, recovery_window_ends_at, receipt_body_cbor_hex, receipt_body_hash_hex, scope, passport_id}. Soft-deletes, filters reserved prefixes, and emits a signed Forget receipt naming the initiating passport.

memory_forget_dry_run

ParamTypeRequiredDefaultConstraints
scopeobjectyes-The same typed scope, but the dry-run schema declares it only as {"type":"object"} with no oneOf mirror
token_budgetintegerno-No description in the schema. Omitted means unbounded

Output: {content, scope, count, facts_that_would_be_affected: [{fact_id, entity, key, stored_at, tokens}], dry_run: true}. Excludes __agent::, __ops::, __bootstrap__:: and __agent_session::.

12.10 Memory panel

ToolDefinitionHandlerSurfacetoken_budgetFlag
memory_viewmod.rs:539memory.rs:155[local]default 2000CORECRUXD_FEATURE_MEMORY_PANEL, default on; =0 disables
memory_editmod.rs:562memory.rs:310[local]-same
memory_pinmod.rs:584memory.rs:443[local]-same
memory_historymod.rs:604memory.rs:518[local]-same

memory_view

Paginated, narrative-friendly consumer read. Filters __agent::, __ops::, __bootstrap__:: and __memory_pin::.

ParamTypeRequiredDefault
entitystringno-
keystringno-
top_kintegerno20
token_budgetintegerno2000, applied at memory.rs:170, documented in the description only, not as a schema default key

Output: {content, structuredContent: {facts: [{id, entity, key, value, version, stored_at, confidence, pinned, source_receipt}], total_tokens, returned}}.

memory_edit

Creates a new version superseding the prior fact. Requires an authenticated identity. Reserved-prefix entities are refused.

ParamTypeRequired
fact_idstringyes
new_valuestringyes
reasonstringno, embedded as memory_edit:<reason> in the new fact's source_receipt

Output: {content, structuredContent: {old_fact_id, new_fact, reason}}.

memory_pin

Pinned facts survive decay and scoped forget. Pin state is per-agent under the reserved __memory_pin::<agent>:: entity, so it never leaks across agents.

ParamTypeRequiredDefault
fact_idstringyes-
pinnedbooleannotrue

Output: {content, structuredContent: {fact_id, pinned}}.

memory_history

Accepts either {entity, key} or {fact_id}. The schema has no required[]. Reserved prefixes are refused, use the operator-side fact_history for those.

ParamTypeRequired
entitystringno
keystringno
fact_idstringno

Output: {content, structuredContent: {versions: [{id, value, version, stored_at, supersedes, deleted, source_receipt}]}}.

12.11 Freshness and decay

ToolDefinitionHandlerSurfacetoken_budgetFlag
memory_freshnessmod.rs:625freshness.rs:97[local]default 500CORECRUXD_FEATURE_FRESHNESS, default on; =0 disables
memory_sweep_candidatesmod.rs:647freshness.rs:184[local]default 500same
memory_set_horizonmod.rs:723freshness.rs:348[local]-same
memory_reverifymod.rs:743freshness.rs:407[local]-same

With the flag off, all four return CAPABILITY_DENIED (freshness.rs:68).

memory_freshness

Per-fact decay state. Read-only. Emits the audit envelope.

ParamTypeRequiredDefault
entitystringno-
keystringno-
top_kintegerno20
token_budgetintegerno500 (declared in the schema at mod.rs:638)

Output: {rows: [{fact_id, entity, key, horizon_class, freshness, age_hours, stored_at, reverified_at?}], policy: {volatile_stale_hours, medium_stale_days, stable_stale_days}, now}. freshness is fresh, stale or unknown.

memory_sweep_candidates

Read-only janitor: facts that are stale or explicitly superseded. Non-mutating.

ParamTypeRequiredDefault
top_kintegerno50
token_budgetintegerno500 (declared at mod.rs:661)

Output: {content, structuredContent: {rows: [{fact_id, entity, key, reason, freshness, horizon_class, age_hours, superseded_by?, stored_at}], dry_run: true, now}}. reason is stale, superseded or stale+superseded.

memory_set_horizon

Requires an authenticated passport. Reserved-prefix facts cannot be re-classified here.

ParamTypeRequiredConstraints
fact_idstringyesForm f_…
horizon_classstringyesOne of volatile, medium, stable, none

Output: {fact_id, horizon_class, ok}.

memory_reverify

Re-anchors the decay clock without rewriting the value, and records a CROWN-verifiable Reverify receipt under __reverify_receipts__::<fact_id>. Requires an authenticated passport.

ParamTypeRequired
fact_idstringyes

Output: {fact_id, receipt_id, receipt_class: 'Reverify', reverified_at}.

12.12 Contradiction surfacing and safe consolidation

ToolDefinitionHandlerSurfacetoken_budgetFlag
memory_contradictionsmod.rs:671consolidation.rs:90[local]default 500CORECRUXD_FEATURE_CONSOLIDATION, default on; =0 disables
memory_consolidatemod.rs:693consolidation.rs:155[local]-same

memory_contradictions

Read-only detection of active, non-superseded facts that share an (entity, key) but carry opposite deterministic polarity, enabled against disabled, active against inactive. It detects and surfaces only. It never resolves.

ParamTypeRequiredDefault
limitintegerno50
token_budgetintegerno500 (declared at mod.rs:684)

Output: {content, structuredContent: {candidates: [{entity, key, reason, polarity_a, polarity_b, fact_ids: [string], values: [string]}], count, limit, dry_run: true}}.

memory_consolidate

An explicit write: collapse named targets under one (entity, key) into a canonical fact, superseding the targets with history preserved, and emitting a consolidation receipt. Requires an authenticated passport.

ParamTypeRequiredDefaultConstraints
entitystringyes-Shared by all targets and the canonical fact
keystringyes-Shared by all targets and the canonical fact
canonical_valuestringyes-The surviving value
target_fact_idsarray<string>yes-Non-empty. Each must be in (entity, key) and unprotected
protected_fact_idsarray<string>no-Caller-pinned ids. If any appears in target_fact_ids the call is rejected
confidencenumberno1.0For the canonical fact
protected_confidence_floornumberno0.99Targets at or above the floor are refused
consolidation_idstringnoautoStable receipt id
horizon_classstringno-One of volatile, medium, stable, none

Output: {content, structuredContent: {status: 'consolidated', receipt: {consolidation_id, canonical_fact_id, superseded_fact_ids: [string], source_fact_ids: [string]}}}.

Refuses protected targets, pinned, receipt-linked, private or high-confidence, with CAPABILITY_DENIED and a reason.

12.13 Artefacts: deferred output parking

ToolDefinitionHandlerSurfacetoken_budgetFlag
artefact_putmod.rs:763artefacts.rs:141[local]unboundedCORECRUXD_FEATURE_ARTEFACTS, default off
artefact_getmod.rs:787artefacts.rs:196[local]unboundedsame
artefact_listmod.rs:807artefacts.rs:246[local]unboundedsame

All three describe token_budget as "Mandatory output-token cap (QC.2)" and none of them list it in required[], and none validate it. The prose is wrong; the schema is the contract. Sources: mod.rs:778, :798, :819.

artefact_put

Content-addressed with BLAKE3: identical bytes always produce the same id. Requires an authenticated passport.

ParamTypeRequiredDefaultConstraints
content_bytes_base64stringyes-Base64 content
mime_typestringyes-Free-form MIME label
tool_originstringno-Which tool produced this; surfaced in artefact_list
ttl_secondsintegerno7 daysMaximum 90 days. 0 means no expiry
token_budgetintegerno-Not validated

Output: {content, structuredContent: {artefact_id, mime_type, tool_origin, size_bytes, created_at, expires_at}}. Ids take the form art_<blake3_hex>.

artefact_get

ParamTypeRequired
artefact_idstringyes
token_budgetintegerno

Output: {content, structuredContent: {artefact_id, mime_type, tool_origin, size_bytes, created_at, expires_at, content_base64}}.

Cross-passport reads return CAPABILITY_DENIED, deliberately, so the operator can audit the attempt.

artefact_list

Passport-scoped, newest first. Emits the audit envelope, surfacing parked artefact ids as memories_used[].

ParamTypeRequiredDefault
top_kintegerno20
scopestringno, Substring filter on mime_type or tool_origin
token_budgetintegerno-

Output: {content, structuredContent: {artefacts: [{artefact_id, mime_type, tool_origin, size_bytes, created_at, expires_at}], count}}. Reserved-prefix mime entries are filtered; cross-passport entries are never included.

12.14 Sessions

ToolDefinitionHandlerSurfacetoken_budgetFlag
get_sessionmod.rs:829sessions.rs:16[local]-,
save_sessionmod.rs:845sessions.rs:39[local]-,
session_checkpointmod.rs:881sessions.rs:77[local]required-
list_sessionsmod.rs:907sessions.rs:130[local]-,
delete_sessionmod.rs:918sessions.rs:153[local]-,
archive_sessionmod.rs:932sessions.rs:183[local]-,
unarchive_sessionmod.rs:947sessions.rs:188[local]-,

Sessions are namespaced per agent via scoped_session_id, becoming __agent_session::<agent>::<id> (scope.rs:124). Anonymous callers get the raw id.

get_session

ParamTypeRequired
session_idstringyes

Output: {session_id, state, updated_at, total_tokens}.

save_session

ParamTypeRequiredConstraints
session_idstringyes
stateobjectyesArbitrary JSON. Two conventional optional keys are read by the console and every session lens: state.title, a short human name, and state.summary, one paragraph. Both plain strings, both optional. Absent means the console falls back to decisions[0], then note, then context_summary, then summary, then a short id, and labels the row untitled. Everything else is opaque and preserved verbatim
ttl_secondsintegernoThe session expires after this duration

Output: {session_id, updated_at}. Writer identity is stamped automatically; there is no argument for it, and anonymous callers store no identity rather than a guessed one.

session_checkpoint

The only session tool that requires token_budget. Stores a compact crux.session_checkpoint.v1 state scoped to the calling agent.

ParamTypeRequiredConstraints
session_idstringyes
token_budgetintegeryesMust be greater than 0. Omitting it fails with -32602
objectivestringno
current_milestonestringno
decisionsarraynoitems: {}, untyped elements
open_questionsarraynoitems: {}
files_touchedarray<string>no
commands_runarray<string>no
test_statusanynoThe schema declares only a description, no type
next_actionstringno
ttl_secondsintegerno

Output: {content, structuredContent: {session_id, updated_at, total_tokens}}.

list_sessions

ParamTypeRequiredDefault
include_archivedbooleannofalse

Output: {sessions: [string]}, sorted.

There is no prefix or pattern filter. include_archived is the only parameter (mod.rs:909). Passing anything else is silently ignored and you get every visible session. This is drift item 6 in chapter 15.

delete_session

Destructive. Prefer archive_session.

ParamTypeRequired
session_idstringyes

Output: {deleted, session_id}.

archive_session

Soft and reversible: state is preserved in full and hidden from the default list_sessions view.

ParamTypeRequired
session_idstringyes
reasonstringno

unarchive_session

Restores a session to the default listing.

ParamTypeRequired
session_idstringyes

12.15 Hardening and audit posture

ToolDefinitionHandlerSurfacetoken_budgetFlag
route_access_matrixmod.rs:961hardening.rs:78[local]-,
execplan_gatemod.rs:971hardening.rs:14[local]required-
auth_posture_auditmod.rs:993hardening.rs:127[local]-,
egress_policy_checkmod.rs:1003hardening.rs:150[local]-,

route_access_matrix

No parameters. Returns the static high-risk HTTP route gate matrix.

Output: {content, structuredContent: {routes: [{route, required_any_scope: [string], passport_binding, tenant_binding, notes}]}}.

execplan_gate

Records a milestone gate as a stable fact under entity execplan:<slug>, key gate:<milestone>.

ParamTypeRequiredConstraints
slugstringyesExecPlan slug without the execplan: prefix
milestonestringyesFor example M2 or gate:M2
statusstringyesOne of passed, failed, blocked, skipped
commit_shastringyes
token_budgetintegeryesMust be greater than 0
tests_passingbooleanno
artifactsarray<string>noFiles, logs, PR links
notesstringno

Output: {content, structuredContent: {fact_id, entity, key, commit_sha, status}}.

auth_posture_audit

No parameters.

Output: {content, structuredContent: {schema: 'crux.auth_posture_audit.v1', checked_at, mcp_agent, daemon_loopback_configured, rcx_router_configured, agent_passports_enabled, data_dir_configured, notes: [string], recommended_checks: [string]}}.

HTTP auth mode is deliberately not exposed through MCP. If you need it, read it on the daemon.

egress_policy_check

ParamTypeRequiredDefault
targetstringyes-
purposestringno-
allow_loopback_httpbooleannotrue
allow_plain_httpbooleannofalse

Output: {content, structuredContent: {schema: 'crux.egress_policy_check.v1', target, purpose, allowed, scheme, host, reasons: [string]}}. Policy: HTTPS is allowed; plain HTTP only for loopback, or under an explicit allow_plain_http.

12.16 Observability

ToolDefinitionHandlerSurfacetoken_budgetFlag
get_gapsmod.rs:1023observe.rs:22[local]-,

Sourced from the ops observation layer. Check it after a low-coverage query.

ParamTypeRequired
querystringno, keyword filter for gap descriptions

Output: {gaps: [{entity, key, value, stored_at}], total_tokens}.

There is no GET /v1/gaps HTTP route. This MCP tool, or GET /v1/features/capabilities/analysis/gaps, is the real surface. Drift item 2 in chapter 15.

12.17 Session observations

ToolDefinitionHandlerSurfacetoken_budgetFlag
list_observationsmod.rs:1041observations.rs:334[local]-CORECRUXD_OBSERVE, default off (daemon-side)
get_observationmod.rs:1063observations.rs:385[local]-same
verify_observationmod.rs:1078observations.rs:416[local]-same

Multi-provider capture. Each record carries an Ed25519 receipt verifiable against the daemon's published passport public key. The gate is daemon-side: CORECRUXD_OBSERVE (agentgraph_kinds.rs:139), route class at route_auth.rs:514.

list_observations

ParamTypeRequiredDefaultConstraints
session_idstringyes-
sincestringno-RFC 3339 lower bound on the observation timestamp
providerstringno-claude-code, openai, anthropic, codex-cli, openclaw, documented, not schema-enforced
limitintegerno50Maximum 500

Output: {session_id, count, observations: [{observation_id, session_id, ts, provider, principal, kind, payload, receipt: {alg, signed_by, body_hash, signature}}]}.

get_observation

ParamTypeRequired
session_idstringyes
observation_idstringyes

Output: a single observation record, or a not-found text response.

verify_observation

Re-canonicalises the record, recomputes the BLAKE3 body hash and verifies the Ed25519 signature.

ParamTypeRequired
session_idstringyes
observation_idstringyes

Output: {observation_id, ok, hash_match, signature_valid, recomputed_hash, receipt_hash, reason?}.

12.18 Receipt verification

ToolDefinitionHandlerSurfacetoken_budgetFlag
receipt_verifymod.rs:1097receipt_verify.rs:96[local]-CORECRUXD_FEATURE_RECEIPT_VERIFY, default off

Loopback scope: receipts:read (receipt_verify.rs:45). Requires an authenticated agent identity, the audit pattern is that only the signer or an operator re-verifies.

ParamTypeRequiredDefault
receipt_idstringyes-
tenant_idstringnodefault

Output: {content, receipt_id, tenant_id, feature_enabled, verified, signer_passport, errors: [string], http_status, report}. signer_passport may be null. With the flag off, report is omitted and errors is ["FEATURE_DISABLED"].

12.19 Agent identity

ToolDefinitionHandlerSurfacetoken_budgetFlag
get_agent_identitymod.rs:1121mod.rs:2854[local]-,
resolve_principalmod.rs:1132resolve_principal.rs:46[local]-,

get_agent_identity

No parameters. Output: {agent_name}, which is "anonymous" when no identity is authenticated (mod.rs:2855).

resolve_principal

Loopback scope sessions:read (resolve_principal.rs:25). additionalProperties: false. Proxies GET /v1/principal/resolve; tenant-scoped server-side.

ParamTypeRequiredNotes
session_idstringnoResolve the principal bound to this hex session id
passport_idstringnoResolve this passport directly, for example claude-work

Resolution order: explicit session_id, then explicit passport_id, then the caller's own passport key. With none of the three available it returns INVALID_PARAMS.

Output: {content, principal: {passport_id, category, tier, tier_rank, capabilities: [string], tenant_id, agent_work_gate, resolved_via, federation_grant?}, resolved_param}. resolved_via is session, passport or identity_link:<id>.

12.20 Handoff

ToolDefinitionHandlerSurfacetoken_budgetFlag
create_handoffmod.rs:1138tools/handoff.rs:24[local]-,
accept_handoffmod.rs:1170tools/handoff.rs:95[local]-,

Observation emission from handoffs is separately gated by CORECRUXD_HANDOFF_OBSERVATIONS, default off (tools/handoff.rs:198). Restart-durable handoff signing requires CRUX_MCP_HANDOFF_SECRET; without it, signing state is in-memory only (dispatch.rs:371).

create_handoff

ParamTypeRequiredDefaultConstraints
session_idstringyes-
include_factsbooleannofalseInclude relevant non-private facts
target_agentstringno-If set, only that agent may accept
messagestringno-
task_recordobjectno-A structured statement of intent, so the receiver need not reconstruct the task from facts
task_record.requesterstringno-
task_record.desired_outcomestringno-
task_record.sourcesarray<string>no-
task_record.acceptance_criteriaarray<string>no-
task_record.boundariesarray<string>no-
task_record.blocker_rulestringno-

Output: {package_json, content_hash, signature, relevant_fact_count}.

accept_handoff

ParamTypeRequired
packagestringyes, the JSON-encoded package returned by create_handoff

Output: {session_loaded, facts_loaded, verified, task_record?}.

12.21 Decisions

ToolDefinitionHandlerSurfacetoken_budgetFlag
record_decisionmod.rs:1187decision.rs:19[local]-,

Append-only, BLAKE3-hashed decision record stored as a fact. Queryable via query_facts under the entity prefix __decisions__::.

ParamTypeRequiredDefault
actionstringyes-
rationalestringyes-
alternativesarray<string>no-
confidencenumberno1.0
session_idstringno_default
context_refsarray<string>no-

Output: {decision_id, decision_hash, entity, action}.

12.22 Constraints and action enrichment

ToolDefinitionHandlerSurfacetoken_budgetFlag
declare_constraintmod.rs:1215constraint.rs:48[local]-,
get_constraintsmod.rs:1247constraint.rs:129[local]-,
check_constraintsmod.rs:1274constraint.rs:186[local]-,
audit_configmod.rs:1309audit.rs:53[local]-,
check_config_auditmod.rs:1349audit.rs:101[local]-,
enrich_actionmod.rs:1383action.rs:17[local]-,

declare_constraint

ParamTypeRequiredDefaultConstraints
constraint_typestringyes-One of boundary, relationship, policy, context_flag, shell_pattern. shell_pattern treats the assertion as a regex matched against tool_parameters.command for Bash and shell calls
assertionstringyes-Natural-language statement
severitystringnomediumOne of critical, high, medium, low. Critical constraints block actions

Output: {constraint_id, constraint_hash, constraint_type, assertion}.

get_constraints

ParamTypeRequiredDefaultConstraints
constraint_typestringno-One of boundary, relationship, policy, context_flag. shell_pattern is absent from this filter enum although it is a valid write-side type; you cannot filter for shell-pattern constraints
statusstringnoactiveactive or suspended

Output: {constraints: [{constraint_id, constraint_type, assertion, severity, status, created_at}], count}, sorted by severity.

check_constraints

Keyword matching against constraint assertions: critical matches block, high matches warn. The schema has no required[], a bare {} is accepted.

ParamTypeRequired
action_descriptionstringno
tool_namestringno: when supplied, the action is deterministically enriched before matching
tool_parametersobjectno
tenant_idstringno, included in the enrichment receipt

Output: {verdict, matched_constraints: [{constraint_id, assertion, severity, match_score}]}. verdict is pass, warn or block.

audit_config

Idempotent on sha256: re-auditing the same hash updates the path, auditor and timestamp. Records live under __ops::config-audit, keyed sha256:<hash>.

ParamTypeRequiredConstraints
pathstringyesAdvisory, the hash is the canonical identity
sha256stringyesLowercase 64-character hex
auditorstringyesPassport id, email, or free text
notestringnoPR link, ticket, or rationale

check_config_audit

Typical caller: a SessionStart hook that has just hashed settings.json, .mcp.json and CLAUDE.md.

ParamTypeRequiredConstraints
pathsarrayyesItems are {path, sha256} objects; both keys required per item

Output: {content, unaudited: [{path, sha256}], audited: [{path, sha256, audited_at, auditor, audited_path}]}.

enrich_action

The free and basic local enrichment path. Pro first-party enrichers live on the daemon HTTP route POST /v1/actions/enrich, not here.

ParamTypeRequiredDefault
tool_namestringyes-
tenant_idstringno-
tool_parametersobjectno{}
action_descriptionstringno-

Output: an EnrichedActionProposal of {schema, tenant_id, enrichment_mode, tool_call, narrative, affected_principals, affected_resources, state_diff, consequences, relationship_hits, consequence_metadata, enrichment_receipt}.

12.23 BYO audit trail

ToolDefinitionHandlerSurfacetoken_budgetFlag
audit_export_bundlemod.rs:1420audit_export.rs:108[local]requiredCORECRUXD_FEATURE_AUDIT_EXPORT, default off

Builds a self-contained, signed tar.zst of every fact-event in the window plus cross-references to source receipts. It re-verifies offline via corecruxctl audit-verify, no daemon, no network.

ParamTypeRequiredDefaultConstraints
token_budgetintegeryes-Caps total tokens swept. At least 1. Omitting it fails with -32602 and the message audit_export_bundle requires token_budget (QC.2)
since_tsstringno-RFC 3339, inclusive lower bound
until_tsstringnonowRFC 3339, exclusive upper bound
scopeobjectno-
scope.entity_prefixstringno-Restrict to matching entities
scope.include_reservedbooleannofalseOperator-only, requires an authenticated passport plus this flag. Silently ignored for non-operator callers

Output: {content, bundle_id, bytes_path, manifest_signature_b64, fact_count, receipt_count, scope, since, until, events_jsonl_sha256, receipts_cbor_sha256}. The bundle is persisted to CORECRUXD_AUDIT_EXPORT_DIR (audit_export.rs:85).

12.24 Passport

ToolDefinitionHandlerSurfacetoken_budgetFlag
issue_passportmod.rs:1455passport.rs:236[hosted], becoming [local] with CORECRUXD_AGENT_PASSPORTS=1-,
request_passport_mintmod.rs:1476mint_request.rs:118[local]-CORECRUXD_FEATURE_PASSPORT_MINT_REQUESTS, default off, controls presence, not just the marker
get_passportmod.rs:1502passport.rs:369[local]-,
revoke_passportmod.rs:1515passport.rs:479[local]-CRUX_PASSPORT_REVOCATION, default off, gates access refusal, not the tool

issue_passport

Requires an authenticated agent identity. This is the only tool whose surface tier a feature flag changes (mod.rs:2446), see chapter 14.

ParamTypeRequired
sponsor_idstringno

Output: {principal_id, reputation_tier, receipt_count, sponsor_id}.

request_passport_mint

Files a self-scoped operator-approval request. It mints nothing. This is the one tool whose existence in the catalogue is flag-controlled: it is filtered out at mod.rs:2440 while the flag is off, and dispatch fails closed with -32601 (mint_request.rs:22).

ParamTypeRequiredDefaultConstraints
requested_categorystringnothe caller's mapped real categoryOne of personal, work, public
reasonstringno-Maximum 2048 UTF-8 bytes

Output: {request_id, requester_id, requested_category, status: 'pending'}.

get_passport

No parameters. Auto-upgrades the tier when receipt thresholds are met. Tiers: unverified, basic at 10 or more receipts, established at 100, trusted at 500, elite at 2000.

Output: {principal_id, reputation_tier, receipt_count, sponsor_id, issued_at, passport_hash}.

revoke_passport

Terminal. Supersede rather than delete.

ParamTypeRequiredDefault
target_passportstringnothe caller's own passport, meaning self-revoke
reasonstringno-

Authorised for the passport itself, the passport's sponsor, or an elite-tier operator. Writes a receipted revocation event. Output: {content, revoked target_passport, revoker_passport, reason}; isError on unauthorised calls or when there is no passport.

Revocation enforcement. When ctx.revocation_enforced is set, call_tool refuses every tool for a revoked passport except a small read-only allowlist (mod.rs:2876). It fails open: only an explicit revoked_at blocks.

12.25 Identity continuity

ToolDefinitionHandlerSurfacetoken_budgetFlag
passport_splitmod.rs:1544identity.rs:195[local]required, minimum 1CORECRUXD_FEATURE_IDENTITY_CONTINUITY, default off
passport_mergemod.rs:1585identity.rs:412[local]required, minimum 1same
passport_link_devicemod.rs:1634identity.rs:667[local]required, minimum 1same

All three require the caller to hold operator tier, meaning trusted or above; cross-tenant operations are forbidden; each emits a CROWN receipt; and none is reversible at the fact level. With the flag off, all three return -32601 (identity.rs:72). Omitting token_budget returns -32602 with token_budget is required (positive integer) per QC.2 (identity.rs:90).

passport_split

Forks a passport into a new identity that inherits the source's facts via lineage read-through; future writes diverge.

ParamTypeRequiredConstraints
target_passportstringyesMust equal the calling agent's passport
new_passport_namestringyesMust share the source's tenant prefix
token_budgetintegeryesminimum: 1
reasonstringnoRecorded in the receipt body

Output: {content, new_passport_id, split_receipt_id, receipt_body_cbor_hex, receipt_body_hash_hex, tenant_id}.

passport_merge

Collapses two passports. The source is retired and its sessions become read-only references. conflict_policy is mandatory and explicit; it is never silently chosen.

ParamTypeRequiredConstraints
source_passportstringyesRetired into the target
target_passportstringyesThe survivor
conflict_policystringyesOne of prefer_source, prefer_target, error_on_conflict
token_budgetintegeryesminimum: 1
reasonstringno

The caller must own the source or the target. Output: {content, merged_passport_id, merge_receipt_id, conflicts_resolved, conflict_policy, receipt_body_cbor_hex, receipt_body_hash_hex, tenant_id, retired_passport_id}.

passport_link_device

ParamTypeRequiredDefaultConstraints
device_fingerprintstringyes-64-character lowercase BLAKE3 hex over the device's canonical attestation blob. Raw attestations are never stored
token_budgetintegeryes-minimum: 1
capabilities_subsetarray<string>no["facts:read"]Propagated to the linked device

Output: {content, link_receipt_id, passport_id, device_fingerprint, capabilities_subset, receipt_body_cbor_hex, receipt_body_hash_hex, tenant_id}.

12.26 Sync and update

ToolDefinitionHandlerSurfacetoken_budgetFlag
sync_pullmod.rs:1673sync.rs:88[hosted]-requires CORECRUXD_SYNC_REMOTE_URL and CORECRUXD_SYNC_API_KEY
sync_pushmod.rs:1695sync.rs:139[hosted]-same
sync_statusmod.rs:1717sync.rs:253[local]-,
update_statusmod.rs:1730update.rs:15[local]-,

sync_pull and sync_push are the only two tools that are hosted-gated regardless of feature flags. See chapter 14. Unconfigured, all three sync tools return sync not configured: CORECRUXD_SYNC_REMOTE_URL is not set (sync.rs:25). sync_pull requires a basic-tier passport (sync.rs:89); sync_push requires established (sync.rs:140).

sync_pull

Pulls shared cloud tenant facts into the local mirror, resuming from the last pull cursor. Local private memory stays local.

ParamTypeRequiredNotes
entity_prefixstringnoReserved for future use. Declared, not implemented
tenant_idstringnoPull the collection-aware mirror for this personal or business tenant instead of the legacy all-facts export

Output: {tenant_id?, facts_pulled, cursor, total_pull_count, collection_cursor_count}.

The handler signature is handle_sync_pull(_args, ctx) (sync.rs:88), arguments are ignored entirely, which is why entity_prefix is inert.

sync_push

Pushes only facts created locally and not previously synced. Private facts and sensitive entity prefixes are never pushed.

ParamTypeRequiredDefaultNotes
confirmbooleannofalseWithout it, the call returns a preview of what would be promoted
tenant_idstringno-Collection-aware tenant promotion instead of the legacy all-facts push
allowlistarray<string>no-Entries such as facts, constraints, plans, collection:facts, entity:business::acme::public, or *

Output: {mode?, tenant_id?, facts_pushed?, would_promote?, preview_hash?, skipped_private?, skipped_synced?, skipped_not_allowlisted?, total_push_count?, collection_cursor_count?}. In preview, mode is tenant_promotion_preview.

sync_status

No parameters.

Output: {mode, configured, background_sync_enabled, remote_url, api_key_configured, platform_online, degraded, degraded_reason, onboarding_hint, last_pull_at, last_push_at, pull_count, push_count, collection_pull_cursor_count, collection_push_cursor_count, tenant_manifest_supported, local_fact_count}. Modes: local-only, cloud-mirror configured, full background sync, degraded.

update_status

No parameters.

Output: {enabled, state, basis, tracking_ref, current_commit, binary_commit, latest_commit, ahead_by, behind_by, checkout_commit, checkout_ahead_by, checkout_behind_by, checked_at, error, comparison_stale, upgrade_hint, upgrade_playbook_query, backup_playbook_query}.

basis distinguishes "binary", the running binary's embedded commit, which is the deploy-gating number, from "checkout", the source-tree HEAD, which is the fallback. The checkout_* fields expose a stale source clone.

12.27 Context-custody audit

ToolDefinitionHandlerSurfacetoken_budgetFlag
context_custody_auditmod.rs:1747context_custody_audit.rs:299[local]advisory onlyCRUX_CONTEXT_CUSTODY_AUDIT, default off

Scores this Crux instance against the context-custody exit test: four questions (SEE, DO, REMEMBER, CHECK) and the exit test (EXPORT, INSPECT, REVOKE, ROUTE, KEEP-LOCAL, PROVE). A pure read.

ParamTypeRequiredNotes
token_budgetintegernoAdvisory only. Never read by the handler; the scorecard is fixed-size (context_custody_audit.rs:56)

Output: {daemon_version, four_questions: [{axis, question, verdict, evidence}], exit_test: [...], lock_in_risk, lock_in_label, trust_posture: {recommendations: [string], standing_gap}, thesis, note}. lock_in_risk is 1 to 5. With the flag off: {enabled: false, note}.

One honesty property worth knowing: each verdict reports the runtime state, so a capability that is gated off scores partial rather than strong, and each verdict cites the backing capability. The scorecard cannot overclaim. Its inputs read CRUX_PASSPORT_REVOCATION, CRUX_AGENT_CARD, CORECRUXD_FEATURE_RECEIPT_VERIFY, CORECRUXD_FEATURE_AUDIT_EXPORT, router presence, sync-remote configuration and the local fact count.

This flag uses parsing dialect 3, where yes counts as ON, unlike most of the flags in this chapter. See 15.1.


Continue to chapter 13 for the remaining 49 tools.

Sources

All line references were verified at commit 93b41a7.