Return type standardization

This commit is contained in:
2026-07-27 00:35:20 -07:00
parent baa48d7cec
commit f0e5267828
8 changed files with 47 additions and 48 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ import urllib.parse
import json
import re
import asyncio
from typing import Any, Dict, Optional
from typing import Any, Dict, List, Optional
from .utils import ToolError
import config
@@ -130,7 +130,7 @@ async def _fetch_toc(title: str) -> Optional[str]:
return "\n".join(lines)
async def handle(args: Dict[str, Any]) -> Dict[str, Any]:
async def handle(args: Dict[str, Any]) -> List[Dict[str, Any]]:
"""
Main handler for the browse_wikipedia tool.
Supports modes: summary, toc, section, and search.
@@ -170,4 +170,4 @@ async def handle(args: Dict[str, Any]) -> Dict[str, Any]:
else:
raise ToolError(f"Invalid mode '{mode}'. Supported modes: summary, toc, section, search")
return {"text": result}
return [{"type": "text", "text": result}]