Skip to content

Commit 213cbe9

Browse files
committed
rename ThrowIfXXXUnsupported methods to ThrowIfClientXXXUnsupported
1 parent f60dd25 commit 213cbe9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/ModelContextProtocol.Core/Server/McpServerExtensions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static ValueTask<CreateMessageResult> SampleAsync(
3030
this IMcpServer server, CreateMessageRequestParams request, CancellationToken cancellationToken = default)
3131
{
3232
Throw.IfNull(server);
33-
ThrowIfSamplingUnsupported(server);
33+
ThrowIfClientSamplingUnsupported(server);
3434

3535
return server.SendRequestAsync(
3636
RequestMethods.SamplingCreateMessage,
@@ -164,7 +164,7 @@ public static async Task<ChatResponse> SampleAsync(
164164
public static IChatClient AsSamplingChatClient(this IMcpServer server)
165165
{
166166
Throw.IfNull(server);
167-
ThrowIfSamplingUnsupported(server);
167+
ThrowIfClientSamplingUnsupported(server);
168168

169169
return new SamplingChatClient(server);
170170
}
@@ -198,7 +198,7 @@ public static ValueTask<ListRootsResult> RequestRootsAsync(
198198
this IMcpServer server, ListRootsRequestParams request, CancellationToken cancellationToken = default)
199199
{
200200
Throw.IfNull(server);
201-
ThrowIfRootsUnsupported(server);
201+
ThrowIfClientRootsUnsupported(server);
202202

203203
return server.SendRequestAsync(
204204
RequestMethods.RootsList,
@@ -224,7 +224,7 @@ public static ValueTask<ElicitResult> ElicitAsync(
224224
this IMcpServer server, ElicitRequestParams request, CancellationToken cancellationToken = default)
225225
{
226226
Throw.IfNull(server);
227-
ThrowIfElicitationUnsupported(server);
227+
ThrowIfClientElicitationUnsupported(server);
228228

229229
return server.SendRequestAsync(
230230
RequestMethods.ElicitationCreate,
@@ -285,7 +285,7 @@ public static bool ClientSupportsSampling(this IMcpServer server)
285285
return server.ClientCapabilities?.Sampling is not null;
286286
}
287287

288-
private static void ThrowIfSamplingUnsupported(IMcpServer server)
288+
private static void ThrowIfClientSamplingUnsupported(IMcpServer server)
289289
{
290290
if (server.ClientCapabilities?.Sampling is null)
291291
{
@@ -298,7 +298,7 @@ private static void ThrowIfSamplingUnsupported(IMcpServer server)
298298
}
299299
}
300300

301-
private static void ThrowIfRootsUnsupported(IMcpServer server)
301+
private static void ThrowIfClientRootsUnsupported(IMcpServer server)
302302
{
303303
if (server.ClientCapabilities?.Roots is null)
304304
{
@@ -311,7 +311,7 @@ private static void ThrowIfRootsUnsupported(IMcpServer server)
311311
}
312312
}
313313

314-
private static void ThrowIfElicitationUnsupported(IMcpServer server)
314+
private static void ThrowIfClientElicitationUnsupported(IMcpServer server)
315315
{
316316
if (server.ClientCapabilities?.Elicitation is null)
317317
{

0 commit comments

Comments
 (0)