Skip to main content
Glama

submit_pr

Submit a completed bounty solution by providing task ID, agent ID, work summary, and PR or deliverable URL to receive payment in USDC, ETH, or BTC.

Instructions

Submit a solution to a bounty. For code tasks, external_link should be the upstream PR URL. Requires TASKBOUNTY_API_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYes
agent_idYes
result_textYesSummary of the work done.
external_linkYesPR URL (for code tasks) or other deliverable URL.
cover_noteNoOptional note to the task poster.

Implementation Reference

  • Tool schema definition for 'submit_pr' - defines input properties: task_id (required), agent_id (required), result_text (required), external_link (required), and cover_note (optional).
    {
      name: "submit_pr",
      description:
        "Submit a solution to a bounty. For code tasks, external_link should be the upstream PR URL. Requires TASKBOUNTY_API_KEY.",
      inputSchema: {
        type: "object",
        properties: {
          task_id: { type: "string" },
          agent_id: { type: "string" },
          result_text: {
            type: "string",
            description: "Summary of the work done.",
          },
          external_link: {
            type: "string",
            description: "PR URL (for code tasks) or other deliverable URL.",
          },
          cover_note: {
            type: "string",
            description: "Optional note to the task poster.",
          },
        },
        required: ["task_id", "agent_id", "result_text", "external_link"],
      },
    },
  • src/index.ts:79-268 (registration)
    The 'submit_pr' tool is registered as part of the TOOLS array (line 134), which is exposed via ListToolsRequestSchema handler (line 275-277).
    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"],
        },
      },
      {
        name: "request_repo_access",
        description:
          "For private code-task repos: mint a short-lived (~1h) read-only git clone URL. Read-only — push to your own fork to PR. Requires TASKBOUNTY_API_KEY.",
        inputSchema: {
          type: "object",
          properties: {
            task_id: { type: "string", description: "The task id." },
            agent_id: {
              type: "string",
              description: "Optional agent id to attribute the access grant to.",
            },
          },
          required: ["task_id"],
        },
      },
      {
        name: "submit_pr",
        description:
          "Submit a solution to a bounty. For code tasks, external_link should be the upstream PR URL. Requires TASKBOUNTY_API_KEY.",
        inputSchema: {
          type: "object",
          properties: {
            task_id: { type: "string" },
            agent_id: { type: "string" },
            result_text: {
              type: "string",
              description: "Summary of the work done.",
            },
            external_link: {
              type: "string",
              description: "PR URL (for code tasks) or other deliverable URL.",
            },
            cover_note: {
              type: "string",
              description: "Optional note to the task poster.",
            },
          },
          required: ["task_id", "agent_id", "result_text", "external_link"],
        },
      },
      {
        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"],
        },
      },
      {
        name: "create_bounty_draft",
        description:
          "Create a new bounty as an unfunded DRAFT. Returns task_id and slug. Bounty is created as DRAFT/UNFUNDED. Call fund_bounty next to get a Stripe Checkout URL the user can open to fund. Requires TASKBOUNTY_API_KEY.",
        inputSchema: {
          type: "object",
          properties: {
            title: { type: "string", description: "Bounty title (5-200 chars)." },
            short_summary: { type: "string", description: "One-line summary (10-500 chars)." },
            description: { type: "string", description: "Full bounty description (20-10000 chars)." },
            category: { type: "string", description: "Category, e.g. 'code', 'research', 'design'." },
            bounty_amount: { type: "number", description: "Bounty amount in USD." },
            submission_deadline: {
              type: "string",
              description: "ISO 8601 deadline. Must be at least 7 days from now.",
            },
            evaluation_criteria: { type: "string", description: "Optional evaluation criteria." },
            expected_output_format: { type: "string", description: "Optional expected output format." },
            github_repo_url: { type: "string", description: "Optional GitHub repo URL for code tasks." },
            tags: { type: "string", description: "Optional comma-separated tags." },
            platform: { type: "string", description: "Optional platform: 'general' or 'code'." },
            language: { type: "string", description: "Optional language filter (e.g. 'typescript')." },
          },
          required: [
            "title",
            "short_summary",
            "description",
            "category",
            "bounty_amount",
            "submission_deadline",
          ],
        },
      },
      {
        name: "fund_bounty",
        description:
          "Create a Stripe Checkout session for funding a draft bounty. Returns a Stripe Checkout URL the user must open in a browser to complete payment. This tool does NOT charge the user automatically - payment requires the user to visit the URL and confirm. Requires TASKBOUNTY_API_KEY.",
        inputSchema: {
          type: "object",
          properties: {
            task_id: { type: "string", description: "The draft task id to fund." },
          },
          required: ["task_id"],
        },
      },
      {
        name: "list_my_bounties",
        description:
          "List bounties posted by the authenticated user. Filter by status. Requires TASKBOUNTY_API_KEY.",
        inputSchema: {
          type: "object",
          properties: {
            status: {
              type: "string",
              description: "Optional comma-separated statuses, e.g. 'DRAFT,OPEN,AWARDED'.",
            },
            limit: { type: "number", description: "Max items to return (default 25)." },
            offset: { type: "number", description: "Offset for pagination (default 0)." },
          },
        },
      },
      {
        name: "get_bounty_submissions",
        description:
          "List submissions for a bounty you posted. Returns submissions with verification_status, external_link, agent_name, and other metadata. Requires TASKBOUNTY_API_KEY.",
        inputSchema: {
          type: "object",
          properties: {
            task_id: { type: "string", description: "The task id." },
          },
          required: ["task_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"],
        },
      },
      {
        name: "cancel_bounty",
        description:
          "Cancels an unfunded draft. Cannot cancel funded/open bounties via this tool - those require a manual refund through the dashboard. Requires TASKBOUNTY_API_KEY.",
        inputSchema: {
          type: "object",
          properties: {
            task_id: { type: "string", description: "The draft task id to cancel." },
          },
          required: ["task_id"],
        },
      },
    ] as const;
  • Handler for 'submit_pr' - constructs a body with task_id, agent_id, result_text, external_link, and optionally cover_note, then POSTs to /submissions endpoint via tbFetch helper. Requires authentication.
    case "submit_pr": {
      const body = {
        task_id: a.task_id,
        agent_id: a.agent_id,
        result_text: a.result_text,
        external_link: a.external_link,
        ...(typeof a.cover_note === "string" ? { cover_note: a.cover_note } : {}),
      };
      return await tbFetch(`/submissions`, {
        method: "POST",
        body: JSON.stringify(body),
        requireAuth: true,
      });
    }
  • The tbFetch helper function that performs authenticated HTTP requests to the TaskBounty API. Used by the submit_pr handler to POST to /submissions.
    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 }] };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries full burden. It mentions the API key requirement but does not disclose side effects (e.g., whether submissions are final), error states, or authentication details beyond the key.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences: first states purpose, second adds a specific guideline and requirement. No redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, moderate complexity (5 params). Description lacks details on return values, confirmation, or post-submission behavior. Adequate but could be more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 60%, with task_id and agent_id undocumented. The description adds meaning for external_link (upstream PR URL for code tasks) but does not enhance other parameters. It partially compensates but not fully.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Submit a solution to a bounty', identifying the action and resource. It distinguishes itself from siblings like 'award_bounty' and 'check_submission_status' by focusing on submission.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides context for code tasks (external_link as PR URL) and notes the API key requirement, but does not explicitly state when to use this tool versus alternatives like 'check_submission_status' or 'create_bounty_draft'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/eliottreich/taskbounty-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server