@@ -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 }