Skip to content

[Bug]: GetExtendedAgentCard fails with the incorrect error when the capability is not available #733

@jmesnil

Description

@jmesnil

What happened?

Summary

GetExtendedAgentCard fails on all transports because the SUT declares capabilities.extendedAgentCard: false but does not return the spec-required UnsupportedOperationError — it returns ExtendedAgentCardNotConfiguredError instead.

Requirement

Specification

Authentication: The client MUST authenticate the request using one of the schemes declared in the public AgentCard.securitySchemes and AgentCard.security fields.

Availability: This operation is only available if the public Agent Card declares capabilities.extendedAgentCard: true.

And from Section 3.3.4 (Capability Validation):

Extended Agent Card: If AgentCard.capabilities.extendedAgentCard is false or not present, attempts to call the Get Extended Agent Card operation MUST return UnsupportedOperationError. If the agent declares support but has not configured an extended card, it MUST return ExtendedAgentCardNotConfiguredError.

Expected behavior

Since the SUT's agent card declares capabilities.extendedAgentCard: false, calls to GetExtendedAgentCard should return UnsupportedOperationError with the appropriate transport-specific error code:

Transport Expected error code
JSON-RPC -32004
HTTP+JSON 400
gRPC UNIMPLEMENTED

Alternatively, if the SUT intends to support extended agent cards, it should set capabilities.extendedAgentCard: true in its agent card and configure an extended card.

Actual behavior

The SUT returns ExtendedAgentCardNotConfiguredError instead of UnsupportedOperationError:

  • HTTP+JSON: 400 with {"error": "io.a2a.spec.ExtendedAgentCardNotConfiguredError", "message": "Extended Card not configured"}
  • JSON-RPC: {"code": -32007, "message": "Extended Card not configured"}
  • gRPC: FAILED_PRECONDITION with "ExtendedCardNotConfiguredError: Extended agent card not configured"

The error ExtendedAgentCardNotConfiguredError is only appropriate when capabilities.extendedAgentCard is true but no extended card has been configured. Since the capability is false, the correct error is UnsupportedOperationError.

Reproducer

# Step 1: Verify the agent card declares extendedAgentCard: false
curl -s http://localhost:9999/.well-known/agent-card.json | python3 -c "
import sys, json
card = json.load(sys.stdin)
print('extendedAgentCard:', card.get('capabilities', {}).get('extendedAgentCard'))
"
# Output: extendedAgentCard: False

# Step 2: Call GetExtendedAgentCard via HTTP+JSON
curl -s -w "\nHTTP %{http_code}" -X GET http://localhost:9999/extendedAgentCard
# Expected: 400 with UnsupportedOperationError
# Actual:   400 with ExtendedAgentCardNotConfiguredError

# Step 3: Call GetExtendedAgentCard via JSON-RPC
curl -s -X POST http://localhost:9999 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"GetExtendedAgentCard","params":{}}'
# Expected: {"code": -32004, "message": "..."} (UnsupportedOperationError)
# Actual:   {"code": -32007, "message": "Extended Card not configured"} (ExtendedAgentCardNotConfiguredError)

# Step 4: Call GetExtendedAgentCard via gRPC
grpcurl -plaintext -d '{}' localhost:9999 lf.a2a.v1.A2AService/GetExtendedAgentCard
# Expected: UNIMPLEMENTED (UnsupportedOperationError)
# Actual:   FailedPrecondition "ExtendedCardNotConfiguredError: Extended agent card not configured"

TCK tests

tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CARD-EXT-001-grpc]
tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CARD-EXT-001-http_json]
tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CARD-EXT-001-jsonrpc]

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

compatibilityIssue related to A2A compatibility

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions