Skip to content

feat: #2886 add convenience properties to ToolCallItem and ToolCallOutputItem#2887

Draft
DanielCufino wants to merge 1 commit intoopenai:mainfrom
DanielCufino:feat/tool-call-item-convenience-properties
Draft

feat: #2886 add convenience properties to ToolCallItem and ToolCallOutputItem#2887
DanielCufino wants to merge 1 commit intoopenai:mainfrom
DanielCufino:feat/tool-call-item-convenience-properties

Conversation

@DanielCufino
Copy link
Copy Markdown

@DanielCufino DanielCufino commented Apr 15, 2026

Summary

ToolApprovalItem exposes tool_name and call_id as properties for easy inspection of tool calls. ToolCallItem and ToolCallOutputItem lack equivalent accessors, requiring users to reach into raw_item internals with getattr chains and isinstance checks.

This adds the same convenience properties to both classes, following the existing ToolApprovalItem patterns:

  • ToolCallItem: tool_name, call_id
  • ToolCallOutputItem: call_id

Test plan

  • make format — pass
  • make lint — pass
  • mypy src/agents/items.py — pass
  • Existing tests/test_items_helpers.py passes (31 tests, no regressions)

Issue number

Closes #2886

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass

@github-actions github-actions bot added enhancement New feature or request feature:core labels Apr 15, 2026
… and ToolCallOutputItem

ToolApprovalItem already exposes tool_name and call_id as properties,
but ToolCallItem and ToolCallOutputItem require users to reach into
raw_item internals. This adds the same convenience accessors to both
classes, following the existing ToolApprovalItem patterns.

Closes openai#2886
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature:core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add convenience properties (tool_name, call_id) to ToolCallItem and ToolCallOutputItem

1 participant