copy_paste
Copy or move content between files using text patterns. Find content by search pattern and insert at marker locations to transfer code sections or text blocks.
Instructions
Copy/paste content between files using text patterns. Find content by search pattern, insert at marker location.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
cut | No | Optional: true to cut (move) instead of copy. Default: false | |
source | Yes | ||
target | Yes |
Input Schema (JSON Schema)
{
"properties": {
"cut": {
"description": "Optional: true to cut (move) instead of copy. Default: false",
"type": "boolean"
},
"source": {
"properties": {
"end_pattern": {
"description": "Optional: text pattern for end of content. If not provided, uses line_count",
"type": "string"
},
"file": {
"description": "Path to source file",
"type": "string"
},
"line_count": {
"description": "Optional: number of lines to copy from start_pattern. Default: 1",
"type": "number"
},
"start_pattern": {
"description": "Text pattern to find start of content to copy (e.g., \"function processData\", \"// Section start\")",
"type": "string"
}
},
"required": [
"file",
"start_pattern"
],
"type": "object"
},
"target": {
"properties": {
"file": {
"description": "Path to target file",
"type": "string"
},
"marker": {
"description": "Text pattern to find insertion point (e.g., \"// Insert here\", \"class MyClass\")",
"type": "string"
},
"position": {
"description": "Where to insert relative to marker: before, after, or replace the marker",
"enum": [
"before",
"after",
"replace"
],
"type": "string"
},
"replace_pattern": {
"description": "Optional: specific text pattern to replace (when position=replace)",
"type": "string"
}
},
"required": [
"file",
"marker",
"position"
],
"type": "object"
}
},
"required": [
"source",
"target"
],
"type": "object"
}