Skip to content

add basic file system server example #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add isError to error results for missing files
  • Loading branch information
jakemac53 committed May 6, 2025
commit 8d23b5bddb3c232aa897c6584584efc4b23e4dde
2 changes: 2 additions & 0 deletions pkgs/dart_mcp/example/file_system_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ final class SimpleFileSystemServer extends MCPServer
if (!await file.exists()) {
return CallToolResult(
content: [TextContent(text: 'File does not exist')],
isError: true,
);
}
return CallToolResult(
Expand All @@ -107,6 +108,7 @@ final class SimpleFileSystemServer extends MCPServer
if (!await file.exists()) {
return CallToolResult(
content: [TextContent(text: 'File does not exist')],
isError: true,
);
}
await file.delete();
Expand Down
Loading