Capabilities capabilities(String agentId) throws Exception { ConnectedAgent connectedAgent = connectedAgents.get(agentId); if (connectedAgent == null) { throw new AgentNotConnectedException(); } return connectedAgent.capabilities(); }