toreador_list_sessions
List the 50 most recent ERC-20 payment sessions for your account, including status, transaction hash, confirmations, and timestamps.
Instructions
List the 50 most recent ERC-20 payment sessions for the authenticated account. Includes status, tx hash, confirmations and timestamps.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:226-227 (handler)The handler for 'toreador_list_sessions' dispatches an HTTP GET request to the '/sessions' endpoint via the shared toreadorRequest helper.
case "toreador_list_sessions": return toreadorRequest("GET", "/sessions"); - src/index.ts:144-153 (schema)The schema definition for 'toreador_list_sessions' — it takes no input parameters (empty properties object).
{ name: "toreador_list_sessions", description: "List the 50 most recent ERC-20 payment sessions for the authenticated account. Includes status, tx hash, confirmations and timestamps.", inputSchema: { type: "object", properties: {}, additionalProperties: false, }, }, - src/index.ts:288-289 (registration)The tool is registered via the ListToolsRequestSchema handler which returns the composed ACTIVE_TOOLS array (which includes toreador_list_sessions when a Pro API key is present).
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: ACTIVE_TOOLS })); - src/index.ts:282-284 (registration)ACTIVE_TOOLS is composed from FREE_TIER_TOOLS and PRO_TIER_TOOLS; toreador_list_sessions is part of PRO_TIER_TOOLS (line 89), so it's only registered when HAS_API_KEY is true.
const ACTIVE_TOOLS: Tool[] = HAS_API_KEY ? [...FREE_TIER_TOOLS, ...PRO_TIER_TOOLS] : FREE_TIER_TOOLS; - src/index.ts:158-191 (helper)The shared toreadorRequest helper function that all tools use to make HTTP requests to the Toreador API. 'toreador_list_sessions' calls this with GET /sessions.
async function toreadorRequest( method: "GET" | "POST", path: string, body?: unknown, ): Promise<{ ok: boolean; status: number; data: unknown }> { const url = `${TOREADOR_BASE_URL}${path}`; const headers: Record<string, string> = { "Accept": "application/json", "User-Agent": "toreador-mcp-server/0.2.0", }; if (TOREADOR_API_KEY) headers["X-API-Key"] = TOREADOR_API_KEY; const init: RequestInit = { method, headers }; if (body !== undefined) { headers["Content-Type"] = "application/json"; init.body = JSON.stringify(body); } const ctrl = new AbortController(); const timer = setTimeout(() => ctrl.abort(), REQUEST_TIMEOUT_MS); init.signal = ctrl.signal; try { const res = await fetch(url, init); let data: unknown = null; try { data = await res.json(); } catch { // non-JSON response — leave data as null } return { ok: res.ok, status: res.status, data }; } finally { clearTimeout(timer); } }