Skip to navigation

unregister

View as MarkdownOpen in Claude

Remove an agent from the server. The next getApp() builds the app without the agent’s routes, and a server started with run() serves each request from the current app, so the routes stop being served. The agent no longer appears in getAgents() or the root listing endpoint.

Parameters

route
stringRequired

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

Returns

boolean — true if an agent was registered at that route and was removed, false if no agent was found at the route.

Example

import { AgentBase, AgentServer } from '@signalwire/sdk';
const server = new AgentServer({ port: 3000 });
const agent = new AgentBase({ name: 'sales', route: '/sales' });
server.register(agent);
const removed = server.unregister('/sales');
console.log(removed); // true