unregister

View as MarkdownOpen in Claude

Remove an agent from the server’s registry. The agent’s routes are no longer tracked, though Hono does not fully remove mounted routers at runtime.

Because Hono does not support dynamic route removal, the agent’s HTTP routes may still respond until the server restarts. This method primarily removes the agent from the internal registry used by getAgents() and the root listing endpoint.

Parameters

route
stringRequired

The route of the agent to remove (e.g., "/sales").

Returns

void

Example

1import { AgentBase, AgentServer } from '@signalwire/sdk';
2
3const server = new AgentServer({ port: 3000 });
4const agent = new AgentBase({ name: 'sales', route: '/sales' });
5server.register(agent);
6
7server.unregister('/sales');