---
type: email
from: Wen-Tien Chang <notifications@github.com>
subject: [openai/openai-agents-python] Add tool call arguments in ToolContext

 for RunHooks (PR #1765)
received: 2026-03-06 07:37:23
date_header: Wed, 17 Sep 2025 13:44:30 -0700
priority: normal
status: awaiting_approval
uid: 30710
---

## Email Content

**From:** Wen-Tien Chang <notifications@github.com>
**Subject:** [openai/openai-agents-python] Add tool call arguments in ToolContext

 for RunHooks (PR #1765)
**Date:** Wed, 17 Sep 2025 13:44:30 -0700

### Body (preview)

## Background 



Currently, the `RunHooks` lifecycle (`on_tool_start`, `on_tool_end`) exposes the `Tool` and `ToolContext`, but does not include the actual arguments passed to the tool call. 



## Solution



This implementation is inspired by [PR #1598](https://github.com/openai/openai-agents-python/pull/1598).



* Add a new `tool_arguments` field to `ToolContext` and populate it via from_agent_context with tool_call.arguments.

* Update `lifecycle_example.py` to demonstrate tool_arguments in hooks

* Unlike the proposal in [issue #252](https://github.com/openai/openai-agents-python/issues/252), this solution is not expected to introduce breaking changes, making it easier to adopt.

You can view, comment on, or merge this pull request online at:



  https://github.com/openai/openai-agents-python/pull/1765



-- Commit Summary --



  * Add tool call arguments in ToolContext for RunHooks



-- File Changes --



    M examples/basic/lifecycle_example.py (14)

    M src/agents/tool_context.py (9)



-- Patch Links --



https://github.com/openai/openai-agents-python/pull/1765.patch

https://github.com/openai/openai-agents-python/pull/1765.diff



-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/pull/1765

You are receiving this because you are subscribed to this thread.



Message ID: &lt;openai/openai-agents-python/pull/1765@github.com&gt;

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
