Skip to content

Use JSON Schema builder in tool examples#5

Closed
tmb wants to merge 1 commit intomainfrom
tmb/use-json-schema-builder
Closed

Use JSON Schema builder in tool examples#5
tmb wants to merge 1 commit intomainfrom
tmb/use-json-schema-builder

Conversation

@tmb
Copy link
Contributor

@tmb tmb commented Feb 20, 2026

Summary

  • Replace hand-written JSON Schema objects with the J.* builder API from @notionhq/workers/json-schema-builder
  • Eliminates manual required/additionalProperties boilerplate — J.object() sets these automatically
  • Uses J.Infer<typeof schema> to derive input/output types from the schema, removing manual type annotations
  • Updates src/index.ts, .examples/tool-example.ts, and .examples/oauth-example.ts

Test plan

  • npx tsc --noEmit passes
  • Verify the builder module is available in the deployed SDK version

Note: Depends on makenotion/workers#183 which adds the json-schema-builder module to the SDK.

🤖 Generated with Claude Code

Replace hand-written JSON Schema objects with the `J.*` builder API
from `@notionhq/workers/json-schema-builder`. This eliminates manual
`required`/`additionalProperties` boilerplate and infers input/output
types directly from the schema via `J.Infer`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tmb tmb requested a review from a team February 20, 2026 03:10
@tmb tmb marked this pull request as draft February 20, 2026 03:10
@jclem
Copy link
Collaborator

jclem commented Feb 20, 2026

Closing for now to clean up; can resurrect later.

@jclem jclem closed this Feb 20, 2026
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.

2 participants