***

title: InfoGathererSkill
slug: /reference/typescript/agents/skills/info-gatherer
description: Collect structured information from the user based on configurable fields.
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[add-skill]: /docs/server-sdks/reference/typescript/agents/agent-base/add-skill

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

<ParamField path="fields" type={"Record<string, unknown>[]"} toc={true}>
  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"`).
</ParamField>

<ParamField path="purpose" type="string" toc={true}>
  A description of why this information is being collected (shown in prompt).
</ParamField>

<ParamField path="confirmation_message" type="string" default="Information has been saved successfully." toc={true}>
  Custom message returned after successful info collection.
</ParamField>

<ParamField path="store_globally" type="boolean" default="false" toc={true}>
  Whether to store gathered info in global data.
</ParamField>

```typescript {6-15}
import { AgentBase, InfoGathererSkill } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
agent.setPromptText('You are a helpful assistant.');

await agent.addSkill(new InfoGathererSkill({
  purpose: 'Collect contact information for follow-up.',
  fields: [
    { name: 'name', description: 'Full name', required: true },
    {
      name: 'email',
      description: 'Email address',
      required: true,
      validation: '^[\\w.+-]+@[\\w-]+\\.[\\w.]+$',
    },
    { name: 'phone', description: 'Phone number', required: false },
  ],
  store_globally: true,
}));

agent.run();
```