JSON.stringify(undefined) returns the value undefined, not a string, so void-returning MCP tools produced content blocks with text: undefined causing clients to reject the call with -32602 despite the action running. Serialize to 'null' as a fallback so the text field is always a string.