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

Function decodeStaticToolArgs

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

Source from the content-addressed store, hash-verified

502}
503
504const decodeStaticToolArgs = (
505 schema: StaticToolSchema | undefined,
506 args: unknown,
507): Effect.Effect<unknown, unknown> => {
508 if (schema == null) return Effect.succeed(args);
509 return Effect.promise(() => Promise.resolve(schema["~standard"].validate(args))).pipe(
510 Effect.flatMap((result) =>
511 "value" in result ? Effect.succeed(result.value) : Effect.fail(result),
512 ),
513 );
514};
515
516export interface StaticToolInput<
517 TStore = unknown,

Callers 1

toolFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected