rigshare_list_my_sessions
Check your active remote sessions on Robotics & AI bookings, including status, GPU allocation, compute hours, and cost. Use to avoid starting a new session if one is already active.
Instructions
REQUIRES API KEY (sessions:read scope). Lists the authenticated user's remote sessions on Robotics & AI bookings — status, GPU allocation, total compute hours, cost so far. Use before starting a new session to check if one is already active.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| booking_id | No | ||
| status | No |
Implementation Reference
- src/index.ts:679-707 (handler)The `listMySessions` async function that executes the tool logic. It checks for API key, calls the authenticated sessions endpoint, and formats session data (status, GPU allocation, compute hours, cost) into a readable text response.
async function listMySessions(args: Record<string, unknown>) { if (!RIGSHARE_API_KEY) return toolError(API_KEY_ERROR_MSG); const params = new URLSearchParams(); if (args.booking_id) params.set("booking_id", String(args.booking_id)); if (args.status) params.set("status", String(args.status)); const res = await fetchAuthJson( RIGSHARE_API_KEY, `${RIGSHARE_AGENT_API}/sessions?${params.toString()}`, ); if (res.error) return toolError(res.error); const sessions = ((res.data as any)?.sessions || []) as any[]; if (sessions.length === 0) { return toolText("No remote sessions found."); } const lines = sessions.map((s, i) => { return [ `${i + 1}. ${s.accessType} session — status: ${s.status} (health: ${s.healthStatus})`, ` Booking ID: ${s.bookingId}`, ` Started: ${s.startedAt ? new Date(s.startedAt).toLocaleString() : "not started"}`, ` Compute hours: ${s.totalComputeHours ?? 0} · Cost so far: $${((s.totalCostCents || 0) / 100).toFixed(2)}`, s.gpuAllocation ? ` GPU: ${s.gpuAllocation}` : "", ] .filter(Boolean) .join("\n"); }); return toolText(`Your remote sessions:\n\n${lines.join("\n\n")}`); } - src/index.ts:230-244 (schema)The tool definition with name 'rigshare_list_my_sessions', description, and inputSchema defining optional 'booking_id' (uuid) and 'status' (enum) parameters.
{ name: "rigshare_list_my_sessions", description: "REQUIRES API KEY (sessions:read scope). Lists the authenticated user's remote sessions on Robotics & AI bookings — status, GPU allocation, total compute hours, cost so far. Use before starting a new session to check if one is already active.", inputSchema: { type: "object", properties: { booking_id: { type: "string", format: "uuid" }, status: { type: "string", enum: ["provisioning", "active", "paused", "terminated", "failed"], }, }, }, }, - src/index.ts:315-316 (registration)The switch-case registration in the CallToolRequestSchema handler that routes the tool name 'rigshare_list_my_sessions' to the `listMySessions` function.
case "rigshare_list_my_sessions": return await listMySessions(args || {});