Skip to content

Commit 2b53891

Browse files
committed
chore: PR feedback
1 parent 59176e5 commit 2b53891

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.claude/agents/python-expert.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Provide:
6363
```python
6464
from fastmcp import FastMCP
6565
import asyncio
66-
import requests
66+
import httpx
6767
from typing import Any
6868

6969
class APIError(Exception):
@@ -75,14 +75,14 @@ mcp = FastMCP("server-name")
7575
async def search_data(query: str) -> str:
7676
"""Search external API and format as plain text."""
7777
try:
78-
# Real API call (no caching)
79-
response = requests.get(f"https://api.example.com/search?q={query}")
80-
response.raise_for_status()
81-
82-
# Format as plain text for LLM
83-
data = response.json()
84-
return format_search_results(data)
85-
except requests.RequestException as e:
78+
async with httpx.AsyncClient() as client:
79+
response = await client.get(f"https://api.example.com/search", params={"q": query})
80+
response.raise_for_status()
81+
82+
# Format as plain text for LLM
83+
data = response.json()
84+
return format_search_results(data)
85+
except httpx.RequestError as e:
8686
return f"Search failed: {str(e)}"
8787

8888
def format_search_results(data: dict[str, Any]) -> str:

0 commit comments

Comments
 (0)