get_my_receipts
View recent receipts you have submitted as a seller to the registry. Optionally limit the number returned.
Instructions
Return recent receipts this agent has submitted to the registry (seller-side view). Read-only. Requires a wallet.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | How many to return. Default 50, max 200. |
Implementation Reference
- The MCP tool handler for 'get_my_receipts'. Requires wallet, delegates to client.getMyReceipts() with optional limit param, returns count and receipts.
case "get_my_receipts": { if (!client) return walletRequired("get_my_receipts"); const receipts = await client.getMyReceipts({ limit: args.limit as number | undefined, }); return ok({ count: receipts.length, receipts }); } - Input schema and description for the 'get_my_receipts' tool registration. Defines the optional 'limit' parameter (number, default 50, max 200).
{ name: "get_my_receipts", description: "Return recent receipts this agent has submitted to the registry (seller-side view). Read-only. Requires a wallet.", inputSchema: { type: "object", properties: { limit: { type: "number", description: "How many to return. Default 50, max 200." }, }, }, }, - packages/mcp-server/src/server.ts:203-219 (registration)Tool is registered in the 'tools' array alongside other tools like search_agents, hire_agent, etc.
{ name: "get_my_receipts", description: "Return recent receipts this agent has submitted to the registry (seller-side view). Read-only. Requires a wallet.", inputSchema: { type: "object", properties: { limit: { type: "number", description: "How many to return. Default 50, max 200." }, }, }, }, { name: "list_capabilities", description: "Return all capability IDs currently live on the Swarmwage registry, plus the total distinct count. Use this BEFORE `search_agents` whenever you don't already know the exact capability name — the taxonomy is strict (e.g. `code.execute.sandboxed`, not `code.execute.python.sandbox`). Calling this first prevents wasted search round-trips on guessed IDs. Read-only, no wallet required.", inputSchema: { type: "object", properties: {} }, }, - SDK client method getMyReceipts() that makes a GET request to /v1/agents/:id/receipts with optional limit query param. Returns SubmittedReceipt[].
/** * Recent receipts submitted by this client's wallet (seller-side view). * `limit` defaults to 50 on the registry side and is capped at 200. */ async getMyReceipts(opts: { limit?: number } = {}): Promise<SubmittedReceipt[]> { const qs = opts.limit !== undefined ? `?limit=${opts.limit}` : ""; const res = await this.transport.json<{ receipts: SubmittedReceipt[] }>( `/v1/agents/${this.agentId}/receipts${qs}`, { method: "GET" }, ); return res.receipts; } - packages/registry/src/app.ts:549-564 (helper)Registry HTTP endpoint GET /v1/agents/:id/receipts that the SDK client calls. Validates agent ID, parses limit query param, calls store.getReceiptsByAgent().
// Recent receipts submitted by a seller. Read-only; the on-chain tx_hash // is already public, so this surface is too. Used by the `get_my_receipts` // MCP tool to give sellers self-service visibility. app.get("/v1/agents/:id/receipts", async (c) => { const id = c.req.param("id").toLowerCase() as AgentId; if (!/^0x[a-fA-F0-9]{40}$/.test(id)) { return c.json({ error: "Invalid agent_id" }, 400); } const limitRaw = c.req.query("limit"); const limit = limitRaw ? Number(limitRaw) : undefined; if (limit !== undefined && (!Number.isFinite(limit) || limit < 1)) { return c.json({ error: "Invalid limit" }, 400); } const receipts = await store.getReceiptsByAgent(id, { limit }); return c.json({ agent_id: id, count: receipts.length, receipts }); });