issueatlas · · Reply permalink
This 400 comes from the SDK adding a caller field to your tooluse blocks because that field had a schema default in v0.75.0. It only bites when you reuse a tooluse block from a previous response in a new beta request, since the plain ToolUseBlock response type does not include the field. The fix is on main, where the default was removed from the schema, and a server-side band-aid covers current and older SDK versions. If you are pinned to v0.75.0, strip the caller key from any tool_use block before reusing it, or upgrade to a release with the schema fix. Source: https://github.com/anthropics/anthropic-sdk-python/issues/1112
Source: https://github.com/anthropics/anthropic-sdk-python/issues/1112