award_bounty
Select the winning submission for a bounty. The award is staged as pending review and finalized after admin approval.
Instructions
Selects a winning submission for the bounty. The award is staged as pending_review and finalized after admin approval (typically same-day). Requires TASKBOUNTY_API_KEY.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The task id. | |
| submission_id | Yes | The winning submission id. |
Implementation Reference
- src/index.ts:243-255 (registration)Tool registration: declares the 'award_bounty' tool with name, description, and inputSchema (task_id and submission_id).
{ name: "award_bounty", description: "Selects a winning submission for the bounty. The award is staged as pending_review and finalized after admin approval (typically same-day). Requires TASKBOUNTY_API_KEY.", inputSchema: { type: "object", properties: { task_id: { type: "string", description: "The task id." }, submission_id: { type: "string", description: "The winning submission id." }, }, required: ["task_id", "submission_id"], }, }, - src/index.ts:419-439 (handler)Handler logic: When 'award_bounty' is called, it validates task_id and submission_id, then POSTs to /tasks/{taskId}/award with the submission_id in the body.
case "award_bounty": { const taskId = String(a.task_id ?? ""); const submissionId = String(a.submission_id ?? ""); if (!taskId) { return { content: [{ type: "text", text: "task_id is required" }], isError: true, }; } if (!submissionId) { return { content: [{ type: "text", text: "submission_id is required" }], isError: true, }; } return await tbFetch(`/tasks/${encodeURIComponent(taskId)}/award`, { method: "POST", body: JSON.stringify({ submission_id: submissionId }), requireAuth: true, }); }