Skip to content

Commit 9586075

Browse files
authored
Fix meta missing in CallToolResult (#38)
* Fix meta missing in CallToolResult * version bump
1 parent f9a3385 commit 9586075

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.1
2+
3+
- Fix issue with CallToolResult not including metadata
4+
15
## 0.6.0
26

37
- Add ToolInputSchema and ToolOutputSchema support in server.tool()

lib/src/shared/protocol.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,8 @@ abstract class Protocol {
745745

746746
return completer.future.then((response) {
747747
try {
748-
return resultFactory(response.result);
748+
return resultFactory(
749+
response.toJson()['result'] as Map<String, dynamic>);
749750
} catch (e, s) {
750751
throw McpError(
751752
ErrorCode.internalError.value,

lib/src/types.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,6 +1980,7 @@ class CallToolResult implements BaseResultData {
19801980

19811981
// Content may optionally be included even if structured based on the unstructuredCompatibility flag.
19821982
result['content'] = content.map((c) => c.toJson()).toList();
1983+
result['meta'] = meta;
19831984

19841985
// Structured or unstructured?
19851986
// Error can only be included if unstructured.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: mcp_dart
22
description: Dart Implementation of Model Context Protocol (MCP) SDK.
3-
version: 0.6.0
3+
version: 0.6.1
44
repository: https://github.com/leehack/mcp_dart
55

66
environment:

0 commit comments

Comments
 (0)