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

Function retoolQueryAgents

workers/retool.ts:70–83  ·  view source on GitHub ↗
(acc: RetoolAccount)

Source from the content-addressed store, hash-verified

68 * Retool API helpers
69 * ------------------------------------------------------------------------------------------------ */
70async function retoolQueryAgents(acc: RetoolAccount) {
71 const url = `https://${acc.domain_name}/api/agents`;
72 const r = await fetch(url, {
73 headers: {
74 "x-xsrf-token": acc.x_xsrf_token,
75 "Cookie": `accessToken=${acc.accessToken}`,
76 "User-Agent": "Rever-Worker/1.0",
77 Accept: "application/json",
78 },
79 });
80 if (!r.ok) throw new Error(`agent query ${r.status}`);
81 const data = await r.json();
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, {

Callers 1

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected