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

Function invokeWith

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

Source from the content-addressed store, hash-verified

5179 const grantedScopes = grantedScopesFromRow(connectionRow);
5180 const invokeTool = runtime.plugin.invokeTool;
5181 const invokeWith = (
5182 resolved: Record<string, string | null>,
5183 ): Effect.Effect<unknown, ToolInvocationError> => {
5184 const credential: ToolInvocationCredential = {
5185 owner: parsed.owner,
5186 integration: parsed.integration,
5187 connection: parsed.connection,
5188 template: AuthTemplateSlug.make(connectionRow.template),
5189 value: resolved[PRIMARY_INPUT_VARIABLE] ?? null,
5190 values: resolved,
5191 config: integrationRow ? decodeJsonColumn(integrationRow.config) : undefined,
5192 ...(grantedScopes ? { grantedScopes } : {}),
5193 };
5194 return wrapInvocationError(
5195 invokeTool({
5196 ctx: runtime.ctx,
5197 toolRow: row,
5198 credential,
5199 args,
5200 elicit: buildElicit(address, args, handler),
5201 invokeOptions: options,
5202 }),
5203 );
5204 };
5205
5206 const first = yield* invokeWith(values);
5207 // 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