> ## Documentation Index
> Fetch the complete documentation index at: https://glide-9da73dea.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# agent.budget.revoke

> Revoke a child agent and optionally auto-sweep its sub-vault back to the parent treasury. Revocation is terminal; spawn a new agent via agent.budget.create to r

Revoke a child agent and optionally auto-sweep its sub-vault back to the parent treasury. Revocation is terminal; spawn a new agent via agent.budget.create to re-provision.

## Metadata

| Field                    | Value                 |
| ------------------------ | --------------------- |
| Name                     | `agent.budget.revoke` |
| Category                 | `treasury`            |
| Required scope           | `agent:budget:revoke` |
| Idempotency key required | no                    |

## Annotations

| Annotation              | Value               |
| ----------------------- | ------------------- |
| Title                   | Revoke Agent Budget |
| Read-only               | no                  |
| Destructive             | yes                 |
| Idempotent              | yes                 |
| Open-world              | no                  |
| Requires human approval | no                  |

## Input schema

```json theme={null}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "agent_principal_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "auto_sweep": {
      "default": true,
      "type": "boolean"
    },
    "reason": {
      "default": "user_request",
      "type": "string",
      "enum": [
        "user_request",
        "anomaly",
        "admin_kill_switch",
        "expired",
        "migration"
      ]
    }
  },
  "required": [
    "agent_principal_id",
    "auto_sweep",
    "reason"
  ],
  "additionalProperties": false
}
```

## Output schema

```json theme={null}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "agent_principal_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "revoked_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "grants_revoked": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "sweep_plan_queued": {
      "type": "boolean"
    }
  },
  "required": [
    "agent_principal_id",
    "revoked_at",
    "grants_revoked",
    "sweep_plan_queued"
  ],
  "additionalProperties": false
}
```

## Auth

Caller's grant must include the `agent:budget:revoke` scope. Grants whose scope set is a superset of the required scope are accepted.

## Request examples

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://mcp.glide.co/mcp/treasury \
    -H "Authorization: Bearer $GLIDE_GRANT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "agent.budget.revoke",
      "params": {
        "agent_principal_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "auto_sweep": true,
        "reason": "user_request"
      }
    }'
  ```

  ```ts TypeScript theme={null}
  import { GlideClient } from './glide-client';

  const client = new GlideClient({ grantToken: process.env.GLIDE_GRANT_TOKEN! });

  const result = await client.call('agent.budget.revoke', {
    agent_principal_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
    auto_sweep: true,
    reason: 'user_request',
  });

  console.log(result);
  ```

  ```python Python theme={null}
  from glide_client import GlideClient
  import os

  client = GlideClient(grant_token=os.environ["GLIDE_GRANT_TOKEN"])

  result = client.call("agent.budget.revoke", {
      "agent_principal_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "auto_sweep": True,
      "reason": "user_request",
  })

  print(result)
  ```
</CodeGroup>

## Response examples

Success — agent revoked and sweep queued:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "agent_principal_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "revoked_at": "2026-05-04T11:00:00Z",
    "grants_revoked": 3,
    "sweep_plan_queued": true
  }
}
```

Agent already revoked (idempotent re-call):

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32602,
    "message": "agent a1b2c3d4-e5f6-7890-abcd-ef1234567890 was already revoked",
    "data": { "reason_id": "already_revoked" }
  }
}
```

## Errors

| Code     | Name            | Cause                                                                           | Remediation                                                        |
| -------- | --------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| `-32600` | Invalid request | Malformed JSON-RPC envelope                                                     | Check `method`, `jsonrpc`, and `id` fields                         |
| `-32602` | Invalid params  | `agent_principal_id` not a valid UUID, or agent was already revoked             | Check `reason_id` — `already_revoked` means a prior call succeeded |
| `-32001` | Unauthorized    | Grant belongs to a different tenant than the target agent                       | Confirm `agent_principal_id` was created by the calling entity     |
| `-32002` | Policy denied   | Grant missing `agent:budget:revoke` scope                                       | Issue a new grant with the required scope                          |
| `-32603` | Internal error  | Sweep-plan write failed; agent row is revoked but sweep may need manual trigger | Check `sweep_plan_queued` in a retry response                      |
