Skip to main content
Glama

git_push

Destructive

Push the current HEAD commit to a specified branch on a remote and optionally set upstream. Supply the expected remote OID when replacing history to confirm the update.

Instructions

Push HEAD to one branch; replacing history requires the expected remote OID.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "git_push"
  }
}

Input Schema

NameRequiredDescriptionDefault
branchNo
remoteNoorigin
set_upstreamNo
expected_remote_oidNo

Output Schema

NameRequiredDescriptionDefault
errorNo
changesYes
updatesNo
conflictsYes
operationYes
head_afterYes
head_beforeYes
process_idsYes
synchronization_errorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.1

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and openWorldHint=true; the description adds genuinely new context by explaining the safety mechanism for history replacement (the expected remote OID). It does not describe what happens on mismatch or how upstream tracking changes, but it goes beyond the annotations.

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

Conciseness4/5

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

A single sentence with the core action front-loaded and the destructive-push caveat second. Nothing is wasted, though the phrasing is dense enough that the default branch behavior is not obvious.

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?

An output schema exists, so return values need not be described, and annotations cover the safety profile. Still, for a 4-parameter mutation tool with zero schema descriptions, the definition should clarify what happens when branch is null and how set_upstream interacts with the push.

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 0%, so the description must carry the burden. It explains only one of four parameters, but it explains the most consequential one: expected_remote_oid is the guard for history-replacing pushes. branch, remote, and set_upstream defaults are left unaddressed in both schema and description.

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?

The description names a specific verb ('Push') and resource ('HEAD to one branch'), so an agent can tell it apart from fetch/pull/commit siblings. It is clear but terse, leaving the default-branch behavior implicit.

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?

Usage is implied by the verb, and it surfaces one important precondition: replacing history requires the expected remote OID. It does not say when to prefer this over alternatives like git_pull or git_fetch, nor when a force-style push is appropriate.

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