Files
Memoh/internal/mcp/jsonrpc.go
T
BBQ a75fdb8040 refactor(mcp): standardize unified tool gateway on go-sdk
Split business executors from federation sources and migrate unified tool/federation transports to the official go-sdk for stricter MCP compliance and safer session lifecycle handling. Add targeted regression tests for accept compatibility, initialization retries, pending cleanup, and include updated swagger artifacts.
2026-02-11 17:37:16 +08:00

19 lines
388 B
Go

package mcp
import (
"encoding/json"
"strings"
)
func IsNotification(req JSONRPCRequest) bool {
return len(req.ID) == 0 && strings.HasPrefix(req.Method, "notifications/")
}
func JSONRPCErrorResponse(id json.RawMessage, code int, message string) JSONRPCResponse {
return JSONRPCResponse{
JSONRPC: "2.0",
ID: id,
Error: &JSONRPCError{Code: code, Message: message},
}
}