get_feature_by_category
Retrieves a list of features for a given category, such as past performance or pedigree, to enable targeted analysis of horse racing data.
Instructions
カテゴリ別に特徴量を取得
Args:
category: カテゴリ名(過去成績、適性、人的要因、血統など)
Returns:
該当カテゴリの特徴量リストInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes |
Implementation Reference
- src/jvlink_mcp_server/server.py:291-309 (handler)The tool handler function for 'get_feature_by_category'. It takes a category string, filters the FEATURE_IMPORTANCE_DATA['important_features'] list by category, and returns matching features with count.
@mcp.tool() def get_feature_by_category(category: str) -> dict: """カテゴリ別に特徴量を取得 Args: category: カテゴリ名(過去成績、適性、人的要因、血統など) Returns: 該当カテゴリの特徴量リスト """ features = [ f for f in FEATURE_IMPORTANCE_DATA["important_features"] if f["category"] == category ] return { "category": category, "features": features, "count": len(features) } - src/jvlink_mcp_server/server.py:291-291 (registration)The tool is registered via the @mcp.tool() decorator on line 291, which uses FastMCP to register 'get_feature_by_category' as an MCP tool.
@mcp.tool() - FEATURE_IMPORTANCE_DATA is loaded from data/feature_importance.json at module load time (or defaults to empty lists). This is the data source used by get_feature_by_category.
# 特徴量知見データの読み込み _feature_importance_path = DATA_DIR / "feature_importance.json" if _feature_importance_path.exists(): with open(_feature_importance_path, "r", encoding="utf-8") as f: FEATURE_IMPORTANCE_DATA = json.load(f) else: import logging logging.getLogger(__name__).warning( f"feature_importance.json not found at {_feature_importance_path}" ) FEATURE_IMPORTANCE_DATA = { "important_features": [], "feature_combinations": [], "references": [] }