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

Function staticToolSchemaRoot

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

Source from the content-addressed store, hash-verified

1522};
1523
1524const staticToolSchemaRoot = (
1525 schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"],
1526 side: StandardJsonSchemaSide,
1527): unknown | undefined => {
1528 if (!schema) return undefined;
1529 const standard = isReadonlyRecord(schema) ? schema["~standard"] : undefined;
1530 if (!isReadonlyRecord(standard)) return schema;
1531 const jsonSchema = standard["jsonSchema"];
1532 if (!isReadonlyRecord(jsonSchema)) return schema;
1533 const materialize = (jsonSchema as StandardJsonSchemaFns)[side];
1534 return typeof materialize === "function" ? materialize({ target: "draft-07" }) : jsonSchema;
1535};
1536
1537export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = readonly []>(
1538 config: ExecutorConfig<TPlugins>,

Callers 1

staticToolToToolFunction · 0.85

Calls 1

isReadonlyRecordFunction · 0.85

Tested by

no test coverage detected