Skip to main content
Glama
miyamamoto

JVLink MCP Server

by miyamamoto

get_database_schema

Retrieve database schema information including table names, column details, and their relationships to understand data structure.

Instructions

データベーススキーマ情報を取得

Returns:
    テーブル一覧、カラム情報、との対応表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool registration for 'get_database_schema' via @mcp.tool() decorator. Calls get_schema_description() helper.
    @mcp.tool()
    def get_database_schema() -> dict:
        """データベーススキーマ情報を取得
    
        Returns:
            テーブル一覧、カラム情報、との対応表
        """
        return get_schema_description()
  • Helper function get_schema_description() that assembles the full schema dictionary including ALL_TABLES, track codes, grade codes, and important notes.
    def get_schema_description():
        return {
            "tables": ALL_TABLES,
            "track_codes": TRACK_CODES,
            "nar_track_codes": NAR_TRACK_CODES,
            "grade_codes": GRADE_CODES,
            "important_notes": [
                "NL_: 蓄積系(確定データ)、RT_: 速報系(当日データ)、TS_: 時系列オッズ",
                "_NAR サフィックス: NAR地方競馬テーブル(JRAと同構造)",
                "KakuteiJyuni(着順)とNinki(人気)はINTEGER型(1, 2, 3...)",
                "Umaban(馬番)とWakuban(枠番)もINTEGER型",
                "JyoCD(競馬場)はTEXT型: JRA='01'-'10', NAR='30'-'57'",
                "Odds, Time, HaronTimeL3, BaTaijyuはREAL型",
                "JRA馬マスタ: NL_UM、NAR馬マスタ: NL_UM_NAR(別テーブル)",
                "速報系(RT_)は当日のみ、過去データはNL_を使用",
                "JRA+NAR横断分析: UNION ALLでNL_SE + NL_SE_NARを結合",
            ],
        }
  • Consolidated ALL_TABLES dictionary combining JVLINK_TABLES (NL_), REALTIME_TABLES (RT_), TIMESERIES_TABLES (TS_), and NAR_TABLES (with _NAR suffix). This is the core schema data returned by get_schema_description().
    ALL_TABLES = {**JVLINK_TABLES, **REALTIME_TABLES, **TIMESERIES_TABLES, **NAR_TABLES}
  • JVLINK_TABLES dictionary defining the schema of JRA accumulated (NL_) tables, including descriptions, primary keys, and key columns.
    JVLINK_TABLES = {
        # レース・出走情報
        "NL_RA": {
            "description": "レース情報テーブル(確定)",
            "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji", "RaceNum"],
            "key_columns": {
                "Year": "開催年 (INTEGER)",
                "MonthDay": "開催月日 (INTEGER, 例: 1225)",
                "JyoCD": "競馬場コード (TEXT, 01-10)",
                "Hondai": "レース名本題",
                "GradeCD": "グレードコード (A=G1, B=G2, C=G3)",
                "Kyori": "距離(INTEGER, メートル)",
                "TrackCD": "トラックコード(2桁: 1桁目=種別[1=芝,2=ダート], 2桁目=回り)",
                "SibaBabaCD": "芝馬場状態コード (1=良, 2=稍重, 3=重, 4=不良)",
                "DirtBabaCD": "ダート馬場状態コード",
            },
        },
        "NL_SE": {
            "description": "出馬表・レース結果テーブル(確定)。血統情報はNL_UMとKettoNumでJOINして取得",
            "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji", "RaceNum", "Umaban"],
            "key_columns": {
                "KettoNum": "血統登録番号(NL_UMとJOINするためのキー)",
                "Umaban": "馬番 (INTEGER, 1-18)",
                "Wakuban": "枠番 (INTEGER, 1-8)",
                "Bamei": "馬名",
                "KisyuRyakusyo": "騎手名略称",
                "KakuteiJyuni": "確定着順 (INTEGER, 1=1着, 2=2着...)",
                "Ninki": "人気 (INTEGER, 1=1番人気, 2=2番人気...)",
                "Odds": "単勝オッズ (REAL)",
                "Time": "走破タイム (REAL, 秒)",
                "HaronTimeL3": "上がり3F (REAL, 秒)",
                "BaTaijyu": "馬体重 (REAL, kg)",
                "Futan": "斤量 (REAL, kg)",
                "Barei": "馬齢 (INTEGER)",
                "SexCD": "性別コード (1=牡, 2=牝, 3=セン)",
            },
        },
        "NL_TK": {
            "description": "特別登録馬テーブル - 特別レースへの登録馬情報",
            "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji", "RaceNum", "KettoNum"],
            "key_columns": {
                "KettoNum": "血統登録番号",
                "Bamei": "馬名",
                "Futan": "斤量 (REAL)",
            },
        },
        "NL_HR": {"description": "払戻テーブル(確定)", "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji", "RaceNum"], "key_columns": {}},
        # 馬・騎手・調教師マスタ
        "NL_UM": {
            "description": "馬マスタ(JRA中央競馬のみ。地方競馬はJOIN不可)",
            "primary_keys": ["KettoNum"],
            "key_columns": {
                "Bamei": "馬名",
                "Ketto3InfoBamei1": "父馬名",
                "Ketto3InfoBamei2": "母馬名",
                "Ketto3InfoBamei5": "母父馬名",
            },
        },
        "NL_KS": {"description": "騎手マスタ", "primary_keys": ["KisyuCode"], "key_columns": {"KisyuName": "騎手名", "KisyuRyakusyo": "騎手名略称"}},
        "NL_CH": {"description": "調教師マスタ", "primary_keys": ["ChokyosiCode"], "key_columns": {"ChokyosiName": "調教師名", "ChokyosiRyakusyo": "調教師名略称"}},
        "NL_BN": {"description": "馬主マスタ", "primary_keys": ["BanusiCode"], "key_columns": {"BanusiName": "馬主名", "Fukusyoku": "服色"}},
        "NL_BR": {"description": "生産者マスタ", "primary_keys": ["BreederCode"], "key_columns": {"BreederName": "生産者名", "Address": "住所"}},
        # 血統・繁殖情報
        "NL_HN": {"description": "繁殖馬マスタ", "primary_keys": ["HansyokuNum"], "key_columns": {"Bamei": "馬名", "FHansyokuNum": "父繁殖番号", "MHansyokuNum": "母繁殖番号"}},
        "NL_SK": {"description": "産駒マスタ", "primary_keys": ["KettoNum"], "key_columns": {"BirthDate": "生年月日", "SexCD": "性別"}},
        "NL_BT": {"description": "系統情報テーブル", "primary_keys": ["HansyokuNum"], "key_columns": {"KeitoName": "系統名"}},
        # 成績・統計情報
        "NL_CK": {
            "description": "競走馬市場取引価格テーブル - 馬の詳細成績・適性情報",
            "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji", "RaceNum", "KettoNum"],
            "key_columns": {
                "KettoNum": "血統登録番号",
                "Bamei": "馬名",
                "KyakusituKeiko": "脚質傾向",
            },
        },
        "NL_HC": {"description": "調教師本賞金・付加賞金テーブル", "primary_keys": ["ChokyosiCode", "SetYear"], "key_columns": {}},
        "NL_HS": {"description": "馬市場取引価格テーブル", "primary_keys": ["KettoNum"], "key_columns": {"Price": "価格"}},
        "NL_HY": {"description": "抹消馬名テーブル", "primary_keys": [], "key_columns": {"Bamei": "馬名"}},
        # オッズ・票数テーブル
        "NL_O1": {"description": "単勝複勝オッズ(確定)", "primary_keys": [], "key_columns": {}},
        "NL_O2": {"description": "馬連オッズ(確定)", "primary_keys": [], "key_columns": {}},
        "NL_O3": {"description": "ワイドオッズ(確定)", "primary_keys": [], "key_columns": {}},
        "NL_O4": {"description": "馬単オッズ(確定)", "primary_keys": [], "key_columns": {}},
        "NL_O5": {"description": "3連複オッズ(確定)", "primary_keys": [], "key_columns": {}},
        "NL_O6": {"description": "3連単オッズ(確定)", "primary_keys": [], "key_columns": {}},
        "NL_H1": {"description": "単勝複勝票数(確定)", "primary_keys": [], "key_columns": {}},
        "NL_H6": {"description": "3連単票数(確定)", "primary_keys": [], "key_columns": {}},
        # 変更情報
        "NL_JC": {"description": "騎手変更テーブル", "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji", "RaceNum", "Umaban"], "key_columns": {}},
        "NL_CC": {"description": "コース変更テーブル", "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji", "RaceNum"], "key_columns": {}},
        "NL_TC": {"description": "発走時刻変更テーブル", "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji", "RaceNum"], "key_columns": {}},
        "NL_JG": {"description": "出走取消・競走除外テーブル", "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji", "RaceNum", "KettoNum"], "key_columns": {}},
        # 天候・馬場情報
        "NL_WE": {"description": "天候馬場状態テーブル", "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji"], "key_columns": {}},
        "NL_WH": {"description": "天候馬場変更テーブル", "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji"], "key_columns": {}},
        # 調教・その他
        "NL_WC": {"description": "調教タイムテーブル", "primary_keys": ["KettoNum", "ChokyoDate"], "key_columns": {"Course": "コース", "HaronTime3Total": "3ハロンタイム"}},
        "NL_DM": {"description": "デジタルメモテーブル", "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji", "RaceNum", "Umaban"], "key_columns": {}},
        "NL_TM": {"description": "タイムマスタテーブル", "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji", "RaceNum", "Umaban"], "key_columns": {"TMScore": "タイムスコア"}},
        "NL_CS": {"description": "コース情報マスタ", "primary_keys": ["JyoCD", "Kyori", "TrackCD"], "key_columns": {}},
        "NL_RC": {"description": "レコードタイムテーブル", "primary_keys": [], "key_columns": {"RecTime": "レコードタイム"}},
        "NL_YS": {"description": "開催スケジュールテーブル", "primary_keys": ["Year", "MonthDay", "JyoCD", "Kaiji", "Nichiji"], "key_columns": {}},
        "NL_WF": {"description": "WIN5情報テーブル", "primary_keys": ["Year", "MonthDay"], "key_columns": {}},
        "NL_AV": {"description": "セリ市情報テーブル", "primary_keys": ["KettoNum"], "key_columns": {"Price": "価格"}},
    }
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the tool returns table list, column info, and correspondence, but misses other traits like read-only behavior, performance considerations, or authentication requirements.

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 very concise with two short sentences, front-loading the purpose. It could benefit from a structured format but avoids unnecessary fluff.

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

Completeness4/5

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

For a parameterless tool with no output schema, the description adequately explains return values. It provides sufficient context for an agent to understand the tool's output.

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?

The input schema has zero parameters (100% coverage), so the description cannot add parameter-level meaning. Baseline of 4 applies as parameters are absent.

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

Purpose4/5

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

The description clearly states the tool retrieves database schema information, including table list, column details, and a correspondence table. It distinguishes itself from siblings like 'get_table_info' or 'list_tables' by implying a broader scope, but does not explicitly differentiate.

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 or any prerequisites. The description lacks context for its preferred use case or exclusions.

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