For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
        • getAgent
        • getAgents
        • getApp
        • register
        • registerGlobalRoutingCallback
        • run
        • serveStaticFiles
        • setupSipRouting
        • unregister
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Parameters
  • Returns
  • Example
AgentsAgentServer

getAgents

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

getApp

Next
Built with

Return all registered agents keyed by their route prefix. Useful for introspection, logging, or building admin interfaces.

Parameters

None.

Returns

Map<string, AgentBase> — A map of route prefixes to AgentBase instances.

Example

1import { AgentBase, AgentServer } from '@signalwire/sdk';
2
3const agent1 = new AgentBase({ name: 'sales', route: '/sales' });
4const agent2 = new AgentBase({ name: 'support', route: '/support' });
5const server = new AgentServer({ port: 3000 });
6server.register(agent1);
7server.register(agent2);
8
9for (const [route, agent] of server.getAgents()) {
10 console.log(`${route}: ${agent.name}`);
11}
12// /sales: sales
13// /support: support