Skip to main content
Glama
miyamamoto

JVLink MCP Server

by miyamamoto

get_database_overview

Retrieve a complete overview of the Japanese horse racing database, detailing tables, columns, and relationships to facilitate data analysis without SQL.

Instructions

データベース全体の概要を取得

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'get_database_overview'. Decorated with @mcp.tool(), it opens a DatabaseConnection and delegates to _get_data_snapshot (which is an alias for get_data_snapshot from sample_data_provider).
    @mcp.tool()
    def get_database_overview() -> dict:
        """データベース全体の概要を取得"""
        with DatabaseConnection() as db:
            return _get_data_snapshot(db)
  • The actual implementation function get_data_snapshot(). Iterates over 9 database tables (NL_RA, NL_SE, NL_UM, NL_KS, NL_CH, NL_HR, NL_O1, NL_RA_NAR, NL_SE_NAR) to count records and determine the data period from NL_SE. Returns table record counts, total_records, and data_period with earliest/latest dates.
    def get_data_snapshot(db_connection) -> Dict[str, Any]:
        """データベース全体のスナップショット情報を取得
    
        Args:
            db_connection: DatabaseConnectionインスタンス
    
        Returns:
            dict: {
                'tables': テーブルごとの概要情報,
                'total_records': 総レコード数,
                'data_period': データ期間
            }
        """
        results = {
            "tables": {},
            "total_records": 0,
        }
    
        # 各テーブルのレコード数を取得
        for table_name in ["NL_RA", "NL_SE", "NL_UM", "NL_KS", "NL_CH", "NL_HR", "NL_O1", "NL_RA_NAR", "NL_SE_NAR"]:
            try:
                count_sql = f"SELECT COUNT(*) as cnt FROM {table_name}"
                df = db_connection.execute_safe_query(count_sql)
                count = int(df.iloc[0]["cnt"]) if not df.empty else 0
                results["tables"][table_name] = {
                    "record_count": count,
                    "description": _get_table_description(table_name),
                }
                results["total_records"] += count
            except Exception:
                results["tables"][table_name] = {"record_count": 0, "error": "取得失敗"}
    
        # データ期間を取得(NL_SEから)
        try:
            period_sql = """
            SELECT
                MIN(Year || '-' || MonthDay) as earliest,
                MAX(Year || '-' || MonthDay) as latest
            FROM NL_SE
            WHERE KakuteiJyuni IS NOT NULL
            """
            df = db_connection.execute_safe_query(period_sql)
            if not df.empty:
                results["data_period"] = {
                    "earliest": df.iloc[0]["earliest"],
                    "latest": df.iloc[0]["latest"],
                }
        except Exception:
            results["data_period"] = {"error": "取得失敗"}
    
        return results
  • The @mcp.tool() decorator registers 'get_database_overview' as an MCP tool on the FastMCP server instance.
    @mcp.tool()
  • Helper function _get_table_description() used by get_data_snapshot to provide human-readable Japanese descriptions for each table.
    def _get_table_description(table_name: str) -> str:
        """テーブルの説明を取得"""
        descriptions = {
            "NL_RA": "レース情報テーブル",
            "NL_SE": "出馬表・レース結果テーブル",
            "NL_UM": "馬マスタテーブル",
            "NL_KS": "騎手マスタテーブル",
            "NL_CH": "調教師マスタテーブル",
            "NL_HR": "払戻テーブル",
            "NL_O1": "単勝複勝オッズテーブル",
        }
        return descriptions.get(table_name, "不明")
  • Import statement: get_data_snapshot is imported from sample_data_provider and aliased as _get_data_snapshot for use in the handler.
    from .database.sample_data_provider import (
        get_sample_data as _get_sample_data,
        get_column_value_examples as _get_column_value_examples,
        get_data_snapshot as _get_data_snapshot,
    )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description only states the tool retrieves an overview. It lacks details on the output format, data structure, or any side effects, which is insufficient for a tool with no other documentation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that front-loads the core purpose. However, the brevity leaves no room for additional useful context; it is not overly verbose but could be more informative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description is too minimal. It does not explain what the overview contains (e.g., database size, table counts, status), leaving the agent uncertain about the return value.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, so the description cannot add parameter-level meaning. The baseline for zero parameters is high, and no additional information is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get overview of entire database' uses a specific verb and resource, and effectively distinguishes from sibling tools like get_database_schema or list_tables by indicating a high-level summary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as get_database_schema or get_table_info. The description implies a broad use case but does not specify exclusions or contexts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/miyamamoto/jvlink-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server