Skip to main content
Glama
ishuen

lottery-mcp

by ishuen

Lottery MCP Server

This MCP (Model Context Protocol) server enables retrieval of Taiwan lottery data for a specified month. It currently supports four games: Super Lotto 638 (威力彩), Lotto 649 (大樂透), Daily Cash 539 (今彩539), and Lotto 4D (4星彩).

Requirements

  • Python 3.9+

  • uv (Python package manager)

Related MCP server: Taiwan Tender MCP

Usage

Install uv if you don't have it:

curl -LsSf https://astral.sh/uv/install.sh | sh

Start the server:

uv run main.py

Running Locally with Claude App

To use this MCP server with Claude App, follow these steps:

  1. Open Settings > Developer in Claude App.

  2. Add or update your configuration as shown below, replacing <absolute_path_to_the_folder> with the full path to your project directory:

    {
      "mcpServers": {
        "lottery": {
          "command": "uv",
          "args": [
            "--directory",
            "<absolute_path_to_the_folder>",
            "run",
            "main.py"
          ]
        }
      }
    }
  3. After connecting, a blue running tag will appear next to your server name in the Local MCP servers list.

  4. Access the server's tools by clicking the Search and tools button in the chat interface.

This confirms the MCP server is running and integrated with Claude App.

Troubleshoot

Available Tools

4 tools
get_daily_cash_monthB

Get lottery, daily cash (今彩539), data in the specified month Args: year: target year, e.g. 2024 month: target month, e.g. 5

ParametersJSON Schema
NameRequiredDescriptionDefault
yearYes
monthYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries full behavioral burden. It repeats the parameter types but doesn't disclose whether this is a read-only operation, authentication requirements, rate limits, or any retrieval behavior; only the limited Args list adds minimal context.

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

Conciseness3/5

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

The description is short and mostly front-loaded with the core action, but the Args section lacks formatting and includes redundant examples (e.g., 2024, 5) that could be structured more cleanly.

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 simple two-parameter monthly data retrieval tool, the description tells the agent what it retrieves and which parameters to supply; since an output schema exists, return values need not be explained, so the description is nearly complete.

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

Parameters3/5

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

Schema description coverage is 0%, but the description adds basic meaning for both year and month via the Args section, slightly compensating for the missing schema details even though the information (e.g., 2024, 5) is mostly inferable from the names.

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?

States a specific verb (Get) and resource (lottery, daily cash 今彩539) with scope (specified month), distinguishing it from siblings like get_super_lotto_month by naming the game type. Clear purpose, though no explicit differentiation beyond the name.

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

Usage Guidelines3/5

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

Implies usage through the month scope but offers no explicit when-to-use vs alternatives or when-not; the description alone doesn't help the agent choose among the four month-based lotto tools.

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

get_lotto_4d_monthC

Get lottery, lotto 4d (4星彩), data in the specified month Args: year: target year, e.g. 2024 month: target month, e.g. 5

ParametersJSON Schema
NameRequiredDescriptionDefault
yearYes
monthYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description bears full behavioral disclosure. It implies a read-only fetch of historical lottery data but doesn't state whether it's read-only, if there are rate limits, whether data is paginated, or if it returns partial data. The Args section adds only examples, not behavioral context.

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 front-loaded with the purpose, followed by a brief Args list. It's appropriately sized with no unnecessary sentences, though the Args formatting is slightly clunky.

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

Completeness3/5

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

An output schema exists, so return values needn't be explained. However, with no annotations and 0% parameter schema coverage, the description should clarify more about parameter constraints and behavioral traits. It covers the bare minimum to invoke correctly but leaves gaps in usage guidance and parameter semantics.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It provides example values ('e.g. 2024', 'e.g. 5'), which is helpful but minimal. It doesn't clarify format constraints (e.g., 1-12 for month) or whether 'year' is full YYYY or two-digit.

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?

States a clear verb-resource pair ('Get lottery, lotto 4d data') and names the temporal scope (specified month). Siblings are other lottery types, and the name 'lotto 4d' distinguishes it, but the description doesn't explicitly say how it differs from get_super_lotto_month or get_lotto_649_month. The parenthetical '4星彩' clarifies the specific game.

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 the sibling lottery tools (get_super_lotto_month, get_lotto_649_month, get_daily_cash_month). An agent must infer from the tool name which lottery game to pick. No exclusions or alternatives mentioned.

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

