Every JSON-RPC method of bma.executor.v1.1 outside the capability requests, with its direction, parameters and result, and how each SDK sends or serves it. Most are handled by the SDK itself (registration, heartbeats, token refresh, tool dispatch); the rest map to the typed methods on the other pages.
Generated from bma-executor-sdk 1.3.0 and its contract (contracts/bma/executor, protocol bma.executor.v1.1). Install, credentials and quick starts are on the bma-executor-sdk overview; the protocol itself is described in Executor Protocol.

Methods

executor.register

Register an executor connection. Executor to harness request, the first frame on the control channel. protocol MUST equal the negotiated WebSocket subprotocol; otherwise the server answers -32010 and closes with 4003. A machine-scoped executor sends an empty environment_id. resume.active_sessions reattaches sessions after reconnect. A machine-scoped executor that declares neither capabilities.process nor capabilities.agent is answered -32012 with data.reason “capability_missing” and data.capability “process” instead of a result; no runtime is bound and the connection stays unregistered. Direction: executor → harness · Kind: request · Since: bma.executor.v1 Parameters Result ExecutorRegisterResult In the SDK Handled by the SDK: sent by start, with the capabilities and the resume id after a reconnect. (executor)

executor.heartbeat

Refresh the executor lease. Executor to harness request, sent every heartbeat_interval_ms. Two missed heartbeats expire the lease server-side. drain=true means the executor must stop accepting new sessions and finish current work. Direction: executor → harness · Kind: request · Since: bma.executor.v1 Parameters Result ExecutorHeartbeatResult In the SDK Handled by the SDK: sent by the client at the interval executor.register returns. (executor)

executor.token.refresh

Extend the connection with a fresh executor token. Executor to harness request. Before the current token expires the executor fetches a new one from POST /v1/machines/{machine_id}/token or POST /v1/environments/{environment_id}/token (legacy alias POST /v1/executors/token) with its original credential and sends it on the open control channel. The harness verifies that it names the same executor, scope and machine credential as the connection and moves the connection’s 4001 deadline to the new token’s expiry; nothing else about the connection changes. A rejected token leaves the old deadline in place. A harness without the method answers -32601; the executor then keeps reconnecting on 4001. Direction: executor → harness · Kind: request · Since: bma.executor.v1.1 Parameters Result ExecutorTokenRefreshResult In the SDK Handled by the SDK: the client fetches a fresh executor token and extends the connection before it expires. (executor)

executor.capabilities.update

Publish changed executor capabilities. Executor to harness notification. It may change capabilities, not the protocol version. Direction: executor → harness · Kind: notification · Since: bma.executor.v1 Parameters Result No result (notification). In the SDK

executor.drain

Ask the executor to drain. Harness to executor request. The executor stops accepting new sessions, finishes current work, and reports active_sessions. Direction: harness → executor · Kind: request · Since: bma.executor.v1 Parameters Result ExecutorDrainResult In the SDK Handled by the SDK: served with onDrain; sent by the harness drain. (executor)

executor.close

Close the executor connection. Either side notification, followed by WebSocket close code 1000 or 1001. Direction: both directions · Kind: notification · Since: bma.executor.v1 Parameters Result No result (notification). In the SDK Handled by the SDK: sent by stop; received, it stops the client for good. (executor)

session.assign

Assign a session to the executor. Harness to executor request. The executor rejects a session that exceeds its capability or resource limits with -32009. metadata.source “harness” marks a long-lived harness session; any other source is one-shot and ends after its tool call. Direction: harness → executor · Kind: request · Since: bma.executor.v1 Parameters Result SessionAssignResult In the SDK Handled by the SDK: served with onSessionAssign (or the Go Core); sent by the harness assignSession. (executor)

session.ready

Report a session ready. Executor to harness request after session.assign is accepted. Direction: executor → harness · Kind: request · Since: bma.executor.v1 Parameters Result Ack In the SDK

session.event

