all scenarios

tools/call result is null

null-result · Tools — execution

Endpoint (Streamable HTTP)
https://chaos-mcp.thomascdnns.com/s/null-result/mcp
On the wire — recorded from a real request
your clientchaos-mcp01initializePOST /s/null-result/mcp200 OK · application/json · 3 ms"jsonrpc""2.0""id"1"result""protocolVersion""2024-11-05""capabilities""tools""serverInfo""name""chaos-mcp/null-result""version""1.0.0""instructions""chaos-mcp scenario: null-result — tools/call result is null"02tools/call returns_nullPOST /s/null-result/mcp200 OK · application/json · 3 ms"jsonrpc""2.0""id"2"result"null

Symptom

what you'll observe

Client errors dereferencing result.content — the result is null.

Cause

what this reproduces

Returning null/None on a path that should still produce a content array.

Fix

how you'd resolve it

Always return {content: [...]}, even for empty results (use an empty text block).

Try it with curl
bash
curl -sS -X POST \
  https://chaos-mcp.thomascdnns.com/s/null-result/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '
"jsonrpc""2.0"
"id"1
"method""initialize"
"params"
"protocolVersion""2024-11-05"
"capabilities"
"clientInfo""name""curl""version""1"

'