List recent payments from this session
grip_list_paymentsLists recent payments from the current session, including pending, settled, rejected, and failed transactions. Helps users review their payment activity and status.
Instructions
Returns recent payments (pending, settled, rejected, failed) staged or executed in this MCP session. Read-only. Useful when the human asks 'what have I paid today' or 'what's pending'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Implementation Reference
- server/src/index.ts:313-350 (registration)Registration of the 'grip_list_payments' tool via server.registerTool(), including its schema (inputSchema) and the async handler function.
server.registerTool( "grip_list_payments", { title: "List recent payments from this session", description: "Returns recent payments (pending, settled, rejected, failed) staged or executed in this MCP session. Read-only. Useful when the human asks 'what have I paid today' or 'what's pending'.", inputSchema: { limit: z.number().int().min(1).max(50).optional(), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, }, async ({ limit }) => { const all = [...pendingPayments.values()] .sort((a, b) => b.createdAt.localeCompare(a.createdAt)) .slice(0, limit ?? 10); if (all.length === 0) { return { content: [{ type: "text", text: "No payments in this session yet." }] }; } const lines = all.map((p) => { const icon = p.status === "settled" ? "🟢" : p.status === "rejected" ? "🔴" : p.status === "failed" ? "⚠️" : "🟡"; const tail = p.txHash ? ` · tx ${p.txHash.slice(0, 10)}…${p.txHash.slice(-6)}` : p.status === "failed" ? ` · ${p.errorMessage}` : ""; return `${icon} ${p.amountUsdc.toFixed(2)} USDC → ${shortAddr(p.recipient)} [${p.status}]${tail}`; }); return { content: [{ type: "text", text: lines.join("\n") }], structuredContent: { payments: all }, }; }, ); - server/src/index.ts:329-349 (handler)Handler function for grip_list_payments that lists payments (pending, settled, rejected, failed) from the session, sorted by createdAt, with limit support.
async ({ limit }) => { const all = [...pendingPayments.values()] .sort((a, b) => b.createdAt.localeCompare(a.createdAt)) .slice(0, limit ?? 10); if (all.length === 0) { return { content: [{ type: "text", text: "No payments in this session yet." }] }; } const lines = all.map((p) => { const icon = p.status === "settled" ? "🟢" : p.status === "rejected" ? "🔴" : p.status === "failed" ? "⚠️" : "🟡"; const tail = p.txHash ? ` · tx ${p.txHash.slice(0, 10)}…${p.txHash.slice(-6)}` : p.status === "failed" ? ` · ${p.errorMessage}` : ""; return `${icon} ${p.amountUsdc.toFixed(2)} USDC → ${shortAddr(p.recipient)} [${p.status}]${tail}`; }); return { content: [{ type: "text", text: lines.join("\n") }], structuredContent: { payments: all }, }; }, - server/src/index.ts:319-321 (schema)Input schema: optional 'limit' parameter (integer, 1-50).
inputSchema: { limit: z.number().int().min(1).max(50).optional(), },