xonecas.io
62159
Sy

symb / commit 55c41fd

fix: Open returns the file to the llm

xonecas2026-02-12 55c41fd967512eaca5a11be793de5f0ceda15036 parent 51235ac

2 files changed

docs/DESIGN.md+1−1
@@ -183,7 +183,7 @@ parameters!
183183 Grep(pattern="...", ...)
184184 ```
185185
186-- Open() should return the openned content to the LLM, and still open the snippet in the editor.
186+- truncate tool reposnses. (time for verbose?)
187187
188188 - Add Prompt, and AGENTS.md support.
189189
internal/mcp_tools/open.go+15−1
@@ -176,8 +176,22 @@ func (h *OpenForUserHandler) Handle(ctx context.Context, arguments json.RawMessa
176176 })
177177 }
178178
179+ // Return the content to the LLM as well
180+ rangeInfo := ""
181+ if args.Start > 0 || args.End > 0 {
182+ start := args.Start
183+ if start <= 0 {
184+ start = 1
185+ }
186+ end := args.End
187+ if end <= 0 || end > len(lines) {
188+ end = len(lines)
189+ }
190+ rangeInfo = fmt.Sprintf(" (lines %d-%d)", start, end)
191+ }
192+
179193 return &mcp.ToolResult{
180- Content: []mcp.ContentBlock{{Type: "text", Text: fmt.Sprintf("Opened %s in editor", args.File)}},
194+ Content: []mcp.ContentBlock{{Type: "text", Text: fmt.Sprintf("Opened %s%s:\n\n%s", args.File, rangeInfo, selectedContent)}},
181195 IsError: false,
182196 }, nil
183197 }