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

Function invokeWith

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

Source from the content-addressed store, hash-verified

4429 const grantedScopes = grantedScopesFromRow(connectionRow);
4430 const invokeTool = runtime.plugin.invokeTool;
4431 const invokeWith = (
4432 resolved: Record<string, string | null>,
4433 ): Effect.Effect<unknown, ToolInvocationError> => {
4434 const credential: ToolInvocationCredential = {
4435 owner: parsed.owner,
4436 integration: parsed.integration,
4437 connection: parsed.connection,
4438 template: AuthTemplateSlug.make(connectionRow.template),
4439 value: resolved[PRIMARY_INPUT_VARIABLE] ?? null,
4440 values: resolved,
4441 config: integrationRow ? decodeJsonColumn(integrationRow.config) : undefined,
4442 ...(grantedScopes ? { grantedScopes } : {}),
4443 };
4444 return wrapInvocationError(
4445 invokeTool({
4446 ctx: runtime.ctx,
4447 toolRow: row,
4448 credential,
4449 args,
4450 elicit: buildElicit(address, args, handler),
4451 invokeOptions: options,
4452 }),
4453 );
4454 };
4455
4456 const first = yield* invokeWith(values);
4457 // 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