Request flow
For tools/call the server generally:
- Resolves the proxy key to agent, member, and dashboard user identifiers.
- Checks agent enabled state, membership approval, and that the target service is allowed and connected.
- Builds a Cedar resource from adapter metadata (
mapResource) and optional cached entity attributes (entity-cache, GitHub installation scope when applicable). - Loads structured policies (agent-wide or per-member), compiles them, and evaluates with WASM Cedar (
cedar-engine.ts). - Updates the tool-session counters used for session-based policy rules.
- Writes an audit record with redacted arguments where applicable (
maskToolArgs). - Forwards the JSON-RPC payload to the upstream MCP endpoint configured for that connector.
Denials return MCP-friendly JSON-RPC errors; exact shapes follow Nitro error helpers in server/error.ts.