// Publish the sample catalog and select tools for one turn. // npm install toolcue // TOOLCUE_URL=... TOOLCUE_TOKEN=... TOOLCUE_ADMIN_TOKEN=... node quickstart.ts (Node 23.6+; older: npx tsx quickstart.ts) import { readFileSync } from "node:fs"; import { ToolcueClient } from "toolcue"; const catalog = JSON.parse(readFileSync(new URL("../catalog.json", import.meta.url), "utf8")); const toolcue = new ToolcueClient(); const summary = await toolcue.publishCatalog("acme-billing", catalog.tools); console.log(`published ${summary.tools} tools, ${summary.edges} dependency links`); const answer = await toolcue.select("acme-billing", "Refund the last invoice for Globex", [], { roles: ["agent"] }); console.log(answer.turnType, `${answer.timings.totalMs.toFixed(0)} ms`); for (const t of answer.tools) console.log(`- ${t.name.padEnd(24)} ${t.reason.padEnd(10)} ${t.detail}`);