You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MCP Tools: change []string to *[]string to preserve nil vs empty
With `json:"tools,omitempty"` on a bare []string, Go collapses both
nil and []string{} to "omitted", losing the documented distinction
between "all tools" (nil) and "no tools" (empty slice). Switch the
field type to *[]string so a non-nil pointer to an empty slice
serializes as `tools: []` on the wire, matching TS `tools?: string[]`
and C# `IList<string>?` with WhenWritingNull.
Callers use the standard Go idiom for pointer-to-slice literals:
Tools: &[]string{"*"} // explicit all tools
Tools: &[]string{} // no tools
Tools: &[]string{"a","b"} // only those tools
Tools: nil // (default) all tools, field omitted
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments