# CLIContextSchema

> **Class** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/_cli_context/CLIContextSchema)

Declared `context_schema` for the agent graph.

Registered via `context_schema=` when the graph is built, so LangGraph
coerces each run's `context=` payload into this dataclass — in-process,
`runtime.context` is a `CLIContextSchema` instance.

It exists alongside `CLIContext` (below) because the payload is shaped
differently on each side of the API boundary: in-process it is coerced to
this dataclass, but over the LangGraph API server (RemoteGraph) it is
serialized to JSON and arrives as a plain dict. Consumers
(`configurable_model._get_context`, `_should_interrupt_tool_call`)
therefore accept both shapes. `CLIContext` is the client-facing builder for
constructing that payload.

Fields mirror `CLIContext`; see its per-field docstrings for semantics.

## Signature

```python
CLIContextSchema(
    self,
    model: str | None = None,
    model_params: dict[str, Any] = dict(),
    profile_overrides: dict[str, Any] = dict(),
    model_context_limit: int | None = None,
    approval_mode: str = 'manual',
    auto_approve: bool = False,
    approval_mode_key: str | None = None,
    thread_id: str | None = None,
    blocked_goal_retry_context: str | None = None,
    offload_tool_call_id: str | None = None,
)
```

## Constructors

```python
__init__(
    self,
    model: str | None = None,
    model_params: dict[str, Any] = dict(),
    profile_overrides: dict[str, Any] = dict(),
    model_context_limit: int | None = None,
    approval_mode: str = 'manual',
    auto_approve: bool = False,
    approval_mode_key: str | None = None,
    thread_id: str | None = None,
    blocked_goal_retry_context: str | None = None,
    offload_tool_call_id: str | None = None,
) -> None
```

| Name | Type |
|------|------|
| `model` | `str \| None` |
| `model_params` | `dict[str, Any]` |
| `profile_overrides` | `dict[str, Any]` |
| `model_context_limit` | `int \| None` |
| `approval_mode` | `str` |
| `auto_approve` | `bool` |
| `approval_mode_key` | `str \| None` |
| `thread_id` | `str \| None` |
| `blocked_goal_retry_context` | `str \| None` |
| `offload_tool_call_id` | `str \| None` |


## Properties

- `model`
- `model_params`
- `profile_overrides`
- `model_context_limit`
- `approval_mode`
- `auto_approve`
- `approval_mode_key`
- `thread_id`
- `blocked_goal_retry_context`
- `offload_tool_call_id`

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e14e0adcbe78565ed3650e7f24b2a775d5437d25/libs/code/deepagents_code/_cli_context.py#L15)