Games
Système de tirage au sort aléatoire pour sélectionner des gagnants parmi les participants
Appelez cet outil depuis votre code en trois langages.
# 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/fr/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'Envoyez une requête POST avec vos entrées en JSON. Les paramètres de type fichier nécessitent un upload préalable.
POST https://api.elysiatools.com/fr/api/tools/random-lottery| Nom | Type | Requis | Description |
|---|---|---|---|
| participantFile | fileupload requis | Oui | Upload Excel file with columns: Name, ID, Department |
| participantText | textarea | Non | Enter participants manually (optional if using file) |
| prizeCount | number | Oui | — |
Résultat interactif
{
"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"
}
}Ajoutez cet outil à votre serveur Model Context Protocol pour que les agents IA puissent le lister et l'appeler.
Ajoutez ce bloc à la configuration de votre client MCP :
{
"mcpServers": {
"elysiatools-random-lottery": {
"name": "random-lottery",
"description": "Système de tirage au sort aléatoire pour sélectionner des gagnants parmi les participants",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=random-lottery",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Après connexion au point d'accès SSE, listez les outils exposés :
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Appelez l'outil par son id ; les arguments sont construits à partir de ses paramètres :
{
"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
}
}
}Des questions ou un problème ? Contactez [email protected]