# AgentMiddleware

::: pydantic_ai_middleware.AgentMiddleware
    options:
      show_source: true
      members:
        - tool_names
        - timeout
        - _should_handle_tool
        - before_run
        - after_run
        - before_model_request
        - before_tool_call
        - on_tool_error
        - after_tool_call
        - on_error
