> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# To Model Output • AI Agent SDK

> to_model_output: Optional hook returning a compact, model-facing view of ``result``.

# to\_model\_output

Method

> This is a method of the [**BaseTool**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/BaseTool.md) class in the [**base**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/base.md) module.

Optional hook returning a compact, model-facing view of `result`.

`result` is the tool's raw return **value** (the `output` channel),
not the enclosing :class:`ToolResult`. This is the single hook contract
used everywhere: `safe_run` and the agent executor both invoke it with
the output value. Override to feed the LLM a terse summary/diff instead
of the full tool output for context economy; the full `result` still
reaches display, hooks, and tracing. Return `None` (the default) to
keep today's behaviour where the model sees the full output.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def to_model_output(result: Any) -> Optional[Any]
```

## Parameters

**result** `Any` *required*

No description available.

### Returns

**Returns** `Optional[Any]`

The result of the operation.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/tools/base.py#L284)
>
> `praisonaiagents/tools/base.py` at line 284

***

## Related Documentation

> [card] [Output Concept](https://praison.ai/docs/docs/concepts/output)

> [card] [Output Configuration](https://praison.ai/docs/docs/configuration/output-config)

> [card] [Save Output](https://praison.ai/docs/docs/features/save-output)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.