Skip to main content
Glama
vandewilly

MCP Dice Roller

by vandewilly

roll_multiple

Roll dice multiple times using standard notation to generate results and statistics for tabletop gaming or probability testing.

Instructions

Roll the same dice multiple times.

Args: notation: Dice notation (e.g., '1d20+5') times: Number of times to roll (1-20)

Returns: Dictionary with all roll results and statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
notationNo1d6
timesNo

Implementation Reference

  • The implementation of the `roll_multiple` MCP tool, which performs a series of dice rolls based on a provided notation and calculates statistics.
    @mcp.tool()
    def roll_multiple(notation: str = "1d6", times: int = 1) -> dict:
        """
        Roll the same dice multiple times.
    
        Args:
            notation: Dice notation (e.g., '1d20+5')
            times: Number of times to roll (1-20)
    
        Returns:
            Dictionary with all roll results and statistics
        """
        if times < 1 or times > 20:
            return {"error": "Times must be between 1 and 20"}
    
        results = []
        totals = []
    
        for i in range(times):
            roll_result = roll_dice(notation)
            if "error" in roll_result:
                return roll_result
            results.append(roll_result)
            totals.append(roll_result["total"])
    
        return {
            "notation": notation,
            "times": times,
            "results": results,
            "totals": totals,
            "statistics": {
                "min": min(totals),
                "max": max(totals),
                "sum": sum(totals),
                "average": round(sum(totals) / len(totals), 2),
            },
        }

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