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

Function invokeWith

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

Source from the content-addressed store, hash-verified

6706 const grantedScopes = grantedScopesFromRow(connectionRow);
6707 const invokeTool = runtime.plugin.invokeTool;
6708 const invokeWith = (
6709 resolved: Record<string, string | null>,
6710 ): Effect.Effect<unknown, ToolInvocationError> => {
6711 const credential: ToolInvocationCredential = {
6712 owner: parsed.owner,
6713 integration: parsed.integration,
6714 connection: parsed.connection,
6715 template: AuthTemplateSlug.make(connectionRow.template),
6716 value: resolved[PRIMARY_INPUT_VARIABLE] ?? null,
6717 values: resolved,
6718 config: decodeJsonColumn(integrationRow.config),
6719 ...(grantedScopes ? { grantedScopes } : {}),
6720 };
6721 return wrapInvocationError(
6722 invokeTool({
6723 ctx: runtime.ctx,
6724 toolRow: row,
6725 credential,
6726 args,
6727 elicit: buildElicit(address, args, handler),
6728 invokeOptions: options,
6729 }),
6730 );
6731 };
6732
6733 const first = yield* invokeWith(values);
6734 // 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