> 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 Tool Conditional Fn

> Decide whether a tool call is allowed to continue.

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 />

Decide whether a tool call is allowed to continue.

The callback receives the tool name and the current argument payload. It can return `Ok(None)` to allow execution, `Ok(Some(reason))` to reject the call with a guardrail message, or an error to abort evaluation entirely.

This alias is [`Arc`](https://doc.rust-lang.org/1.93.0/alloc/sync/struct.Arc.html)-backed so the runtime can clone conditional guardrails into an evaluation snapshot and invoke them after registry locks are released.

## Parameters

* First argument: Tool name being evaluated.
* Second argument: Current tool argument payload.

## Returns

A [`Result`](/reference/api/rust-library-reference/nemo-relay/error/type-result) containing `Ok(None)` when execution is allowed or `Ok(Some(reason))` when the guardrail rejects the call.

## Errors

The callback can return any [`FlowError`](/reference/api/rust-library-reference/nemo-relay/error/enum-flowerror) to abort guardrail evaluation.

## Aliased Type

```rust
pub struct ToolConditionalFn { /* private fields */ }
```