Developer guide

API reference

Endpoints, headers, auth and error codes for the tool-call hook.

API reference

The endpoints your agent uses to get tool calls governed. All calls authenticate with an agent key.

Authentication

Send your agent key (it starts with sk-mcp-) as a bearer token on every request.

bash
Authorization: Bearer sk-mcp-...

Headers

HeaderPurpose
AuthorizationBearer sk-mcp-... agent key. Required.
x-vw-agent-run-idGroups model calls into the same run. Aliases: x-session-id, helicone-session-id.

POST /v1/mcp/hook

Ask for a decision on a native tool call. The gateway never runs the tool; it only returns a decision.

Request body:

FieldDescription
tool_nameName of the tool, e.g. "Bash".
argumentsObject with the tool arguments, e.g. { "command": "ls" }.
session_idThe run id for this turn. Used to group the call into a run.
tool_use_idA unique id for this specific call.
bash
curl -X POST "$VW_GATEWAY_URL/v1/mcp/hook" \
  -H "Authorization: Bearer $VW_AGENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tool_name":"Bash","arguments":{"command":"ls"},"session_id":"run-123","tool_use_id":"call-1"}'

Responses, one per decision:

json
{ "decision": "allow" }

{ "decision": "deny", "reason": "policy violation", "detections": [] }

{ "decision": "approval_required", "approval_id": 42,
  "poll_endpoint": "/v1/mcp/approvals/42/status",
  "expires_at": "2026-04-20T15:30:00+00:00" }

{ "decision": "rate_limited", "reason": "rate limit exceeded" }

POST /v1/mcp/hook/result

Report the result of a tool that has already run, so the run shows what happened. Best-effort; it never blocks.

FieldDescription
tool_nameName of the tool that ran.
tool_responseObject with the tool result.
session_idSame run id used on the hook call.
tool_use_idSame call id used on the hook call.
python
import httpx, os
httpx.post(
    f"{os.environ['VW_GATEWAY_URL']}/v1/mcp/hook/result",
    headers={"Authorization": f"Bearer {os.environ['VW_AGENT_KEY']}"},
    json={
        "tool_name": "Bash",
        "tool_response": {"stdout": "file1\nfile2"},
        "session_id": "run-123",
        "tool_use_id": "call-1",
    },
)

GET /v1/mcp/approvals/{id}/status

Check whether a pending approval has been decided. Returns a status of pending, approved, denied or expired.

bash
curl "$VW_GATEWAY_URL/v1/mcp/approvals/42/status" \
  -H "Authorization: Bearer $VW_AGENT_KEY"

JSON-RPC error codes

On the MCP proxy path (POST /v1/mcp), an approval requirement comes back as a JSON-RPC error.

CodeMeaning
-32001Tool requires approval. error.data has approval_id, poll_endpoint and expires_at.

What gets scanned

For file-write tools, the gateway scans the content being written, not the file path or the text being removed. For other tools it scans the full arguments. This means writing sensitive data can be blocked, while deleting it is allowed.

PreviousGoverning tool calls
NextPlatform REST API
API reference - Developer guide - VerifyWise User Guide