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

# McpTaskAnnotations

> Attaches `Microsoft.OData.Mcp.V1` to an [EdmModel](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.edmmodel) and stamps Task annotations.

## Definition

**Assembly:** Microsoft.OData.Mcp.AspNetCore.dll

**Namespace:** Microsoft.OData.Mcp.AspNetCore.Vocabularies

**Inheritance:** System.Object

## Syntax

```csharp theme={null}
Microsoft.OData.Mcp.AspNetCore.Vocabularies.McpTaskAnnotations
```

## Summary

Attaches `Microsoft.OData.Mcp.V1` to an [EdmModel](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.edmmodel) and stamps Task annotations.

## Methods

### &#x20;EnsureReferenced

Adds the MCP vocabulary as a referenced model and an `edmx:Reference` Include
when the service model does not already have it.

#### Syntax

```csharp theme={null}
public static void EnsureReferenced(Microsoft.OData.Edm.EdmModel model)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `model` | `Microsoft.OData.Edm.EdmModel` | The service model being built. |

#### Examples

```csharp theme={null}
McpTaskAnnotations.EnsureReferenced(edmModel);
```

#### Remarks

`FindTerm` only sees terms on referenced models.
`SetEdmReferences` is merged so ModelBuilder's Core/Capabilities references stay on the model.

### &#x20;StampTask

Stamps `Microsoft.OData.Mcp.V1.Task` on an action, attaching the vocabulary if needed.

#### Syntax

```csharp theme={null}
public static void StampTask(Microsoft.OData.Edm.EdmModel model, Microsoft.OData.Edm.Vocabularies.IEdmVocabularyAnnotatable target, System.Collections.Generic.IReadOnlyList<string> elicitUrlProperties = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `model` | `Microsoft.OData.Edm.EdmModel` | The service model. |
| `target` | `Microsoft.OData.Edm.Vocabularies.IEdmVocabularyAnnotatable` | The action to annotate. |
| `elicitUrlProperties` | `System.Collections.Generic.IReadOnlyList<string>?` | Optional JSON property names for `ElicitUrlProperties`. |

#### Examples

```csharp theme={null}
McpTaskAnnotations.StampTask(edmModel, authorizeAction);
```

#### Remarks

Used after OData routes are mapped, when the finished model is already in hand.
The annotation is serialized inline on *target* so it appears in
the schema that already declares the action.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.