> 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. # getAgent > Get the agent this skill is attached to. [ref-setagent]: /docs/server-sdks/reference/typescript/agents/skill-base/set-agent Get the [`AgentBase`](/docs/server-sdks/reference/typescript/agents/agent-base) that owns this skill instance. Called internally from `setup()` and tool handlers to interact with the agent's configuration, tools, or global data. > **Warning** > > Throws `Error` when called before the skill has been attached. The > `SkillManager` calls [`setAgent()`][ref-setagent] as part of > `addSkill()`; only call `getAgent()` from `setup()` or tool handlers where > attachment is guaranteed. ## **Returns** `AgentBase` -- the owning agent. ## **Example** ```typescript {9} import { SkillBase } from '@signalwire/sdk'; export class MySkill extends SkillBase { static SKILL_NAME = 'my-skill'; static SKILL_DESCRIPTION = 'An example skill'; async setup(): Promise { const agent = this.getAgent(); agent.addHint('Prefer concise answers.'); return true; } } ``` > Get the agent this skill is attached to.