Skip to main content
Glama
QuantConnect

QuantConnect

Official
by QuantConnect

patch_file

Idempotent

Apply a unified diff patch to modify a file in your QuantConnect project. Specify the project ID and the patch in git diff format to update code precisely.

Instructions

Apply a patch (unified diff) to a file in a project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successNoIndicate if the API request was successful.
errorsNoList of errors with the API call.
Behavior3/5

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

The description adds substantial detail about the patch format requirements and matching criteria, which is behavioral. Annotations already indicate idempotentHint=true, and the description doesn't conflict. However, it lacks information on failure modes (e.g., what happens if patch doesn't match exactly) or authorization needs.

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 structured with a clear lead sentence followed by detailed format rules and recommended approach. It uses bullet points and examples effectively, though it is somewhat lengthy. Every sentence contributes value for this complex operation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there is an output schema (not shown), the description does not need to explain return values. However, it fails to address error scenarios (e.g., patch application failure) or success criteria. For a complex tool with critical format requirements, this is a significant gap.

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?

The input schema already provides detailed descriptions for each parameter, especially 'patch' with format requirements. The tool description does not add new semantics beyond the schema, so it meets the baseline for high coverage.

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 verb 'apply' and the resource 'a patch (unified diff) to a file in a project'. It distinguishes itself from sibling tools like update_file_contents (which likely replaces entire file) and create_file, as patching is a specific operation.

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 includes a 'Recommended approach' with steps (read current file first, use 3+ lines context) but does not explicitly state when to use this tool versus alternatives like update_file_contents. No when-not-to-use or exclusion guidance is provided.

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/QuantConnect/mcp-server'

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