retell_update_chat_agent
Modify chat agent settings like display name and webhook URL to adjust AI conversation behavior and integration points.
Instructions
Update a chat agent's configuration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | The chat agent ID to update | |
| agent_name | No | New display name | |
| webhook_url | No | New webhook URL |
Implementation Reference
- src/index.ts:1193-1196 (handler)Handler logic for retell_update_chat_agent: extracts agent_id, destructures remaining args as update data, and makes a PATCH request to Retell API endpoint /update-chat-agent/{agent_id}case "retell_update_chat_agent": { const { agent_id: chatAgentId, ...chatAgentUpdateData } = args; return retellRequest(`/update-chat-agent/${chatAgentId}`, "PATCH", chatAgentUpdateData as Record<string, unknown>); }
- src/index.ts:664-685 (schema)Tool definition including name, description, and input schema (JSON Schema) for validating arguments: requires agent_id, optional agent_name and webhook_url{ name: "retell_update_chat_agent", description: "Update a chat agent's configuration.", inputSchema: { type: "object", properties: { agent_id: { type: "string", description: "The chat agent ID to update" }, agent_name: { type: "string", description: "New display name" }, webhook_url: { type: "string", description: "New webhook URL" } }, required: ["agent_id"] } },
- src/index.ts:1283-1285 (registration)MCP server registration for listing tools, which exposes the retell_update_chat_agent schema via the static tools arrayserver.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/index.ts:1287-1313 (registration)MCP server registration for calling tools, which dispatches to executeTool switch statement containing the handler case for retell_update_chat_agent// Register tool execution handler server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const result = await executeTool(name, args as Record<string, unknown>); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: "text", text: `Error: ${errorMessage}`, }, ], isError: true, }; } });
- src/index.ts:23-57 (helper)Generic helper function for making authenticated HTTP requests to Retell AI API, used by the tool handlerasync function retellRequest( endpoint: string, method: string = "GET", body?: Record<string, unknown> ): Promise<unknown> { const apiKey = getApiKey(); const headers: Record<string, string> = { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json", }; const options: RequestInit = { method, headers, }; if (body && method !== "GET") { options.body = JSON.stringify(body); } const response = await fetch(`${RETELL_API_BASE}${endpoint}`, options); if (!response.ok) { const errorText = await response.text(); throw new Error(`Retell API error (${response.status}): ${errorText}`); } // Handle 204 No Content if (response.status === 204) { return { success: true }; } return response.json(); }