//native
type Ultravox = {
apiKey: string;
};
/**
* Calls stages tools list
*
*/
export async function main(
auth: Ultravox,
call_id: string,
call_stage_id: string,
) {
const url = new URL(
`https://api.ultravox.ai/api/calls/${call_id}/stages/${call_stage_id}/tools`,
);
const response = await fetch(url, {
method: "GET",
headers: {
"X-API-Key": auth.apiKey,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 428 days ago