Skip to main content
Glama
miyamamoto

JVLink MCP Server

by miyamamoto

get_query_examples

Retrieve a collection of commonly used SQL query examples for analyzing Japanese horse racing data, enabling quick start without writing queries from scratch.

Instructions

クエリ例集を取得

Returns:
    よく使うクエリのサンプル集

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler that exposes get_query_examples as an MCP tool, delegating to get_target_equivalent_query_examples()
    @mcp.tool()
    def get_query_examples() -> dict:
        """クエリ例集を取得
    
        Returns:
            よく使うクエリのサンプル集
        """
        return get_target_equivalent_query_examples()
  • Core data function that defines the query examples dictionary with 9 sample SQL queries for horse racing analysis
    def get_query_examples():
        return {
            "1番人気勝率": "SELECT COUNT(*) as total, SUM(CASE WHEN KakuteiJyuni = 1 THEN 1 ELSE 0 END) as wins FROM NL_SE WHERE Ninki = 1 AND KakuteiJyuni IS NOT NULL",
            "騎手成績": "SELECT KisyuRyakusyo, COUNT(*) as rides, SUM(CASE WHEN KakuteiJyuni = 1 THEN 1 ELSE 0 END) as wins FROM NL_SE WHERE KakuteiJyuni IS NOT NULL GROUP BY KisyuRyakusyo ORDER BY wins DESC LIMIT 20",
            "東京1番人気": "SELECT COUNT(*) as total, SUM(CASE WHEN KakuteiJyuni = 1 THEN 1 ELSE 0 END) as wins FROM NL_SE WHERE JyoCD = '05' AND Ninki = 1 AND KakuteiJyuni IS NOT NULL",
            "枠番別成績": "SELECT Wakuban, COUNT(*) as total, SUM(CASE WHEN KakuteiJyuni = 1 THEN 1 ELSE 0 END) as wins FROM NL_SE WHERE KakuteiJyuni IS NOT NULL GROUP BY Wakuban ORDER BY Wakuban",
            "種牡馬成績": "SELECT u.Ketto3InfoBamei1 as sire, COUNT(*) as runs, SUM(CASE WHEN s.KakuteiJyuni = 1 THEN 1 ELSE 0 END) as wins FROM NL_SE s JOIN NL_UM u ON s.KettoNum = u.KettoNum WHERE s.KakuteiJyuni IS NOT NULL GROUP BY u.Ketto3InfoBamei1 HAVING COUNT(*) >= 100 ORDER BY wins DESC LIMIT 20",
            "当日オッズ推移": "SELECT HassoTime, Umaban, TanOdds, TanNinki FROM TS_O1 WHERE Year = 2024 AND MonthDay = 1222 AND JyoCD = '06' AND RaceNum = 11 ORDER BY HassoTime, Umaban",
            "NAR大井1番人気": "SELECT COUNT(*) as total, SUM(CASE WHEN KakuteiJyuni = 1 THEN 1 ELSE 0 END) as wins FROM NL_SE_NAR WHERE JyoCD = '44' AND Ninki = 1 AND KakuteiJyuni IS NOT NULL",
            "NAR騎手成績": "SELECT KisyuRyakusyo, COUNT(*) as rides, SUM(CASE WHEN KakuteiJyuni = 1 THEN 1 ELSE 0 END) as wins FROM NL_SE_NAR WHERE KakuteiJyuni IS NOT NULL GROUP BY KisyuRyakusyo ORDER BY wins DESC LIMIT 20",
            "JRA_NAR横断1番人気": "SELECT CASE WHEN JyoCD <= '10' THEN 'JRA' ELSE 'NAR' END as org, COUNT(*) as total, SUM(CASE WHEN KakuteiJyuni = 1 THEN 1 ELSE 0 END) as wins FROM (SELECT JyoCD, Ninki, KakuteiJyuni FROM NL_SE WHERE Ninki = 1 AND KakuteiJyuni IS NOT NULL UNION ALL SELECT JyoCD, Ninki, KakuteiJyuni FROM NL_SE_NAR WHERE Ninki = 1 AND KakuteiJyuni IS NOT NULL) combined GROUP BY org",
        }
  • The @mcp.tool() decorator registers this function as an MCP tool named 'get_query_examples'
    @mcp.tool()
    def get_query_examples() -> dict:
        """クエリ例集を取得
    
        Returns:
            よく使うクエリのサンプル集
        """
        return get_target_equivalent_query_examples()
  • Helper function that delegates to get_query_examples() - intermediary between the MCP tool handler and the core data function
    def get_target_equivalent_query_examples():
        return get_query_examples()
  • MCP resource that also exposes the same query examples via the 'examples://queries' resource URI
    @mcp.resource("examples://queries")
    def query_examples_resource() -> str:
        """クエリ例集
    
        よく使うクエリパターンをサンプルとして提供
        """
        examples = get_target_equivalent_query_examples()
        return json.dumps(examples, ensure_ascii=False, indent=2)
Behavior3/5

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

No annotations provided, but the description indicates a read-only operation returning samples. No behavioral traits beyond basic function are disclosed; however, given simplicity, a score of 3 is adequate.

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

Conciseness5/5

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

The description is extremely concise with no unnecessary words. It efficiently conveys purpose and return value in two short sentences.

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 zero-parameter tool returning a static collection, the description is complete. It could mention format or examples of returned queries, but not essential.

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?

No parameters exist, so schema coverage is 100%. The description does not need to add parameter details, meeting the baseline of 4.

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 it gets query examples (クエリ例集を取得). The resource is distinct from sibling tools like get_column_examples or get_database_schema, so purpose is clear.

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 (e.g., get_column_examples or list_query_templates). It only states what it does without context.

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