Sonde Docs
Integration

Integrate with Sonde Serve

JSON line protocol contract for sonde serve.

Purpose

Document the line-delimited protocol used by sonde serve for tool discovery and execution.

Inputs

  • stdin lines containing JSON requests.
  • Loaded sondage.manifest.json.

Outputs

  • One JSON line response per request line.
  • Startup readiness line when server begins.

Startup contract

Command:

sonde serve --json

First stdout line:

{
  "ok": true,
  "apiVersion": "1.0.0",
  "protocolVersion": "1.0.0",
  "command": "serve",
  "status": "ready"
}

Request schema

{
  "id": "string-or-number",
  "method": "tools/list | tools/call",
  "params": {
    "name": "tool-name",
    "input": {}
  }
}

tools/list

Request:

{
  "id": "1",
  "method": "tools/list"
}

Response shape:

{
  "id": "1",
  "ok": true,
  "protocolVersion": "1.0.0",
  "result": {
    "tools": [
      {
        "name": "deploy",
        "description": "Deploy project",
        "inputSchema": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        }
      }
    ]
  }
}

tools/call

Request:

{
  "id": "2",
  "method": "tools/call",
  "params": {
    "name": "deploy",
    "input": {
      "target": "preview"
    }
  }
}

Success response shape:

{
  "id": "2",
  "ok": true,
  "protocolVersion": "1.0.0",
  "result": {
    "tool": "deploy",
    "output": {}
  }
}

Unknown tool response:

{
  "id": "3",
  "ok": false,
  "protocolVersion": "1.0.0",
  "error": {
    "message": "Unknown tool 'dangerous-shell'"
  }
}

Malformed JSON response:

{
  "id": null,
  "ok": false,
  "protocolVersion": "1.0.0",
  "error": {
    "message": "Invalid JSON request"
  }
}

Edge cases

  • Empty lines are ignored.
  • Missing params.name for tools/call returns Missing tool name in tools/call request.
  • Runtime execution errors are returned as ok: false with request id.
  • Use protocolVersion for compatibility checks before handling responses.

See also

On this page