Skip to main content
Glama

random-web3-mcp

shuffle_array

Randomly shuffle arrays ensuring fairness using the Fisher-Yates algorithm. Ideal for shuffling game elements, generating random orderings, grouping tasks, or preparing datasets. Supports optional salt for enhanced randomness.

Instructions

Random Array Shuffler

Randomly shuffle the input array, ensuring each element has an equal probability of appearing in any position.
Uses Fisher-Yates shuffle algorithm to ensure fairness.

Args:
    input_array (List): Array to be shuffled, elements can be of any type
    salt (str, optional): Random number salt value for increased randomness. Defaults to "".

Returns:
    str: JSON string containing the shuffled array, formatted as:
    {
        "requestId": "Generated request ID",
        "shuffledArray": [Shuffled array]
    }

Application Scenarios:
1. Game shuffling (playing cards, mahjong tiles)
2. Random ordering (question order, playlist)
3. Random grouping (team assignment, experiment grouping)
4. Data shuffling (training dataset, test cases)

Input Schema

NameRequiredDescriptionDefault
input_arrayYes
saltNo

Input Schema (JSON Schema)

{ "properties": { "input_array": { "items": {}, "title": "Input Array", "type": "array" }, "salt": { "default": "", "title": "Salt", "type": "string" } }, "required": [ "input_array" ], "title": "shuffle_arrayArguments", "type": "object" }

Other Tools from random-web3-mcp

Related Tools

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/suxiongye/random-web3-mcp'

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