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

Function decodeStaticToolArgs

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

Source from the content-addressed store, hash-verified

470}
471
472const decodeStaticToolArgs = (
473 schema: StaticToolSchema | undefined,
474 args: unknown,
475): Effect.Effect<unknown, unknown> => {
476 if (schema == null) return Effect.succeed(args);
477 return Effect.promise(() => Promise.resolve(schema["~standard"].validate(args))).pipe(
478 Effect.flatMap((result) =>
479 "value" in result ? Effect.succeed(result.value) : Effect.fail(result),
480 ),
481 );
482};
483
484export interface StaticToolInput<
485 TStore = unknown,

Callers 1

toolFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected