Skip to main content
Glama
vandewilly

MCP Dice Roller

by vandewilly

flip_coin

Simulate coin flips for decision-making or probability testing. Specify how many times to flip (1-100) and get the results.

Instructions

Flip a coin one or more times.

Args: times: Number of times to flip (1-100)

Returns: Results of the coin flip(s)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timesNo

Implementation Reference

  • The flip_coin tool handler implemented with @mcp.tool() decorator.
    def flip_coin(times: int = 1) -> dict:
        """
        Flip a coin one or more times.
    
        Args:
            times: Number of times to flip (1-100)
    
        Returns:
            Results of the coin flip(s)
        """
        if times < 1 or times > 100:
            return {"error": "Times must be between 1 and 100"}
    
        flips = [random.choice(["heads", "tails"]) for _ in range(times)]
    
        if times == 1:
            return {"result": flips[0]}
    
        heads_count = flips.count("heads")
        tails_count = flips.count("tails")
    
        return {
            "flips": flips,
            "count": {"heads": heads_count, "tails": tails_count},
            "total": times,
        }

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/vandewilly/mcp-dice-roller'

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