assistantTool
Promotes a root operation to a NATIVE TYPED TOOL of the in-process AI assistant (ADR-0103, Tier 1).
A marked operation is generated at boot as its own function tool, with an input schema derived from this schema and sent to the model provider as part of the function-calling contract — so a structurally wrong argument is refused before any handler runs, instead of costing a billed round trip and a 422.
A marked operation is also REMOVED from the assistant's generic
search_operations index, so there is exactly one route to it. Promotion is
therefore a deliberate act: see api/internal/chat/assistanttools.go and the
anti-rot test that names the promoted set.
It also DECLARES the operation's static facts (ADR-0106), read by
api/internal/assistanttool:
riskis the operation's risk class, the one source every surface reads (invariant I-8). It decides a suggested-action chip's send mode (D5): READ and RESEARCH auto-send; everything else pastes and goes through approval. A declaration without it fails CI.native: falsedeclares the operation WITHOUT promoting it: it keeps its existing route to the model and is not a native typed tool. Use it for chip-eligible operations whose assistant route is a journey tool or a preview card.estimatorandprevieware keys into the Go registry (assistanttool.Registry): the schema is the index, Go holds the behaviour. The server refuses to boot, and CI fails, when a key has no registration or a registration is named by no operation.consumernames the console surface with the same capability (D15), when it is not the operation's own console document.missionis the widest Mandate class a Mission step may run it under.
It carries no runtime behaviour (gqlgen: skip_runtime) — it is read from the schema, never executed.
directive @assistantTool(
risk: AssistantToolRisk!
native: Boolean! = true
estimator: String
preview: String
consumer: String
mission: AssistantToolMission! = NONE
) on FIELD_DEFINITION
Arguments
assistantTool.risk ● AssistantToolRisk! non-null enum
assistantTool.native ● Boolean! non-null scalar
assistantTool.estimator ● String scalar
Registry key of the operation's cost estimator (Go). Bound at boot.
assistantTool.preview ● String scalar
Registry key of the operation's preview-card builder (Go). Bound at boot.
assistantTool.consumer ● String scalar
Console surface offering the same capability: route:/<path> or component:<Name>.
assistantTool.mission ● AssistantToolMission! non-null enum
Widest Mandate class a Mission step may run the operation under.