retell_get_agent_versions
Retrieve version history for a Retell AI agent to track changes, manage updates, and revert to previous configurations when needed.
Instructions
Retrieve the version history of an agent.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | The agent ID to get versions for |
Implementation Reference
- src/index.ts:1183-1184 (handler)Handler implementation in the executeTool switch statement. Makes a GET request to the Retell API endpoint `/get-agent-versions/{agent_id}` using the retellRequest helper.case "retell_get_agent_versions": return retellRequest(`/get-agent-versions/${args.agent_id}`, "GET");
- src/index.ts:595-604 (schema)Input schema definition for the tool, requiring an 'agent_id' string parameter.inputSchema: { type: "object", properties: { agent_id: { type: "string", description: "The agent ID to get versions for" } }, required: ["agent_id"] }
- src/index.ts:592-605 (registration)Tool registration in the 'tools' array used by the MCP server's listTools handler.{ name: "retell_get_agent_versions", description: "Retrieve the version history of an agent.", inputSchema: { type: "object", properties: { agent_id: { type: "string", description: "The agent ID to get versions for" } }, required: ["agent_id"] } },
- src/index.ts:23-57 (helper)Generic retellRequest helper function used by all Retell API tools to make authenticated HTTP requests.async 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(); }