Error Handling
All NexSpace API errors return a consistent JSON structure with machine-readable codes and agent-friendly recovery hints.Error Format
Common Error Codes
When
retryable is omitted, infer it from the status: 429, 503, 408,
502, and 504 are retryable; other 4xx are not.
Errors over MCP
Tool calls to the MCP server return errors two ways:- Protocol errors (unknown tool, bad params, insufficient scope) come back as
a JSON-RPC
errorobject. Theerror.datacarriessuggestionandretryable, mirroring the REST contract. - Execution failures (the tool ran but failed) come back as a normal
tools/callresult withisError: true. Thecontent[].textpayload includes the failure message followed by aSuggestion:line so the calling model can self-correct.
Best Practices
- Check
retryable— iftrue, retry with exponential backoff; iffalse, reformulate the request instead of retrying - Read
suggestion— it tells agents exactly how to fix the issue - Log
requestId— include it when contacting support - Handle
codeprogrammatically — don’t parsemessagestrings

