toreador_get_payment_status
Get the real-time status of an ERC-20 payment session by its ID. Status values: pending, submitted, confirming, completed, expired, or failed. Includes on-chain confirmation count and transaction hash when submitted.
Instructions
Get the current status of an ERC-20 payment session by ID. Status values: pending, submitted, confirming, completed, expired, failed. Includes on-chain confirmation count and tx hash once submitted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | Session ID returned by toreador_create_session. |
Implementation Reference
- src/index.ts:118-132 (schema)Tool schema definition for toreador_get_payment_status. Declares name, description, and inputSchema requiring a single 'sessionId' string parameter.
{ name: "toreador_get_payment_status", description: "Get the current status of an ERC-20 payment session by ID. Status values: pending, submitted, confirming, completed, expired, failed. Includes on-chain confirmation count and tx hash once submitted.", inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "Session ID returned by toreador_create_session.", }, }, required: ["sessionId"], additionalProperties: false, }, - src/index.ts:219-223 (handler)Tool handler for toreador_get_payment_status in the callTool dispatcher. Sends a GET request to /payment/{sessionId}/status using the toreadorRequest helper.
case "toreador_get_payment_status": return toreadorRequest( "GET", `/payment/${encodeURIComponent(String(args.sessionId))}/status`, ); - src/index.ts:282-282 (registration)Tool registration: PRO_TIER_TOOLS array is composed into ACTIVE_TOOLS only when HAS_API_KEY is true, and registered via ListToolsRequestSchema handler at line 288.
const ACTIVE_TOOLS: Tool[] = HAS_API_KEY - src/index.ts:158-191 (helper)Helper toreadorRequest: generic HTTP client that sends requests with the API key header and handles timeout/JSON parsing. Used by all tool handlers.
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); } }