MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / toJsonSchemaSafe

Function toJsonSchemaSafe

packages/agent-runtime/src/tools/prompts.ts:48–54  ·  view source on GitHub ↗
(schema: z.ZodType)

Source from the content-addressed store, hash-verified

46}
47
48function toJsonSchemaSafe(schema: z.ZodType): Record<string, unknown> {
49 try {
50 return z.toJSONSchema(schema, { io: 'input' }) as Record<string, unknown>
51 } catch {
52 return { type: 'object', properties: {} }
53 }
54}
55
56function hasMeaningfulJsonSchema(jsonSchema: Record<string, unknown>): boolean {
57 const properties = jsonSchema.properties

Callers 1

paramsSectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected