> This page is for version Latest (default).
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo/guardrails/latest/llms.txt
> - v0.25.0: https://docs.nvidia.com/nemo/guardrails/v0.25.0/llms.txt
> - v0.24.1: https://docs.nvidia.com/nemo/guardrails/v0.24.1/llms.txt
> - v0.24.0: https://docs.nvidia.com/nemo/guardrails/v0.24.0/llms.txt
> - v0.23.0: https://docs.nvidia.com/nemo/guardrails/v0.23.0/llms.txt
> - v0.22.0: https://docs.nvidia.com/nemo/guardrails/v0.22.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/guardrails/llms.txt.

# nemoguardrails.server.hooks.schemas

Request models for the agent hooks the hooks server checks, one interface per agent path.

## Module Contents

### Classes

| Name                                                                                                                                          | Description                                                                                         |
| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [`ClaudeCodePreToolUseRequest`](#nemoguardrails-server-hooks-schemas-ClaudeCodePreToolUseRequest)                                             | Claude Code's `PreToolUse` hook input, requiring only the fields the server reads.                  |
| [`CodexPreToolUseRequest`](#nemoguardrails-server-hooks-schemas-CodexPreToolUseRequest)                                                       | Codex's `PreToolUse` hook input, requiring only the fields the server reads.                        |
| [`HookBody`](#nemoguardrails-server-hooks-schemas-HookBody)                                                                                   | The field every hook body carries, read before the body is validated as its event.                  |
| [`HookErrorCode`](#nemoguardrails-server-hooks-schemas-HookErrorCode)                                                                         | The `error.code` of a hooks request that ends in an error rather than an allow or a deny.           |
| [`NemoRelayToolConditionalExecutionGuardrailRequest`](#nemoguardrails-server-hooks-schemas-NemoRelayToolConditionalExecutionGuardrailRequest) | NeMo Relay tool conditional-execution guardrail callback receives: the tool name and its arguments. |

### API

```python
class nemoguardrails.server.hooks.schemas.ClaudeCodePreToolUseRequest()
```

**Bases:** `BaseModel`

Claude Code's `PreToolUse` hook input, requiring only the fields the server reads.

**`hook_event_name`** `Literal['PreToolUse']`

---

**`model_config`** `= ConfigDict(extra='allow')`

---

**`tool_name`** `str = Field(min_length=1)`

---

**`tool_use_id`** `str`

---

```python
class nemoguardrails.server.hooks.schemas.CodexPreToolUseRequest()
```

**Bases:** `BaseModel`

Codex's `PreToolUse` hook input, requiring only the fields the server reads.

**`hook_event_name`** `Literal['PreToolUse']`

---

**`model_config`** `= ConfigDict(extra='allow')`

---

**`tool_name`** `str = Field(min_length=1)`

---

**`tool_use_id`** `str`

---

```python
class nemoguardrails.server.hooks.schemas.HookBody()
```

**Bases:** `BaseModel`

The field every hook body carries, read before the body is validated as its event.

**`hook_event_name`** `str`

---

```python
class nemoguardrails.server.hooks.HookErrorCode
```

**Bases:** `enum.Enum`

The `error.code` of a hooks request that ends in an error rather than an allow or a deny.

**`QUEUE_FULL`** `= 'queue_full'`

---

**`RAIL_FAILED`** `= 'rail_failed'`

---

**`UNSUPPORTED_HOOK_EVENT`** `= 'unsupported_hook_event'`

---

```python
class nemoguardrails.server.hooks.schemas.NemoRelayToolConditionalExecutionGuardrailRequest()
```

**Bases:** `BaseModel`

NeMo Relay tool conditional-execution guardrail callback receives: the tool name and its arguments.

**`hook_event_name`** `Literal['NemoRelayToolConditionalExecutionGuardrail']`

---

**`model_config`** `= ConfigDict(extra='forbid')`

---

**`tool_name`** `str = Field(min_length=1)`

---