Class A2aAgentCardServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
/.well-known/agent-card.json): identity, the JSON-RPC service endpoint, and the
currently visible skills. This is how external agents discover Release.
Answers 404 while the A2A feature is disabled (mirroring A2aServerEnabledFilter on
the endpoint itself). Read-only mode hides mutating skills from the card — enforcement on the
call path is the endpoint servlet's job; the card only ever advertises what would be accepted.
The card is rebuilt per request: the endpoint URL follows the configured server URL, and the skill list follows the read-only toggle, with no restart.
Why the SDK's AgentCard rather than a hand-built JSON tree. This card used to
be assembled field by field, and it drifted: it advertised protocolVersion: "1.0" while
emitting the 0.3 body — a top-level url and preferredTransport, both of which
1.0 replaced with supportedInterfaces. A spec-compliant 1.0 client reading that card
finds no callable interface and refuses to register Release at all. Building the record and
letting A2aServerJson write it makes that class of drift a compile error instead.
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
ConstructorsConstructorDescriptionA2aAgentCardServlet(Supplier<String> endpointUrl, Supplier<String> serverVersion, A2aSkillRegistry skills, BooleanSupplier enabled, BooleanSupplier readOnly) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, init, isSensitiveHeader, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
A2aAgentCardServlet
public A2aAgentCardServlet(Supplier<String> endpointUrl, Supplier<String> serverVersion, A2aSkillRegistry skills, BooleanSupplier enabled, BooleanSupplier readOnly) - Parameters:
endpointUrl- supplier of the full public A2A endpoint URL (read per request so server-URL changes are reflected immediately)serverVersion- the product version advertised on the cardskills- all built-in skills; read-only filtering happens per requestenabled- whether the A2A feature is on, read per requestreadOnly- whether the A2A feature is in read-only mode, read per request
-
-
Method Details
-
doGet
protected void doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException - Overrides:
doGetin classjakarta.servlet.http.HttpServlet- Throws:
IOException
-