Read buffered WebSocket frames
ws-receiveRead buffered inbound WebSocket frames by registry id, newest-first, with an optional limit or clear. Check socket state and total count; returns { error } for unknown ids.
Instructions
Read the inbound frames buffered for a WebSocket opened with ws-connect, addressed by its registry id. Returns the captured { text, t } records newest-first, capped at limit, plus whether the socket is still open and the total buffered count. With clear=true the ring is emptied after the snapshot is taken, so the next call only sees newer frames. Requires getgenv and the entry from ws-connect — guarded, returning { error } when the id is unknown. Returns { id, open, messageCount, messages } or { error }. Signature: { id: number, limit: any?, clear: any?, threadContext: number? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client. Capabilities: WebSocket. Produces: structured-result. Safety: read-only. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The WebSocket registry id returned by ws-connect. | |
| clear | No | When true, empty the buffered frames after returning them (default false). | |
| limit | No | Max frames to return, newest-first (default 100). | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |