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

Function invokeWith

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

Source from the content-addressed store, hash-verified

5986 const grantedScopes = grantedScopesFromRow(connectionRow);
5987 const invokeTool = runtime.plugin.invokeTool;
5988 const invokeWith = (
5989 resolved: Record<string, string | null>,
5990 ): Effect.Effect<unknown, ToolInvocationError> => {
5991 const credential: ToolInvocationCredential = {
5992 owner: parsed.owner,
5993 integration: parsed.integration,
5994 connection: parsed.connection,
5995 template: AuthTemplateSlug.make(connectionRow.template),
5996 value: resolved[PRIMARY_INPUT_VARIABLE] ?? null,
5997 values: resolved,
5998 config: integrationRow ? decodeJsonColumn(integrationRow.config) : undefined,
5999 ...(grantedScopes ? { grantedScopes } : {}),
6000 };
6001 return wrapInvocationError(
6002 invokeTool({
6003 ctx: runtime.ctx,
6004 toolRow: row,
6005 credential,
6006 args,
6007 elicit: buildElicit(address, args, handler),
6008 invokeOptions: options,
6009 }),
6010 );
6011 };
6012
6013 const first = yield* invokeWith(values);
6014 // 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