Skip to main content
The conventions AgentArea adds to a standard MCP tools/call so a remote MCP server knows which task, workspace and end user a call is for, and can report progress. Contract version 1. Every field is a standard MCP field or a header, so any MCP client can still call the same server. The TypeScript server side is @agentarea/tools. The platform side is agentarea_mcp/tool_context.py (keys, token) and MCPServerInstanceService.execute_tool (sending them).

Synopsis

When context is sent

AgentArea never sends agentarea/* keys without a token, so a server never has to trust _meta on its own.

Transport

_meta keys

progressToken is also set on every call (the MCP client uses the request id).

X-AgentArea-Context token

The key is the instance’s context_secret as UTF-8 bytes. Every agentarea/* key in _meta has an equal claim, and the token has no context claim that _meta lacks.

Verification a server performs

  1. Check the signature with an HS256-only algorithm list, exp/iat (reject tokens older than 10 minutes, allow 30 s skew), aud equal to the instance id, and iss equal to agentarea.
  2. If tool is present, it must equal params.name.
  3. Every agentarea/* key in _meta must equal its claim (objects compared independently of key order).
  4. Run the tool only after all three pass.
Answer a failure on the HTTP layer with a JSON-RPC error and the request id: AgentArea reports a 401 or 403 to the agent as MCP tool call failed: <host> rejected the credentials (HTTP 401).

Progress

The server sends standard notifications/progress on the call’s response stream. The worker relays them as tool.progress task events: stored in task_events and put on the task’s live stream, so they appear in the task SSE feed and its history.

Timeout

A call waits for its result for the instance’s tool_timeout_seconds (in the instance json_spec), progress notifications included, then fails as MCP tool call timed out: no result within <n> s and the server is sent notifications/cancelled.

Results

When content is empty, the model reads structuredContent as text instead.

Tool names the model sees

An agent’s MCP tool is offered to the model as mcp__<server>__<tool>, at most 64 characters (a longer name is cut and ends in an 8-character digest). <tool> is the raw tool name with characters outside [a-zA-Z0-9_-] replaced by _. <server> comes from the instance name: Two instances with the same <server> on one agent are kept apart by a suffix of the second one’s id. Your server receives the raw <tool> name in tools/call, never the qualified one, so renaming affects only what the model, the event stream and policy rules written against tool:mcp__… see. Compatibility. Names of instances whose name is ASCII did not change. An instance with a non-ASCII name was previously offered as mcp__ followed by one _ per non-ASCII character; it now gets the readable label above. Running tasks keep the names they started with. Rules written as tool:mcp:<instance id>:<tool> (what approval toggles write) are unaffected; a hand-written rule that targeted the old underscore name must be rewritten to the new name or, better, to tool:mcp:<instance id>:<tool>. Client MCP endpoints apply the same label to a non-ASCII instance name when the member has no namespace_prefix.

Idempotency

A retried tool activity sends the same task_id, tool_call_id, idempotency key and arguments, with a newly minted token. A server that is not safe to re-run remembers the result per idempotency key and returns it for a duplicate. It can say so by setting _meta["agentarea/replayed"] to true on that result. A retry’s tool.result carries attempt: <n>. It carries replayed: true when the server said so, when a wallet payment for the call had already settled, or when the call’s cost lines were already in the spend ledger; a replay never writes a second line. Both fields are absent on a first, fresh call.

Setting the inputs

The model cannot set metadata or end_user_id: they are task metadata, written when the task is created and carried into every tool call of the task, follow-ups included. Reading the task back (GET …/tasks/{task_id}, the task lists) returns both to API key and service-client callers and null to anyone else. To bill per end user, see Charge your users for task cost.

Versioning

agentarea/protocol is "<major>" or "<major>.<minor>". Servers reject an unknown major and accept any minor. Adding an optional key or claim is a minor change; removing one or changing its meaning is a major change.

Security notes

  • The static credential and context_secret are different values. Leaking the credential lets an attacker call tools but not assert a workspace, task or end user.
  • Arguments are not covered by the signature. Within its 5-minute lifetime a token can be replayed at the same server for the same tool; idempotency makes a replay of the same call a no-op.
  • end_user_id and metadata are assertions by the API caller that created the task, relayed by AgentArea. Authorize them against your own data.
  • HS256 means the server holding the secret could mint tokens for itself. Use one secret per instance.
  • Rotation: the platform holds one secret per instance. Make the server accept the old and the new secret, PATCH the instance with the new one, then drop the old one from the server.
Last modified on October 13, 2026