MCPcopy Create free account
hub / github.com/aws/aws-cli / resolve_agents

Function resolve_agents

awscli/customizations/agenttoolkit/utils.py:224–238  ·  view source on GitHub ↗

Resolve agents, optionally filtered by agent id.

(agent_filter, agent_configs=None)

Source from the content-addressed store, hash-verified

222
223
224def resolve_agents(agent_filter, agent_configs=None):
225 """Resolve agents, optionally filtered by agent id."""
226 if agent_configs is None:
227 agent_configs = AGENT_CONFIGS
228 if agent_filter:
229 by_id = {c.id.lower(): c for c in agent_configs}
230 config = by_id.get(agent_filter.lower())
231 if config is None:
232 raise ParamValidationError(
233 f'Invalid agent "{agent_filter}". Valid values: '
234 f'{", ".join(sorted(c.id for c in agent_configs))}.'
235 )
236 agent = config.detect()
237 return [agent] if agent is not None else []
238 return get_detected_agents(agent_configs=agent_configs)

Callers 4

_run_mainMethod · 0.90
_run_mainMethod · 0.90
_run_mainMethod · 0.90
_run_mainMethod · 0.90

Calls 3

get_detected_agentsFunction · 0.90
detectMethod · 0.80

Tested by

no test coverage detected