( inputSchema: JsonObjectSchema )
| 209 | |
| 210 | /** Rehydrate the small Zod shape required by the SDK's tools/call validation. */ |
| 211 | export function zodInputSchemaFromJson( |
| 212 | inputSchema: JsonObjectSchema |
| 213 | ): Record<string, z.ZodTypeAny> { |
| 214 | const required = new Set(inputSchema.required ?? []) |
| 215 | return Object.fromEntries( |
| 216 | Object.entries(inputSchema.properties).map(([name, property]) => { |
| 217 | const schema = z.string().describe(property.description) |
| 218 | return [name, required.has(name) ? schema : schema.optional()] |
| 219 | }) |
| 220 | ) |
| 221 | } |
| 222 | |
| 223 | function buildJsonInputSchema(operation: OperationInfo, path: string): JsonObjectSchema { |
| 224 | const properties: JsonObjectSchema['properties'] = {} |
no outgoing calls
no test coverage detected