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

Function retoolQueryAgents

retool.ts:87–100  ·  view source on GitHub ↗
(acc: RetoolAccount)

Source from the content-addressed store, hash-verified

85// Retool API helpers
86// ----------------------------------------------------------------------------
87async function retoolQueryAgents(acc: RetoolAccount) {
88 const url = `https://${acc.domain_name}/api/agents`;
89 const resp = await fetch(url, {
90 headers: {
91 "x-xsrf-token": acc.x_xsrf_token,
92 "Cookie": `accessToken=${acc.accessToken}`,
93 "User-Agent": "Rever-Deno-Port/1.0",
94 "Accept": "application/json",
95 },
96 });
97 if (!resp.ok) throw new Error(`Agent query failed ${resp.status}`);
98 const data = await resp.json();
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, {

Callers 1

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected