Skip to main content
Claude can return text or tool results. Boundary validates the value that comes back, repairs fixable failures, and gives your app one decision: accepted or rejected.

Install

Define the contract

Call Claude inside accept()

attempt.repairs are generic { role, content } messages. Map them into Anthropic’s message type before sending the retry.
The RunFn must return the raw JSON string, or null if the model did not provide text. Boundary owns parsing and validation.

Tool use

If you already use Claude tool use for structure, return the tool input as a JSON string and let Boundary enforce the rules.

Gate side effects

Use the model you already trust for the task. Boundary is not a model router; it is the deterministic check after the model returns structured data. Next: Invoice extraction for a complete use case, or Local development for testing the contract without provider calls.