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:
Copilot 2026-02-17 19:45:48 -05:00 • committed by GitHub
commit ec4c732632
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,7 +31,15 @@ public sealed class Tool : IBaseMetadata
/// </para>
/// <para>
/// The description is typically presented to AI models to help them determine when
/// and how to use the tool based on user requests.
/// and how to use the tool based on user requests. A well-written description significantly
/// reduces incorrect tool invocations. Include information about what the tool does, any
/// constraints or prerequisites, and what it returns.
/// </para>
/// <para>
/// Similarly, individual parameter descriptions (provided via <see cref="System.ComponentModel.DescriptionAttribute"/>
/// on tool method parameters) are important for guiding the model to supply correct argument values.
/// Descriptions should document expected formats, valid value ranges, and any other constraints
/// the model should be aware of.
/// </para>
/// </remarks>
[JsonPropertyName("description")]