Documentation Index
Fetch the complete documentation index at: https://agents.candu.ai/llms.txt
Use this file to discover all available pages before exploring further.
response_mask is an optional field on API tool definitions that controls which fields from a tool’s HTTP response are forwarded to the AI model in subsequent conversation turns.
Without a mask, the full response body is stored in conversation history and re-sent to the model on every turn. For APIs that return large objects — say, a 70+ key flow document — this accumulates quickly and increases both latency and cost. A response_mask lets you declare exactly which fields the model needs, discarding the rest before the response enters history.
Format
The mask is a plain JSON object. Each key corresponds to a field in the response body. The value is either:true— keep the field’s value as-is (any type: scalar, array, nested object)- A nested mask object — recurse into the field, applying the inner mask
Array handling
Arrays are transparent to the mask. When a masked field contains an array, the mask is applied to each element individually. You don’t need to declare that a field is an array — the same nested mask works regardless.["id1", "id2"]), use true — there’s nothing to recurse into:
Behaviour
| Scenario | Result |
|---|---|
response_mask omitted | No filtering; full response stored in history |
| Field present in mask, present in response | Field included in history |
| Field present in mask, absent in response | Field silently omitted (no error) |
| Field absent from mask, present in response | Field dropped from history |
| Response is not a JSON object | Mask is skipped; full response stored |
| Nested mask on a scalar value | Scalar returned as-is |
blocks array containing both container blocks and service blocks — are handled naturally. Fields absent from a given element are simply omitted for that element.