Emit a durable session event. Executor to harness request for durable session events. A tool executor’s event is idempotent by its JSON-RPC id. An agent executor (capability agent) also sends turn_id, event_id and sequence; the harness deduplicates by (session_id, event_id), accepts a sequence at or below acked_sequence as a duplicate, and rejects a gap with -32013 conflict (data.expected_sequence). An agent event matches schemas/agent.json AgentEvent. The JSON-RPC response is the ACK; the executor keeps every unacked event and resends them in sequence order after reconnect, before any new event. Direction: executor → harness · Kind: request · Idempotent by: jsonrpc_id · Since: bma.executor.v1 Parameters Result SessionEventResult In the SDK

session.status

Report session status. Executor to harness notification. detail carries free-form context such as tool_running or mcp_unavailable. Direction: executor → harness · Kind: notification · Since: bma.executor.v1 Parameters Result No result (notification). In the SDK

session.stop

Stop a session. Harness to executor request. The executor terminates every process and MCP server of the session (SIGTERM, then SIGKILL) and then sends session.ended. Direction: harness → executor · Kind: request · Since: bma.executor.v1 Parameters Result SessionStopResult In the SDK Handled by the SDK: served with onSessionStop (or the Go Core); sent by the harness session stop. (executor)

session.ended

Report a session ended. Executor to harness request, sent after every process of the session is gone. Retried until accepted. Direction: executor → harness · Kind: request · Since: bma.executor.v1 Parameters Result Ack In the SDK

tool.call

Dispatch a tool call. Harness to executor request. The executor acknowledges the dispatch and reports the outcome separately with tool.result. A duplicate tool_call_id is acknowledged without re-execution. A tool the executor does not serve is -32012 with data.capability “tool:<name>”. Direction: harness → executor · Kind: request · Since: bma.executor.v1 Parameters Result Ack In the SDK Handled by the SDK: served by the typed tool slots client.tools.<name>.handle; sent by the harness callTool / session.tools.<name>.call. (tools)

tool.result

Report a tool result. Executor to harness request, idempotent by tool_call_id and retried until accepted. Large output is uploaded first (POST /v1/environments/{environment_id}/artifacts; legacy alias POST /v1/executors/artifacts) and referenced by an artifact content block. Direction: executor → harness · Kind: request · Idempotent by: tool_call_id · Since: bma.executor.v1 Parameters Result Ack In the SDK

tool.cancel

Cancel a running tool call. Harness to executor request. The executor kills the process group; canceled=false when the call is unknown or already finished. Direction: harness → executor · Kind: request · Since: bma.executor.v1 Parameters Result ToolCancelResult In the SDK Handled by the SDK: aborts the running handler (its signal or context); sent by the harness cancelTool. (tools)

tool.progress

Report tool progress. Executor to harness notification, optional. Direction: executor → harness · Kind: notification · Since: bma.executor.v1 Parameters Result No result (notification). In the SDK

fs.mount

Mount session file views backed by bma-file. Harness to executor request (machine-scoped). The executor mounts each listed view at its path as a FUSE file system that reads from service_url with the view’s token, and keeps the token in memory only. Idempotent by (session_id, view), so resending the same mounts with new tokens renews the tokens without remounting; a changed path or readonly remounts. Sent when the session is bound to the machine and again after a resume or reconnect, because tokens are bound to the binding epoch. Direction: harness → executor · Kind: request · Capability: fs.fuse · Idempotent by: session_id+view · Since: bma.executor.v1.1 Parameters Result FsMountResult In the SDK

fs.unmount

Unmount the session file views. Harness to executor request (machine-scoped). Unmounts every view of the session and drops its tokens. With flush the executor first commits pending writes (none for read-only views). Idempotent by session_id, a session with nothing mounted answers “unmounted”. Direction: harness → executor · Kind: request · Capability: fs.fuse · Idempotent by: session_id · Since: bma.executor.v1.1 Parameters Result FsUnmountResult In the SDK

turn.start

