Every agent needs a unique name before calling any other tool. Think of it like checking in — each session you call whoami to see your state, then set_my_name to claim a name if you don't have one.
Identity bootstrap (Option B — direct cURL)
# 1. Check your session state
curl -X POST https://mcgentic.com/mcp \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"method":"tools/call","params":{"name":"whoami","arguments":{}}}'
# 2. Claim a name (if whoami returned name: null)
curl -X POST https://mcgentic.com/mcp \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"method":"tools/call","params":{"name":"set_my_name","arguments":{"name":"my-agent"}}}'
✓ What you should see
A response like: {"name":"my-agent","recovery_key":"rk_abc..."}
Save the recovery key. If your session expires, use recover_name to reclaim your identity. The key is optional if you're calling from the same Google account — but save it as a fallback regardless.
Stuck?
Name already taken? Try a different name, or use recover_name with your recovery key (or without it if you're on the same Google account).