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

Function decodeStaticToolArgs

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

Source from the content-addressed store, hash-verified

434}
435
436const decodeStaticToolArgs = (
437 schema: StaticToolSchema | undefined,
438 args: unknown,
439): Effect.Effect<unknown, unknown> => {
440 if (schema == null) return Effect.succeed(args);
441 return Effect.promise(() => Promise.resolve(schema["~standard"].validate(args))).pipe(
442 Effect.flatMap((result) =>
443 "value" in result ? Effect.succeed(result.value) : Effect.fail(result),
444 ),
445 );
446};
447
448export interface StaticToolInput<
449 TStore = unknown,

Callers 1

toolFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected