https://retellai.com/?utm_source=discord&utm_medium=seo logo
I need to get transcript and call id when agent us...
# ❓・ai-evy-support
n
@AI Evy I need to get transcript and call id when agent use my mcp
a
Thanks for tagging me @nicottone. I'll look through relevant sources and get back to you shortly.
### Answer To get the
call_id
and transcript when your agent uses an MCP tool, you have a couple of options: 1. Pass
call_id
as a dynamic variable to MCP
You can use dynamic variables to pass the
call_id
into your MCP request via query parameters. [(1) ]() When configuring your MCP Node, you can add query parameters with dynamic variables to pass user inputs or call-specific data like the call ID. 2. Retrieve transcript after the call ends The
transcript
is available after the call ends. [(2) ]() [(3) ]() You can retrieve it by calling the Get Call API:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const callResponse = await client.call.retrieve('119c3f8e47135a29e65947eeb34cf12d') ;
console.log(callResponse) ;
[(3) ]() The response includes: -
call_id
- Unique id of the call -
transcript
- Transcription of the call (available after call ends) -
transcript_object
- Transcript as a list of utterances with timestamps -
transcript_with_tool_calls
- Transcript weaved with tool call invocation and results 3. Use webhooks You can also subscribe to the
call_analyzed
or
call_ended
webhook events to receive call data including the transcript once the call completes. Note that the transcript is not available mid-call—it becomes available after the call ends. [(2) ]() [(3) ]()
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Connect any AI Voice Agent to MCP with Retell AI MCP Node (Guide) | Retell AI](https://www.retellai.com/blog/connect-any-ai-voice-agent-to-mcp-with-retell-ai-mcp-node) [[2] Create Web Call](https://docs.retellai.com/api-references/create-web-call) [[3] Get Call](https://docs.retellai.com/api-references/get-call) ​
n
@AI Evy are u sure there is not possible to get transcript using call_id?
a
Thanks for the follow-up, @nicottone. I'll get back to you soon.
### Answer Yes, you can get the transcript using the `call_id`—but only after the call ends. [(1) ]() Use the Get Call API with the
call_id
to retrieve the transcript:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const callResponse = await client.call.retrieve('119c3f8e47135a29e65947eeb34cf12d') ;
console.log(callResponse) ;
The response includes the
transcript
field, which contains the transcription of the call. The key limitation is timing: the transcript is available after call ends, not during an active call. [(1) ]() [(2) ]() So if your MCP tool is being invoked mid-call and you need the transcript at that moment, it won't be available yet. You would need to retrieve it after the call completes using the
call_id
.
​ To learn more, see the sources I considered: [[1] Get Call](https://docs.retellai.com/api-references/get-call) [[2] Create Web Call](https://docs.retellai.com/api-references/create-web-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy I need transcript in the middle of the call
a
Thanks for the follow-up, @nicottone. I'll get back to you soon.
### Answer To get the transcript mid-call, you need to use a Custom LLM with the LLM WebSocket. [(1) ]() When using the LLM WebSocket, Retell sends real-time transcript updates to your server via
update_only
events and
response_required
/
reminder_required
events. These events include a
transcript
field: -
transcript
- Complete live transcript collected in the call so far. Presented in the form of a list of utterances. Additionally, if you set
transcript_with_tool_calls
to
true
in your config event, you'll also receive: -
transcript_with_tool_calls
- Transcript of the call weaved with tool call invocation and results. It precisely captures when (at what utterance, which word) the tool was invoked and what was the result. To enable this, send a config event at connection open:
Copy code
json
{
  "response_type": "config",
  "config": {
    "transcript_with_tool_calls": true
  }
}
**Summary**: If you're using the Retell LLM (single/multi-prompt) or Conversation Flow without a custom LLM WebSocket, mid-call transcript access is not available. You would need to implement a Custom LLM server that receives the WebSocket events to access the live transcript during the call.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.