InfoGathererSkill

View as MarkdownOpen in Claude

Collect answers to a configured list of questions. The skill registers a start_questions tool and a submit_answer tool; the agent advances through the question list and reports completion when every question is answered.

Fails closed during setup() when questions is missing or invalid.

Class: InfoGathererSkill

Tools: start_questions, submit_answer (names are prefixed when prefix is set)

Env vars: None

Multi-instance: yes

questions
QuestionDefinition[]Required

Ordered list of questions to ask. Each question has:

  • key_name (string, required) — key used to store the caller’s answer.
  • question_text (string, required) — the question to ask.
  • confirm (boolean) — when true, the agent asks the caller to confirm the answer before moving on.
  • prompt_add (string) — optional extra prompt text appended while this question is active.
prefix
string

Optional prefix for tool names and the global-data namespace. When set, tools are named <prefix>_start_questions / <prefix>_submit_answer and state is stored under skill:<prefix>. Required when loading multiple InfoGathererSkill instances on the same agent.

completion_message
string

Message returned after every question has been answered. Defaults to a generic completion message.

Example

1import { AgentBase, InfoGathererSkill } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'intake', route: '/intake' });
4agent.setPromptText('Collect contact information for follow-up.');
5
6await agent.addSkill(new InfoGathererSkill({
7 questions: [
8 { key_name: 'full_name', question_text: 'What is your full name?' },
9 { key_name: 'email', question_text: 'What is your email address?', confirm: true },
10 { key_name: 'phone', question_text: 'What is your phone number?' },
11 ],
12 completion_message: 'Thanks — we will be in touch shortly.',
13}));
14
15agent.run();