Spaces:
Sleeping
Sleeping
Download src/tools.py from vn6295337/Instant-SWOT-Agent: direct link, hf CLI and curl.
- Browser
- Download file 441 Bytes
-
https://huggingface.co/spaces/vn6295337/Instant-SWOT-Agent/resolve/main/src/tools.py
- Command line
-
hf download hf://spaces/vn6295337/Instant-SWOT-Agent/src/tools.py
-
curl -L -o tools.py https://huggingface.co/spaces/vn6295337/Instant-SWOT-Agent/resolve/main/src/tools.py
441 Bytes
| import sqlite3 | |
| def get_strategy_context(strategy_name: str) -> str: | |
| """MCP Tool Function - Query strategy database""" | |
| db_path = 'data/strategy.db' | |
| conn = sqlite3.connect(db_path) | |
| cursor = conn.cursor() | |
| cursor.execute( | |
| 'SELECT description FROM focus_areas WHERE strategy_name = ?', | |
| (strategy_name,) | |
| ) | |
| row = cursor.fetchone() | |
| conn.close() | |
| return row[0] if row else "No such strategy found." |