Skip to main content
Tool execution hook payloads.

Classes

CLASS ToolPreInvokePayload

Payload for tool_pre_invoke — before tool/function invocation. Attributes:
  • model_tool_call: The [ModelToolCall](../../core/base#class-modeltoolcall) about to be executed (writable — plugins may modify arguments or swap the tool entirely).

CLASS ToolPostInvokePayload

Payload for tool_post_invoke — after tool execution. Attributes:
  • model_tool_call: The [ModelToolCall](../../core/base#class-modeltoolcall) that was executed.
  • tool_output: The return value of the tool function (writable — plugins may transform the output before it is formatted).
  • tool_message: The ToolMessage constructed from the output.
  • execution_time_ms: Wall-clock time of the tool execution in milliseconds.
  • success: True if the tool executed without raising an exception.
  • error: The Exception raised during execution, or None on success.