Bitbucket GET Request
bb_getRetrieve Bitbucket API data with token-efficient TOON format. Use jq to filter fields and reduce costs. Supports queries for workspaces, repositories, pull requests, branches, commits, and more.
Instructions
Read any Bitbucket data. Returns TOON format by default (30-60% fewer tokens than JSON).
IMPORTANT - Cost Optimization:
ALWAYS use
jqparam to filter response fields. Unfiltered responses are very expensive!Use
pagelenquery param to restrict result count (e.g.,pagelen: "5")If unsure about available fields, first fetch ONE item with
pagelen: "1"and NO jq filter to explore the schema, then use jq in subsequent calls
Schema Discovery Pattern:
First call:
path: "/workspaces", queryParams: {"pagelen": "1"}(no jq) - explore available fieldsThen use:
jq: "values[*].{slug: slug, name: name, uuid: uuid}"- extract only what you need
Output format: TOON (default, token-efficient) or JSON (outputFormat: "json")
Common paths:
/workspaces- list workspaces/repositories/{workspace}- list repos in workspace/repositories/{workspace}/{repo}- get repo details/repositories/{workspace}/{repo}/pullrequests- list PRs/repositories/{workspace}/{repo}/pullrequests/{id}- get PR details/repositories/{workspace}/{repo}/pullrequests/{id}/comments- list PR comments/repositories/{workspace}/{repo}/pullrequests/{id}/diff- get PR diff/repositories/{workspace}/{repo}/refs/branches- list branches/repositories/{workspace}/{repo}/commits- list commits/repositories/{workspace}/{repo}/src/{commit}/{filepath}- get file content/repositories/{workspace}/{repo}/diff/{source}..{destination}- compare branches/commits
Query params: pagelen (page size), page (page number), q (filter), sort (order), fields (sparse response)
Example filters (q param): state="OPEN", source.branch.name="feature", title~"bug"
JQ examples: values[*].slug, values[0], values[*].{name: name, uuid: 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. |