Skip to content

[plan] Implement standardized MCP error codes #7714

@github-actions

Description

@github-actions

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

  1. Review current error handling in tool handlers in pkg/cli/mcp_server.go
  2. Identify error types (invalid params, internal error, method not found, etc.)
  3. Replace generic errors with jsonrpc.Error constants:
    // Example
    return nil, jsonrpc.NewError(jsonrpc.InvalidParams, "workflow not found", nil)
  4. Update error messages to be clear and actionable
  5. Add tests for error scenarios

Files to Modify

  • pkg/cli/mcp_server.go - Update error returns in tool handlers
  • pkg/cli/mcp_server_test.go - Add tests for error codes

Acceptance Criteria

AI generated by Plan Command for discussion #7710

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions