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

Function decodeStaticToolArgs

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

Source from the content-addressed store, hash-verified

489}
490
491const decodeStaticToolArgs = (
492 schema: StaticToolSchema | undefined,
493 args: unknown,
494): Effect.Effect<unknown, unknown> => {
495 if (schema == null) return Effect.succeed(args);
496 return Effect.promise(() => Promise.resolve(schema["~standard"].validate(args))).pipe(
497 Effect.flatMap((result) =>
498 "value" in result ? Effect.succeed(result.value) : Effect.fail(result),
499 ),
500 );
501};
502
503export interface StaticToolInput<
504 TStore = unknown,

Callers 1

toolFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected