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

Function retoolGetThreadId

workers/retool.ts:84–98  ·  view source on GitHub ↗
(acc: RetoolAccount, agentId: string)

Source from the content-addressed store, hash-verified

82 return data.agents as any[];
83}
84async function retoolGetThreadId(acc: RetoolAccount, agentId: string) {
85 const url = `https://${acc.domain_name}/api/agents/${agentId}/threads`;
86 const r = await fetch(url, {
87 method: "POST",
88 headers: {
89 "x-xsrf-token": acc.x_xsrf_token,
90 "Cookie": `accessToken=${acc.accessToken}`,
91 "Content-Type": "application/json",
92 },
93 body: JSON.stringify({ name: "", timezone: "" }),
94 });
95 if (!r.ok) throw new Error(`thread ${r.status}`);
96 const data = await r.json();
97 return data.id as string;
98}
99async function retoolSendMessage(
100 acc: RetoolAccount,
101 agentId: string,

Callers 1

fetchFunction · 0.70

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected