Bitbucket PUT Request
bb_putReplace Bitbucket resources with full update. Common operations: update repositories, files, and branch restrictions. Use jq to filter response fields to reduce token costs. Returns TOON format by default.
Instructions
Replace Bitbucket resources (full update). Returns TOON format by default.
IMPORTANT - Cost Optimization:
Use
jqparam to extract only needed fields from responseExample:
jq: "{uuid: uuid, name: name}"
Output format: TOON (default) or JSON (outputFormat: "json")
Common operations:
Update repository:
/repositories/{workspace}/{repo}body:{"description": "...", "is_private": true, "has_issues": true}Create/update file:
/repositories/{workspace}/{repo}/srcNote: Use multipart form data for file uploads (complex - prefer PATCH for metadata)Update branch restriction:
/repositories/{workspace}/{repo}/branch-restrictions/{id}body:{"kind": "push", "pattern": "main", "users": [{"uuid": "..."}]}
The /2.0 prefix is added automatically. API reference: https://developer.atlassian.com/cloud/bitbucket/rest/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The Bitbucket API endpoint path (without base URL). Must start with "/". Examples: "/workspaces", "/repositories/{workspace}/{repo_slug}", "/repositories/{workspace}/{repo_slug}/pullrequests/{id}" | |
| queryParams | No | Optional query parameters as key-value pairs. Examples: {"pagelen": "25", "page": "2", "q": "state=\"OPEN\"", "fields": "values.title,values.state"} | |
| jq | No | JMESPath expression to filter/transform the response. IMPORTANT: Always use this to extract only needed fields and reduce token costs. Examples: "values[*].{name: name, slug: slug}" (extract specific fields), "values[0]" (first result), "values[*].name" (names only). See https://jmespath.org | |
| outputFormat | No | Output format: "toon" (default, 30-60% fewer tokens) or "json". TOON is optimized for LLMs with tabular arrays and minimal syntax. | |
| body | Yes | Request body as a JSON object. Structure depends on the endpoint. Example for PR: {"title": "My PR", "source": {"branch": {"name": "feature"}}} |