mcp: unexport incidentally exported error codes (#536)

Unexport error codes that were accidentally exported. I don't think it's
possible that they could be useful for users (see #535).

Fixes #535
This commit is contained in:
Robert Findley 2025-09-26 14:04:28 -04:00 • committed by GitHub
commit b2048cd73a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -526,7 +526,7 @@ func (s *Server) getPrompt(ctx context.Context, req *GetPromptRequest) (*GetProm
if !ok {
// Return a proper JSON-RPC error with the correct error code
return nil, &jsonrpc2.WireError{
Code: CodeInvalidParams,
Code: codeInvalidParams,
Message: fmt.Sprintf("unknown prompt %q", req.Params.Name),
}
}
@ -553,7 +553,7 @@ func (s *Server) callTool(ctx context.Context, req *CallToolRequest) (*CallToolR
s.mu.Unlock()
if !ok {
return nil, &jsonrpc2.WireError{
Code: CodeInvalidParams,
Code: codeInvalidParams,
Message: fmt.Sprintf("unknown tool %q", req.Params.Name),
}
}