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

getAgent

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

getAgents

Next
Built with

Look up a registered agent by its route prefix. Returns undefined if no agent is registered at the given path.

Parameters

route
stringRequired

The route prefix to look up (e.g., "/sales").

Returns

AgentBase | undefined — The agent at that route, or undefined if none is registered.

Example

1import { AgentBase, AgentServer } from '@signalwire/sdk';
2
3const agent1 = new AgentBase({ name: 'sales', route: '/sales' });
4const server = new AgentServer({ port: 3000 });
5server.register(agent1);
6
7const agent = server.getAgent('/sales');
8if (agent) {
9 console.log(`Found: ${agent.name}`);
10} else {
11 console.log('No agent at /sales');
12}