Skip to content

Conversation

@tkolanko
Copy link

@tkolanko tkolanko commented Jan 16, 2026

Background

When executing tools, developers may want access to the assistant's response that triggered the tool call - particularly for accessing reasoning content. Currently this requires manually handling the tool loop without providing an execute function, which adds boilerplate.

Summary

Added currentModelResponse to ToolExecutionOptions, which provides access to the full assistant response during tool execution. This allows tools to access reasoning content and other response metadata without manual loop handling.

  • Added currentModelResponse parameter to executeToolCall and executeTools
  • Updated ToolExecutionOptions interface in @ai-sdk/provider-utils
  • Updated documentation for tools and tool calling

Manual Verification

Updated existing tests to verify currentModelResponse is passed correctly.

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Future Work

I am passing the entire response object but we may want to limit this to just the content, I'm not sure here. It might be better to pass the entire response and let developers grab what they need.

Related Issues

#11822

@vercel-ai-sdk vercel-ai-sdk bot added ai/core feature New feature or request labels Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/core feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants