# MentorAgentAttribute class

> The MentorAgentAttribute class of Novior.MentorAgent.Attributes: Level 2 — Decorates a class to turn it into a specialized AI agent with a Handoff Workflow…

- URL: https://docs.mentoragent.net/api/novior-mentoragent-attributes/mentoragentattribute
- Verified with: MentorAgent 1.2.0
- Last updated: 2026-10-27
- Packages: Novior.MentorAgent

Level 2 — Decorates a class to turn it into a specialized AI agent with a Handoff Workflow. The class must be registered in the DI container; implementing [`IMentorAgent`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentoragent) is optional (discovery is by this attribute alone). MentorAgent builds a `ChatClientAgent` whose tools are the class's methods marked `[Description]` or `[MentorAction]`, and connects it to the Handoff graph via `HandoffTo`.

```text title="Example"
[MentorAgent(
    Name = "OrderAgent",
    Description = "Handles everything related to orders: creation, tracking, cancellation",
    HandoffTo = ["CustomerAgent", "InvoiceAgent"]
)]
public class OrderAgent : IMentorAgent
{
    [Description("Creates a new order")]
    public async Task<Order> CreateOrder(int customerId, List<string> products) { }
}
```

## Definition

Namespace: `Novior.MentorAgent.Attributes`. Package: `Novior.MentorAgent`.

`public sealed class MentorAgentAttribute : Attribute`

```shell
dotnet add package Novior.MentorAgent
```

## Constructors

`public MentorAgentAttribute()`

## Properties

### `Description`

`public required string Description { get; init; }`

Description of the agent's capabilities. Used by the Main Coordinator to decide when to hand off to this agent.

### `HandoffTo`

`public string[] HandoffTo { get; init; }`

Names of other \[MentorAgent\] agents this agent can hand off to. Must match the `Name` values of other `MentorAgentAttribute` instances. Example: `HandoffTo = ["CustomerAgent", "InvoiceAgent"]`

### `Instructions`

`public string? Instructions { get; init; }`

Instructions (system prompt) for this agent. If null, MentorAgent auto-generates a prompt from Name and Description.

### `Name`

`public required string Name { get; init; }`

The agent name. Used as `name` in the `ChatClientAgent` and as the key in the Handoff graph.

---

- Previous: [MentorActionAttribute class](https://docs.mentoragent.net/api/novior-mentoragent-attributes/mentoractionattribute.md)
- Next: [MentorPageAttribute class](https://docs.mentoragent.net/api/novior-mentoragent-attributes/mentorpageattribute.md)
