Align x-mcp-header implementation with SEP-2243 spec clarifications (#1619)
Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
This commit is contained in:
parent
719eade5e0
commit
ed19286a08
1 changed files with 1035 additions and 116 deletions
|
|
@ -1221,6 +1221,15 @@ public partial class McpServerToolTests
|
|||
McpServerTool.Create(typeof(McpHeaderToolType).GetMethod(nameof(McpHeaderToolType.ToolWithNonPrimitiveHeader))!));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WithMcpHeaderOnUInt64Type_ThrowsInvalidOperationException()
|
||||
{
|
||||
// ulong is excluded per SEP-2243 because its domain extends beyond the JavaScript safe
|
||||
// integer range (and beyond long), so it cannot be represented as a signed integer header.
|
||||
Assert.Throws<InvalidOperationException>(() =>
|
||||
McpServerTool.Create(typeof(McpHeaderToolType).GetMethod(nameof(McpHeaderToolType.ToolWithUInt64Header))!));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WithMcpHeaderOnNumericType_AddsExtension()
|
||||
{
|
||||
|
|
@ -1308,5 +1317,10 @@ public partial class McpServerToolTests
|
|||
[McpServerTool]
|
||||
public static string ToolWithoutHeaders(string region, string query)
|
||||
=> "result";
|
||||
|
||||
[McpServerTool]
|
||||
public static string ToolWithUInt64Header(
|
||||
[McpHeader("Count")] ulong count)
|
||||
=> "result";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue