list_open_bounties
List currently open, funded bounties on TaskBounty. Filter by platform or language to find rewards in USDC, ETH, or BTC.
Instructions
List currently open, funded bounties on TaskBounty. Returns title, reward, repo, language, and task id/slug.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| platform | No | Optional platform filter (e.g. 'github'). | |
| language | No | Optional language filter (e.g. 'typescript'). | |
| limit | No | Max items to return (default 25). |
Implementation Reference
- src/index.ts:79-101 (schema)Tool definition and input schema for 'list_open_bounties'. Accepts optional platform, language, and limit parameters.
const TOOLS = [ { name: "list_open_bounties", description: "List currently open, funded bounties on TaskBounty. Returns title, reward, repo, language, and task id/slug.", inputSchema: { type: "object", properties: { platform: { type: "string", description: "Optional platform filter (e.g. 'github').", }, language: { type: "string", description: "Optional language filter (e.g. 'typescript').", }, limit: { type: "number", description: "Max items to return (default 25).", }, }, }, }, - src/index.ts:284-291 (handler)Handler for 'list_open_bounties' - builds query params from args and calls tbFetch('/bounties.json') with optional query string.
case "list_open_bounties": { const params = new URLSearchParams(); if (typeof a.platform === "string") params.set("platform", a.platform); if (typeof a.language === "string") params.set("language", a.language); if (typeof a.limit === "number") params.set("limit", String(a.limit)); const qs = params.toString(); return await tbFetch(`/bounties.json${qs ? `?${qs}` : ""}`); } - src/index.ts:275-277 (registration)Registration of the tool via ListToolsRequestSchema handler, returning the TOOLS array.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS as unknown as typeof TOOLS, })); - src/index.ts:279-291 (registration)CallToolRequestSchema handler with switch-case dispatching to the list_open_bounties handler.
server.setRequestHandler(CallToolRequestSchema, async (req) => { const { name, arguments: args = {} } = req.params; const a = args as Record<string, unknown>; switch (name) { case "list_open_bounties": { const params = new URLSearchParams(); if (typeof a.platform === "string") params.set("platform", a.platform); if (typeof a.language === "string") params.set("language", a.language); if (typeof a.limit === "number") params.set("limit", String(a.limit)); const qs = params.toString(); return await tbFetch(`/bounties.json${qs ? `?${qs}` : ""}`); } - src/index.ts:23-77 (helper)tbFetch helper function that makes authenticated HTTP requests to the TaskBounty API. Used by the list_open_bounties handler.
async function tbFetch( path: string, init: RequestInit & { requireAuth?: boolean } = {}, ): Promise<ToolResult> { const { requireAuth, headers, ...rest } = init; if (requireAuth && !API_KEY) { return { content: [ { type: "text", text: "Missing TASKBOUNTY_API_KEY environment variable. Set it to your tb_live_* key from https://www.task-bounty.com/dashboard/api-keys.", }, ], isError: true, }; } const url = `${API_BASE}${path}`; const finalHeaders: Record<string, string> = { Accept: "application/json", ...(headers as Record<string, string> | undefined), }; if (API_KEY) finalHeaders["Authorization"] = `Bearer ${API_KEY}`; if (rest.body && !finalHeaders["Content-Type"]) { finalHeaders["Content-Type"] = "application/json"; } let res: Response; try { res = await fetch(url, { ...rest, headers: finalHeaders }); } catch (err) { return { content: [ { type: "text", text: `Network error calling ${url}: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } const text = await res.text(); if (!res.ok) { return { content: [ { type: "text", text: `HTTP ${res.status} ${res.statusText} from ${url}\n\n${text}`, }, ], isError: true, }; } return { content: [{ type: "text", text }] }; }