TOOLS
[ SCHEMA GENERATOR ]
JSON → Schema / TS / Zod
ブラウザ内で完結・送信なし
API レスポンスなどのサンプル JSON から JSON Schema・TypeScript 型・Zod スキーマ・Claude の tool 定義をまとめて生成します。Tool use や Structured Outputs の下書きに。
SAMPLE JSON
有効な JSON です。配列内のオブジェクトはキーをまとめて推論します。
OPTIONS
ルートの名前
OUTPUT
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Task",
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"title": {
"type": "string"
},
"status": {
"type": "string"
},
"priority": {
"type": "integer"
},
"estimateHours": {
"type": "number"
},
"assignee": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
}
},
"required": [
"name",
"email"
],
"additionalProperties": false
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"subtasks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"done": {
"type": "boolean"
},
"note": {
"type": "string"
}
},
"required": [
"title",
"done"
],
"additionalProperties": false
}
},
"dueAt": {
"type": "string",
"format": "date-time"
},
"archived": {
"type": "null"
}
},
"required": [
"id",
"title",
"status",
"priority",
"estimateHours",
"assignee",
"tags",
"subtasks",
"dueAt",
"archived"
],
"additionalProperties": false
}export interface Task {
id: string
title: string
status: string
priority: number
estimateHours: number
assignee: Assignee
tags: string[]
subtasks: Subtask[]
dueAt: string
archived: null
}
export interface Subtask {
title: string
done: boolean
note?: string
}
export interface Assignee {
name: string
email: string
}
import { z } from 'zod'
export const taskSchema = z.object({
id: z.string().uuid(),
title: z.string(),
status: z.string(),
priority: z.number().int(),
estimateHours: z.number(),
assignee: z.object({
name: z.string(),
email: z.string().email(),
}).strict(),
tags: z.array(z.string()),
subtasks: z.array(z.object({
title: z.string(),
done: z.boolean(),
note: z.string().optional(),
}).strict()),
dueAt: z.string().datetime(),
archived: z.null(),
}).strict()
export type Task = z.infer<typeof taskSchema>
Claude API の tools にそのまま渡せる形です。description はツールを選ぶ判断材料になるので、具体的に書き直してください。
{
"name": "task",
"description": "TODO: このツールが何をするのか、いつ使うべきかを具体的に書く",
"input_schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"title": {
"type": "string"
},
"status": {
"type": "string"
},
"priority": {
"type": "integer"
},
"estimateHours": {
"type": "number"
},
"assignee": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
}
},
"required": [
"name",
"email"
],
"additionalProperties": false
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"subtasks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"done": {
"type": "boolean"
},
"note": {
"type": "string"
}
},
"required": [
"title",
"done"
],
"additionalProperties": false
}
},
"dueAt": {
"type": "string",
"format": "date-time"
},
"archived": {
"type": "null"
}
},
"required": [
"id",
"title",
"status",
"priority",
"estimateHours",
"assignee",
"tags",
"subtasks",
"dueAt",
"archived"
],
"additionalProperties": false
}
}