$npx -y skills add aws/agent-toolkit-for-aws --skill chatting-with-aws-devops-agentHave a fast, conversational analysis with the AWS DevOps Agent. Use for cost optimization, architecture review, topology mapping, knowledge / runbook discovery, security audits, dependency questions, and quick diagnostics — anything that needs a 5-30 second answer rather than a 5
| 1 | # Chat with the AWS DevOps Agent |
| 2 | |
| 3 | > **AgentSpace routing (SigV4 only):** If `list_agent_spaces` is available in your tool list and the multi-space orchestration skill has NOT been invoked yet this session, invoke it first to determine which `agent_space_id` to use. Then pass `agent_space_id` on all tool calls below. For bearer token auth this is unnecessary — the token is already scoped to one space. |
| 4 | |
| 5 | Chat is the **default**. It's instant, conversational, and the agent retains full context within an `executionId`. Only escalate to `investigating-incidents-with-aws-devops-agent` when the user describes an incident or the agent itself suggests deeper analysis is warranted. |
| 6 | |
| 7 | ## How to send messages |
| 8 | |
| 9 | **Primary — use the `chat` tool:** |
| 10 | |
| 11 | ``` |
| 12 | aws_devops_agent__chat(message="What's causing the 503 errors on checkout-service?") |
| 13 | → {"executionId": "uuid", "answer": "Based on my analysis..."} |
| 14 | ``` |
| 15 | |
| 16 | One call, full answer. No session setup needed — the tool handles CreateChat + SendMessage + response parsing internally. |
| 17 | |
| 18 | **For follow-up messages in the same conversation**, use `send_message` with the `execution_id` from the first response: |
| 19 | |
| 20 | ``` |
| 21 | aws_devops_agent__send_message( |
| 22 | execution_id="<executionId from chat response>", |
| 23 | content="What about the upstream dependency?" |
| 24 | ) |
| 25 | → "The upstream service shows..." |
| 26 | ``` |
| 27 | |
| 28 | The agent retains full context within an `executionId`. Reuse it for follow-ups — don't call `chat` again for the same conversation. |
| 29 | |
| 30 | **For browsing previous conversations:** |
| 31 | |
| 32 | ``` |
| 33 | aws_devops_agent__list_chats() |
| 34 | → {"chats": [...]} |
| 35 | ``` |
| 36 | |
| 37 | ## Injecting local context |
| 38 | |
| 39 | Pack local workspace knowledge into the `message` parameter. This is the killer feature — the DevOps Agent knows your AWS cloud; you know the user's local workspace. |
| 40 | |
| 41 | ``` |
| 42 | aws_devops_agent__chat(message="""[Local Context] |
| 43 | Service: checkout-service (from package.json) |
| 44 | Last deploy: commit abc1234 — 2h ago |
| 45 | CDK Stack: lib/checkout-stack.ts — ECS Fargate behind ALB |
| 46 | Error: ConnectionError upstream connect error |
| 47 | |
| 48 | [Question] |
| 49 | What's causing the 503 errors on the checkout-service?""") |
| 50 | ``` |
| 51 | |
| 52 | Tailor by intent: |
| 53 | |
| 54 | - **Cost questions** — include IaC files (CDK / CFN / Terraform), instance types, scaling policies |
| 55 | - **Architecture review** — IaC files + dependency manifest + public API surface |
| 56 | - **Topology mapping** — service name + key resources (cluster, ALB, RDS instance) |
| 57 | - **Knowledge / runbook discovery** — no local context needed, just ask |
| 58 | - **Quick diagnostics** — alarm/metric/error + `git log --oneline -10` |
| 59 | |
| 60 | ## Phrasing matters |
| 61 | |
| 62 | The DevOps Agent's intent detection is keyword-based: |
| 63 | |
| 64 | | Phrasing | Response time | |
| 65 | |----------|---------------| |
| 66 | | "Analyze...", "Review...", "Compare...", "What if...", "Show topology..." | 5–30s (chat) | |
| 67 | | "List...", "Show me...", "What is..." | instant (discovery) | |
| 68 | | "Investigate...", "Root cause of...", "What's wrong with..." | 5–8 min (deep — escalate to `investigating-incidents-with-aws-devops-agent` skill) | |
| 69 | |
| 70 | If the user phrases something as "investigate" but it's really a question, you can still chat — but if the agent suggests deeper analysis, escalate via the `investigating-incidents-with-aws-devops-agent` skill. |
| 71 | |
| 72 | ## Escalating to investigation |
| 73 | |
| 74 | When chat surfaces a finding that needs deep multi-service correlation, hand off: |
| 75 | |
| 76 | ``` |
| 77 | aws_devops_agent__investigate(title="Root cause of <thing chat found>") |
| 78 | ``` |
| 79 | |
| 80 | Switch to the `investigating-incidents-with-aws-devops-agent` skill for the polling/progress workflow. |
| 81 | |
| 82 | ## Fallback path (aws-mcp) |
| 83 | |
| 84 | If the remote MCP server (`aws-devops-agent`) is unavailable, fall back to `aws-mcp`: |
| 85 | |
| 86 | ``` |
| 87 | aws devops-agent create-chat --agent-space-id SPACE_ID --user-id USER_ID --user-type IAM --region us-east-1 |
| 88 | → executionId |
| 89 | ``` |
| 90 | |
| 91 | Then send a message: |
| 92 | |
| 93 | ```bash |
| 94 | aws devops-agent send-message \ |
| 95 | --agent-space-id SPACE_ID \ |
| 96 | --execution-id EXEC_ID \ |
| 97 | --user-id USER_ID \ |
| 98 | --content '<your question with local context>' \ |
| 99 | --region us-east-1 |
| 100 | ``` |
| 101 | |
| 102 | Tell the user: "Remote server unavailable — using direct AWS API fallback." |
| 103 | |
| 104 | ## Timeout behavior |
| 105 | |
| 106 | The `chat` tool buffers the full response server-side before returning. Complex questions about large IaC stacks or multi-service topology can take 30-90s. This is normal — don't retry prematurely. |
| 107 | |
| 108 | If a response fails or times out: |
| 109 | |
| 110 | 1. Retry the same `chat` call once. |
| 111 | 2. If it fails again, fall back to `aws-mcp`. |
| 112 | |
| 113 | ## Chat session lifecycle |
| 114 | |
| 115 | - **Single questions:** Use `chat` — it creates a fresh session each time. |
| 116 | - **Follow-ups:** Use `send_message` with the `execution_id` from |