Add DebuggerDisplay attributes to Protocol types (#1068)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com> Co-authored-by: Stephen Halter <halter73@gmail.com>
This commit is contained in:
parent
970207989e
commit
1b52ddacba
1 changed files with 175 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using System.Diagnostics;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using System.Text.Json.Serialization;
|
||||
|
|
@ -8,6 +9,7 @@ namespace ModelContextProtocol.Protocol;
|
|||
/// <summary>
|
||||
/// Represents a tool that the server is capable of calling.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||
public sealed class Tool : IBaseMetadata
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
|
@ -130,4 +132,14 @@ public sealed class Tool : IBaseMetadata
|
|||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public McpServerTool? McpServerTool { get; set; }
|
||||
|
||||
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
||||
private string DebuggerDisplay
|
||||
{
|
||||
get
|
||||
{
|
||||
string desc = Description is not null ? $", Description = \"{Description}\"" : "";
|
||||
return $"Name = {Name}{desc}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue