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

# McpElicitFormAttribute

> Marks a tool so MCP elicits a named form before the member runs. `WithTasksPlus` keeps the call on `tools/call` Multi Round-Trip Requests (`Synchronous`).

## Definition

**Assembly:** CloudNimble.McpEssentials.Core.dll

**Namespace:** CloudNimble.McpEssentials.Core.Tasks.Elicitations

**Inheritance:** System.Attribute

## Syntax

```csharp theme={"dark"}
CloudNimble.McpEssentials.Core.Tasks.Elicitations.McpElicitFormAttribute
```

## Summary

Marks a tool so MCP elicits a named form before the member runs.
`WithTasksPlus` keeps the call on `tools/call` Multi Round-Trip Requests
(`Synchronous`).

## Remarks

Pass the same name to `AddFormElicitation` and `RequireForm`.
Class-level usage applies to every `[McpServerTool]` method on the type.
When both this attribute and [McpElicitUrlAttribute](https://si.nimbleapps.cloud/mcpessentials/api-reference/CloudNimble/McpEssentials/Core/Tasks/Elicitations/McpElicitUrlAttribute.md) are present, the form wins.

## Examples

```csharp theme={"dark"}
[McpServerTool(Name = "ShipOrder")]
[McpElicitForm("ship")]
public static string ShipOrder(RequestContext&lt;CallToolRequestParams&gt; context)
{
    var result = context.RequireForm("ship");
    if (!result.IsAccepted)
    {
        return "Shipping cancelled.";
    }

    return $"Shipped as {result.Content!["trackingNumber"].GetString()}.";
}
```

## Constructors

### &#x20;.ctor

Marks the member as eliciting the named form.

#### Syntax

```csharp theme={"dark"}
public McpElicitFormAttribute(string name)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `name` | `string` | The name passed to `AddFormElicitation` and `RequireForm`. |

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentException` | Thrown when *name* is empty. |

## Properties

### &#x20;Name

Gets the keyed form name.

#### Syntax

```csharp theme={"dark"}
public string Name { get; }
```

#### Property Value

Type: `string`


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