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

Function invokeWith

packages/core/sdk/src/executor.ts:6616–6639  ·  view source on GitHub ↗
(
            resolved: Record<string, string | null>,
          )

Source from the content-addressed store, hash-verified

6614 const grantedScopes = grantedScopesFromRow(connectionRow);
6615 const invokeTool = runtime.plugin.invokeTool;
6616 const invokeWith = (
6617 resolved: Record<string, string | null>,
6618 ): Effect.Effect<unknown, ToolInvocationError> => {
6619 const credential: ToolInvocationCredential = {
6620 owner: parsed.owner,
6621 integration: parsed.integration,
6622 connection: parsed.connection,
6623 template: AuthTemplateSlug.make(connectionRow.template),
6624 value: resolved[PRIMARY_INPUT_VARIABLE] ?? null,
6625 values: resolved,
6626 config: decodeJsonColumn(integrationRow.config),
6627 ...(grantedScopes ? { grantedScopes } : {}),
6628 };
6629 return wrapInvocationError(
6630 invokeTool({
6631 ctx: runtime.ctx,
6632 toolRow: row,
6633 credential,
6634 args,
6635 elicit: buildElicit(address, args, handler),
6636 invokeOptions: options,
6637 }),
6638 );
6639 };
6640
6641 const first = yield* invokeWith(values);
6642 // Reactive refresh. `expires_at` is only ever the AS's ADVERTISED

Callers 1

executeFunction · 0.85

Calls 3

decodeJsonColumnFunction · 0.85
wrapInvocationErrorFunction · 0.85
buildElicitFunction · 0.85

Tested by

no test coverage detected