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

Function buildElicit

packages/core/sdk/src/executor.ts:3517–3537  ·  view source on GitHub ↗
(
      address: ToolAddress,
      args: unknown,
      handler: ElicitationHandler,
    )

Source from the content-addressed store, hash-verified

3515 : defaultElicitationHandler;
3516
3517 const buildElicit = (
3518 address: ToolAddress,
3519 args: unknown,
3520 handler: ElicitationHandler,
3521 ): Elicit => {
3522 return (request: ElicitationRequest) =>
3523 Effect.gen(function* () {
3524 const response: ElicitationResponse = yield* handler({
3525 address,
3526 args,
3527 request,
3528 });
3529 if (response.action !== "accept") {
3530 return yield* new ElicitationDeclinedError({
3531 address,
3532 action: response.action,
3533 });
3534 }
3535 return response;
3536 });
3537 };
3538
3539 // The single source of truth for "will enforceApproval pause this call".
3540 // Read before pre-approval arg validation so the extra validation pass

Callers 1

executeFunction · 0.85

Calls 1

handlerFunction · 0.50

Tested by

no test coverage detected