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

# loadSkill

> Instantiate a skill class and add it; returns a [success, error] tuple.

[ref-addskill]: /docs/server-sdks/reference/typescript/agents/skill-manager/add-skill

[ref-skillbase]: /docs/server-sdks/reference/typescript/agents/skill-base

Construct a skill instance from the provided class and add it via
[`addSkill`][ref-addskill]. Catches any throw from `addSkill` and returns a
`[success, errorMessage]` tuple — matching the Python SDK's `load_skill`
return contract.

## **Parameters**

<ParamField path="skillClass" type="typeof SkillBase" required={true} toc={true}>
  A concrete subclass of [`SkillBase`][ref-skillbase].
</ParamField>

<ParamField path="config" type="SkillConfig" toc={true}>
  Optional configuration forwarded to the skill constructor.
</ParamField>

## **Returns**

`Promise<[boolean, string]>` — `[true, '']` on success, `[false, errorMessage]`
on any validation or setup failure.

## **Example**

```typescript {3}
import { MyCustomSkill } from './my-skill.js';

const [ok, err] = await agent.skillManager.loadSkill(MyCustomSkill, { api_key: 'secret' });
if (!ok) console.error(err);
```