feat: add agent-card list#188
Draft
NicoleMGomes wants to merge 5 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds A2A agent card discovery to the Agent Gateway module. A new
list_agent_cards()method onAgentGatewayClientdiscovers destination fragments labelledagw.a2a.serverand fetches each agent's card from{fragment_url}/.well-known/agent-card.json. Results can be filtered by fragment name or ORD ID via the newAgentCardFilterdataclass.This release also extracts all fragment-listing logic into a dedicated
_fragments.pymodule, centralising label constants and BTP Destination Service fragment operations that were previously scattered across_lob.py.Changes:
_models.py: newAgentCard,Agent, andAgentCardFilterdataclasses._fragments.py(new): centralised fragment discovery — label constants (LABEL_KEY,MCP_LABEL_VALUE,IAS_LABEL_VALUE,IAS_USER_LABEL_VALUE,A2A_LABEL_VALUE),list_mcp_fragments,list_a2a_fragments,get_ias_fragment_name,get_ias_user_fragment_name._lob.py: new_fetch_agent_cardandget_agent_cards_lobfunctions; fragment helpers removed (now in_fragments.py).agw_client.py: newlist_agent_cards(filter: AgentCardFilter | None)method with telemetry; customer agent path raisesAgentGatewaySDKError(not yet supported).operation.py: newAGENTGATEWAY_LIST_AGENT_CARDStelemetry operation.user-guide.md: new A2A Agent Cards section, Fragments and Labels table, updated API reference.Related Issue
Closes #
Type of Change
How to Test
agents = await agw_client.list_agent_cards()— should return oneAgentper A2A fragment (labelagw.a2a.server).agent.ord_idmatches theordIdproperty on the fragment andagent.agent_card.rawcontains the parsed JSON from{fragment_url}/.well-known/agent-card.json.AgentGatewaySDKErrorwith "not yet supported for customer agents".Checklist
Additional Notes
list_agent_cardsis currently LoB-only. Customer agent support is tracked with a TODO inagw_client.pyand will be added in a follow-up._fragments.pyis internal (_-prefixed) and not part of the public API. All functions previously accessible via_lobcontinue to work as before.AgentCardFilteruses AND semantics when bothnamesandord_idsare set. Empty lists behave the same asNone(no filtering on that field).URL(base URL) andordIdproperties. Fragments missing either are skipped with a warning log.