Conversation
…or error handling Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
There was a problem hiding this comment.
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
services/browser.go:385
- [nitpick] When the type assertion for 'selector' fails, the variable 'selector' is not assigned and may be empty. Consider referencing request.Params.Arguments["selector"] directly to provide a more informative error message.
return mcp.NewToolResultError(fmt.Sprintf("selector must be a string:%v", selector)), nil
services/file_system.go:715
- [nitpick] There is an inconsistency in error message capitalization compared to other similar messages (e.g., 'Path must be a string'). Standardizing the capitalization can improve clarity and consistency.
return mcp.NewToolResultError("path must be a string"), nil
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request involves refactoring error handling and result reporting methods in several service files to use a unified approach. The changes replace custom error and result handling methods with standardized methods from the
mcppackage.Error Handling and Result Reporting Standardization:
services/browser.go: Replacedbs.CallToolResultErrandbs.CallToolResultwithmcp.NewToolResultErrorandmcp.NewToolResultTextrespectively in various methods such ashandleNavigate,handleScreenshot,handleClick,handleFill,handleSelect,handleHover, andhandleEvaluate. [1] [2] [3]services/browser_debugger.go: Updated methods likehandleDebugEnable,handleSetBreakpoint,handleRemoveBreakpoint,handlePause,handleResume, andhandleGetCallstackto usemcp.NewToolResultErrorandmcp.NewToolResultTextinstead ofbs.CallToolResultErrandbs.CallToolResult. [1] [2] [3] [4] [5] [6] [7]services/command.go: ModifiedhandleExecuteCommandto replacecs.CallToolResultErrandcs.CallToolResultwithmcp.NewToolResultErrorandmcp.NewToolResultText.services/file_system.go: Updated methods likehandleReadFile,handleWriteFile,handleListDirectory, andhandleCreateDirectoryto usemcp.NewToolResultErrorandmcp.NewToolResultTextinstead offss.CallToolResultErrandfss.CallToolResult. [1] [2] [3] [4] [5] [6] [7]