< Summary

Information
Class: Shared.Contracts.Mcp.McpToolConfig
Assembly: Shared
File(s): /home/runner/work/InvAit/InvAit/Shared/Contracts/Mcp/McpModels.cs
Tag: 14_22728831704
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 106
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Name()100%11100%
get_Description()100%11100%
get_InputSchema()100%11100%
get_RequiredArguments()100%11100%
get_Enabled()100%11100%

File(s)

/home/runner/work/InvAit/InvAit/Shared/Contracts/Mcp/McpModels.cs

#LineLine coverage
 1using System.Text.Json;
 2
 3namespace Shared.Contracts.Mcp;
 4
 5/// <summary>
 6/// MCP Tool definition
 7/// </summary>
 8public class McpTool
 9{
 10    public string Name { get; set; } = string.Empty;
 11    public string? Description { get; set; }
 12    public object InputSchema { get; set; } = new();
 13}
 14
 15/// <summary>
 16/// MCP Resource definition
 17/// </summary>
 18public class McpResource
 19{
 20    public string Uri { get; set; } = string.Empty;
 21    public string Name { get; set; } = string.Empty;
 22    public string? Description { get; set; }
 23    public string? MimeType { get; set; }
 24}
 25
 26/// <summary>
 27/// MCP Prompt definition
 28/// </summary>
 29public class McpPrompt
 30{
 31    public string Name { get; set; } = string.Empty;
 32    public string? Description { get; set; }
 33    public List<McpPromptArgument> Arguments { get; set; } = new();
 34}
 35
 36/// <summary>
 37/// MCP Prompt argument
 38/// </summary>
 39public class McpPromptArgument
 40{
 41    public string Name { get; set; } = string.Empty;
 42    public string? Description { get; set; }
 43    public bool Required { get; set; }
 44}
 45
 46/// <summary>
 47/// MCP Tool configuration for settings
 48/// </summary>
 49public class McpToolConfig
 50{
 2051    public string Name { get; set; } = string.Empty;
 652    public string? Description { get; set; }
 53
 54    /// <summary>
 55    /// Full JSON Schema for tool arguments (preserves types, required fields, descriptions)
 56    /// </summary>
 757    public JsonElement? InputSchema { get; set; }
 58
 59    /// <summary>
 60    /// List of required argument names
 61    /// </summary>
 962    public List<string> RequiredArguments { get; set; } = [];
 63
 64    /// <summary>
 65    /// Временная переменная, для UI. не стоит доверять.
 66    /// </summary>
 667    public bool Enabled { get; set; } = true;
 68}
 69
 70/// <summary>
 71/// MCP Server configuration
 72/// </summary>
 73public class McpServerConfig
 74{
 75    public string Name { get; set; } = string.Empty;
 76    public string Transport { get; set; } = "stdio"; // "stdio" or "http"
 77    public string Command { get; set; } = string.Empty;
 78    public string[] Args { get; set; } = [];
 79    public string Url { get; set; } = string.Empty;
 80    public string Endpoint { get; set; } = string.Empty;
 81    public Dictionary<string, string> Env { get; set; } = new();
 82    public bool Enabled { get; set; } = true;
 83    public List<McpToolConfig> Tools { get; set; } = [];
 84}
 85
 86/// <summary>
 87/// Root model for mcp.json file deserialization
 88/// </summary>
 89public class McpSettingsFile
 90{
 91    public Dictionary<string, McpServerJsonEntry> McpServers { get; set; } = new();
 92}
 93
 94/// <summary>
 95/// Single MCP server entry in mcp.json
 96/// </summary>
 97public class McpServerJsonEntry
 98{
 99    public string? Command { get; set; }
 100
 101    public string[]? Args { get; set; }
 102
 103    public string? Url { get; set; }
 104
 105    public Dictionary<string, string>? Env { get; set; }
 106}