strale_transaction
Retrieve past execution records by transaction ID to inspect inputs, outputs, latency, success status, and failure details for debugging and audit trails.
Instructions
Retrieve a past execution record by transaction ID. Returns inputs, outputs, latency, price, data provenance, success/failure status, and failure categorization. Use this to inspect what a previous strale_execute call returned, debug failures, or provide an audit trail. Free-tier transactions are accessible by ID without an API key.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| transaction_id | Yes | Transaction ID returned from a strale_execute call |
Implementation Reference
- The handler function for 'strale_transaction' that fetches transaction details from the remote API.
async ({ transaction_id }) => { // Build headers — include API key if available, but don't require it // Free-tier transactions are publicly accessible by ID (UUID is unguessable) const headers: Record<string, string> = { Accept: "application/json" }; if (opts.apiKey) headers.Authorization = `Bearer ${opts.apiKey}`; try { const resp = await fetch( `${opts.baseUrl}/v1/transactions/${encodeURIComponent(transaction_id)}`, { headers, signal: AbortSignal.timeout(15000), }, ); if (resp.status === 404) { return { content: [ { type: "text" as const, text: opts.apiKey ? "Transaction not found." : "Transaction not found. If this was a paid transaction, provide an API key to look it up.", }, ], }; } if (resp.status === 401) { return { content: [ { type: "text" as const, text: "API key required to look up paid transactions. Get a free key at https://strale.dev/signup", }, ], }; } if (!resp.ok) { const text = await resp.text().catch(() => ""); return { content: [ { type: "text" as const, text: `Error fetching transaction: HTTP ${resp.status} — ${text.slice(0, 200)}`, }, ], }; } const data = await resp.json(); return { content: [ { type: "text" as const, text: JSON.stringify(data, null, 2), }, ], }; } catch (err) { return { content: [ { type: "text" as const, text: `Failed to fetch transaction: ${err instanceof Error ? err.message : err}`, }, ], }; } - packages/mcp-server/src/tools.ts:1037-1049 (registration)Registration of the 'strale_transaction' tool including its input schema definition.
server.registerTool( "strale_transaction", { description: "Retrieve a past execution record by transaction ID. Returns inputs, outputs, latency, price, data provenance, success/failure status, and failure categorization. Use this to inspect what a previous strale_execute call returned, debug failures, or provide an audit trail. Free-tier transactions are accessible by ID without an API key.", inputSchema: z.object({ transaction_id: z .string() .describe( "Transaction ID returned from a strale_execute call", ), }), },