MCP Tools Reference: securesourcemanager.googleapis.com

Tool: get_branch_rule

Retrieves details of a Secure Source Manager branch rule.

The following code sample shows how to use curl to call the get_branch_rule MCP tool.

Curl Request
curl --location 'https://securesourcemanager.europe-west4.rep.googleapis.com/mcp' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "get_branch_rule",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'

Input Schema

GetBranchRuleRequest is the request for getting a branch rule.

GetBranchRuleRequest

JSON representation
{
  "name": string
}
Fields
name

string

Required. Name of the repository to retrieve. The format is projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}.

Output Schema

Metadata of a BranchRule. BranchRule is the protection rule to enforce pre-defined rules on designated branches within a repository.

BranchRule

JSON representation
{
  "name": string,
  "uid": string,
  "createTime": string,
  "updateTime": string,
  "annotations": {
    string: string,
    ...
  },
  "etag": string,
  "includePattern": string,
  "disabled": boolean,
  "requirePullRequest": boolean,
  "minimumReviewsCount": integer,
  "minimumApprovalsCount": integer,
  "requireCodeOwnerApproval": boolean,
  "requireCommentsResolved": boolean,
  "allowStaleReviews": boolean,
  "requireLinearHistory": boolean,
  "requiredStatusChecks": [
    {
      object (Check)
    }
  ]
}
Fields
name

string

Identifier. A unique identifier for a BranchRule. The name should be of the format: projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}

uid

string

Output only. Unique identifier of the repository.

createTime

string (Timestamp format)

Output only. Create timestamp.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

updateTime

string (Timestamp format)

Output only. Update timestamp.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

annotations

map (key: string, value: string)

Optional. User annotations. These attributes can only be set and used by the user. See https://google.aip.dev/128#annotations for more details such as format and size limitations.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

etag

string

Optional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.

includePattern

string

Optional. The pattern of the branch that can match to this BranchRule. Specified as regex. .* for all branches. Examples: main, (main|release.*). Current MVP phase only support .* for wildcard.

disabled

boolean

Optional. Determines if the branch rule is disabled or not.

requirePullRequest

boolean

Optional. Determines if the branch rule requires a pull request or not.

minimumReviewsCount

integer

Optional. The minimum number of reviews required for the branch rule to be matched.

minimumApprovalsCount

integer

Optional. The minimum number of approvals required for the branch rule to be matched.

requireCodeOwnerApproval

boolean

Optional. Determines if code owners must approve before merging to the branch.

requireCommentsResolved

boolean

Optional. Determines if require comments resolved before merging to the branch.

allowStaleReviews

boolean

Optional. Determines if allow stale reviews or approvals before merging to the branch.

requireLinearHistory

boolean

Optional. Determines if require linear history before merging to the branch.

requiredStatusChecks[]

object (Check)

Optional. List of required status checks before merging to the branch.

Timestamp

JSON representation
{
  "seconds": string,
  "nanos": integer
}
Fields
seconds

string (int64 format)

Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be between -62135596800 and 253402300799 inclusive (which corresponds to 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).

nanos

integer

Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive.

AnnotationsEntry

JSON representation
{
  "key": string,
  "value": string
}
Fields
key

string

value

string

Check

JSON representation
{
  "context": string
}
Fields
context

string

Required. The context of the check.

Tool Annotations

Destructive Hint: ❌ | Idempotent Hint: ❌ | Read Only Hint: ✅ | Open World Hint: ❌