# Agent.getInstructions()
[EN] Source: https://mastra.ai/reference/agents/getInstructions

The `.getInstructions()` method retrieves the instructions configured for an agent, resolving them if they're a function. These instructions guide the agent's behavior and define its capabilities and constraints.

## Usage example

```typescript copy
await agent.getInstructions();
```

## Parameters

<PropertiesTable
  content={[
    {
      name: "options",
      type: "{ runtimeContext?: RuntimeContext }",
      isOptional: true,
      defaultValue: "{}",
      description: "Optional configuration object containing runtime context.",
    },
  ]}
/>

## Returns

<PropertiesTable
  content={[
    {
      name: "instructions",
      type: "SystemMessage | Promise<SystemMessage>",
      description:
        "The instructions configured for the agent. SystemMessage can be: string | string[] | CoreSystemMessage | CoreSystemMessage[] | SystemModelMessage | SystemModelMessage[]. Returns either directly or as a promise that resolves to the instructions.",
    },
  ]}
/>

## Extended usage example

```typescript copy
await agent.getInstructions({
  runtimeContext: new RuntimeContext(),
});
```

### Options parameters

<PropertiesTable
  content={[
    {
      name: "runtimeContext",
      type: "RuntimeContext",
      isOptional: true,
      defaultValue: "undefined",
      description:
        "Runtime context for dependency injection and contextual information.",
    },
  ]}
/>

## Related

- [Agents overview](/docs/agents/overview)
- [Runtime Context](/docs/server-db/runtime-context)


---
title: "Reference: Agent.getLLM() | Agents"
description: "Documentation for the `Agent.getLLM()` method in Mastra agents, which retrieves the language model instance."
---