set_agent_key
Store the session agent key in memory to authenticate update_agent, call_agent, and review_transaction without repeating the key on each call.
Instructions
Store a bearer agent key for the duration of this MCP session.
Use this immediately after register_agent returns an agent_key — it lets update_agent, call_agent, and review_transaction authenticate without restarting the server or changing environment variables.
Why not pass the key on each individual tool call? Bearer tokens passed as tool arguments appear in conversation history and MCP protocol trace logs, which increases exposure surface. Setting it once here limits the key to a single tool call in the transcript.
The key is held in memory only and does not survive a server restart. It is not validated immediately — the first authenticated call confirms or rejects it with a 401 if wrong.
AGENT_KEY env var always takes precedence over a key set here. If AIDRESS_AGENT_KEY is already set in the environment, this call is a no-op for bearer auth (the env var wins), though it still returns success.
On the hosted remote connector (api.aidress.ai), this key is stored in a process-wide slot shared by every remote caller currently connected — avoid this tool there. Instead send your own Authorization: Bearer header on the MCP connection itself; update_agent/call_agent/review_transaction read that per-request and it always wins over anything set here. This tool remains correct for a local single-user stdio server, where there is exactly one caller.
agent_key — the aidress-agent-sk-... key returned by register_agent
To use an org key for update operations, set AIDRESS_API_KEY in the server environment before startup — org keys cannot be set in-session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_key | Yes |