Return type standardization
This commit is contained in:
@@ -35,7 +35,7 @@ async def handle(args: Dict[str, Any]):
|
||||
# Case 1: No pattern and no lines provided -> Dump whole file
|
||||
if not pattern and not lines_str:
|
||||
output = [f"{i+1}: {line}" for i, line in enumerate(all_lines)]
|
||||
return {"text": "".join(output)}
|
||||
return [{"type": "text", "text": "".join(output)}]
|
||||
|
||||
# Determine target line numbers (1-based)
|
||||
target_lines: Set[int] = set()
|
||||
@@ -61,7 +61,7 @@ async def handle(args: Dict[str, Any]):
|
||||
raise ToolError(f"Error parsing line indices: {e}")
|
||||
|
||||
if not target_lines:
|
||||
return {"text": "No matching lines found."}
|
||||
return [{"type": "text", "text": "No matching lines found."}]
|
||||
|
||||
# Expand targets with context
|
||||
lines_to_show: Set[int] = set()
|
||||
@@ -83,4 +83,4 @@ async def handle(args: Dict[str, Any]):
|
||||
output.append(f"{ln}: {all_lines[ln-1]}")
|
||||
last_line = ln
|
||||
|
||||
return {"text": "".join(output)}
|
||||
return [{"type": "text", "text": "".join(output)}]
|
||||
|
||||
Reference in New Issue
Block a user