You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: texttool/deletetextlines.go
+37-36Lines changed: 37 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -19,48 +19,49 @@ var deleteTextLinesTool = spec.Tool{
19
19
Slug: "deletetextlines",
20
20
Version: "v1.0.0",
21
21
DisplayName: "Delete text lines",
22
-
Description: "Delete one or more exact line-block occurrences from a UTF-8 text file. Matching compares TrimSpace(line). "+
23
-
"For reliable calls, prefer editing > 2 consecutive lines and use immediate beforeLines/afterLines to reduce ambiguity. "+
24
-
"maybeStartLine can softly prefer a nearby occurrence, but the tool still fails unless the final deletion count equals expectedDeletions.",
22
+
Description: "Delete a uniquely located block of lines from a UTF-8 text file. Matching compares TrimSpace(line). "+
23
+
"Before calling, get exact file text and line numbers with find/read tools unless you already have them. "+
24
+
"Use a pointed locator: copy an exact distinctive block of > 2 consecutive lines, add immediate beforeLines/afterLines when the block may repeat, and pass maybeStartLine from the observed line number when relevant. "+
25
+
"Do not send generic, repeated, overlapping, or conflict-prone deletions. The tool fails unless the final deletion count equals expectedDeletions.",
"description": "Distinctive block of lines to delete. Prefer editing > 2 consecutive lines. Avoid generic single lines such as blank lines, braces, or repeated return statements. Newline characters inside items are allowed and treated as line breaks."
40
-
},
41
-
"beforeLines": {
42
-
"type": "array",
43
-
"items": { "type": "string" },
44
-
"minItems": 1,
45
-
"description": "Optional immediate-adjacent lines that must appear directly before matchLines. Use 2-5 neighboring lines to disambiguate."
46
-
},
47
-
"afterLines": {
48
-
"type": "array",
49
-
"items": { "type": "string" },
50
-
"minItems": 1,
51
-
"description": "Optional immediate-adjacent lines that must appear directly after matchLines. Use 2-5 neighboring lines to disambiguate."
52
-
},
53
-
"maybeStartLine": {
54
-
"type": "integer",
55
-
"minimum": 1,
56
-
"description": "Optional 1-based approximate startline hint. Best used when you expect one deletion. If several matches exist, the tool will prefer a uniquely closest nearby match within a small built-in tolerance; otherwise it still fails and reports candidates."
57
-
},
58
-
"expectedDeletions": {
59
-
"type": "integer",
60
-
"minimum": 1,
61
-
"default": 1,
62
-
"description": "Fail unless the number of deleted blocks equals this value. Leave at 1 for the common case of a single intended deletion."
63
-
}
32
+
"path": {
33
+
"type": "string",
34
+
"description": "Path of the UTF-8 text file."
35
+
},
36
+
"matchLines": {
37
+
"type": "array",
38
+
"items": { "type": "string" },
39
+
"minItems": 1,
40
+
"description": "Exact consecutive lines to delete, copied from the file. Prefer a distinctive block of > 2 lines. Do not paraphrase. Do not use generic single lines such as blank lines, braces, or repeated return statements. Newline characters inside items are allowed and treated as line breaks."
41
+
},
42
+
"beforeLines": {
43
+
"type": "array",
44
+
"items": { "type": "string" },
45
+
"minItems": 1,
46
+
"description": "Optional exact immediate-adjacent lines copied from the file that must appear directly before matchLines. Use 2-5 lines whenever the target block might repeat."
47
+
},
48
+
"afterLines": {
49
+
"type": "array",
50
+
"items": { "type": "string" },
51
+
"minItems": 1,
52
+
"description": "Optional exact immediate-adjacent lines copied from the file that must appear directly after matchLines. Use 2-5 lines whenever the target block might repeat."
53
+
},
54
+
"maybeStartLine": {
55
+
"type": "integer",
56
+
"minimum": 1,
57
+
"description": "Optional 1-based start-line hint taken from read/find output. Supply it whenever available to point at the intended occurrence. If several matches still exist, the tool only succeeds when one nearby match is uniquely preferred within a small built-in tolerance."
58
+
},
59
+
"expectedDeletions": {
60
+
"type": "integer",
61
+
"minimum": 1,
62
+
"default": 1,
63
+
"description": "Fail unless the number of deleted blocks equals this value. Keep at 1 for the normal case. Do not raise this to bypass ambiguity."
Copy file name to clipboardExpand all lines: texttool/findtext.go
+44-48Lines changed: 44 additions & 48 deletions
Original file line number
Diff line number
Diff line change
@@ -21,60 +21,56 @@ var findTextTool = spec.Tool{
21
21
Slug: "findtext",
22
22
Version: "v1.0.0",
23
23
DisplayName: "Find text matches with context",
24
-
Description: "Search a UTF-8 text file and return matching lines or line-blocks with surrounding context. "+
25
-
"Use this tool before edit tools to gather exact lines and line numbers. "+
26
-
"substring and regex are best for discovery; lineBlock is best for validating an edit locator. "+
27
-
"For lineBlock mode, matching compares TrimSpace(line). Prefer a distinctive multi-line block, and add beforeLines/afterLines when the block may repeat.",
24
+
Description: "Locate exact edit targets in a UTF-8 text file and return matches with surrounding context and line numbers. "+
25
+
"Use this before insert/replace/delete whenever you need a reliable locator. Request enough context lines to build a unique follow-up change block. "+
26
+
"Use substring or regex to discover candidate areas, then reuse the returned exact text and line numbers in edit calls. Use lineBlock to validate that a pointed exact multi-line block is unique before editing. "+
27
+
"For lineBlock mode, matching compares TrimSpace(line) and works best with a distinctive > 2 line block plus beforeLines/afterLines when the block may repeat.",
"description": "Search mode. Use substring or regex to discover candidate areas; use lineBlock when you want to validate a specific block before editing."
43
-
},
44
-
"query": {
45
-
"type": "string",
46
-
"description": "Query string for queryType=substring or regex (Go/RE2 regex). Omit for queryType=lineBlock."
47
-
},
48
-
"matchLines": {
49
-
"type": "array",
50
-
"items": { "type": "string" },
51
-
"minItems": 1,
52
-
"description": "For queryType=lineBlock only: distinctive block of lines to match. Prefer > 2 consecutive lines. Avoid generic single lines such as blank lines, braces, or repeated return statements. Newline characters in items are allowed and treated as line breaks."
53
-
},
54
-
"beforeLines": {
55
-
"type": "array",
56
-
"items": { "type": "string" },
57
-
"minItems": 1,
58
-
"description": "For queryType=lineBlock only: optional immediate-adjacent lines that must appear directly before matchLines. Use 2-5 neighboring lines to disambiguate."
59
-
},
60
-
"afterLines": {
61
-
"type": "array",
62
-
"items": { "type": "string" },
63
-
"minItems": 1,
64
-
"description": "For queryType=lineBlock only: optional immediate-adjacent lines that must appear directly after matchLines. Use 2-5 neighboring lines to disambiguate."
65
-
},
66
-
"contextLines": {
67
-
"type": "integer",
68
-
"minimum": 0,
69
-
"default": 5,
70
-
"description": "Number of lines to include before and after each returned match. Small values such as 2-8 are usually best for building follow-up edit calls."
71
-
},
72
-
"maxMatches": {
73
-
"type": "integer",
74
-
"minimum": 1,
75
-
"default": 10,
76
-
"description": "Maximum number of matches to return."
77
-
}
34
+
"path": {
35
+
"type": "string",
36
+
"description": "Path of the UTF-8 text file."
37
+
},
38
+
"queryType": {
39
+
"type": "string",
40
+
"enum": ["substring", "regex", "lineBlock"],
41
+
"default": "substring",
42
+
"description": "Search mode. Use substring or regex to discover candidate regions. Use lineBlock to verify an exact multi-line edit locator before calling an edit tool."
43
+
},
44
+
"matchLines": {
45
+
"type": "array",
46
+
"items": { "type": "string" },
47
+
"minItems": 1,
48
+
"description": "For queryType=lineBlock only: exact consecutive lines copied from the file to validate an edit locator. Prefer > 2 distinctive lines. Avoid generic single lines such as blank lines, braces, or repeated return statements. Newline characters in items are allowed and treated as line breaks."
49
+
},
50
+
"beforeLines": {
51
+
"type": "array",
52
+
"items": { "type": "string" },
53
+
"minItems": 1,
54
+
"description": "For queryType=lineBlock only: optional exact immediate-adjacent lines copied from the file that must appear directly before matchLines. Use 2-5 lines to disambiguate repeated blocks."
55
+
},
56
+
"afterLines": {
57
+
"type": "array",
58
+
"items": { "type": "string" },
59
+
"minItems": 1,
60
+
"description": "For queryType=lineBlock only: optional exact immediate-adjacent lines copied from the file that must appear directly after matchLines. Use 2-5 lines to disambiguate repeated blocks."
61
+
},
62
+
"contextLines": {
63
+
"type": "integer",
64
+
"minimum": 0,
65
+
"default": 5,
66
+
"description": "Number of lines to include before and after each returned match. Use enough context, usually 5-20 lines, to build a unique follow-up edit call and capture a useful maybeStartLine."
67
+
},
68
+
"maxMatches": {
69
+
"type": "integer",
70
+
"minimum": 1,
71
+
"default": 10,
72
+
"description": "Maximum number of matches to return. Keep this reasonably small while narrowing to a unique target."
Copy file name to clipboardExpand all lines: texttool/inserttextlines.go
+42-43Lines changed: 42 additions & 43 deletions
Original file line number
Diff line number
Diff line change
@@ -24,55 +24,54 @@ var insertTextLinesTool = spec.Tool{
24
24
Version: "v1.0.0",
25
25
DisplayName: "Insert text lines",
26
26
Description: "Insert lines into a UTF-8 text file at start/end or relative to a uniquely matched anchor block. "+
27
-
"Anchor matching compares TrimSpace(line). Prefer a distinctive multi-line anchor. "+
28
-
"Avoid generic anchors such as blank lines, braces, import blocks, or repeated one-line statements. "+
29
-
"If the anchor may repeat, add immediate anchorBeforeLines/anchorAfterLines. "+
30
-
"maybeStartLine can softly prefer a nearby anchor, but the tool still fails if the call is not unambiguous.",
27
+
"Before calling for beforeAnchor/afterAnchor, locate the anchor with find/read tools unless you already have exact text and line numbers. "+
28
+
"Anchor matching compares TrimSpace(line). Use a pointed exact anchor of > 2 consecutive lines, add anchorBeforeLines/anchorAfterLines when the anchor may repeat, and pass maybeStartLine from the observed line number when relevant. "+
29
+
"Do not insert against a generic or repeated anchor. The tool fails if the anchor is not unique.",
"description": "Lines to insert. These are written exactly as provided. Newline characters inside items are allowed and are treated as line breaks."
52
-
},
53
-
"anchorMatchLines": {
54
-
"type": "array",
55
-
"items": { "type": "string" },
56
-
"minItems": 1,
57
-
"description": "Anchor block to match using TrimSpace comparison. Required for position=beforeAnchor/afterAnchor. Prefer > 2 consecutive lines; avoid short generic anchors."
58
-
},
59
-
"anchorBeforeLines": {
60
-
"type": "array",
61
-
"items": { "type": "string" },
62
-
"minItems": 1,
63
-
"description": "Optional immediate-adjacent lines that must appear directly before anchorMatchLines. Use 2-5 neighboring lines to disambiguate."
64
-
},
65
-
"anchorAfterLines": {
66
-
"type": "array",
67
-
"items": { "type": "string" },
68
-
"minItems": 1,
69
-
"description": "Optional immediate-adjacent lines that must appear directly after anchorMatchLines. Use 2-5 neighboring lines to disambiguate."
70
-
},
71
-
"maybeStartLine": {
72
-
"type": "integer",
73
-
"minimum": 1,
74
-
"description": "Optional 1-based approximate startline hint for the anchor. If several anchors match, the tool will prefer a uniquely closest nearby match within a small built-in tolerance; otherwise it still fails and reports candidates."
"description": "Lines to insert. These are written exactly as provided. Newline characters inside items are allowed and are treated as line breaks."
51
+
},
52
+
"anchorMatchLines": {
53
+
"type": "array",
54
+
"items": { "type": "string" },
55
+
"minItems": 1,
56
+
"description": "Anchor block copied exactly from the file. Required for position=beforeAnchor/afterAnchor. Prefer a distinctive block of > 2 consecutive lines. Do not use short generic anchors."
57
+
},
58
+
"anchorBeforeLines": {
59
+
"type": "array",
60
+
"items": { "type": "string" },
61
+
"minItems": 1,
62
+
"description": "Optional exact immediate-adjacent lines copied from the file that must appear directly before anchorMatchLines. Use 2-5 lines whenever the anchor might repeat."
63
+
},
64
+
"anchorAfterLines": {
65
+
"type": "array",
66
+
"items": { "type": "string" },
67
+
"minItems": 1,
68
+
"description": "Optional exact immediate-adjacent lines copied from the file that must appear directly after anchorMatchLines. Use 2-5 lines whenever the anchor might repeat."
69
+
},
70
+
"maybeStartLine": {
71
+
"type": "integer",
72
+
"minimum": 1,
73
+
"description": "Optional 1-based anchor start-line hint taken from read/find output. Supply it whenever available to point at the intended anchor. If several anchors still match, the tool only succeeds when one nearby anchor is uniquely preferred within a small built-in tolerance."
Copy file name to clipboardExpand all lines: texttool/readtextrange.go
+5-6Lines changed: 5 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -18,10 +18,9 @@ var readTextRangeTool = spec.Tool{
18
18
Slug: "readtextrange",
19
19
Version: "v1.0.0",
20
20
DisplayName: "Read text range",
21
-
22
-
Description: "Read a UTF-8 text file and return lines. Optional start and end marker blocks can narrow the range. "+
23
-
"Marker matching uses TrimSpace(line). For reliable marker selection, copy distinctive lines and avoid short generic markers. "+
24
-
"Returned lines preserve original text and line numbers so they can be reused in follow-up edit calls.",
21
+
Description: "Read a UTF-8 text file and return original lines with line numbers for building safe follow-up edits. "+
22
+
"Use this to capture exact text, enough surrounding context, and pointed marker blocks before calling replace/delete/insert. "+
23
+
"Optional start and end marker blocks can narrow the range. Marker matching uses TrimSpace(line), and each provided marker must match exactly once, so choose distinctive multi-line markers instead of short generic snippets.",
25
24
Tags: []string{"text"},
26
25
27
26
ArgSchema: spec.JSONSchema(`{
@@ -36,13 +35,13 @@ var readTextRangeTool = spec.Tool{
36
35
"type": "array",
37
36
"items": { "type": "string" },
38
37
"minItems": 1,
39
-
"description": "Optional start marker block. Must match exactly once. Prefer a distinctive multi-line block; avoid short generic markers."
38
+
"description": "Optional exact start marker block copied from the file. Must match exactly once. Prefer a distinctive block of > 2 lines; avoid short generic markers."
40
39
},
41
40
"endMatchLines": {
42
41
"type": "array",
43
42
"items": { "type": "string" },
44
43
"minItems": 1,
45
-
"description": "Optional end marker block. Must match exactly once. Prefer a distinctive multi-line block; avoid short generic markers."
44
+
"description": "Optional exact end marker block copied from the file. Must match exactly once. Prefer a distinctive block of > 2 lines; avoid short generic markers."
0 commit comments