Skip to main content
Glama
pdogra1299
by pdogra1299

add_comment

Post comments on Bitbucket pull requests, including threaded replies, inline code notes, code suggestions, and tasks.

Instructions

Add a PR comment: general, threaded reply (parent_comment_id), inline (file_path + line_number), code suggestion (suggestion), or task (severity BLOCKER, Server only). code_snippet auto-resolves line_number from exact diff text when line_number is unknown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
severityNoBLOCKER creates a task (Server only)
file_pathNoInline comment file
line_typeNoDefault CONTEXT
workspaceYesProject key (e.g., PROJ)
repositoryYesRepository slug
suggestionNoReplacement code block; needs file_path + line_number
attachmentsNoLocal files to upload & embed (Server/DC only). Item: path string or {file_path, alt_text?, render?: image|link|auto}
line_numberNoInline comment line (or use code_snippet)
code_snippetNoExact diff line text to locate (whitespace-sensitive)
comment_textYes
match_strategyNoOn multiple snippet matches (default strict)
search_contextNoDisambiguates repeated code_snippet
pull_request_idYesPull request ID
parent_comment_idNoReply to this comment
suggestion_end_lineNoMulti-line suggestion end

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed16 schema fields changedv3.0.1
    • addedInput schema / properties / attachments
      Added value: +{
      +  "description": "Local files to upload & embed (Server/DC only). Item: path string or {file_path, alt_text?, render?: image|link|auto}",
      +  "items": {
      +    "oneOf": [
      +      {
      +        "type": "string"
      +      },
      +      {
      +        "properties": {
      +          "alt_text": {
      +            "type": "string"
      +          },
      +          "file_path": {
      +            "type": "string"
      +          },
      +          "render": {
      +            "enum": [
      +              "image",
      +              "link",
      +              "auto"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "file_path"
      +        ],
      +        "type": "object"
      +      }
      +    ]
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / code_snippet / description
      Previous value: -"Exact code text from the diff to find and comment on. Use this instead of line_number for auto-detection. Must match exactly including whitespace (optional)"New value: +"Exact diff line text to locate (whitespace-sensitive)"
    • removedInput schema / properties / comment_text / description
      Removed value: -"The main comment text. For suggestions, this is the explanation before the code suggestion."
    • changedInput schema / properties / file_path / description
      Previous value: -"File path for inline comment. Required for inline comments. Example: \"src/components/Button.js\" (optional)"New value: +"Inline comment file"
    • changedInput schema / properties / line_number / description
      Previous value: -"Exact line number in the file. Use this OR code_snippet, not both. Required with file_path unless using code_snippet (optional)"New value: +"Inline comment line (or use code_snippet)"
    • changedInput schema / properties / line_type / description
      Previous value: -"Type of line: ADDED (green/new lines), REMOVED (red/deleted lines), or CONTEXT (unchanged lines). Default: CONTEXT"New value: +"Default CONTEXT"
    • changedInput schema / properties / match_strategy / description
      Previous value: -"How to handle multiple matches when using code_snippet. \"strict\": fail with detailed error showing all matches. \"best\": automatically pick the highest confidence match. Default: \"strict\""New value: +"On multiple snippet matches (default strict)"
    • changedInput schema / properties / parent_comment_id / description
      Previous value: -"ID of comment to reply to. Use this to create threaded conversations (optional)"New value: +"Reply to this comment"
    • changedInput schema / properties / repository / description
      Previous value: -"Repository slug (e.g., \"my-repo\")"New value: +"Repository slug"
    • changedInput schema / properties / search_context / description
      Previous value: -"Additional context lines to help locate the exact position when using code_snippet. Useful when the same code appears multiple times (optional)"New value: +"Disambiguates repeated code_snippet"
    • removedInput schema / properties / search_context / properties / after / description
      Removed value: -"Array of code lines that appear AFTER the target line. Helps disambiguate when code_snippet appears multiple times"
    • removedInput schema / properties / search_context / properties / before / description
      Removed value: -"Array of code lines that appear BEFORE the target line. Helps disambiguate when code_snippet appears multiple times"
    • addedInput schema / properties / severity
      Added value: +{
      +  "description": "BLOCKER creates a task (Server only)",
      +  "enum": [
      +    "NORMAL",
      +    "BLOCKER"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / suggestion / description
      Previous value: -"Replacement code for a suggestion. Creates a suggestion block that can be applied in Bitbucket UI. Requires file_path and line_number. For multi-line, include newlines in the string (optional)"New value: +"Replacement code block; needs file_path + line_number"
    • changedInput schema / properties / suggestion_end_line / description
      Previous value: -"For multi-line suggestions: the last line number to replace. If not provided, only replaces the single line at line_number (optional)"New value: +"Multi-line suggestion end"
    • changedInput schema / properties / workspace / description
      Previous value: -"Bitbucket workspace/project key (e.g., \"PROJ\")"New value: +"Project key (e.g., PROJ)"
  2. First observedv1.0.0

TDQS

A3.9/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It usefully discloses platform limitations (task/attachments are 'Server only') and the auto-resolution behavior of code_snippet, which are real behavioral traits. But it omits permissions, idempotency, and whether the operation is reversible, leaving meaningful gaps for a mutation tool.

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 dense sentences front-load the mode enumeration, which is the most decision-relevant information, then add the code_snippet fallback. No filler and no repetition of structured data.

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

Completeness4/5

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

For a 15-parameter tool with nested objects and no output schema, the description covers the essential mode-selection logic and the notable code_snippet behavior. It is largely complete, though the unaddressed manage_comment relationship and mutation side-effects are minor omissions.

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

Parameters4/5

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

Schema coverage is 93%, so the schema already documents most parameters (baseline 3). The description goes beyond it by mapping parameter combinations to comment modes and explaining that code_snippet auto-resolves line_number when it is unknown, adding genuine semantic glue the schema cannot express.

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

Purpose4/5

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

States a specific verb+resource ('Add a PR comment') and enumerates the comment modes it supports (general, threaded reply, inline, suggestion, task). The agent knows precisely what operation is performed. It does not, however, distinguish itself from the sibling manage_comment, leaving ambiguity about which tool owns comment mutations.

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

Usage Guidelines4/5

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

The mode enumeration effectively doubles as usage guidance by mapping each comment type to its triggering parameters (parent_comment_id for reply, file_path+line_number for inline, suggestion for suggestions, severity BLOCKER for tasks). It gives clear selection conditions among modes but offers no when-not-to-use guidance and never references the manage_comment alternative.

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