InfoGathererSkill

View as MarkdownOpen in Claude

Collect structured information from the user based on configurable fields. Fields support optional validation patterns and required/optional flags. Collected data can be stored in global data.

Class: InfoGathererSkill

Tools: save_info, get_gathered_info

Env vars: None

fields
Record<string, unknown>[]

Array of field definitions to collect. Each object has:

  • name (string, required) — Field name used as the parameter key.
  • description (string, required) — Description of what this field collects.
  • required (boolean, optional) — Whether this field must be provided.
  • validation (string, optional) — Regex pattern for validating the field value.
  • type (string, optional) — Parameter type for the tool schema (defaults to "string").
purpose
string

A description of why this information is being collected (shown in prompt).

confirmation_message
stringDefaults to Information has been saved successfully.

Custom message returned after successful info collection.

store_globally
booleanDefaults to false

Whether to store gathered info in global data.

1import { AgentBase, InfoGathererSkill } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
4agent.setPromptText('You are a helpful assistant.');
5
6await agent.addSkill(new InfoGathererSkill({
7 purpose: 'Collect contact information for follow-up.',
8 fields: [
9 { name: 'name', description: 'Full name', required: true },
10 {
11 name: 'email',
12 description: 'Email address',
13 required: true,
14 validation: '^[\\w.+-]+@[\\w-]+\\.[\\w.]+$',
15 },
16 { name: 'phone', description: 'Phone number', required: false },
17 ],
18 store_globally: true,
19}));
20
21agent.run();