> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# invoke • AI Agent SDK

> invoke: Render a skill body into a ready-to-send prompt.

# invoke

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**SkillManager**](../classes/SkillManager) class in the [**manager**](../modules/manager) module.

Render a skill body into a ready-to-send prompt.

Substitutes `$ARGUMENTS`, `$N`, `$&#123;PRAISON_SKILL_DIR&#125;` and
optionally runs ``!`cmd` `` inline shell blocks when `shell_exec`
is True.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def invoke(name: str, raw_args: str, session_id: Optional[str], shell_exec: bool) -> Optional[str]
```

## Parameters

<ParamField query="name" type="str" required={true}>
  No description available.
</ParamField>

<ParamField query="raw_args" type="str" required={false} default="''">
  No description available.
</ParamField>

<ParamField query="session_id" type="Optional[str]" required={false}>
  No description available.
</ParamField>

<ParamField query="shell_exec" type="bool" required={false} default="False">
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="Optional[str]">
  Rendered body, or None if the skill does not exist or is not
  user-invocable.
</ResponseField>

## Uses

* `get_skill`
* `activate`
* `render_skill_body`
* `render_shell_blocks`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/skills/manager.py#L530">
  `praisonaiagents/skills/manager.py` at line 530
</Card>
