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

Function decodeStaticToolArgs

packages/core/sdk/src/plugin.ts:380–390  ·  view source on GitHub ↗
(
  schema: StaticToolSchema | undefined,
  args: unknown,
)

Source from the content-addressed store, hash-verified

378}
379
380const decodeStaticToolArgs = (
381 schema: StaticToolSchema | undefined,
382 args: unknown,
383): Effect.Effect<unknown, unknown> => {
384 if (schema == null) return Effect.succeed(args);
385 return Effect.promise(() => Promise.resolve(schema["~standard"].validate(args))).pipe(
386 Effect.flatMap((result) =>
387 "value" in result ? Effect.succeed(result.value) : Effect.fail(result),
388 ),
389 );
390};
391
392export interface StaticToolInput<
393 TStore = unknown,

Callers 1

toolFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected