Skip to main content
Glama

generate_patch

Generate a validated unified diff for code changes. Specify files to modify, constraints, and test failures to guide patch creation.

Instructions

Generate a validated candidate unified diff; this tool never edits the repository.

Use deepseek-v4-pro for complex work and deepseek-v4-flash for routine changes. file_context should label each supplied file with its repository-relative path. allowed_paths is the exact list of files the returned patch may add, edit, or delete. On a repair round, send current file contents plus exact test/build failures.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYes
modelNodeepseek-v4-pro
constraintsNo
file_contextYes
allowed_pathsYes
test_failuresNo
Behavior4/5

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

With no annotations provided, the description carries the full burden. It explicitly states the tool never edits the repository, which is the key behavioral trait. Additional clarity about validation or side effects would improve this, but the main constraint is clearly disclosed.

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 5 sentences long, front-loading the core purpose and then adding usage guidelines. It is mostly concise, though some repetition could be trimmed. The structure is logical.

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?

Given the tool has 6 parameters and no output schema or annotations, the description provides a good overview but lacks detail on task and constraints parameters, output format, or error behavior. It is adequate but not exhaustive.

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 coverage is 0%, so the description must add meaning. It explains file_context should include repository-relative paths, allowed_paths defines which files the patch can modify, and provides context for test_failures. However, task and constraints parameters are not described, leaving gaps.

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 clearly states the tool generates a validated candidate unified diff and explicitly notes it never edits the repository. This specific verb-resource combination distinguishes it from siblings like submit_patch_job and review_patch.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description advises using deepseek-v4-pro for complex work and deepseek-v4-flash for routine changes, and specifies that on a repair round the agent should include current file contents and test/build failures. While it provides context for when to use different models, it does not explicitly exclude alternatives.

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

Install Server

Other Tools

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/prelearn-code/deepseek-mcp'

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