Skip to main content
Glama

jules_apply_patch

Fetch a completed Jules session's git patch and apply it to a local repo with 3-way merge, optionally creating a branch, running tests, and auto-committing.

Instructions

Fetch the clean git unidiff patch from a completed Jules session and apply it directly to a local repository workspace, with optional branch creation, test execution, and auto-commit using 3-way merge.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYesAbsolute local repository path on this machine (e.g. '/root/projects/agent-brain').
session_idYesThe Jules session ID containing the git patch output.
auto_commitNoIf true and tests pass (or no test command given), automatically commits the changes using Jules's suggested commit message (defaults to false).
branch_nameNoOptional branch name to create and switch to before applying (e.g. 'jules/fix-health-check').
test_commandNoOptional verification command to execute after applying patch (e.g. 'npm test' or 'pytest').

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.5.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral burden and does disclose several important traits: it applies a patch directly to the local repo, can create branches, run tests, and auto-commit using a 3-way merge. It does not mention error handling, failure modes, or side effects on an unclean working tree, which keeps it from a 5.

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?

The description is a single dense sentence with no wasted words, front-loading the core action and then listing optional behaviors. It could be slightly more scannable with a second sentence, but it remains efficiently sized and informative.

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?

For a five-parameter tool with no output schema and no annotations, the description should explain more about expected results, such as what is returned after applying the patch, test results, or commit status. It covers the main workflow well but omits output/return behavior and practical prerequisites, leaving the agent to infer critical operational details.

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 100%, so the baseline is 3. The description adds only modest semantic context beyond the schema, such as 'clean git unidiff patch' for session_id and '3-way merge' for the application process, but does not systematically add meaning to each parameter.

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

Purpose5/5

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

The description names a specific verb (fetch and apply), a specific resource (clean git unidiff patch from a completed Jules session to a local repository), and the optional actions (branch creation, tests, auto-commit). It clearly differentiates from sibling tools like jules_get_patch, which only fetches a patch, by emphasizing direct application to the workspace.

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?

The description implies usage context: you should use this when you have a completed Jules session producing a patch and you want it applied locally. However, it never explicitly states when to use this tool instead of alternatives like jules_get_patch or jules_verify_patch, nor does it give any exclusions or prerequisites such as requiring a clean working tree.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yasserbousrih/jules-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server