MCPcopy Create free account
hub / github.com/Shinplex/rever / retoolGetThreadId

Function retoolGetThreadId

retool.ts:101–115  ·  view source on GitHub ↗
(acc: RetoolAccount, agentId: string)

Source from the content-addressed store, hash-verified

99 return data.agents as any[];
100}
101async function retoolGetThreadId(acc: RetoolAccount, agentId: string) {
102 const url = `https://${acc.domain_name}/api/agents/${agentId}/threads`;
103 const resp = await fetch(url, {
104 method: "POST",
105 headers: {
106 "x-xsrf-token": acc.x_xsrf_token,
107 "Cookie": `accessToken=${acc.accessToken}`,
108 "Content-Type": "application/json",
109 },
110 body: JSON.stringify({ name: "", timezone: "" }),
111 });
112 if (!resp.ok) throw new Error(`create thread failed ${resp.status}`);
113 const data = await resp.json();
114 return data.id as string;
115}
116async function retoolSendMessage(
117 acc: RetoolAccount,
118 agentId: string,

Callers 1

handleRequestFunction · 0.70

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected