Path base: both routers mount under /agents — document routes nest as /agents/{agent_id}/documents/....
Validation: request bodies are Pydantic-validated (Schemas); violations return 422 with FastAPI's standard detail array.
Existence guard: almost every route 404s first if {agent_id} doesn't resolve.
Tool gating: tool-bearing routes 403 when the agent lacks the required tool (Tools).
Ordering: list endpoints return newest-first (id desc), except workflow steps and chunks (oldest-first) and messages (newest-first with limit/offset pagination).
Trailing slashes matter on the collection routes: POST /agents/ and GET /agents/ (with slash).