← All MCP tools

MCP tool

raise_agent_exception

Record a structured operational, policy or evidence exception on an active run and block the run. Use a stable machine category plus a human-readable message and detail. Raising an exception does not roll back or infer the outcome of any provider action. Ambiguous provider side effects require a permitted human to reconcile them in Operator; poll the relevant read tool for the resulting state.

Input

Pass fields from this schema as the tool arguments. Runtime ownership, product scope and readiness checks still apply.

Input JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "runId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "category": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$"
    },
    "severity": {
      "type": "string",
      "enum": [
        "info",
        "warning",
        "critical"
      ]
    },
    "message": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
    },
    "detail": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    },
    "stepId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    }
  },
  "required": [
    "runId",
    "category",
    "severity",
    "message"
  ]
}

REST mapping and authority

The tool wraps this REST endpoint. The mapping identifies path/query/body transformations and approval or idempotency headers.

Request contract
{
  "method": "POST",
  "path": "/api/v1/agent/runs/{runId}/exceptions",
  "pathFields": [
    "runId"
  ],
  "pathSchema": {
    "type": "object",
    "properties": {
      "runId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128
      }
    },
    "additionalProperties": false,
    "required": [
      "runId"
    ]
  },
  "pathEncoding": "encodeURIComponent for each path field",
  "governedAction": null,
  "headers": {},
  "bodySchema": {
    "type": "object",
    "properties": {
      "category": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120,
        "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$"
      },
      "severity": {
        "type": "string",
        "enum": [
          "info",
          "warning",
          "critical"
        ]
      },
      "message": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2000
      },
      "detail": {
        "default": {},
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      },
      "stepId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128
      }
    },
    "additionalProperties": false,
    "required": [
      "category",
      "severity",
      "message"
    ]
  },
  "responseMapping": "REST JSON is returned as MCP structuredContent and a compatibility text block; privacy-sensitive tools validate their output schema."
}

Output

This is the registered MCP output envelope. Nested fields are only modeled where the schema explicitly defines them.

Output JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "exception": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    }
  },
  "required": [
    "exception"
  ],
  "additionalProperties": {}
}

Safety annotations

MCP annotations
{
  "readOnlyHint": false,
  "destructiveHint": true,
  "idempotentHint": false,
  "openWorldHint": false
}

Annotations help a client present the tool. The API independently enforces authorization and exact action approvals. Error and retry guidance →

raise_agent_exception | AdBuyMCP docs