Agent Operation Patterns
Use these patterns when exposing Zerq MCP endpoints to AI agents that need deterministic behavior and tight scope.
Pattern 1: Discover then act
Allow read-only discovery tools first, then permit mutating tools only for explicit workflows.
Pattern 2: Policy-first routing
Map each agent identity to a dedicated client and profile. Do not share broad profiles across multiple agents.
Pattern 3: Bounded retries
Agents should retry transient failures, but stop on policy responses (401, 403, 405) and require operator review.
Example tool call flow
curl -i "https://gateway.example.com/mcp" \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "X-Client-ID: support-agent" \
-H "X-Profile-ID: prod-ai-support" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"tools-1","method":"tools/list","params":{}}'
Status handling for agents
401: refresh credentials or re-authenticate.403: tool is outside policy scope; do not auto-retry.405: wrong method for MCP endpoint; fix client implementation.429: back off with jitter and respect retry window.