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

Function staticToolSchemaRoot

packages/core/sdk/src/executor.ts:1563–1574  ·  view source on GitHub ↗
(
  schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"],
  side: StandardJsonSchemaSide,
)

Source from the content-addressed store, hash-verified

1561};
1562
1563const staticToolSchemaRoot = (
1564 schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"],
1565 side: StandardJsonSchemaSide,
1566): unknown | undefined => {
1567 if (!schema) return undefined;
1568 const standard = isReadonlyRecord(schema) ? schema["~standard"] : undefined;
1569 if (!isReadonlyRecord(standard)) return schema;
1570 const jsonSchema = standard["jsonSchema"];
1571 if (!isReadonlyRecord(jsonSchema)) return schema;
1572 const materialize = (jsonSchema as StandardJsonSchemaFns)[side];
1573 return typeof materialize === "function" ? materialize({ target: "draft-07" }) : jsonSchema;
1574};
1575
1576export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = readonly []>(
1577 config: ExecutorConfig<TPlugins>,

Callers 1

staticToolToToolFunction · 0.85

Calls 1

isReadonlyRecordFunction · 0.85

Tested by

no test coverage detected