# MentorAgentSourceContext record

> The MentorAgentSourceContext record of Novior.MentorAgent.Core: What a IMentorAgentSource is given to build its agents.

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

What a [`IMentorAgentSource`](https://docs.mentoragent.net/api/novior-mentoragent-core/imentoragentsource) is given to build its agents.

## Definition

Namespace: `Novior.MentorAgent.Core`. Package: `Novior.MentorAgent`.

`public sealed record MentorAgentSourceContext : IEquatable<MentorAgentSourceContext>`

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

## Constructors

`public MentorAgentSourceContext(IChatClient ChatClient, IReadOnlyList<AIFunction> Tools)`

What a [`IMentorAgentSource`](https://docs.mentoragent.net/api/novior-mentoragent-core/imentoragentsource) is given to build its agents.

**Parameters**

- `ChatClient`: The same chat client the coordinator uses, already wrapped in MentorAgent's middleware pipeline (token counting, routing, observability). Build agents on this one, not on a fresh client, or their usage disappears from the metrics.
- `Tools`: Every Level-1 tool, **already wrapped in the gate**. An agent built from a declarative definition runs its own function-calling loop inside the workflow, where the coordinator's middleware never reaches — so the gate has to travel with the function. Hand these to the agent as-is and `RequiredRoles`, human approval, action feedback and per-tool metrics keep working exactly as they do for a C\# specialist. Building your own `AIFunction` from the same method instead would silently bypass all four.

## Properties

### `ChatClient`

`public IChatClient ChatClient { get; init; }`

The same chat client the coordinator uses, already wrapped in MentorAgent's middleware pipeline (token counting, routing, observability). Build agents on this one, not on a fresh client, or their usage disappears from the metrics.

### `Tools`

`public IReadOnlyList<AIFunction> Tools { get; init; }`

Every Level-1 tool, **already wrapped in the gate**. An agent built from a declarative definition runs its own function-calling loop inside the workflow, where the coordinator's middleware never reaches — so the gate has to travel with the function. Hand these to the agent as-is and `RequiredRoles`, human approval, action feedback and per-tool metrics keep working exactly as they do for a C\# specialist. Building your own `AIFunction` from the same method instead would silently bypass all four.

---

- Previous: [IMentorAgentSource interface](https://docs.mentoragent.net/api/novior-mentoragent-core/imentoragentsource.md)
- Next: [MentorChatReducer class](https://docs.mentoragent.net/api/novior-mentoragent-core/mentorchatreducer.md)