Start an agent turn. Harness to executor request (capability agent). Opens the agent session on first use (no session.assign) or continues it; executor_session_ref from an earlier TurnStartResult lets the executor resume its local conversation after a restart. The executor answers as soon as the turn is accepted and reports progress with session.event. Idempotent by turn_id. A session with a running turn answers -32013 conflict (use turn.input); a new session beyond max_sessions answers -32009. Direction: harness → executor · Kind: request · Capability: agent · Idempotent by: turn_id · Since: bma.executor.v1.1 Parameters Result TurnStartResult In the SDK Handled by the SDK: served by serveAgent (openTurn, then runTurn); sent by the harness startTurn. (agent)

turn.input

Add user input to the running turn. Harness to executor request (capability agent). The local agent consumes the input at its next step. Idempotent by input_id. When turn_id is not the running turn the executor answers -32013 conflict and the harness starts a new turn instead. Direction: harness → executor · Kind: request · Capability: agent · Idempotent by: input_id · Since: bma.executor.v1.1 Parameters Result Ack In the SDK Handled by the SDK: delivered to the running turn’s inputs; sent by the harness sendTurnInput. (agent)

turn.cancel

Stop the running turn. Harness to executor request (capability agent). The executor stops the agent loop, cancels its local tool calls, withdraws open interactions (interaction.cancel turn_canceled), and ends the turn with session.status_idle turn_outcome=canceled. The session stays open for the next turn.start. Unlike tool.cancel (one harness-dispatched tool call) and session.stop (a hand session and its processes), it targets only the agent turn. Direction: harness → executor · Kind: request · Capability: agent · Since: bma.executor.v1.1 Parameters Result TurnCancelResult In the SDK Handled by the SDK: cancels runTurn; sent by the harness cancelTurn. (agent)

session.close

Close an agent session. Harness to executor request (capability agent). The executor cancels a running turn as turn.cancel does, waits until its events are acknowledged, releases the local conversation, and then sends session.ended. closed=false for an unknown session. A later turn.start with the same session_id starts a new local conversation. Direction: harness → executor · Kind: request · Capability: agent · Since: bma.executor.v1.1 Parameters Result SessionCloseResult In the SDK Handled by the SDK: served by serveAgent (closeSession); sent by the harness closeAgentSession. (agent)

session.event_delta

Stream a preview of a durable agent event. Executor to harness notification (capability agent). Transient and lossy; never acknowledged or resent. event_id is the event_id of the durable session.event that finalizes the preview. The harness relays it to subscribers as Anthropic event_start and event_delta. Direction: executor → harness · Kind: notification · Capability: agent · Since: bma.executor.v1.1 Parameters Result No result (notification). In the SDK

interaction.request

Ask the platform for an approval or an answer. Executor to harness request (capability agent). The harness opens one platform agent interaction (the same request on desktop, mobile and integrations) and answers with interaction.response later. Idempotent by interaction_id. A permission request references the agent.tool_use event in tool_use_id, sent earlier with evaluated_permission ask. The executor keeps local authority; it may still deny, and it treats expires_at as a local deny. An interaction_id of the form appr_ plus 24 lower-case hex digits (the deterministic approval id) is adopted as the platform interaction id; the interactions API, its card and the session stream use it, platform_interaction_id equals it, and a repeat of it (after an executor restart too) names the same interaction, never a second card. The same id for another tool_use_id (within one executor epoch) or another kind is refused with error conflict (-32013) and the stored interaction is left unchanged. An interaction_id of any other form is only the executor’s key; the platform assigns its own id (int_…) and returns it. Direction: executor → harness · Kind: request · Capability: agent · Idempotent by: interaction_id · Since: bma.executor.v1.1 Parameters Result InteractionRequestResult In the SDK

interaction.response

Deliver the answer to an interaction. Harness to executor request (capability agent). Sent once the platform interaction resolves, expires or is canceled; retried with the same interaction_id until answered. The first answer wins; a repeat or an unknown interaction answers accepted=false. Direction: harness → executor · Kind: request · Capability: agent · Idempotent by: interaction_id · Since: bma.executor.v1.1 Parameters Result InteractionResponseResult In the SDK Handled by the SDK: resolves the waiting requestInteraction; sent by the harness respondInteraction. (agent)

