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

# Hooks

> Examples for pre-hooks, post-hooks, tool hooks, stream hooks, and agent context management.

| Example | Description |
| - | - |
| [Post Hook Output](https://agno-v2.mintlify.site/examples/agents/hooks/post-hook-output.md) | Example demonstrating output validation using post-hooks with Agno Agent. |
| [Pre Hook Input](https://agno-v2.mintlify.site/examples/agents/hooks/pre-hook-input.md) | Example demonstrating how to use a pre\_hook to perform comprehensive input validation for your Agno Agent. |
| [Session State Hooks](https://agno-v2.mintlify.site/examples/agents/hooks/session-state-hooks.md) | Example demonstrating how to use a pre\_hook to update the session\_state. |
| [Stream Hook](https://agno-v2.mintlify.site/examples/agents/hooks/stream-hook.md) | Example demonstrating sending a notification to the user after an agent generates a response. |
| [Tool Hooks](https://agno-v2.mintlify.site/examples/agents/hooks/tool-hooks.md) | Use tool\_hooks to add middleware that wraps every tool call. |
| [Few Shot Learning](https://agno-v2.mintlify.site/examples/agents/context-management/few-shot-learning.md) | Use additional\_input with an Agent. |
| [Filter Tool Calls From History](https://agno-v2.mintlify.site/examples/agents/context-management/filter-tool-calls-from-history.md) | Demonstrates `max_tool_calls_from_history` by showing that tool-call filtering only affects model input history while full run history remains in storage. |
| [Instructions With State](https://agno-v2.mintlify.site/examples/agents/context-management/instructions-with-state.md) | Example demonstrating how to use a function as instructions for an agent. |
| [Instructions](https://agno-v2.mintlify.site/examples/agents/context-management/instructions.md) | Add the current date and time to the agent's context with add\_datetime\_to\_context and a timezone. |
| [Introduction Message](https://agno-v2.mintlify.site/examples/agents/context-management/introduction-message.md) | Use the introduction parameter to set an initial greeting message. |
| [System Message](https://agno-v2.mintlify.site/examples/agents/context-management/system-message.md) | Customize the agent's system message and role. |
| [Custom Datetime Format](https://agno-v2.mintlify.site/examples/agents/context-management/datetime-format.md) | Customize the datetime format injected into the agent's system context. |
| [Message History Hooks](https://agno-v2.mintlify.site/examples/agents/hooks/message-history-hooks.md) | Access the current run's message history inside tool pre/post hooks via run\_context.messages. |


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