Title
A2A agent listing returns 500 in MCP Gateway /docs, preventing retrieval of agent_id; invoke test also fails with HTTP 500
🐞 Bug Summary
I created and registered an A2A agent successfully in IBM Context Forge, and the agent appears as active and reachable in the UI.
However, when testing the A2A APIs from the FastAPI MCP Gateway Swagger /docs page, the List A2A Agents endpoint (GET /a2a) returns 500 Internal Server Error instead of returning the registered agents. Because of this, I cannot get the agent_id required to test Get A2A Agent (GET /a2a/{agent_id}).
Additionally, after registration, invoking the agent from IBM Context Forge shows the agent card as active/reachable but the test execution fails with HTTP 500.
🧩 Affected Component
-
mcpgateway - API
-
mcpgateway - UI (admin panel)
-
mcpgateway.wrapper - stdio wrapper
- Federation or Transports
- CLI, Makefiles, or shell scripts
- Container setup (Docker/Podman/Compose)
- Other (explain below)
🔁 Steps to Reproduce
- Create an A2A agent and register it in IBM Context Forge.
- Confirm the agent is shown as up/running in the UI.
- Open the MCP Gateway Swagger docs:
https://maassist06-mcp-accesspoint.cp.manh.cloud/docs
- Navigate to the A2A Agents section and test the endpoints, especially:
GET /a2a
GET /a2a/{agent_id}
POST /a2a/{agent_name}/invoke
- Call List A2A Agents (
GET /a2a).
- Observe that the request fails with 500 Internal Server Error.
- Check the deployment logs.
- Also, from the IBM Context Forge UI, try Test / Invoke for the registered agent.
- Observe the UI shows:
helloworld
Hello world A2A agent
Active
Reachable
Endpoint: http://localhost:8083/agent
Executions: 0 | Success Rate: N/A
❌ Test Failed
Error: HTTP 500
🤔 Expected Behavior
GET /a2a should return the list of registered A2A agents visible to the authenticated user.
- The response should include the agent metadata and
agent_id, allowing follow-up calls such as GET /a2a/{agent_id}.
- Invoking the registered A2A agent from IBM Context Forge should succeed instead of returning HTTP 500.
📓 Logs / Error Output
⚠️ No secrets, credentials, or tokens included below.
2026-05-06 08:57:14,784 - mcpgateway.services.team_management_service - ERROR - Failed to get teams for user {'email': 'admin@admin.com', 'full_name': 'Platform Administrator', 'is_admin': True, 'ip_address': '103.82.211.205', 'user_agent': 'Mozilla/5.0 ...', 'db': <sqlalchemy.orm.session.Session object at 0x...>}: (sqlite3.ProgrammingError) Error binding parameter 1: type 'dict' is not supported
SQL:
SELECT email_teams.id AS email_teams_id, email_teams.name AS email_teams_name, email_teams.slug AS email_teams_slug, email_teams.description AS email_teams_description, email_teams.created_by AS email_teams_created_by, email_teams.is_personal AS email_teams_is_personal, email_teams.visibility AS email_teams_visibility, email_teams.max_members AS email_teams_max_members, email_teams.created_at AS email_teams_created_at, email_teams.updated_at AS email_teams_updated_at, email_teams.is_active AS email_teams_is_active
FROM email_teams JOIN email_team_members ON email_teams.id = email_team_members.team_id
WHERE email_team_members.user_email = ? AND email_team_members.is_active IS 1 AND email_teams.is_active IS 1
parameters:
({'email': 'admin@admin.com', 'full_name': 'Platform Administrator', 'is_admin': True, ...},)
2026-05-06 08:57:14,790 - uvicorn.access - INFO - 103.82.211.205:0 - "GET /a2a HTTP/1.1" 500
Traceback (most recent call last):
...
File "/app/mcpgateway/main.py", line 1677, in list_a2a_agents
return await a2a_service.list_agents_for_user(db, user_email=user, team_id=team_id, visibility=visibility, include_inactive=include_inactive, skip=skip, limit=limit)
...
sqlalchemy.exc.ProgrammingError: (sqlite3.ProgrammingError) Error binding parameter 1: type 'dict' is not supported
SQL:
SELECT a2a_agents.id, a2a_agents.name, a2a_agents.slug, a2a_agents.description, a2a_agents.endpoint_url, a2a_agents.agent_type, a2a_agents.protocol_version, a2a_agents.capabilities, a2a_agents.config, a2a_agents.auth_type, a2a_agents.auth_value, a2a_agents.enabled, a2a_agents.reachable, a2a_agents.created_at, a2a_agents.updated_at, a2a_agents.last_interaction, a2a_agents.tags, a2a_agents.created_by, a2a_agents.created_from_ip, a2a_agents.created_via, a2a_agents.created_user_agent, a2a_agents.modified_by, a2a_agents.modified_from_ip, a2a_agents.modified_via, a2a_agents.modified_user_agent, a2a_agents.import_batch_id, a2a_agents.federation_source, a2a_agents.version, a2a_agents.team_id, a2a_agents.owner_email, a2a_agents.visibility
FROM a2a_agents
WHERE a2a_agents.enabled IS 1 AND (a2a_agents.owner_email = ? OR a2a_agents.visibility = ?)
ORDER BY a2a_agents.created_at DESC
LIMIT ? OFFSET ?
parameters:
({'email': 'admin@admin.com', 'full_name': 'Platform Administrator', 'is_admin': True, ...}, 'public', 100, 0)
Observed invocation result in UI:
helloworld
Hello world A2A agent
Active
Reachable
customAuth: None
Endpoint: http://localhost:8083/agent
Executions: 0 | Success Rate: N/A
Created: 2026-05-06 10:16:35
❌ Test Failed
Error: HTTP 500:
🧠 Environment Info
| Key |
Value |
| Version or commit |
0.7.0 |
| Runtime |
Python 3.12, Uvicorn |
| Platform / OS |
Not yet confirmed |
| Container |
Containerized deployment |
🧩 Additional Context (optional)
- The A2A agent registration itself appears to succeed.
- The primary blocker is that
GET /a2a fails with 500, so I cannot obtain the agent_id needed for GET /a2a/{agent_id}.
- From the stack trace, it looks like the request is passing a full authenticated user dict where the SQL query expects a scalar email string.
- The relevant call appears to be:
return await a2a_service.list_agents_for_user(db, user_email=user, ...)
It may need to pass something like user["email"] instead of the entire user object.
- There may also be a second issue affecting invocation, since the registered agent endpoint is currently shown as:
http://localhost:8083/agent
If the gateway/runtime is not on the same host/network namespace as that agent process, localhost may not be reachable from the MCP Gateway container/pod even if the agent is reachable in its own local environment.
- I can attach screenshots for:
- Agent shown as active/running in IBM Context Forge
- Swagger
/docs A2A endpoints
- UI test failure showing HTTP 500
Title
A2A agent listing returns 500 in MCP Gateway
/docs, preventing retrieval ofagent_id; invoke test also fails with HTTP 500🐞 Bug Summary
I created and registered an A2A agent successfully in IBM Context Forge, and the agent appears as active and reachable in the UI.
However, when testing the A2A APIs from the FastAPI MCP Gateway Swagger
/docspage, the List A2A Agents endpoint (GET /a2a) returns 500 Internal Server Error instead of returning the registered agents. Because of this, I cannot get theagent_idrequired to test Get A2A Agent (GET /a2a/{agent_id}).Additionally, after registration, invoking the agent from IBM Context Forge shows the agent card as active/reachable but the test execution fails with HTTP 500.
🧩 Affected Component
mcpgateway- APImcpgateway- UI (admin panel)mcpgateway.wrapper- stdio wrapper🔁 Steps to Reproduce
https://maassist06-mcp-accesspoint.cp.manh.cloud/docsGET /a2aGET /a2a/{agent_id}POST /a2a/{agent_name}/invokeGET /a2a).helloworldHello world A2A agentActiveReachableEndpoint: http://localhost:8083/agentExecutions: 0 | Success Rate: N/A❌ Test FailedError: HTTP 500🤔 Expected Behavior
GET /a2ashould return the list of registered A2A agents visible to the authenticated user.agent_id, allowing follow-up calls such asGET /a2a/{agent_id}.📓 Logs / Error Output
Observed invocation result in UI:
🧠 Environment Info
🧩 Additional Context (optional)
GET /a2afails with 500, so I cannot obtain theagent_idneeded forGET /a2a/{agent_id}.It may need to pass something like
user["email"]instead of the entire user object.If the gateway/runtime is not on the same host/network namespace as that agent process,
localhostmay not be reachable from the MCP Gateway container/pod even if the agent is reachable in its own local environment./docsA2A endpoints