ReceptionistAgent

View as MarkdownOpen in Claude

A front-desk agent that handles visitor check-in, department directory lookup, and call transfers by extension. The check_in_visitor tool is enabled by default and fires an optional callback when a visitor checks in.

1import { ReceptionistAgent } from '@signalwire/sdk';
2
3const agent = new ReceptionistAgent({ /* ReceptionistConfig */ });

ReceptionistConfig

companyName
stringRequired

Company name displayed in greetings and prompts.

departments
ReceptionistDepartment[]Required

Departments with extensions for the directory. Each ReceptionistDepartment object has:

  • name (string, required) — Department name (e.g., "Engineering").
  • extension (string, required) — Internal extension number or SIP address.
  • description (string) — Optional description of the department.
welcomeMessage
string

Custom welcome message. Defaults to "Welcome to {companyName}! How may I help you today?".

checkInEnabled
booleanDefaults to true

Whether visitor check-in functionality is enabled. When true, the check_in_visitor tool is registered.

onVisitorCheckIn
(visitor: Record<string, string>) => void | Promise<void>

Callback fired when a visitor checks in. Receives a record with visitor_name, purpose, visiting, and checked_in_at fields.

name
stringDefaults to Receptionist

Agent display name.

agentOptions
Partial<AgentOptions>

Additional AgentBase options forwarded to the constructor.

Built-in Tools

ToolDescriptionParameters
get_department_listList all departments with extensions and descriptions(none)
transfer_to_departmentTransfer the caller to a department by dialing its extensiondepartment_name (string)
check_in_visitorCheck in a visitor (only when checkInEnabled is true)visitor_name (string), purpose (string), visiting (string)

The transfer_to_department tool uses FunctionResult.connect() to dial the department’s extension and transfer the call.

Example

1import { ReceptionistAgent } from '@signalwire/sdk';
2
3const agent = new ReceptionistAgent({
4 companyName: 'Acme Corporation',
5 departments: [
6 { name: 'Sales', extension: '1001', description: 'New orders and pricing' },
7 { name: 'Support', extension: '1002', description: 'Technical issues' },
8 { name: 'Billing', extension: '1003', description: 'Invoices and payments' },
9 { name: 'HR', extension: '1004', description: 'Employment and benefits' },
10 ],
11 welcomeMessage: 'Thank you for calling Acme Corporation. How may I direct your call?',
12 onVisitorCheckIn: (visitor) => {
13 console.log(`Visitor checked in: ${visitor.visitor_name} visiting ${visitor.visiting}`);
14 },
15});
16
17agent.promptAddSection('Company', {
18 body: 'You are the receptionist for Acme Corporation.',
19});
20
21agent.serve();

createReceptionistAgent

1import { createReceptionistAgent } from '@signalwire/sdk';
2
3const agent = createReceptionistAgent({
4 companyName: 'Acme Corporation',
5 departments: [
6 { name: 'Sales', extension: '1001', description: 'New orders' },
7 { name: 'Support', extension: '1002' },
8 ],
9});