Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/tools / / buildToolExecutionContext

Function: buildToolExecutionContext()

ts
function buildToolExecutionContext<TDeps>(opts): ToolExecutionContext<TDeps>;

Defined in: packages/tools/src/executor/tool-context.ts:70

Build a ToolExecutionContext for one invocation. The returned context honours the tool's secretsAllowed ACL — calls to ctx.secrets.require(...) for keys outside the allowlist throw SecretAccessDeniedError.

The context also wires the streaming surface: ctx.reportProgress

  • ctx.streamContent are no-ops when the tool's __streamingHint is false.

Type Parameters

Type ParameterDefault type
TDepsunknown

Parameters

ParameterType
optsToolContextOptions&lt;TDeps&gt;

Returns

ToolExecutionContext&lt;TDeps&gt;

Stable