{"record":{"id":"7673e691b68c4115","repo":"Tencent/WeKnora","slug":"invalid-response-from-server","errorCode":null,"errorMessage":"invalid response from server","messagePattern":"invalid response from server","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/mcp/errors.go","lineNumber":25,"sourceCode":"\tErrUnsupportedTransport = errors.New(\"unsupported transport type\")\n\n\t// ErrNotConnected is returned when operation requires connection but client is not connected\n\tErrNotConnected = errors.New(\"client not connected\")\n\n\t// ErrAlreadyConnected is returned when trying to connect an already connected client\n\tErrAlreadyConnected = errors.New(\"client already connected\")\n\n\t// ErrInitializeFailed is returned when MCP initialize handshake fails\n\tErrInitializeFailed = errors.New(\"MCP initialize handshake failed\")\n\n\t// ErrToolNotFound is returned when requested tool is not found\n\tErrToolNotFound = errors.New(\"tool not found\")\n\n\t// ErrResourceNotFound is returned when requested resource is not found\n\tErrResourceNotFound = errors.New(\"resource not found\")\n\n\t// ErrInvalidResponse is returned when server response is invalid\n\tErrInvalidResponse = errors.New(\"invalid response from server\")\n\n\t// ErrTimeout is returned when operation times out\n\tErrTimeout = errors.New(\"operation timed out\")\n\n\t// ErrConnectionClosed is returned when connection is closed unexpectedly\n\tErrConnectionClosed = errors.New(\"connection closed\")\n)\n","sourceCodeStart":7,"sourceCodeEnd":33,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/mcp/errors.go#L7-L33","documentation":"Sentinel returned when the MCP server sends a response that cannot be parsed or does not match the expected JSON-RPC shape (missing fields, wrong types, error payload where a result was expected). It indicates a protocol-level mismatch rather than a business error.","triggerScenarios":"Thrown at internal/mcp/errors.go:25 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log the raw response payload to diagnose the protocol mismatch","Verify client and server MCP protocol versions are compatible","Retry the request in case of a truncated/corrupted transport frame","Upgrade the MCP client library or server if the wire format changed"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}