Skip to content

Commit c64b5d6

Browse files
committed
Changelog updates and check for sampling capability
1 parent 44cead4 commit c64b5d6

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

pkgs/dart_mcp/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
been possible to use in a functional manner, so it is assumed that it had
77
no usage previously.
88
- Fix the `type` getter on `EmbeddedResource` to read the actual type field.
9+
- Add `toJson` method to the `CreateMessageResult` of a sampling request.
910

1011
## 0.4.0
1112

pkgs/dart_mcp_server/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
resources or resource links (when reading a directory).
1111
- Add `additionalProperties: false` to most schemas so they provide better
1212
errors when invoked with incorrect arguments.
13-
- Add `toJson` method to the `CreateMessageResult` of a sampling request.
13+
- Add `DartMcpServer.samplingRequest` service extension method to send a sampling
14+
request over DTD.
1415

1516
# 0.1.1 (Dart SDK 3.10.0)
1617

pkgs/dart_mcp_server/lib/src/mixins/dtd.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,13 @@ base mixin DartToolingDaemonSupport
289289
Future<void> _registerServices() async {
290290
final dtd = _dtd!;
291291

292-
await dtd.registerService(
293-
McpServiceConstants.serviceName,
294-
McpServiceConstants.samplingRequest,
295-
_handleSamplingRequest,
296-
);
292+
if (clientCapabilities.sampling != null) {
293+
await dtd.registerService(
294+
McpServiceConstants.serviceName,
295+
McpServiceConstants.samplingRequest,
296+
_handleSamplingRequest,
297+
);
298+
}
297299
}
298300

299301
Future<Map<String, Object?>> _handleSamplingRequest(Parameters params) async {

0 commit comments

Comments
 (0)