get_table_info
Retrieve schema details for JVLink horse racing data tables, including column information, table descriptions, and query hints to support analysis.
Instructions
指定テーブルのスキーマ情報を取得(詳細説明付き)
Args:
table_name: テーブル名
Returns:
カラム情報、テーブル説明、クエリヒントを含む辞書Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes |
Implementation Reference
- src/jvlink_mcp_server/server.py:229-263 (handler)The `get_table_info` tool implementation in the MCP server, which retrieves schema and column details for a specified table.
def get_table_info(table_name: str) -> dict: """指定テーブルのスキーマ情報を取得(詳細説明付き) Args: table_name: テーブル名 Returns: カラム情報、テーブル説明、クエリヒントを含む辞書 """ with DatabaseConnection() as db: schema_df = db.get_table_schema(table_name) # カラム情報に説明を追加 columns_with_desc = [] for _, row in schema_df.iterrows(): col_name = row["column_name"] col_info = { "name": col_name, "type": row["column_type"], "description": get_column_description(table_name, col_name) } columns_with_desc.append(col_info) # テーブル説明を取得 table_desc = get_table_description(table_name) return { "table_name": table_name, "table_description": table_desc.get("description", ""), "target_equivalent": table_desc.get("target_equivalent", ""), "primary_keys": table_desc.get("primary_keys", []), "total_columns": len(columns_with_desc), "columns": columns_with_desc, "query_hints": QUERY_GENERATION_HINTS if table_name in ["NL_RA", "NL_SE"] else "" }