Skip to content

Commit 2093225

Browse files
domesticmousesigurdm
authored andcommitted
Making instructions optional. (dart-lang#98)
Fix for dart-lang#97
1 parent 525ea44 commit 2093225

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkgs/dart_mcp/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
which has all supported versions and whether or not they are supported.
2828
- **Breaking**: Change `InitializeRequest` and `InitializeResult` to take a
2929
`ProtocolVersion` instead of a string.
30+
- **Breaking**: Change the `InitializaeResult`'s `instructions` to `String?` to reflect
31+
that not all servers return instructions.
3032

3133
## 0.1.0
3234

pkgs/dart_mcp/lib/src/api/initialization.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extension type InitializeResult.fromMap(Map<String, Object?> _value)
4545
required ProtocolVersion protocolVersion,
4646
required ServerCapabilities serverCapabilities,
4747
required ServerImplementation serverInfo,
48-
required String instructions,
48+
String? instructions,
4949
}) => InitializeResult.fromMap({
5050
'protocolVersion': protocolVersion.versionString,
5151
'capabilities': serverCapabilities,
@@ -82,7 +82,7 @@ extension type InitializeResult.fromMap(Map<String, Object?> _value)
8282
/// This can be used by clients to improve the LLM's understanding of
8383
/// available tools, resources, etc. It can be thought of like a "hint" to the
8484
/// model. For example, this information MAY be added to the system prompt.
85-
String get instructions => _value['instructions'] as String;
85+
String? get instructions => _value['instructions'] as String?;
8686
}
8787

8888
/// This notification is sent from the client to the server after initialization

0 commit comments

Comments
 (0)