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

Function decodeStaticToolArgs

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

Source from the content-addressed store, hash-verified

453}
454
455const decodeStaticToolArgs = (
456 schema: StaticToolSchema | undefined,
457 args: unknown,
458): Effect.Effect<unknown, unknown> => {
459 if (schema == null) return Effect.succeed(args);
460 return Effect.promise(() => Promise.resolve(schema["~standard"].validate(args))).pipe(
461 Effect.flatMap((result) =>
462 "value" in result ? Effect.succeed(result.value) : Effect.fail(result),
463 ),
464 );
465};
466
467export interface StaticToolInput<
468 TStore = unknown,

Callers 1

toolFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected