Build the tool.result hook payload (schema documented in hooks).
tool_output is capped to HOOK_TOOL_OUTPUT_LIMIT here so both surfaces
apply the identical cap regardless of where the raw output originates. When
the cap fires the value ends with TOOL_OUTPUT_TRUNCATION_MARKER (counted
within the cap, so the result never exceeds the limit) so a consumer can tell
a capped result from a short one. tool_args is intentionally not truncated
(see HOOK_TOOL_OUTPUT_LIMIT).
"success" or "error".
The tool's returned content (capped in the payload).