< Summary

Information
Class: NexusLabs.Needlr.Copilot.McpJsonRpcRequest
Assembly: NexusLabs.Needlr.Copilot
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Copilot/McpModels.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 75
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_Jsonrpc()100%11100%
get_Id()100%11100%
get_Method()100%11100%
get_Params()100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Copilot/McpModels.cs

#LineLine coverage
 1using System.Text.Json.Serialization;
 2
 3namespace NexusLabs.Needlr.Copilot;
 4
 5// ── MCP JSON-RPC DTOs ──
 6
 7[JsonSerializable(typeof(McpJsonRpcRequest))]
 8[JsonSerializable(typeof(McpJsonRpcResponse))]
 9[JsonSourceGenerationOptions(
 10    PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
 11    DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
 12internal partial class McpJsonContext : JsonSerializerContext;
 13
 14internal sealed class McpJsonRpcRequest
 15{
 16    [JsonPropertyName("jsonrpc")]
 1217    public string Jsonrpc { get; set; } = "2.0";
 18
 19    [JsonPropertyName("id")]
 1220    public int Id { get; set; }
 21
 22    [JsonPropertyName("method")]
 1823    public string Method { get; set; } = "";
 24
 25    [JsonPropertyName("params")]
 1226    public McpCallParams? Params { get; set; }
 27}
 28
 29internal sealed class McpCallParams
 30{
 31    [JsonPropertyName("name")]
 32    public string Name { get; set; } = "";
 33
 34    [JsonPropertyName("arguments")]
 35    public Dictionary<string, string>? Arguments { get; set; }
 36}
 37
 38internal sealed class McpJsonRpcResponse
 39{
 40    [JsonPropertyName("jsonrpc")]
 41    public string? Jsonrpc { get; set; }
 42
 43    [JsonPropertyName("id")]
 44    public int Id { get; set; }
 45
 46    [JsonPropertyName("result")]
 47    public McpResult? Result { get; set; }
 48
 49    [JsonPropertyName("error")]
 50    public McpError? Error { get; set; }
 51}
 52
 53internal sealed class McpResult
 54{
 55    [JsonPropertyName("content")]
 56    public List<McpContent>? Content { get; set; }
 57}
 58
 59internal sealed class McpContent
 60{
 61    [JsonPropertyName("type")]
 62    public string? Type { get; set; }
 63
 64    [JsonPropertyName("text")]
 65    public string? Text { get; set; }
 66}
 67
 68internal sealed class McpError
 69{
 70    [JsonPropertyName("code")]
 71    public int Code { get; set; }
 72
 73    [JsonPropertyName("message")]
 74    public string? Message { get; set; }
 75}