Class Tool | MCP C# SDK

Namespace
ModelContextProtocol.Protocol
Assembly
ModelContextProtocol.Core.dll

Represents a tool that the server is capable of calling.

public sealed class Tool : IBaseMetadata
Inheritance

Tool

Implements
Inherited Members

Properties

Annotations

Gets or sets optional additional tool information and behavior hints.

[JsonPropertyName("annotations")]
public ToolAnnotations? Annotations { get; set; }

Property Value

ToolAnnotations

Description

Gets or sets a human-readable description of the tool.

[JsonPropertyName("description")]
public string? Description { get; set; }

Property Value

string

Execution

Gets or sets execution-related metadata for this tool.

[Experimental("MCPEXP001", UrlFormat = "https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/list-of-diagnostics.md#mcpexp001")]
[JsonIgnore]
public ToolExecution? Execution { get; set; }

Property Value

ToolExecution

Icons

Gets or sets an optional list of icons for this tool.

[JsonPropertyName("icons")]
public IList<Icon>? Icons { get; set; }

Property Value

IList<Icon>

InputSchema

Gets or sets a JSON Schema object defining the expected parameters for the tool.

[JsonPropertyName("inputSchema")]
public JsonElement InputSchema { get; set; }

Property Value

JsonElement

Exceptions

ArgumentException

The value is not a valid MCP tool JSON schema.

Meta

Gets or sets metadata reserved by MCP for protocol-level metadata.

[JsonPropertyName("_meta")]
public JsonObject? Meta { get; set; }

Property Value

JsonObject

Name

Gets or sets the unique identifier for this item.

[JsonPropertyName("name")]
public required string Name { get; set; }

Property Value

string

OutputSchema

Gets or sets a JSON Schema object defining the expected structured outputs for the tool.

[JsonPropertyName("outputSchema")]
public JsonElement? OutputSchema { get; set; }

Property Value

JsonElement?

Exceptions

ArgumentException

The value is not a valid MCP tool JSON schema.

Title

Gets or sets a title.

[JsonPropertyName("title")]
public string? Title { get; set; }

Property Value

string