***

title: executeRpc
slug: /reference/typescript/agents/function-result/execute-rpc
description: Execute a generic RPC method on a call.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[rpc-dial]: /docs/server-sdks/reference/typescript/agents/function-result/rpc-dial

[rpc-ai-message]: /docs/server-sdks/reference/typescript/agents/function-result/rpc-ai-message

[rpc-ai-unhold]: /docs/server-sdks/reference/typescript/agents/function-result/rpc-ai-unhold

[functionresult]: /docs/server-sdks/reference/typescript/agents/function-result

Execute a generic RPC method on a call. This is the low-level interface for
cross-call communication. For common operations, prefer the specific helpers
[`rpcDial()`][rpc-dial],
[`rpcAiMessage()`][rpc-ai-message], and
[`rpcAiUnhold()`][rpc-ai-unhold].

## **Parameters**

<ParamField path="opts" type="object" required={true} toc={true}>
  RPC configuration object.
</ParamField>

<Indent>
  <ParamField path="opts.method" type="string" required={true} toc={true}>
    RPC method name (e.g., `"dial"`, `"ai_message"`, `"ai_unhold"`).
  </ParamField>

  <ParamField path="opts.params" type={"Record<string, unknown>"} toc={true}>
    Parameters for the RPC method.
  </ParamField>

  <ParamField path="opts.callId" type="string" toc={true}>
    Target call ID for the RPC command.
  </ParamField>

  <ParamField path="opts.nodeId" type="string" toc={true}>
    Target node ID for the RPC command.
  </ParamField>
</Indent>

## **Returns**

[`FunctionResult`][functionresult] -- `this`, for chaining.

## **Example**

```typescript {4}
import { FunctionResult } from '@signalwire/sdk';

const result = new FunctionResult()
  .executeRpc({
    method: 'custom_method',
    params: { key: 'value' },
  });
```