@invoke/sdk package is the primary way to route agent tool calls through the Invoke execution runtime from TypeScript. Install it once, instantiate a client, and replace direct API calls in your agent loop with invoke.call().
Installation
Client setup
INVOKE_API_KEY from the environment automatically. Pass the value explicitly to ensure TypeScript can verify the key is present at startup.
invoke.call()
The primary method. Routes a tool call through Invoke’s execution controls.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tool | string | Yes | The registered tool name |
params | object | Yes | Tool parameters |
agentId | string | Yes | The agent identity bound to a registered policy |
idempotencyKey | string | Recommended | Deduplication key for write operations |
workflowId | string | No | Groups related calls into a single workflow run |
Response
| Status | Meaning |
|---|---|
executed | Tool ran, side effect landed |
blocked | Failed a policy, scope, or identity check |
pending_approval | Staged for human review |
reconciled | Prior attempt succeeded, duplicate blocked |
replan_required | Live state drifted, agent should replan |
Error handling
Next steps
- Quick Start — end-to-end example with the SDK
- CLI — invoke tools from the terminal
- Authentication — API key setup