get_lotto_649_monthC

Get lottery, super lotto 649 (大樂透), data in the specified month Args: year: target year, e.g. 2024 month: target month, e.g. 5

ParametersJSON Schema
NameRequiredDescriptionDefault
yearYes
monthYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It never states that this is a read-only operation, nor does it disclose any ordering, pagination, or missing-data behavior for the month range.

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?

Short and front-loaded, with the core purpose first and the Args block second. The Args block largely restates the schema and could be trimmed, but there is no filler.

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

Completeness3/5

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

An output schema exists, so return values need not be explained. Still, for a query tool with no annotations and 0% schema coverage, the description omits parameter ranges and any behavioral context, leaving gaps an agent must guess at.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It supplies example values (year: 2024, month: 5), which add some meaning, but gives no valid ranges, formatting rules, or timezone context for the two parameters.

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?

States a specific verb ('Get'), the resource (lottery 649 / 大樂透 data), and the scope (a specified month). However, the parenthetical '(大樂透)' alongside the sibling 'get_super_lotto_month' creates naming ambiguity about whether this is the same lottery as the sibling.

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 versus the three sibling lottery tools (get_super_lotto_month, get_daily_cash_month, get_lotto_4d_month). The agent must infer the distinction purely from the tool name.

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

get_super_lotto_monthB

Get lottery, super lotto 638 (威力彩), data in the specified month Args: year: target year, e.g. 2024 month: target month, e.g. 5

ParametersJSON Schema
NameRequiredDescriptionDefault
yearYes
monthYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral-disclosure burden. It only implies a read operation via 'Get' and says nothing about authentication, rate limits, pagination, empty results, or whether the operation can fail for invalid months.

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 short and front-loads the core operation before listing arguments. The Args section is somewhat schema-like but earns its place because the schema itself has no parameter descriptions.

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

Completeness3/5

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

An output schema exists, so return values need not be explained, and both parameters are documented. However, for a retrieval tool with no annotations, the description does not provide enough context about usage conditions or constraints to be fully complete.

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?

Schema description coverage is 0%, so the description must carry parameter semantics. It does document both parameters, explaining that 'year' is the target year with an example (2024) and 'month' is the target month with an example (5), which meaningfully compensates for the empty schema.

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 states a specific verb ('Get') and resource ('super lotto 638 / 威力彩 data in the specified month'), which clearly identifies the tool. The named lottery game differentiates it from sibling tools like get_lotto_649_month and get_daily_cash_month, though it does not explicitly state the alternatives.

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?

There is no explicit guidance on when to use this tool versus the sibling lottery tools or any other alternatives. The only implied usage is retrieving a specific game's monthly data, with no exclusions or prerequisite conditions mentioned.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.0
    • First observedget_daily_cash_month
    • First observedget_lotto_4d_month
    • First observedget_lotto_649_month
    • First observedget_super_lotto_month

TDQS

B3.4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool targets a distinct lottery game (super lotto 638, lotto 649, daily cash, lotto 4d) with no overlap. The game name in the tool name and description makes the purpose unambiguous.

Naming Consistency5/5

All four tools follow a consistent get_<game>_month pattern. The naming is predictable and clearly indicates the action and resource.

Tool Count4/5

Four tools is reasonable given the server covers four distinct lottery games. The scope is narrow but well-defined, and each tool earns its place.

Completeness3/5

The surface only provides monthly data retrieval for each game. There are no tools for fetching individual draws, latest results, or time ranges, which are common needs. CRUD operations are not applicable, but the read-only surface is limited to a single granularity.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    A
    maintenance
    Provides comprehensive access to Taiwan's Legislative Yuan data including bills, committees, gazettes, meeting records, interpellations, laws, legislators, and IVOD recordings through the Legislative Yuan API v2.
    42
    6
    MIT
  • F
    license
    A
    quality
    Not graded
    maintenance
    Enables users to search and retrieve detailed information about Taiwan government procurement tenders through the Government Electronic Procurement System API. It supports searching tenders by keyword, category code, date, and government unit.
    6
    -
  • A
    license
    A
    quality
    D
    maintenance
    Enables to access Taiwan Central Weather Administration data, including 3-day and 1-week weather forecasts for counties/cities and historical rainfall data.
    3
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Provides tools to query Chinese lottery results, check prizes, and update data for 双色球 (Double Color Ball) and 大乐透 (Super Lotto).
    4
    1
    MIT