Skip to content

Commit 65c33d2

Browse files
author
Tarek Mahmoud Sayed
committed
Document sticky registration and escape hatch in AddKnownTools docs
Clarify that known status is sticky for the McpClient lifetime and point to RemoveKnownTools/ClearKnownTools for explicit removal.
1 parent 46c65dc commit 65c33d2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/ModelContextProtocol.Core/Client/McpClient.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ protected McpClient()
9292
/// <item>Calling <see cref="McpClient.ListToolsAsync(RequestOptions?, CancellationToken)"/> after <see cref="AddKnownTools"/> preserves
9393
/// manually registered tools — only server-discovered tools are cleared and repopulated.</item>
9494
/// <item>If the server returns a tool with the same name as a manually registered tool, the server's
95-
/// definition overwrites the registered one in the cache, but the tool retains its registered status
96-
/// and will survive subsequent cache clears.</item>
95+
/// definition overwrites the registered one in the cache, but the tool retains its known status
96+
/// and will survive subsequent cache clears. This registration is sticky for the lifetime of the
97+
/// <see cref="McpClient"/>; use <see cref="RemoveKnownTools"/> or <see cref="ClearKnownTools"/> to
98+
/// explicitly drop known tools that are no longer needed.</item>
9799
/// <item>Tools can be registered at any time — before or after <see cref="McpClient.ListToolsAsync(RequestOptions?, CancellationToken)"/>,
98100
/// and across multiple calls.</item>
99101
/// <item>Re-registering a tool with the same name overwrites the previous definition in the cache (last write wins).</item>

0 commit comments

Comments
 (0)