Active-site rule
Target the correct site when a workspace contains multiple sites.
The active-site rule prevents external clients and agents from writing to the wrong site. Every site-level MCP call must resolve a target site before the tool handler runs.
Why it exists
A single user can belong to many workspaces. A single agency can manage many client workspaces. Without explicit site targeting, an agent could inspect one site and mutate another. Mini Agency avoids that by resolving the target from headers, query, token scope, session context, or the _site magic argument.
Recommended target format
Use _site in tools/call arguments:
{
"name": "read",
"arguments": {
"_site": "workspace-slug/site-slug",
"nodeId": "ab_123"
}
}The value mirrors the public staging route segments. It is readable in logs and easy for agents to repeat.
Resolution order
The server can resolve site identity from several places. In practice, use one of these:
- _site in MCP tool arguments for per-call target selection.
- x-paper3-site header with workspace-slug/site-slug for a whole session.
- x-paper3-site-id header when your integration already has the UUID.
- The personal token workspace scope when there is only one valid active target.
The server strips _site before validating strict tool schemas, so tools can remain clean while still accepting the target hint.
Agency guidance
Agency agents should always pass _site. Do not rely on whichever site was last active in the browser. When a workflow creates a new client site and then edits it, pass the new slug pair immediately on the next call.