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

# @agent

The `@agent` decorator is used to define agent metadata and information about the runtime environment that will be provisioned to execute it.

<CodeGroup>
  ```python agent.py theme={null}
  @agent(
      name="my-agent",
      required_env_vars=["CLAUDE_API_KEY"]
  )
  ```
</CodeGroup>

The only required argument for the `@agent` decorator is the `name` argument. The `name` must be unique per workspace; changing the `name` will create a new agent or overwrite an existing agent if the `name` already exists.

### Arguments

<ResponseField name="name" type="string" required>
  The name of the agent.
</ResponseField>

<ResponseField name="required_env_vars" type="array">
  The environment variables that are required to run your agent. Automations cannot be enabled when these are not defined.
</ResponseField>
