> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# @rpc

> **rpc**(`options?`): \{(`value`, `context`): `void`; \<`V`>(`value`, `context`): (`initial`) => `V`; }

Mark a method (or a function-valued class field) as remote-callable.

Only decorated members dispatch over the agent socket; reserved names —
the lifecycle hooks (`constructor`/`alarm`/`fetch`/`webSocket`), the
connection seams (`authorize`/`onAttach`/`onConnect`), and `_`-prefixed
names — remain non-dispatchable even if decorated, and an undecorated
override of a decorated base method is not dispatchable.

The optional metadata is introspectable via [rpcSurface](/docs/agent-sdk/interface/rpcSurface), so a caller
can discover what an agent exposes remotely.

**Parameters**

| Parameter | Type |
| - | - |
| `options` | [`RpcOptions`](/docs/agent-sdk/interface/rpc#rpcoptions) |

**Returns**

\{(`value`, `context`): `void`; \<`V`>(`value`, `context`): (`initial`) => `V`; }

**Example**

```ts theme={null}
class Support extends Agent {
  @rpc({ description: "Human takes over the thread" })
  async humanReply(text: string): Promise<void> {
    await this.messages.add("assistant", text);
  }

  async recalc(): Promise<void> {} // in-process only, not remote-callable
}
```

## RpcOptions

Metadata attached to a remote-callable method via `@rpc()`.

**Properties**

**description?**

> `readonly` `optional` **description?**: `string`

Human-readable summary of what the method does.
