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

Agents can be configured with default generation options for controlling model behavior, output formatting and tool and workflow calls. The `.getDefaultGenerateOptions()` method retrieves these defaults, resolving them if they are functions. These options apply to all `generate()`calls unless overridden and are useful for inspecting an agent’s unknown defaults.

## Usage example

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

## Parameters

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

## Returns

<PropertiesTable
  content={[
    {
      name: "defaultOptions",
      type: "AgentGenerateOptions | Promise<AgentGenerateOptions>",
      description:
        "The default generation options configured for the agent, either as a direct object or a promise that resolves to the options.",
    },
  ]}
/>

## Extended usage example

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

### Options parameters

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

## Related

- [Agent generation](/docs/agents/overview#generating-responses)
- [Runtime Context](/docs/server-db/runtime-context)


---
title: "Reference: Agent.getDefaultStreamOptions() | Agents"
description: "Documentation for the `Agent.getDefaultStreamOptions()` method in Mastra agents, which retrieves the default options used for stream calls."
---