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

Function validateArgs

packages/core/execution/src/tool-invoker.test.ts:153–163  ·  view source on GitHub ↗
(
  validator: Validator | undefined,
  args: unknown,
)

Source from the content-addressed store, hash-verified

151};
152
153const validateArgs = (
154 validator: Validator | undefined,
155 args: unknown,
156): Effect.Effect<unknown, unknown> => {
157 if (validator == null) return Effect.succeed(args);
158 return Effect.promise(() => Promise.resolve(validator["~standard"].validate(args))).pipe(
159 Effect.flatMap((result) =>
160 "value" in result ? Effect.succeed(result.value) : Effect.fail(result),
161 ),
162 );
163};
164
165const withPrivateAnnotations = (annotations: ToolAnnotations) => ({
166 ...annotations,

Callers 1

makeTestPluginFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected