get_earnings
Retrieve bounty earnings history from HackerOne, showing payment amounts, currencies, dates, and programs that paid out.
Instructions
Get your bounty earnings history. Shows amounts, currency, dates, and which programs paid out.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_size | No | Number of earnings to return (default 100) |
Implementation Reference
- src/h1client.ts:281-294 (handler)The function that executes the earnings data retrieval logic.
export async function getEarnings(pageSize = 100) { const data = await h1Fetch("/hackers/payments/earnings", { "page[size]": String(pageSize), }); return data.data.map((e: any) => ({ id: e.id, amount: e.attributes.amount, awarded_by: e.attributes.awarded_by_name, created_at: e.attributes.created_at, currency: e.relationships?.program?.data?.attributes?.currency ?? null, program: e.relationships?.program?.data?.attributes?.handle ?? null, })); } - src/index.ts:344-367 (registration)Registration of the 'get_earnings' tool using the MCP server framework.
server.tool( "get_earnings", "Get your bounty earnings history. Shows amounts, currency, dates, and which programs paid out.", { page_size: z .number() .min(1) .max(100) .optional() .describe("Number of earnings to return (default 100)"), }, async ({ page_size }) => { try { const earnings = await getEarnings(page_size); return { content: [ { type: "text" as const, text: JSON.stringify(earnings, null, 2), }, ], }; } catch (err: any) { return {