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

curl -X POST "https://example.com/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"      }    }  }'
{  "match": true,  "error": "string"}