agent.custom_tool_result

Deliver the user’s result of a custom tool call. Harness to executor request (capability agent; sent only to an executor that declared agent.custom_tools). The executor emitted agent.custom_tool_use (its event_id is the tool_use_id) and waits; the platform sends the result the user’s application submitted with user.custom_tool_result. Only the first result of a call counts: the platform accepts one per tool_use_id and the executor answers a repeat, an unknown tool_use_id or a call it no longer waits for with accepted=false. Idempotent by tool_use_id: the platform retries the same result until the executor answers, also on a new connection. Timeout: the executor owns the wait. When its own limit passes it ends the call with a failed agent.tool_result (tool_use_id of the call, is_error true), continues the turn, and answers a later result with accepted=false; the platform stops accepting results for that call. Cancel: turn.cancel ends the waiting call as canceled with the turn, and the platform drops results it has not delivered yet for a turn that ended. Direction: harness → executor · Kind: request · Capability: agent · Idempotent by: tool_use_id · Since: bma.executor.v1.1 Parameters Result CustomToolResultResult In the SDK

interaction.cancel

Withdraw an open interaction. Executor to harness request (capability agent). The executor no longer needs the answer, for example the user answered in the local UI (resolved_locally) or the turn was canceled. The harness cancels the platform interaction so every client dismisses it. Idempotent by interaction_id. Direction: executor → harness · Kind: request · Capability: agent · Idempotent by: interaction_id · Since: bma.executor.v1.1 Parameters Result Ack In the SDK

model_token.refresh

Fetch a fresh model token for a running turn. Executor to harness request (capability agent). A brain started by turn.start with a model credential (metadata model_token, valid 1 hour) calls it before the token expires (the reference executors do so when less than 10 minutes remain) and joins model_base_url with the new model_token for its next model calls; the old token stays valid until it expires. The platform signs a new token only while the turn is active (pending, running or rescheduling) and the turn belongs to a session routed to this executor’s machine, so a turn that ended, was canceled or failed gets no further tokens: this is how the platform revokes model access per turn (a token already issued runs out its own expiry). Each call returns a new token; calls are not idempotent and a repeat is harmless. Errors carry data.reason: turn_inactive (-32007: the turn is not active), forbidden (-32001: the session or turn is unknown, belongs to another executor, or this executor is not entitled to platform credentials), model_token_unavailable (-32012: the platform issues no such token). A harness without the method answers -32601; the executor then keeps the token it has. Direction: executor → harness · Kind: request · Capability: agent · Since: bma.executor.v1.1 Parameters Result ModelTokenRefreshResult In the SDK

tools_token.refresh

Fetch a fresh platform tools token for a running turn. Executor to harness request (capability agent, contract 1.4.0). A brain started by turn.start with a platform tools credential (metadata tools_mcp_token, valid 1 hour, handed over only when the session’s brain machine and hands machine differ) calls it before the token expires (the reference executors do so when less than 10 minutes remain) and uses the new tools_mcp_token with tools_mcp_url for its next tool calls; the old token stays valid until it expires or its epoch is superseded. The shape and rules are those of model_token.refresh: the platform signs a new token only while the turn is active (pending, running or rescheduling), the turn belongs to a session routed to this executor’s machine as the brain machine, and the call comes from the turn’s current epoch, so a turn that ended, was canceled or failed, or was started again in a newer epoch gets no further token for the old epoch. Each call returns a new token; calls are not idempotent and a repeat is harmless. Errors carry data.reason: turn_inactive (-32007: the turn is not active), forbidden (-32001: the session or turn is unknown, belongs to another executor, or this executor is not entitled to brain_tools), tools_token_unavailable (-32012: the platform issues no such token for this turn, for example brain and hands are one machine). A harness without the method answers -32601; the executor then keeps the token it has. Direction: executor → harness · Kind: request · Capability: agent · Since: bma.executor.v1.1 Parameters Result ToolsTokenRefreshResult In the SDK