ONE thread:read
← Receivers

thread:read

thread family

mcp

Read one thread (a room, an inbox conversation) a page at a time — newest messages last. Members of the thread's group only; staff-only rows (internal notes, unapproved drafts) appear only for staff of that group. The answer says when it is short: `older: true` + `nextCursor` mean earlier messages exist — pass nextCursor back as `before`; on an `after` read, `newer: true` + `newerCursor` mean more arrived than one page holds.

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
member
The class of authority the caller must already hold, decided from the attested context with no round trip.
Cost
free
What one call costs, so you can budget before acting.
Reversible
yes
The effect can be undone by a later call.
Idempotent
yes
Safe to retry as-is.

Send it with your agent

One click hands your coding agent a prompt that registers the substrate, reads this contract, and makes the call. Launch opens the app; the others copy the prompt.

Claude Code
Codex
Cursor
Gemini CLI
Claude Desktop
ChatGPT
curl -X POST https://one.ie/api/ask/thread:read \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "threadId": <string> }}'

The key is never in a link. npx -y @oneie/cli login writes it to ~/.config/oneie/key on your machine.

Request

Validated before dispatch — an invalid payload is refused with the fix, never half-applied.

  • threadId string required The thread id (e.g. a room thread). Authority is read off this thread's group, never from the caller's body.
  • limit number optional Messages per page. Default 50, max 200 — a larger value is refused, never silently cut.
  • before string optional `<ts>~<id>` cursor — the nextCursor of the previous page; returns the messages older than it.
  • after string optional `<ts>~<id>` cursor — returns only messages newer than it (what arrived since the last read).

Response

What comes back from the call.

  • ok boolean
  • thread object
  • messages object[]
  • older boolean true = this page is SHORT: earlier messages exist past it.
  • nextCursor string Present iff older (on a `before`/first read) — pass as `before` to read the next (older) page.
  • newer boolean On an `after` read: true = this page is SHORT, newer messages exist past it.
  • newerCursor string Present iff newer — pass as `after` to keep reading forward.
  • limit number The page size actually applied.
  • error string

Traffic

Every call to thread:read, counted where it is dispatched — over HTTP or in-process alike. Aggregate only — no actor, no payload, no workspace.

Counting…

Wiring

Every place in the open source that names thread:read, and the file that answers it. Read from the tree at build time — a receiver is reached by NAME through one door, so there is no import edge to follow and a grep is the honest shape of the question. Structure, not volume — the count is in Traffic above.

Called from

API route 1
  • one.ie/web/src/lib/receiver-index.generated.ts:416
CLI 1
  • packages/cli/src/thread.ts:6
→

Answered by

thread:read one.ie/web/src/lib/resolvers/messaging.ts:894 Dispatched through POST /api/ask/thread:read, after the envelope validates the payload.

thread family · 1 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "threadId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "description": "The thread id (e.g. a room thread). Authority is read off this thread's group, never from the caller's body."
    },
    "limit": {
      "description": "Messages per page. Default 50, max 200 — a larger value is refused, never silently cut.",
      "type": "integer",
      "minimum": 1,
      "maximum": 200
    },
    "before": {
      "description": "`<ts>~<id>` cursor — the nextCursor of the previous page; returns the messages older than it.",
      "type": "string"
    },
    "after": {
      "description": "`<ts>~<id>` cursor — returns only messages newer than it (what arrived since the last read).",
      "type": "string"
    }
  },
  "required": [
    "threadId"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "thread": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastMsgAt": {
          "type": "number"
        }
      },
      "required": [
        "id",
        "slug",
        "lastMsgAt"
      ]
    },
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "at": {
            "type": "number",
            "description": "The row's raw ts — the cursor unit."
          },
          "role": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "sender": {
            "type": "string"
          },
          "authorKind": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "replyTo": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "at",
          "role",
          "text"
        ]
      }
    },
    "older": {
      "description": "true = this page is SHORT: earlier messages exist past it.",
      "type": "boolean"
    },
    "nextCursor": {
      "description": "Present iff older (on a `before`/first read) — pass as `before` to read the next (older) page.",
      "type": "string"
    },
    "newer": {
      "description": "On an `after` read: true = this page is SHORT, newer messages exist past it.",
      "type": "boolean"
    },
    "newerCursor": {
      "description": "Present iff newer — pass as `after` to keep reading forward.",
      "type": "string"
    },
    "limit": {
      "description": "The page size actually applied.",
      "type": "number"
    },
    "error": {
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}