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 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
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
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
Returns
McpServerTool
The SDK's tool, whose value-object arguments a server one of the WithValueObjectTools methods
configured checks, or one whose options
Exceptions
method is null.
method is an instance method and target
is null, which the SDK refuses.