Skip to main content
Glama
zaqdaisuki

mahjong-calculator

by zaqdaisuki

calculate_mahjong_score

Calculate Mahjong score and yaku from your hand and win tile. Include dora indicators, winds, riichi, tsumo, and other conditions to get han, fu, and points.

Instructions

麻雀の点数を計算します

牌姿と和了牌、対局状況から点数と役を計算します。

Args:
    tiles: 手牌(例: "123m456p789s1122z")
        - 萬子: 1-9m(例: 123m)
        - 筒子: 1-9p(例: 456p)
        - 索子: 1-9s(例: 789s)
        - 字牌: 1-7z(1=東, 2=南, 3=西, 4=北, 5=白, 6=發, 7=中)
        - 赤ドラ: 0で表現(例: 50m = 赤5萬)
    win_tile: 和了牌(例: "2z")
    dora_indicators: ドラ表示牌(カンマ区切り、例: "1m,5p")
    player_wind: 自風(east/south/west/north、デフォルト: east)
    round_wind: 場風(east/south/west/north、デフォルト: east)
    is_tsumo: ツモ和了かどうか(デフォルト: True)
    is_riichi: 立直しているかどうか(デフォルト: False)
    is_ippatsu: 一発かどうか(デフォルト: False)
    is_rinshan: 嶺上開花かどうか(デフォルト: False)
    is_chankan: 搶槓かどうか(デフォルト: False)
    is_haitei: 海底摸月かどうか(デフォルト: False)
    is_houtei: 河底撈魚かどうか(デフォルト: False)

Returns:
    str: 計算結果(役、翻数、符、点数)

Examples:
    calculate_mahjong_score("123m456p789s1122z", "2z")
    → 役牌の計算結果を返す

    calculate_mahjong_score("234m345p456s55z", "5z", is_tsumo=True, is_riichi=True)
    → 立直ツモの計算結果を返す

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tilesYes
is_tsumoNo
win_tileYes
is_haiteiNo
is_houteiNo
is_riichiNo
is_chankanNo
is_ippatsuNo
is_rinshanNo
round_windNoeast
player_windNoeast
dora_indicatorsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/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 of behavioral disclosure. It thoroughly explains the input format (including red dora notation), all boolean flags, and the exact return format. This makes the tool's behavior highly transparent for a calculation tool.

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?

While the description is long, it is well-structured into a purpose statement, Args block, Returns, and Examples. Every sentence adds necessary information, and the formatting makes it easy to scan. There is no fluff or redundancy.

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

Completeness5/5

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

The description covers all 12 parameters, explains the return value in plain terms (yaku, han, fu, points), and provides two examples. Given the tool's complexity, this is a complete and self-contained description.

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

Parameters5/5

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

The schema provides no descriptions for parameters (0% coverage), but the description compensates fully by explaining each parameter in detail, including defaults, examples, and tile encoding conventions. This is exceptional parameter documentation.

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 states it calculates mahjong score and yaku from tile arrangement and game situation. This is a specific verb+resource that clearly explains what the tool does, and since no siblings are listed, there is no need for further differentiation.

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

Usage Guidelines4/5

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

The description provides clear context and practical examples of when to use the tool, but it does not explicitly mention when not to use it or alternatives. Given the absence of sibling tools, the guidance is sufficient and clearly implied.

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/zaqdaisuki/mahjong_calculator'

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