ws:Close — close a WebSocket and free its slot
ws-closeCloses a WebSocket opened by ws-connect using its registry id, then marks it closed and removes it from the registry.
Instructions
WRITES LIVE GAME STATE — closes a WebSocket previously opened with ws-connect, addressed by its registry id. Calls socket:Close() (pcall-wrapped), marks the entry closed, and removes it from the getgenv registry so the id no longer appears in ws-list. Requires getgenv and the entry from ws-connect — guarded, returning { error } when the id is unknown. Returns { id, closed = true } or { error }. Signature: { id: number, threadContext: number? }. Phase: act; cost=medium; idempotency=contextual-write. Requires: active-client, explicit-mutation-approval. Capabilities: WebSocket. Produces: structured-result. Verify with: ws-list. Safety: MUTATING; performs external network or socket I/O. 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. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |