***

title: rpcAiMessage
slug: /reference/typescript/agents/function-result/rpc-ai-message
description: Inject a message into the AI agent running on another call.
max-toc-depth: 3
---------------------

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

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

Inject a message into the AI agent running on another call. Useful for
cross-call coordination, such as notifying a held caller's agent about a
status change or instructing it to relay information.

## **Parameters**

<ParamField path="callId" type="string" required={true} toc={true}>
  Call ID of the target call whose AI agent should receive the message.
</ParamField>

<ParamField path="messageText" type="string" required={true} toc={true}>
  The message text to inject into the target AI's conversation.
</ParamField>

<ParamField path="role" type="string" default="system" toc={true}>
  Role for the injected message. Typically `"system"` for instructions.
</ParamField>

## **Returns**

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

## **Example**

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

const result = new FunctionResult()
  .rpcAiMessage('call-id-123', 'The caller needs help with billing.');
```