Skip to main content
Glama
ShiYioo

opencode_native_tools

by ShiYioo

apply_patch

Applies OpenCode patch documents to add, delete, update, or move files using formatted headers and directives.

Instructions

Apply an OpenCode patch document. Wrap one or more file operations in *** Begin Patch and *** End Patch. Use *** Add File, *** Delete File, or *** Update File headers. New lines in an added file must begin with +. Updates may include a *** Move to: path directive.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patchTextYesThe full patch text that describes all changes to be made
Behavior4/5

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

With no annotations, the description carries full responsibility for behavior. It discloses critical format constraints: the required '*** Begin Patch' and '*** End Patch' markers, allowed headers, the '+' prefix for new file lines, and the optional '*** Move to:' directive. This goes beyond surface description and helps avoid malformed patches, though it does not address error handling or atomicity.

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

Conciseness5/5

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

The description is only three sentences long but packs essential instructions. It starts with the primary purpose and then lists the required formatting elements without any fluff. Every sentence earns its place.

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

Completeness4/5

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

For a single-parameter tool with no output schema, the description covers the core usage well: it explains what to pass and how to structure it. It could be enhanced by mentioning what constitutes a valid patch (e.g., the need for at least one operation) or what happens on invalid input, but these are not critical for basic invocation. Overall, it is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema only describes patchText as 'full patch text', which is generic. The tool description provides essential semantics by specifying the exact patch syntax expected, including structure and examples of headers. This adds significant meaning beyond the schema and is crucial for correct invocation.

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 'Apply an OpenCode patch document', which is a specific verb+resource. It also provides details on the patch format (Begin/End markers, headers), distinguishing it from sibling tools like write and edit that operate on single files directly.

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 explains the mechanics of creating a patch but does not explicitly state when to prefer apply_patch over write/edit. The phrase 'one or more file operations' implies batch use, but no direct comparison or exclusion criteria are given. Usage context is implied rather than explicitly defined.

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/ShiYioo/opencode_native_tools'

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