random_choices
Choose random items from a list, with optional weights to influence selection probabilities. Ideal for sampling, simulations, or random assignments.
Instructions
Choose k items from population with replacement, optionally weighted.
Args: population: List of items to choose from k: Number of items to choose (default 1) weights: Optional weights for each item (default None for equal weights)
Returns: List of k chosen items
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"population": "<population>"
},
"name": "random_choices"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| population | Yes | ||
| k | No | ||
| weights | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |