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

Function invokeWith

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

Source from the content-addressed store, hash-verified

4455 const grantedScopes = grantedScopesFromRow(connectionRow);
4456 const invokeTool = runtime.plugin.invokeTool;
4457 const invokeWith = (
4458 resolved: Record<string, string | null>,
4459 ): Effect.Effect<unknown, ToolInvocationError> => {
4460 const credential: ToolInvocationCredential = {
4461 owner: parsed.owner,
4462 integration: parsed.integration,
4463 connection: parsed.connection,
4464 template: AuthTemplateSlug.make(connectionRow.template),
4465 value: resolved[PRIMARY_INPUT_VARIABLE] ?? null,
4466 values: resolved,
4467 config: integrationRow ? decodeJsonColumn(integrationRow.config) : undefined,
4468 ...(grantedScopes ? { grantedScopes } : {}),
4469 };
4470 return wrapInvocationError(
4471 invokeTool({
4472 ctx: runtime.ctx,
4473 toolRow: row,
4474 credential,
4475 args,
4476 elicit: buildElicit(address, args, handler),
4477 invokeOptions: options,
4478 }),
4479 );
4480 };
4481
4482 const first = yield* invokeWith(values);
4483 // 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