go-sdk/internal
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Luca Candela 3785c500b5
mcp: preserve structured content number precision (#1239)
CallToolResult currently decodes structuredContent through an any field,
which converts JSON numbers to float64 and silently rounds integers
outside the IEEE-754 safe range.

This change decodes structuredContent separately with UseNumber,
preserving wire numbers as json.Number while retaining the existing
decoded object, array, and primitive shapes. The field documentation now
describes that representation. Users who depend on the previous float64
behavior can temporarily restore it with
MCPGODEBUG=structuredcontentfloat64=1.

An end-to-end in-memory client/server regression covers 9007199254740993
from a low-level Server.AddTool result. Additional coverage verifies the
compatibility option restores the legacy rounded float64 value.

Verification:
- gofmt -l .
- go test ./...
- go vet ./...

Fixes #1236

---------

Co-authored-by: Guglielmo Colombo <guglielmoc@google.com>
2026-09-16 09:22:16 +02:00
..
authutil mcp: add optional issuer validator for pre-registered client validation (SEP-2352) (#946) 2026-05-29 12:46:34 +00:00
docs mcp: preserve structured content number precision (#1239) 2026-09-16 09:22:16 +02:00
json mcp: preserve structured content number precision (#1239) 2026-09-16 09:22:16 +02:00
jsonrpc2 mcp: carry a cancelled notification's reason as the request's cancel cause (#1255) 2026-09-14 11:33:30 +00:00
mcpgodebug mcp: update JSON marshaling to not HTML-escape messages (#769) 2026-01-30 17:13:30 +01:00
oauthtest auth: validate unadvertised RFC 9207 iss instead of rejecting it (#1187) 2026-08-25 09:26:17 +00:00
readme mcp: add docs for tier 1 assessment (#1195) 2026-08-24 12:00:59 +02:00
util oauthex: oauth discovery checks (#1220) 2026-09-02 21:07:19 +02:00
xcontext x/tools: modernize interface{} -> any 2025-02-19 15:14:27 -08:00