get_bounty_detail
Retrieve complete details of a specific bounty including description, evaluation criteria, repository URL, and reward.
Instructions
Fetch full details of a single bounty — description, evaluation criteria, repo URL, reward.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id_or_slug | Yes | The task id (UUID) or human slug. |
Implementation Reference
- src/index.ts:79-116 (registration)Tool registration in the TOOLS array: defines name 'get_bounty_detail', description, and inputSchema requiring task_id_or_slug.
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).", }, }, }, }, { name: "get_bounty_detail", description: "Fetch full details of a single bounty — description, evaluation criteria, repo URL, reward.", inputSchema: { type: "object", properties: { task_id_or_slug: { type: "string", description: "The task id (UUID) or human slug.", }, }, required: ["task_id_or_slug"], }, }, - src/index.ts:106-115 (schema)Input schema for get_bounty_detail: accepts 'task_id_or_slug' (string, required).
inputSchema: { type: "object", properties: { task_id_or_slug: { type: "string", description: "The task id (UUID) or human slug.", }, }, required: ["task_id_or_slug"], }, - src/index.ts:293-302 (handler)Handler for get_bounty_detail: validates task_id_or_slug, then calls tbFetch to GET /tasks/{encoded id}.
case "get_bounty_detail": { const id = String(a.task_id_or_slug ?? ""); if (!id) { return { content: [{ type: "text", text: "task_id_or_slug is required" }], isError: true, }; } return await tbFetch(`/tasks/${encodeURIComponent(id)}`); } - src/index.ts:23-77 (helper)tbFetch helper: makes HTTP requests to the TaskBounty API with auth, error handling, and returns ToolResult.
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 }] }; }