Class ToolError
Base type for typed tool errors.
public abstract record ToolError : IEquatable<ToolError>
- Inheritance
-
ToolError
- Implements
- Derived
- Inherited Members
Remarks
Tool implementations never throw into their callers. Every failure case is reified as a concrete ToolError wrapped in Err(ToolError). This keeps the eventual MCP-error wire format flexible while giving in-process callers a typed surface they can match on.
Constructors
ToolError(string, string)
Base type for typed tool errors.
protected ToolError(string Code, string Message)
Parameters
CodestringStable error code; safe to switch on.
MessagestringHuman-readable message; not localised.
Remarks
Tool implementations never throw into their callers. Every failure case is reified as a concrete ToolError wrapped in Err(ToolError). This keeps the eventual MCP-error wire format flexible while giving in-process callers a typed surface they can match on.
Properties
Code
Stable error code; safe to switch on.
public string Code { get; init; }
Property Value
Message
Human-readable message; not localised.
public string Message { get; init; }