Skip to content

Show real examples for nullable, $ref and tuple tool arguments - #459

Merged
jancurn merged 1 commit into
mainfrom
claude/friendly-planck-nq49yc
Oct 20, 2026
Merged

jancurn merged 1 commit into
mainfrom
claude/friendly-planck-nq49yc

Conversation

@jancurn

@jancurn jancurn commented Oct 20, 2026

Copy link
Copy Markdown
Member

Follow-up to #456. The tools-get call example still showed nullable array/object arguments and $ref-defined items as a string, which the server rejects, e.g. ids: {type: ['array','null']} → ids:='"something"'. Now it shows ids:='[1]'.

  • Union types and anyOf/oneOf reduce to their non-null member (Pydantic Optional[...], zod .nullable())
  • Local $ref (#/$defs/…) is resolved against the input schema, with a depth cap so recursive refs can't loop
  • Tuples (prefixItems, array-form items) and required object properties are filled in; const is honoured

Refs #455, #456


Generated by Claude Code

The tools-get call example still rendered nullable array/object arguments
(type: ['array','null'], anyOf with null) and items defined via $ref as a
string, which the server rejects. exampleValue() now reduces union types
and anyOf/oneOf to their non-null member, resolves local $ref against the
input schema (depth-capped against recursive refs), builds tuples from
prefixItems/items arrays, fills required object properties, and honours
const.

Refs #455, #456

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R6bYaHfW65PjvDi692A9RT
@jancurn
jancurn merged commit 03707fe into main Oct 20, 2026
7 checks passed
@jancurn
jancurn deleted the claude/friendly-planck-nq49yc branch October 20, 2026 21:35
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.

3 participants