> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# Type Alias Nemo Relay Tool Exec Intercept Cb

> Callback for tool execution intercepts. Receives arguments as JSON plus a `next` callback and its context. Call `next_fn(args, next_ctx)` to invoke the next layer in the middleware chain, or return directly to short-circuit. The `result` field is passed to the remaining middleware and application; `pending_marks` are Relay-owned lifecycle metadata emitted after the tool-end event and are not included in the application-visible result. The returned JSON must contain a `result` field and may contain a `pending_marks` array. The returned string must be allocated with `malloc` or an equivalent allocation compatible with `nemo_relay_string_free`. Ownership transfers to Relay when the callback returns; the callback must not free or reuse the string afterward, and Relay frees it exactly once.

Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker`.

<pre />

Callback for tool execution intercepts. Receives arguments as JSON plus a `next` callback and its context. Call `next_fn(args, next_ctx)` to invoke the next layer in the middleware chain, or return directly to short-circuit. The `result` field is passed to the remaining middleware and application; `pending_marks` are Relay-owned lifecycle metadata emitted after the tool-end event and are not included in the application-visible result. The returned JSON must contain a `result` field and may contain a `pending_marks` array. The returned string must be allocated with `malloc` or an equivalent allocation compatible with `nemo_relay_string_free`. Ownership transfers to Relay when the callback returns; the callback must not free or reuse the string afterward, and Relay frees it exactly once.