# IMentorTenant interface

> The IMentorTenant interface of Novior.MentorAgent.Abstractions.Interfaces: The tenant of the current request, as the IMentorTenantResolver named it. Scoped…

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

The tenant of the current request, as the [`IMentorTenantResolver`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentortenantresolver) named it. Scoped: inject it into an action, a policy, or a service the governor resolves from `MentorActionRequest.Services`.

## Definition

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

`public interface IMentorTenant`

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

## Properties

### `Id`

`string? Id { get; }`

The tenant's identifier; `null` when the application registers no [`IMentorTenantResolver`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentortenantresolver) and serves a single tenant.

In a turn, the tenant resolved when the turn started; during a call to the MCP server, the call's own. With a resolver registered, reading it in a scope where nothing was resolved yet — before the first turn of a circuit, say, or in the build of `WarmUpAtStartup`, which serves nobody — throws `InvalidOperationException`: it never reads as the single tenant. [`IMentorTenant.GetIdAsync`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentortenant#getidasync) resolves it there.

## Methods

### `GetIdAsync`

`ValueTask<string?> GetIdAsync(CancellationToken cancellationToken = default)`

The tenant's identifier, as [`IMentorTenant.Id`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentortenant#id); in a scope that had no turn yet — a page that only reads the memory or the dashboard — it asks the [`IMentorTenantResolver`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentortenantresolver) first, with the scope's user, under the same rules as a turn.

**Exceptions**

- `InvalidOperationException`: The resolver names no tenant for this scope, or another than its own.

---

- Previous: [IMentorTeam interface](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentorteam.md)
- Next: [IMentorTenantResolver interface](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentortenantresolver.md)
