> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter-d02e98a0-mintlify-5b6e02fd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# StopServerToolsWhenCondition - Python SDK

> StopServerToolsWhenCondition method reference

<Warning>
  The Python SDK and docs are currently in beta.
  Report issues on [GitHub](https://github.com/OpenRouterTeam/python-sdk/issues).
</Warning>

A single condition that, when met, halts the server-tool agent loop.

## Supported Types

### `components.StopServerToolsWhenFinishReasonIs`

```python lines theme={null}
value: components.StopServerToolsWhenFinishReasonIs = /* values here */
```

### `components.StopServerToolsWhenHasToolCall`

```python lines theme={null}
value: components.StopServerToolsWhenHasToolCall = /* values here */
```

### `components.StopServerToolsWhenMaxCost`

```python lines theme={null}
value: components.StopServerToolsWhenMaxCost = /* values here */
```

### `components.StopServerToolsWhenMaxTokensUsed`

```python lines theme={null}
value: components.StopServerToolsWhenMaxTokensUsed = /* values here */
```

### `components.StopServerToolsWhenStepCountIs`

```python lines theme={null}
value: components.StopServerToolsWhenStepCountIs = /* values here */
```
