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

Function buildElicit

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

Source from the content-addressed store, hash-verified

6336 : defaultElicitationHandler;
6337
6338 const buildElicit = (
6339 address: ToolAddress,
6340 args: unknown,
6341 handler: ElicitationHandler,
6342 ): Elicit => {
6343 return (request: ElicitationRequest) =>
6344 Effect.gen(function* () {
6345 const response: ElicitationResponse = yield* handler({
6346 address,
6347 args,
6348 request,
6349 source: "tool",
6350 });
6351 if (response.action !== "accept") {
6352 return yield* new ElicitationDeclinedError({
6353 address,
6354 action: response.action,
6355 });
6356 }
6357 return response;
6358 });
6359 };
6360
6361 // The single source of truth for "will enforceApproval pause this call".
6362 // Read before pre-approval arg validation so the extra validation pass

Callers 2

executeFunction · 0.85
invokeWithFunction · 0.85

Calls 1

handlerFunction · 0.50

Tested by

no test coverage detected