feat(mcp): add read_file tool and simplify edit/write returns

- edit_file: truncate diff to 15 lines, compact result format
- write_file: return only path/bytes/message
- read_file: new tool with multi-file, directory, regex support
  - paths: single file, array, or directory
  - pattern: glob filter (*.ts)
  - contentPattern: regex content search
  - maxDepth, maxFiles, includeContent options
- Update tool-strategy.md documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-12-13 17:28:03 +08:00
parent 029384c427
commit 675aff26ff
17 changed files with 1108 additions and 248 deletions

View File

@@ -37,6 +37,19 @@ mcp__ccw-tools__write_file(path="file.txt", content="code with `backticks` and $
**Options**: `backup`, `createDirectories`, `encoding`
### read_file
**When to Use**: Read multiple files, directory traversal, content search
```
mcp__ccw-tools__read_file(paths="file.ts") # Single file
mcp__ccw-tools__read_file(paths=["a.ts", "b.ts"]) # Multiple files
mcp__ccw-tools__read_file(paths="src/", pattern="*.ts") # Directory + glob
mcp__ccw-tools__read_file(paths="src/", contentPattern="TODO") # Regex search
```
**Options**: `pattern`, `contentPattern`, `maxDepth` (3), `includeContent` (true), `maxFiles` (50)
### codex_lens
**When to Use**: Code indexing and semantic search