Static source inference · medium confidence · evidence: Streamable HTTP
Current-spec patterns detected
Summary
The server implements 3 tools with basic but incomplete definitions. All tools have non-empty descriptions (10-50 characters) and documented input schemas with parameters, meeting minimal requirements. However, descriptions are generic and fail to explain WHEN to use each tool vs alternatives, parameter descriptions lack constraint details (format, range, valid values), and output schemas are not formally documented. Error handling exists but provides no recovery guidance. The server accepts Korean-language descriptions which is appropriate for the domain but may limit LLM comprehension in English-primary agents. Naming follows verb_noun convention appropriately (check_*, get_*). No security issues detected (no exposed secrets, read-only operations). No tool composition issues (single-purpose tools). The caching layer demonstrates operational awareness but is not exposed to callers. Overall, this is a functional but C-grade implementation with room for improvement in description depth, schema formality, and error guidance.
Lack of formal output schema documentation. All three tools return free-form markdown strings instead of structured JSON objects. Agents must parse unstructured text to extract business status, apartment listings, or weather data, increasing error rates and token waste.
Enum constraints embedded in code, not in schema. district (get_real_estate_trades) and city (get_weather_forecast) accept arbitrary strings but only work with 35 and 25 hardcoded values respectively. Schema does not express these enums, forcing agents to call the tool speculatively or use error messages for discovery.
Incomplete parameter descriptions. Parameter descriptions mention format examples (e.g., '202602', '10자리 숫자') but do not formally specify ranges, patterns, or constraints. LLMs cannot reliably infer that year_month requires YYYYMM format or that hours_ahead must be 1-72.
Recommendations
Convert tool return values from markdown strings to structured JSON objects. Example: Instead of returning '## 사업자등록 상태 조회 결과 (1건)\n- 1234567890: 계속사업자', return {"status": "success", "results": [{"business_number": "1234567890", "status": "계속사업자", "tax_type": "..."}], "count": 1}. Document this schema in each tool's docstring.
Add enum constraints to schema for district and city parameters. Embed DISTRICT_CODES.keys() and CITY_GRID.keys() directly into the schema definition so the LLM sees valid options upfront and JSON Schema validators reject invalid values.
Expand tool descriptions to 100-150 characters. Include WHEN to use each tool, required preconditions (API keys), and what kind of result to expect. Example: 'Retrieve Korean business registration status (계속사업자, 휴업자, 폐업자) for up to 100 business numbers. Call this to verify active status before contacting a business. Requires DATA_GO_KR_API_KEY.'
Add formal constraints to schema. For year_month: add 'pattern': '^\d{6}$' and 'description': '연월 (YYYYMM 형식, 예: 202602). 현재 월 기준 최대 36개월 이전.' For hours_ahead: add 'minimum': 1, 'maximum': 72.
Implement input validation with actionable error messages. Catch KeyError on city/district lookup and return: 'City "xx" not found. Supported cities: 서울, 부산, 제주, ... (총 25개). Did you mean "부산"?' This enables agent self-correction.
Document expected output schema for each tool in its docstring. Example: 'Returns: {"status": "success" | "error", "results": [...], "total_count": int, "cached_at": ISO8601_timestamp}'.
Tool descriptions lack WHEN-to-use context. Descriptions state WHAT the tool does but not when to call it, what preconditions exist (API key setup), or what downstream tools might use its output. Baseline: A+ tools average 194 chars; these average ~30 chars.
Error handling does not guide recovery. Errors like 'API 호출 실패' or silent KeyError (invalid city) provide no next steps. Baseline: recovery-guide pattern requires actionable errors like 'City not found. Try: 서울, 부산, 제주, ...' or 'Retry in 30 seconds.'
No input validation at tool boundary. Invalid city names, malformed dates, or out-of-range hours_ahead are not caught with clear error messages. The tool either fails silently (KeyError) or returns unexpected results.
Insufficient parameter constraints in schema. hours_ahead lacks min/max in JSON Schema (doc says max 72, but schema does not enforce). year_month accepts any string (should enforce YYYYMM pattern). business_numbers array accepts any length (code caps at 100, but schema does not).
Add recovery guidance to error messages. Instead of 'API 호출 실패: {e}', return 'API call failed (timeout). The public data API occasionally experiences latency. Retry in 5 seconds. If repeated, verify DATA_GO_KR_API_KEY in .env.'
Document caching behavior. Add to tool descriptions: 'Results are cached for 24 hours (real estate) / 10 minutes (weather). Cached results reflect the last successful call timestamp.' Or expose cache_hit/cache_miss in output so the agent knows data freshness.
Add parameter metadata: For business_numbers, clarify 'Accepts 1-100 numbers, hyphens optional (10-digit strings).' For year_month, clarify 'Available for 36 months of historical data.'
Consider adding a batch_size or pagination parameter to get_real_estate_trades. The current implementation returns up to 50 items. If results exceed this, offer a parameter to paginate (page_number, limit) and return total_count so agents can plan multi-call sequences.