mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
2bd709db63
Bumps [github.com/mark3labs/mcp-go](https://github.com/mark3labs/mcp-go) from 0.37.0 to 0.43.0. - [Release notes](https://github.com/mark3labs/mcp-go/releases) - [Commits](https://github.com/mark3labs/mcp-go/compare/v0.37.0...v0.43.0) --- updated-dependencies: - dependency-name: github.com/mark3labs/mcp-go dependency-version: 0.43.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
27 lines
679 B
Go
27 lines
679 B
Go
package transport
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/mark3labs/mcp-go/mcp"
|
|
)
|
|
|
|
// NewJSONRPCErrorResponse creates a new JSONRPCResponse with an error.
|
|
func NewJSONRPCErrorResponse(id mcp.RequestId, code int, message string, data any) *JSONRPCResponse {
|
|
details := mcp.NewJSONRPCErrorDetails(code, message, data)
|
|
return &JSONRPCResponse{
|
|
JSONRPC: mcp.JSONRPC_VERSION,
|
|
ID: id,
|
|
Error: &details,
|
|
}
|
|
}
|
|
|
|
// NewJSONRPCResultResponse creates a new JSONRPCResponse with a result.
|
|
func NewJSONRPCResultResponse(id mcp.RequestId, result json.RawMessage) *JSONRPCResponse {
|
|
return &JSONRPCResponse{
|
|
JSONRPC: mcp.JSONRPC_VERSION,
|
|
ID: id,
|
|
Result: result,
|
|
}
|
|
}
|