2121logger = logging .getLogger (__name__ )
2222
2323
24- class A2AAgent :
24+ class A2AServer :
2525 """A2A-compatible wrapper for Strands Agent."""
2626
2727 def __init__ (
@@ -32,6 +32,7 @@ def __init__(
3232 host : str = "0.0.0.0" ,
3333 port : int = 9000 ,
3434 version : str = "0.0.1" ,
35+ skills : list [AgentSkill ] | None = None ,
3536 ):
3637 """Initialize an A2A-compatible agent from a Strands agent.
3738
@@ -42,6 +43,7 @@ def __init__(
4243 host: The hostname or IP address to bind the A2A server to. Defaults to "0.0.0.0".
4344 port: The port to bind the A2A server to. Defaults to 9000.
4445 version: The version of the agent. Defaults to "0.0.1".
46+ skills: The list of capabilities or functions the agent can perform.
4547 """
4648 self .host = host
4749 self .port = port
@@ -56,6 +58,7 @@ def __init__(
5658 agent_executor = StrandsA2AExecutor (self .strands_agent ),
5759 task_store = InMemoryTaskStore (),
5860 )
61+ self ._agent_skills = skills
5962 logger .info ("Strands' integration with A2A is experimental. Be aware of frequent breaking changes." )
6063
6164 @property
@@ -88,18 +91,33 @@ def public_agent_card(self) -> AgentCard:
8891 capabilities = self .capabilities ,
8992 )
9093
91- @property
92- def agent_skills (self ) -> list [AgentSkill ]:
93- """Get the list of skills this agent provides.
94+ def _get_skills_from_tools (self ) -> list [AgentSkill ]:
95+ """Get the list of skills from Strands agent tools.
9496
9597 Skills represent specific capabilities that the agent can perform.
9698 Strands agent tools are adapted to A2A skills.
9799
98100 Returns:
99101 list[AgentSkill]: A list of skills this agent provides.
100102 """
101- # TODO: translate Strands tools (native & MCP) to skills
102- return []
103+ return [
104+ AgentSkill (name = config ["name" ], id = config ["name" ], description = config ["description" ], tags = [])
105+ for config in self .strands_agent .tool_registry .get_all_tools_config ().values ()
106+ ]
107+
108+ @property
109+ def agent_skills (self ) -> list [AgentSkill ]:
110+ """Get the list of skills this agent provides."""
111+ return self ._agent_skills if self ._agent_skills is not None else self ._get_skills_from_tools ()
112+
113+ @agent_skills .setter
114+ def agent_skills (self , skills : list [AgentSkill ]) -> None :
115+ """Set the list of skills this agent provides.
116+
117+ Args:
118+ skills: A list of AgentSkill objects to set for this agent.
119+ """
120+ self ._agent_skills = skills
103121
104122 def to_starlette_app (self ) -> Starlette :
105123 """Create a Starlette application for serving this agent via HTTP.
0 commit comments