MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / toolFileSchemaFor

Function toolFileSchemaFor

packages/plugins/openapi/src/sdk/extract.ts:203–211  ·  view source on GitHub ↗
(node: Record<string, unknown>)

Source from the content-addressed store, hash-verified

201 * an object and cannot express null through a type array.
202 */
203const toolFileSchemaFor = (node: Record<string, unknown>): Record<string, unknown> => {
204 const annotations: Record<string, unknown> = {};
205 if (typeof node.title === "string") annotations.title = node.title;
206 if (typeof node.description === "string") annotations.description = node.description;
207
208 return nullableType(node)
209 ? { anyOf: [ToolFileJsonSchema, { type: "null" }], ...annotations }
210 : { ...(ToolFileJsonSchema as Record<string, unknown>), ...annotations };
211};
212
213/**
214 * Rewrite one multipart property. Deliberately limited to the two shapes the

Callers 1

multipartFilePropertyFunction · 0.85

Calls 1

nullableTypeFunction · 0.85

Tested by

no test coverage detected