Skip to main content
Glama
ShiYioo

opencode_native_tools

by ShiYioo

edit

Replace text in a file using OpenCode matching semantics, preserving exact indentation from read output. Use replaceAll to replace every occurrence or add context when the match is ambiguous.

Instructions

Replace text in a file using OpenCode matching semantics. Preserve the exact indentation from read output, excluding its line-number prefix. The operation fails when oldString cannot be identified unambiguously; supply more context or use replaceAll to replace every occurrence.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesThe absolute path to the file to modify
newStringYesThe text to replace it with (must be different from oldString)
oldStringYesThe text to replace
replaceAllNoReplace all occurrences of oldString (default false)
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It explains OpenCode matching semantics, the need to preserve indentation, the failure condition when oldString is ambiguous, and the replaceAll fallback. This is substantial behavioral information, though it does not cover permissions or side effects of the edit operation.

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 two sentences long, front-loaded with the core purpose, and every sentence earns its place. It is concise, structured, and free of fluff.

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 file-edit tool with no annotations and no output schema, the description covers the essential behavior: matching semantics, indentation handling, failure conditions, and disambiguation. It does not mention return values or when to prefer this over apply_patch/write, but it is adequate for typical use.

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 provides descriptions for all four parameters, giving 100% schema coverage. The description adds a bit of context by noting the matching semantics (which impacts oldString) and the replaceAll fallback, but it does not significantly enhance the parameter-level understanding beyond the schema.

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 clearly states the tool's function with a specific verb and resource: 'Replace text in a file using OpenCode matching semantics.' This makes the purpose clear, but it does not explicitly differentiate from sibling tools like apply_patch or write, so it lacks the full points for sibling differentiation.

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 provides concrete usage guidance: 'Preserve the exact indentation from read output, excluding its line-number prefix' and explains how to handle ambiguity: 'supply more context or use replaceAll to replace every occurrence.' This gives clear context on successful operation, though it does not mention when to use this tool versus alternatives like apply_patch or write.

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