# IMentorTenantResolver interface

> The IMentorTenantResolver interface of Novior.MentorAgent.Abstractions.Interfaces: Names the tenant a request belongs to, so that one instance of the…

- URL: https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentortenantresolver
- Verified with: MentorAgent 1.4.0
- Last updated: 2026-11-18
- Packages: Novior.MentorAgent.Abstractions

Names the tenant a request belongs to, so that one instance of the application can serve more than one company. Without one, MentorAgent serves a single tenant, as it always has: [`IMentorTenant.Id`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentortenant#id) is `null` and nothing changes.

Register it with `AddMentorTenantResolver<T>()`. There is one per application: a second registration throws. It is a singleton: what it needs from the request's scope it resolves from [`MentorTenantRequest.Services`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-models/mentortenantrequest#services).

It is asked once for every unit of work, before anything else is done for it: when a turn starts — in a Blazor circuit, on the hub, on `/mentor/chat` and in a task from another agent — and for every `tools/list` and `tools/call` of the MCP server, whose calls share no scope. Its answer is what [`IMentorTenant.Id`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentortenant#id) reads in that scope, or during that call.

**A request is never served without a tenant.** A resolver that throws, or answers `null`, an empty string or white space, refuses the request: the turn is refused before the model is called, a `tools/call` is answered with an error and a `tools/list` lists nothing. Going on as the single tenant would put the request in the data every tenant shares. A turn whose tenant differs from the one the scope's first turn had is refused as well: a conversation stays with the tenant it began with. The exception's message is never logged, only its type.

## Definition

Namespace: `Novior.MentorAgent.Abstractions.Interfaces`. Package: `Novior.MentorAgent.Abstractions`.

`public interface IMentorTenantResolver`

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

## Methods

### `ResolveAsync`

`ValueTask<string?> ResolveAsync(MentorTenantRequest request, CancellationToken cancellationToken)`

The tenant `request` belongs to: an identifier MentorAgent uses as it is.

---

- Previous: [IMentorTenant interface](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentortenant.md)
- Next: [IMentorTour interface](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentortour.md)
