APIRules

Evaluate MCP call condition

Evaluate a CEL condition against a sample MCP call context.

POST
/rules/scopes/mcp-call/conditions/evaluate

Evaluate a CEL condition against a sample MCP call context.

Authorization

ApiKeyAuth
headerAuthorizationBearer <token>

Bearer token authentication. Send an API key (a saai_api_-prefixed token) as Authorization: Bearer <token>.

Required permission

No permission required.

Request Body

application/json
  1. body
expression*string

CEL expression to evaluate

Length1 <= length
context*

The MCP call context to evaluate the expression against.

Response Body

The request has succeeded.

application/json
  1. response
match*boolean

Whether the expression matched (returned true)

error?string

Error message if evaluation failed

Example Request
curl -X POST 'https://your-org.aisecurity.services.us.connect.secureauth.com/api/v1/rules/scopes/mcp-call/conditions/evaluate' \  -H 'Content-Type: application/json' \  -d '{  "expression": "string",  "context": {    "agent": {      "id": "string",      "name": "string",      "slug": "string"    },    "user": {      "id": "string",      "name": "string",      "email": "string",      "groups": [        "string"      ]    },    "mcp": {      "id": "string",      "name": "string",      "slug": "string"    }  }}'
Example Response
{  "match": true,  "error": "string"}