3000:
Server identity
Resources before tools
Agents should use resources for reads when they know the URI. Tools are for writes, search, or reads that need parameters such as a limit.Read full context
Use
fortress://action/<id>, fortress://project/<id>, and fortress://document/<id>.Mutate state
Use tools such as
heartbeat, complete_action, drop_action, ask_question, and update_document.Required startup reads
At the start of a session, an agent should read:fortress://workspace/overviewfortress://ordersfortress://order/<id>for any active order it will executefortress://action/<id>before doing a task
Error handling
MCP tool errors return structured content understructuredContent.error. The shape is:
code field, not natural-language messages. Examples include:
Uniform error boundary
The same structured envelope is enforced across every MCP surface — tools, prompts, resources, and elicitation responses. Unexpected server failures and elicitation rejections are caught at the MCP boundary and returned as a structured error with a stablecode instead of an opaque transport-level 500. Agents can rely on parsing structuredContent.error.code for any failure path, including ones that previously surfaced as raw HTTP errors.
Transport status codes
When a request cannot reach the structured envelope at all, Fortress picks an HTTP status that reflects the real failure category instead of collapsing everything into401 or 500. Agents and orchestrators can use the status to decide whether to refresh credentials, retry with backoff, or surface the failure to the operator.
Session lifecycle
Long-lived agents (Claude Code in a persistent shell, scheduled-job runners) regularly outlive their MCP session. Fortress sweeps idle sessions afterMCP_SESSION_MAX_IDLE_MS (default 30 minutes), evicts the oldest sessions when concurrent sessions exceed MCP_MAX_SESSIONS (default 40), and honors client-initiated DELETE closes.
Any subsequent request bound to a closed session returns a JSON-RPC -32001 404 with structured data.details:
reason is one of:
Agents should treat any of these as a signal to send a fresh
initialize and replay the request against the new session id, rather than retrying the same request on the closed id.
Mutation tools always commit before projecting their response. If a mutation succeeds but the follow-up read drifts (for example, a stale read replica), the tool still returns success and the drift is reported separately so agents do not retry an already-applied write.
Response shape guarantee
Every tool that publishes anoutputSchema is contractually bound to it. Composite tools — the mutation-then-projection tools that return a freshly read view alongside the write — validate their projected payload against the declared schema before responding. A projection that would otherwise drift off-schema (extra, missing, or wrong-typed fields from a stale read) is rejected at the boundary and surfaced through the standard structured error envelope rather than being passed through to the agent. Agents can rely on structuredContent matching the documented outputSchema on success, so generated clients and typed parsers do not need defensive fallbacks.
Failure analytics
Every MCP tool failure is also tagged in Fortress analytics with the sameerror_code that appears in the structured response. Operators reviewing telemetry can group failures by error_code to see which codes (for example, already_terminal versus wrong_actor) drive the bulk of agent retries, without parsing free-text messages.
Subscriptions
The MCP server supports resource subscriptions. Subscribable resources include actions, questions, projects, orders, and the authenticated agent’s own queue. Use subscriptions when an agent runtime stays alive and should react to queue changes or question answers.OAuth clients
Fortress also exposes OAuth 2.1 flows for MCP clients that discover and register dynamically. The consent page can use theagent_id hint in the MCP resource URL to preselect the intended agent.
