Conversation
zod-to-json-schema only emits the numeric exclusiveMinimum and exclusiveMaximum form for the jsonSchema7 target. The jsonSchema2019-09 target takes the non-draft-7 branch in its number parser and produces the draft-4 boolean pair (minimum: 0, exclusiveMinimum: true), which draft 2020-12 rejects. Anthropic's API therefore 400s the entire tool list whenever dnsProvider-createRecord or updateRecord is included. Comparing both targets across all 597 generated tools, ignoring the $schema key this function overwrites, the outputs are byte-identical except for the two affected tools, which now emit exclusiveMinimum: 0. Add a regression test sweeping every tool inputSchema for boolean exclusive bounds, following the existing nested-walk test pattern. Fixes Dokploy#74
|
Confirmed, this is exactly what broke for me Reproduced with the repo's pinned versions (zod 3.25.28, zod-to-json-schema 3.25.2): the ttl field comes out as On the workaround from #74: DOKPLOY_DISABLED_TAGS=dns doesn't filter anything, the tag is dnsProvider. DOKPLOY_DISABLED_TAGS=dnsprovider drops the 11 dnsProvider tools and the rest works fine. Anything else needed to merge this ? |
|
nope should be all, if anyone would like to merge, or let me know and i will work on the edits |
|
Confirmed on Dokploy version: Agent harness: Observation: Sessions fails to load with the error message: Please fix |
|
Im also having this same exact issue. |
Fixes #74
Root cause
toDraft2020_12JsonSchemaconverts withzod-to-json-schemausingtarget: "jsonSchema2019-09", then stamps the result as draft 2020-12. zod-to-json-schema emits the numericexclusiveMinimum/exclusiveMaximumform only for thejsonSchema7target; every other target takes the non-draft-7 branch inparsers/number.jsand emits the draft-4 pair:{"type": "integer", "exclusiveMinimum": true, "minimum": 0, "maximum": 9007199254740991}Draft 2020-12 requires a number there, so strict validators reject the whole tool list the moment
dnsProvider-createRecordordnsProvider-updateRecordis in the payload, exactly as reported in #74.Fix
Switch the conversion target to
jsonSchema7. To confirm this changes nothing else, I compared both targets across all 597 generated tools, ignoring the$schemakey this function overwrites: the outputs are byte-identical except for the two affected tools, which now emit"exclusiveMinimum": 0.Verification
inputSchemafor boolean exclusive bounds, following the existing nested-walk pattern from the Invalid JSON Schema in Tool Definition in Claude Code #10/v2.0 does not fix draft 2020-12 schema error (reopen #10) #32/@dokploy/mcp: All tool schemas inject$schema: draft-07causing Anthropic API 400 error #36/tools/list emits draft-07 schemas with array-form nullable types — Anthropic API rejects all 524 tools #37 tests. It fails against the previous target and passes with this change.biome checkandtsc --noEmitclean on both changed files.Note:
pnpm precommitfails on a clean checkout ofmainfor an unrelated pre-existing formatting issue inredactSensitive.test.ts; #75 fixes that separately.