check_submission_status
Check the current status of a submission to see if it is pending, accepted, rejected, or paid. Requires the submission ID.
Instructions
Check status of a submission (pending, accepted, rejected, paid). Requires TASKBOUNTY_API_KEY.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| submission_id | Yes |
Implementation Reference
- src/index.ts:336-347 (handler)Handler for the check_submission_status tool. Extracts submission_id from arguments, validates it, and calls tbFetch to GET /submissions/{id} with authentication.
case "check_submission_status": { const id = String(a.submission_id ?? ""); if (!id) { return { content: [{ type: "text", text: "submission_id is required" }], isError: true, }; } return await tbFetch(`/submissions/${encodeURIComponent(id)}`, { requireAuth: true, }); } - src/index.ts:158-169 (schema)Schema definition for check_submission_status: requires 'submission_id' (string). Registered in the TOOLS array.
{ name: "check_submission_status", description: "Check status of a submission (pending, accepted, rejected, paid). Requires TASKBOUNTY_API_KEY.", inputSchema: { type: "object", properties: { submission_id: { type: "string" }, }, required: ["submission_id"], }, }, - src/index.ts:275-277 (registration)Registration: tools are listed in the TOOLS array constant and exposed via ListToolsRequestSchema handler.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS as unknown as typeof TOOLS, })); - src/index.ts:23-77 (helper)tbFetch helper function used by the handler to make authenticated API calls to the TaskBounty backend.
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 }] }; }