Skip to main content
Version: 0.3.x (0.3.0)

Class ValueObjectMcpServerTool

Namespace: AdCodicem.ValueObjects.ModelContextProtocol
Assembly: AdCodicem.ValueObjects.ModelContextProtocol.dll

Creates Model Context Protocol tools whose schemas carry the rules of their value objects.

public static class ValueObjectMcpServerTool

Inheritance​

object ← ValueObjectMcpServerTool

Inherited Members​

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Remarks​

A tool created here is the SDK's own, built by with schema options that describe each value object, alone, nullable, or held by a collection, a dictionary or an object, with the rules declared on it, in its inputSchema, and in its outputSchema when it returns structured content. The SDK rewrites the output schema of its own tools for a client on a protocol version before 2026-07-28, so the tool is never wrapped.

Its value-object arguments are checked on a server that one of the WithValueObjectTools methods of configured: register it with , or, on a server created without dependency injection, hand its options to . The SDK's WithTools alone publishes its schemas and leaves a refused argument to the SDK's bare error.

Methods​

Create(MethodInfo, object?, McpServerToolCreateOptions?)​

Creates a tool for a method as does, with the rules of each value object in its schemas.

public static McpServerTool Create(MethodInfo method, object? target = null, McpServerToolCreateOptions? options = null)

Parameters​

method MethodInfo

The method the tool calls.

target object?

The instance the method runs on, or null for a static method.

options McpServerToolCreateOptions?

The options of the tool, copied and never changed: a transform its carries runs first, and the value objects are described after it.

Returns​

McpServerTool

The SDK's tool, whose value-object arguments a server one of the WithValueObjectTools methods configured checks, or one whose options was given.

Exceptions​

ArgumentNullException

method is null.

ArgumentException

method is an instance method and target is null, which the SDK refuses.