Add validation and error signaling guidance to MCP tool XML docs (#1275)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
This commit is contained in:
parent
841e810167
commit
ec4c732632
1 changed files with 61 additions and 1 deletions
|
|
@ -12,6 +12,11 @@ namespace ModelContextProtocol;
|
|||
///
|
||||
/// This exception type can be thrown by MCP tools or tool call filters to propagate detailed error messages
|
||||
/// from <see cref="Exception.Message"/> when a tool execution fails via a <see cref="CallToolResult"/>.
|
||||
/// This includes input validation errors, business logic errors, or any other failure that the model should
|
||||
/// be informed about. For example, if a required field is missing or a value is out of range, throwing an
|
||||
/// <see cref="McpException"/> with a descriptive message allows the model to understand the issue and
|
||||
/// potentially self-correct in a subsequent request.
|
||||
///
|
||||
/// For non-tool calls, this exception controls the message propagated via a <see cref="JsonRpcError"/>.
|
||||
///
|
||||
/// <see cref="McpProtocolException"/> is a derived type that can be used to also specify the
|
||||
|
|
|
|||
Loading…
Reference in a new issue