-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
Description
Objective
Update tool error handling to use standardized MCP error codes from v1.2.0's jsonrpc.Error constants for better client compatibility.
Context
v1.2.0 exposes standardized error codes via jsonrpc.Error sentinels. Currently, tools return generic errors. Using standardized codes enables MCP clients to handle errors more intelligently.
Approach
- Review current error handling in tool handlers in
pkg/cli/mcp_server.go - Identify error types (invalid params, internal error, method not found, etc.)
- Replace generic errors with
jsonrpc.Errorconstants:// Example return nil, jsonrpc.NewError(jsonrpc.InvalidParams, "workflow not found", nil)
- Update error messages to be clear and actionable
- Add tests for error scenarios
Files to Modify
pkg/cli/mcp_server.go- Update error returns in tool handlerspkg/cli/mcp_server_test.go- Add tests for error codes
Acceptance Criteria
- All tool handlers use appropriate
jsonrpc.Errorcodes - Error messages are clear and actionable
- Tests verify correct error codes are returned
- Error handling follows MCP best practices
Related to [plan] Upgrade MCP Go SDK to v1.2.0 and implement improvements #7711
AI generated by Plan Command for discussion #7710
Copilot