> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # setAgent > Attach the skill to an agent (called by the SkillManager). [ref-getagent]: /docs/server-sdks/reference/typescript/agents/skill-base/get-agent [ref-skillmanager]: /docs/server-sdks/reference/typescript/agents/skill-manager Attach this skill to an [`AgentBase`](/docs/server-sdks/reference/typescript/agents/agent-base). Called by the [`SkillManager`][ref-skillmanager] during `agent.addSkill()` before `setup()` runs, so [`getAgent()`][ref-getagent] is safe from within `setup()` and tool handlers. > **Note** > > Normally not called directly. If you are implementing a custom skill loader > that bypasses `addSkill()`, call this yourself before invoking `setup()`. ## **Parameters** **`agent`** `AgentBase` — required The agent instance that owns this skill. --- ## **Returns** `void` ## **Example** ```typescript {7} import { AgentBase, SkillBase } from '@signalwire/sdk'; class InlineSkill extends SkillBase { /* ... */ } const agent = new AgentBase({ name: 'demo' }); const skill = new InlineSkill(); skill.setAgent(agent); await skill.setup(); ``` > Attach the skill to an agent (called by the SkillManager).