> ## 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.

# audit.stream

> Mint a cursor for subscribing to this agent's event stream over SSE. The cursor is bound to the current grant — when the grant expires or is revoked, the SSE co

Mint a cursor for subscribing to this agent's event stream over SSE. The cursor is bound to the current grant — when the grant expires or is revoked, the SSE connection closes.

## Metadata

| Field                    | Value          |
| ------------------------ | -------------- |
| Name                     | `audit.stream` |
| Category                 | `read`         |
| Required scope           | `audit:stream` |
| Idempotency key required | no             |

## Annotations

| Annotation              | Value                     |
| ----------------------- | ------------------------- |
| Title                   | Subscribe to Audit Stream |
| Read-only               | yes                       |
| Destructive             | no                        |
| Idempotent              | no                        |
| Open-world              | no                        |
| Requires human approval | no                        |

## Input schema

```json theme={null}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "from_iso": {
      "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))$"
    }
  },
  "additionalProperties": false
}
```

## Output schema

```json theme={null}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "sse_url": {
      "type": "string",
      "format": "uri"
    },
    "cursor": {
      "type": "string",
      "minLength": 1
    },
    "expires_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))$"
    },
    "heartbeat_seconds": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "sse_url",
    "cursor",
    "expires_at",
    "heartbeat_seconds"
  ],
  "additionalProperties": false
}
```

## Request examples

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://mcp.glide.co/mcp/read \
    -H "Authorization: Bearer $GLIDE_GRANT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "audit.stream",
      "params": {
        "from_iso": "2026-05-04T00:00:00Z"
      }
    }'
  ```

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

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

  // Mint an SSE cursor starting from midnight today
  const result = await client.call('audit.stream', {
    from_iso: '2026-05-04T00:00:00Z',
  });

  // Open the SSE stream
  const eventSource = new EventSource(result.sse_url);
  eventSource.onmessage = (e) => console.log(JSON.parse(e.data));

  console.log(`Cursor expires at: ${result.expires_at}`);
  ```

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

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

  result = client.call("audit.stream", {
      "from_iso": "2026-05-04T00:00:00Z",
  })

  # Open the SSE stream
  response = requests.get(result["sse_url"], stream=True)
  sse = sseclient.SSEClient(response)
  for event in sse.events():
      print(event.data)
  ```
</CodeGroup>

## Response examples

Successful response — returns an SSE cursor URL:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "sse_url": "https://mcp.glide.co/sse/audit?cursor=eyJhbGciOiJIUzI1NiJ9.eyJhZ2VudCI6ImQ0ZTVmNmE3In0.sig",
    "cursor": "eyJhbGciOiJIUzI1NiJ9.eyJhZ2VudCI6ImQ0ZTVmNmE3In0.sig",
    "expires_at": "2026-05-04T13:00:00Z",
    "heartbeat_seconds": 30
  }
}
```

Error — missing `audit:stream` scope:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32002,
    "message": "grant does not include audit:stream scope",
    "data": {
      "reason_id": "insufficient_scope"
    }
  }
}
```

Error — `from_iso` is not a valid ISO 8601 datetime:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32602,
    "message": "from_iso does not match expected datetime format",
    "data": {
      "reason_id": "invalid_date_format"
    }
  }
}
```

## Errors

| Code     | Name               | Cause                                           | Remediation                                |
| -------- | ------------------ | ----------------------------------------------- | ------------------------------------------ |
| `-32600` | Invalid request    | Malformed JSON-RPC envelope                     | Check `method`, `jsonrpc`, and `id` fields |
| `-32602` | Invalid params     | `from_iso` is not a valid UTC ISO 8601 datetime | Validate against schema before call        |
| `-32000` | Unauthenticated    | Missing `Authorization` header                  | Supply a valid `Bearer` token              |
| `-32001` | Unauthorized       | Grant token expired or revoked                  | Refresh token via `agent.grant.refresh`    |
| `-32002` | Insufficient scope | Grant missing `audit:stream` scope              | Issue new grant with `audit:stream` scope  |
| `-32603` | Internal error     | Server-side error                               | Retry with backoff; contact support        |

## Auth

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