Drive an agent session from an MCP client
Goal
Start one of your own agent sessions and send it a prompt from an MCP client, using the approval-gated agent tools.
Prerequisites
- The Redgold MCP server connected (see Connect an MCP client and query your data).
- An environment (d-pod) the session can run in.
Steps
The agent tools operate only on your own tickets, sessions, and approvals. agent_spawn and agent_prompt never take effect directly: each call creates an approval request attributed to your account and returns an approval id, and the underlying action runs only once that approval resolves.
Request a session:
{
"jsonrpc": "2.0", "id": 4, "method": "tools/call",
"params": { "name": "agent_spawn", "arguments": { "purpose": "summarize yesterday's prices", "target_environment": "my-dpod" } }
}
The result carries the approval id. Poll it with agent_action_status — a read tool, not approval-gated — until it reports the action resolved:
{
"jsonrpc": "2.0", "id": 5, "method": "tools/call",
"params": { "name": "agent_action_status", "arguments": { "approval_id": "<id-from-spawn>" } }
}
Once the session exists, list it with list_agent_sessions, send it a prompt with agent_prompt (also approval-gated), and follow the transcript with tail_agent_session (bounded to 500 lines / 30 seconds per call).
Expected output
agent_spawn returns an approval id; agent_action_status reports that approval moving from pending to resolved; list_agent_sessions then shows the new session and its status.
When it breaks
- The action never runs — the approval is still pending. Approve it (in the client that receives approvals for your account) and poll
agent_action_statusagain; the gate fails to the human, it does not auto-run. - Operator or dev tools (task management, tmux, raw SQL against the whole database, cluster operations) are not reachable with an
sk-rg-key — the tenant profile is read-only apart from these two approval-gated actions.
Source
MCP server (agent tools, approval flow).