Skip to content

Comments

feat(providers): expose tool calls in Claude Agent SDK response metadata#7790

Merged
mldangelo merged 1 commit intopromptfoo:mainfrom
nordnet:feat/claude-agent-sdk-tool-calls
Feb 23, 2026
Merged

feat(providers): expose tool calls in Claude Agent SDK response metadata#7790
mldangelo merged 1 commit intopromptfoo:mainfrom
nordnet:feat/claude-agent-sdk-tool-calls

Conversation

@henriklundstrom
Copy link
Contributor

Summary

  • Capture all tool calls (name, input, output, error status) made during Claude Agent SDK sessions and expose them in response.metadata.toolCalls
  • Include parentToolUseId on each entry (null for top-level, set for sub-agent calls) to support filtering by agent scope
  • Update documentation with usage examples for asserting on tool calls in evals

🤖 Generated with Claude Code

Capture all tool calls made during agentic sessions and expose them in
response.metadata.toolCalls. Each entry includes the tool name, input,
output, error status, and parentToolUseId to distinguish top-level from
sub-agent calls. This enables eval assertions on tool usage patterns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@promptfoo-scanner promptfoo-scanner bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 All Clear

I've reviewed this PR that adds tool call tracking to the Claude Agent SDK provider. The feature captures tool inputs and outputs in response metadata to enable test assertions on tool usage. No LLM security vulnerabilities were identified in this change.

Minimum severity threshold: 🟡 Medium | To re-scan after changes, comment @promptfoo-scanner
Learn more


Was this helpful?  👍 Yes  |  👎 No 

@mldangelo
Copy link
Member

Thank you so much @henriklundstrom! Please reach out if you would like some promptfoo swag!

@mldangelo mldangelo merged commit d1a2d28 into promptfoo:main Feb 23, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants