fix(sdk): strip input_examples from Anthropic tool definitions#2652
Merged
harbournick merged 2 commits intomainfrom Mar 30, 2026
Merged
fix(sdk): strip input_examples from Anthropic tool definitions#2652harbournick merged 2 commits intomainfrom
harbournick merged 2 commits intomainfrom
Conversation
Anthropic validates input_examples against the tool's input_schema.
The superdoc_format tool has examples with target {kind:"block"} but
the merged schema only exposes {kind:"selection"}. This causes
Anthropic to reject the tool definitions with a validation error.
Strip input_examples from Anthropic output until the schema properly
supports all target variants via oneOf.
Moved the import statement for 'path' to the correct position and simplified the return structure of the toAnthropicTool function by directly returning the object instead of assigning it to a variable first.
Contributor
|
Woot~! |
Contributor
|
🎉 This PR is included in superdoc-sdk v1.3.0-next.48 |
Contributor
|
🎉 This PR is included in superdoc-sdk v1.3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Anthropic validates
input_examplesagainst the tool'sinput_schema. Thesuperdoc_formattool has examples withtarget: {kind: "block"}but the merged schema only exposes{kind: "selection"}. This causes Anthropic to reject the tool definitions with a validation error.Strips
input_examplesfrom the Anthropic tool output ingenerate-intent-tools.mjsuntil the schema properly supports all target variants viaoneOf.Changes
packages/sdk/codegen/src/generate-intent-tools.mjs: Removeinput_examplesfromtoAnthropicTool()outputTest plan
bun test packages/sdk/codegen/src/__tests__/— 38 passed, 0 failedtools.anthropic.jsonhas 0 occurrences ofinput_examples