crawl_google_suggest
Get keyword suggestions from Google Suggest for a given keyword in Korea, US, or Japan. Collects autocomplete data to inform SEO and content strategy.
Instructions
입력된 키워드에 대해 구글 서제스트에 나타난 키워드 수집 요청
args:
keyword: str, 키워드
gl: Literal['kr', 'us', 'jp'] = "kr", 국가 코드
returns:
dict[Any] | None: 구글 서제스트 수집 결과
키워드 suggestions
한국 (gl: kr)
미국 (gl: us)
일본 (gl: jp)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | ||
| gl | No | kr |
Implementation Reference
- data_api.py:423-453 (handler)The main handler function for the 'crawl_google_suggest' MCP tool. It sends a POST request to the Hubble API's /google_suggest endpoint with a keyword (q) and country code (gl), returns suggestions from Google Suggest.
@mcp.tool() @async_retry(exceptions=(Exception), tries=2, delay=0.3) async def crawl_google_suggest( q: str, gl: Literal['kr', 'us', 'jp'] = "kr") -> dict[Any] | None: ''' 입력된 키워드에 대해 구글 서제스트에 나타난 키워드 수집 요청 args: keyword: str, 키워드 gl: Literal['kr', 'us', 'jp'] = "kr", 국가 코드 returns: dict[Any] | None: 구글 서제스트 수집 결과 키워드 suggestions 한국 (gl: kr) 미국 (gl: us) 일본 (gl: jp) ''' async with httpx.AsyncClient() as client: payload = { "q": q, "gl": gl, } headers = {"X-API-Key": HUBBLE_API_KEY} response = await client.post( f"{HUBBLE_API_URL}/google_suggest", headers=headers, json=payload, timeout=30.0) response.raise_for_status() return response.text - data_api.py:423-424 (registration)The tool is registered with the FastMCP server via the @mcp.tool() decorator, which registers 'crawl_google_suggest' as an MCP tool named 'hubble'.
@mcp.tool() @async_retry(exceptions=(Exception), tries=2, delay=0.3) - data_api.py:12-12 (helper)The HUBBLE_API_KEY is loaded from environment variable and used in the X-API-Key header for authentication.
HUBBLE_API_KEY = os.environ.get('HUBBLE_API_KEY') - data_api.py:15-15 (helper)The base URL for the external Hubble API service used by crawl_google_suggest.
HUBBLE_API_URL = "https://alpha-listeningmind-mcp-api.ascentlab.io" - data_api.py:19-20 (helper)The async_retry decorator wraps crawl_google_suggest to retry up to 2 times on Exception with a 0.3s delay.
def async_retry(exceptions=(Exception), tries=3, delay=0.3, logger=None): def wrapper(func):