Skip to content

[BUG] A2A Server Agent Card displays internal path instead of  /a2a/{serverId}  endpoint and uses relative URL #1198

@Adam-Madet

Description

@Adam-Madet

Describe the bug

The A2A Server Agent Card currently shows the internal agent card path instead of the expected  a2a/{serverId}  endpoint. Additionally, the displayed URL is relative, which causes issues for external/third‑party agents that require a fully qualified absolute URL.

Steps To Reproduce

import { Agent, VoltAgent } from '@voltagent/core';
import { A2AServer } from '@voltagent/a2a-server';
import { honoServer } from '@voltagent/server-hono';
import type { A2ARequestContext } from '@voltagent/a2a-server';

const assistant = new Agent({
  id: 'assistant',
  name: 'Assistant',
  purpose: 'A helpful AI assistant powered by Endor.',
  instructions: 'You are a helpful assistant.',
  model: "" // whatever model placed here,
});

const a2aServer = new A2AServer({
  id: 'assistant',
  name: 'assistant',
  version: '1.0.0',
  description: 'AI assistant',
});

new VoltAgent({
  agents: { assistant },
  a2aServers: { assistant: a2aServer },
  server: honoServer({ port: 3000 }),
});


### Expected behavior

Hopefully 2 potential changes. Allowing us to either..
1. Pass our own url property into A2AServer to override what is set by VoltAgent
2. Use the correct relative path and allow us to pass a domain to be attached to the beginning of the URL
3. Allow us to override the entire agent card per agent ID (allowing developers full control)

Currently I'm overriding the agent card to work for our use cases by doing the below..

// Override agent card URL — the library hardcodes a relative path
const _getAgentCard = a2aServer.getAgentCard.bind(a2aServer);
a2aServer.getAgentCard = (agentId: string, context?: A2ARequestContext) => {
const card = _getAgentCard(agentId, context);
card.url = /a2a/${agentId};
return card;
};


### Packages

`"@apple/endor-bridge": "0.3.1"`
`"@voltagent/a2a-server": "^2.0.2"`
`"@voltagent/core": "^2.6.12"`
`"@voltagent/server-hono": "^2.0.8"`

### Additional Context

I can't contribute directly due to company policy on open source contributions but I've explored potentially forking VoltAgent internally and making the change there (I'd rather avoid this).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions