Skip to content

feat: add tool support for structured outputs. #43

@alihankoc

Description

@alihankoc

Hi,

I’m using Prism with both the direct Anthropic provider and the AWS Bedrock provider. Tool/function calling works correctly when I use the native Anthropic integration, but the same tool definitions are completely ignored when I switch to Bedrock with structured output.

Details:
• Models tested: Claude Sonnet (4.x equivalent on Bedrock)
• Setup:
Prism::structured()->using(Bedrock::KEY, 'anthropic.claude...')->withTools($tools)...

Behavior:
• With Anthropic provider: tools are sent, model returns tool_use blocks correctly.
• With Bedrock provider: tools are not included in the request payload at all, and the model never attempts a tool call, even with ToolChoice::Any.

It seems the Bedrock adapter currently does not map Prism tools to Anthropic’s tool_use / tools schema when use structured output, so the feature is silently disabled for all Claude models on Bedrock.

Expected behavior:
The Bedrock provider should forward tool definitions and handle tool_use responses in the same way as the Anthropic provider.

This makes it currently impossible to use function/tool calling with Claude on Bedrock through Prism, even though the underlying model supports it.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions