MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / toolSchemaToJsonSchema

Function toolSchemaToJsonSchema

packages/components/src/utils.ts:2332–2341  ·  view source on GitHub ↗
(schema: unknown)

Source from the content-addressed store, hash-verified

2330 * `$schema` marker so the result is safe to embed in LLM tool definitions.
2331 */
2332export const toolSchemaToJsonSchema = (schema: unknown): ToolJsonSchema => {
2333 if (schema == null) return { type: 'object', properties: {} }
2334 const jsonSchema: ToolJsonSchema = isZodSchema(schema)
2335 ? (zodToJsonSchema(schema) as ToolJsonSchema)
2336 : cloneDeep(schema as ToolJsonSchema)
2337 if (jsonSchema.$schema) {
2338 delete jsonSchema.$schema
2339 }
2340 return jsonSchema
2341}

Callers 3

listToolInputArgsMethod · 0.90
runMethod · 0.90

Calls 1

isZodSchemaFunction · 0.85

Tested by

no test coverage detected