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

Function staticToolSchemaRoot

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

Source from the content-addressed store, hash-verified

1861};
1862
1863const staticToolSchemaRoot = (
1864 schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"],
1865 side: StandardJsonSchemaSide,
1866): unknown | undefined => {
1867 if (!schema) return undefined;
1868 const standard = isReadonlyRecord(schema) ? schema["~standard"] : undefined;
1869 if (!isReadonlyRecord(standard)) return schema;
1870 const jsonSchema = standard["jsonSchema"];
1871 if (!isReadonlyRecord(jsonSchema)) return schema;
1872 const materialize = (jsonSchema as StandardJsonSchemaFns)[side];
1873 return typeof materialize === "function" ? materialize({ target: "draft-07" }) : jsonSchema;
1874};
1875
1876export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = readonly []>(
1877 config: ExecutorConfig<TPlugins>,

Callers 1

staticToolToToolFunction · 0.85

Calls 1

isReadonlyRecordFunction · 0.85

Tested by

no test coverage detected