From c349b98206c017b79620c544d218e97a1af80e7b Mon Sep 17 00:00:00 2001 From: Jason Walker <913443@dadeschools.net> Date: Sat, 4 Jul 2026 17:06:41 -0400 Subject: [PATCH] docs: note in-place mutation contract on _with_optional_url Subagent review (read-only) found no blockers; this addresses its one LOW note by documenting that the helper mutates the passed dict and must receive a freshly-built one. Co-Authored-By: Claude Fable 5 --- mcp_server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mcp_server.py b/mcp_server.py index e63c37a..3964f76 100644 --- a/mcp_server.py +++ b/mcp_server.py @@ -56,7 +56,11 @@ def _reveal_endpoints() -> bool: def _with_optional_url(result: dict, url: str | None) -> dict: - """Attach web links only under the explicit endpoint reveal opt-in.""" + """Attach web links only under the explicit endpoint reveal opt-in. + + Mutates *result* in place and returns it; pass a freshly-built dict, + never a shared/aliased one. + """ if _reveal_endpoints() and url: result["url"] = url return result