Games
Random lottery system for selecting winners from participant list
Call this tool from your code in three languages.
# 1) Upload each file first → returns { filePath }
curl -X POST 'https://api.elysiatools.com/upload/random-lottery' \
-F 'file=@/path/to/participantFile.ext'
# 2) Call the tool with the returned filePath values
curl -X POST 'https://api.elysiatools.com/en/api/tools/random-lottery' \
-F 'participantFile=/path/to/file.ext' \
-F 'participantText=One participant per line. Format: Name,ID,Department
张三,001,技术部
李四,002,市场部
王五' \
-F 'prizeCount=1'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/random-lottery| Name | Type | Required | Description |
|---|---|---|---|
| participantFile | fileupload required | Yes | Upload Excel file with columns: Name, ID, Department |
| participantText | textarea | No | Enter participants manually (optional if using file) |
| prizeCount | number | Yes | — |
Interactive result
{
"result": "Initial display content",
"interactive": true,
"components": [
{
"type": "timer",
"id": "timer1",
"config": {
"label": "Countdown",
"duration": 60
}
}
],
"state": {
"key": "value"
},
"actions": [
{
"type": "start",
"id": "start-btn",
"label": "Start"
}
],
"styles": "/* Custom CSS */",
"scripts": "/* Client-side scripts */",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-random-lottery": {
"name": "random-lottery",
"description": "Random lottery system for selecting winners from participant list",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=random-lottery",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "random-lottery",
"arguments": {
"participantFile": "https://example.com/file.ext",
"participantText": "One participant per line. Format: Name,ID,Department\n张三,001,技术部\n李四,002,市场部\n王五",
"prizeCount": 1
}
}
}Questions or issues? Contact [email protected]