> ## 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.

# McpTaskAttribute

> Marks a CLR operation as an MCP task. After OData routes are mapped, the host stamps `Microsoft.OData.Mcp.V1.Task` on the matching EDM action.

## Definition

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

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

**Inheritance:** System.Attribute

## Syntax

```csharp theme={null}
Microsoft.OData.Mcp.Core.Vocabularies.McpTaskAttribute
```

## Summary

Marks a CLR operation as an MCP task. After OData routes are mapped, the host stamps
`Microsoft.OData.Mcp.V1.Task` on the matching EDM action.

## Remarks

Pair with Restier `[BoundOperation]` / `[UnboundOperation]` or an OData controller action.
Convention ModelBuilder hosts use `HasMcpTask()` instead. Pair
[McpElicitUrlAttribute](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Vocabularies/McpElicitUrlAttribute.md) to name elicit URL properties without relying on the
constructor convenience arguments. Functions are not tasked.

## Examples

```csharp theme={null}
[BoundOperation(OperationType = OperationType.Action)]
[McpTask]
public Order Ship(Order order)
{
    return order;
}
```

## Constructors

### &#x20;.ctor

Marks the method as an MCP task.

#### Syntax

```csharp theme={null}
public McpTaskAttribute(params string[] elicitUrlProperties)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `elicitUrlProperties` | `string[]` | Optional JSON property names for `ElicitUrlProperties`. |

## Properties

### &#x20;ElicitUrlProperties

Gets JSON property names for `ElicitUrlProperties`. Empty when omitted.

#### Syntax

```csharp theme={null}
public string[] ElicitUrlProperties { get; }
```

#### Property Value

Type: `string[]`


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