MCP टूल

MCP टूल जो टीम के Simulator पर टैप, इंतज़ार, टाइपिंग और दूसरे steps की एक सूची क्रम से, एक ही कॉल में चलाता है।

simulator_batch टीम के चल रहे Simulator पर 1 से 1000 steps क्रम से, एक ही कॉल में चलाता है। इसे किसी जाने-पहचाने flow के लिए इस्तेमाल करें, जैसे कोई फ़ॉर्म भरना और Next दबाना। किसी एलिमेंट का नाम देने वाला हर step स्क्रीन को नए सिरे से पढ़ता है। पहला step चलने से पहले पूरी सूची जाँची जाती है, इसलिए गलत लिखा step डिवाइस को छुए बिना कॉल फ़ेल कर देता है। चलते समय, batch पहले फ़ेल होने वाले step पर रुक जाता है। जो steps हो चुके, वे हो चुके रहते हैं। विफलता नतीजे में बताई जाती है (ok: false, failedStep), टूल त्रुटि के रूप में नहीं। एक batch के waits और sleeps कुल मिलाकर 30 सेकंड से काफ़ी कम रखें; लंबे flow को कई कॉल में बाँटें, वरना कॉल टूटे कनेक्शन के साथ फ़ेल हो सकता है।

रीड-ओनली डिस्ट्रक्टिव आइडेम्पोटेंट
नहीं नहीं नहीं

स्टेप्स

हर step एक object है जिसमें एक action और सिर्फ़ उस action के फ़ील्ड होते हैं; कोई भी दूसरा फ़ील्ड ठुकरा दिया जाता है। selector एक object है जिसमें सेलेक्टर वाले फ़ील्ड होते हैं: text, id, value, role, exact, strict, nodeId। points स्क्रीन कोऑर्डिनेट इस्तेमाल करते हैं।

action फ़ील्ड यह क्या करता है
tap selector; timeoutMs (0 से 600000, डिफ़ॉल्ट 10000); duration (0 से 60 सेकंड, वैकल्पिक) एलिमेंट का इंतज़ार करता है और उसे टैप करता है, जैसे सेलेक्टर के साथ simulator_tap
find selector मेल खाने वाले एलिमेंट की सूची देता है, जैसे simulator_find, बिना इंतज़ार किए
wait-visible selector; timeoutMs (0 से 600000, डिफ़ॉल्ट 10000) तब तक इंतज़ार करता है जब तक एलिमेंट मौजूद और इस्तेमाल लायक न हो
wait-hidden selector; timeoutMs (0 से 600000, डिफ़ॉल्ट 10000) तब तक इंतज़ार करता है जब तक कोई इस्तेमाल लायक एलिमेंट मेल न खाए
slider selector; percent (0 से 100) जैसे simulator_slider
adjust selector; steps (पूर्ण संख्या, 0 नहीं) जैसे simulator_adjust; अधूरा adjustment step को फ़ेल कर देता है
drag start और end (हर एक x, y); duration (0.05 से 60 सेकंड); steps (2 से 1000)। सभी ज़रूरी जैसे simulator_drag
input event एक input event, जैसे simulator_input में
sleep ms (0 से 60000) रुकता है

इनपुट

इनपुट टाइप ज़रूरी डिफ़ॉल्ट यह क्या करता है
teamId string (UUID) हाँ — टीम, list_teams से
simulator string नहीं टीम का डिफ़ॉल्ट डिवाइस कौन-सा डिवाइस, list_simulators से मिले id से
steps 1 से 1000 objects की सूची हाँ — स्टेप्स, क्रम से

नतीजा

फ़ील्ड मतलब
ok true जब हर step सफल रहा
results चले हर step के लिए एक एंट्री, क्रम से
results[].step step का index, 0 से
results[].ok यह सफल रहा या नहीं
results[].elapsedMs इसमें कितना समय लगा, मिलीसेकंड में
results[].result step ने क्या लौटाया: tap और wait-visible के लिए, एलिमेंट, point, exact, matchCount और excluded, जैसे simulator_tap में; find के लिए, matches और excluded; slider और adjust के लिए, उनके टूल के नतीजे; वरना खाली
results[].error step क्यों फ़ेल हुआ, जब वह किसी संदेश के साथ फ़ेल हुआ
failedStep फ़ेल हुए step का index; सिर्फ़ जब ok false हो
{
  "ok": false,
  "results": [
    { "step": 0, "ok": true, "elapsedMs": 412, "result": { "element": { "label": "Next", "identifier": "next", "role": "AXButton" }, "point": { "x": 201, "y": 780 }, "exact": true, "matchCount": 1, "excluded": [] } },
    { "step": 1, "ok": false, "elapsedMs": 10004, "error": "no usable element matching id=\"done\" within 10.0s" }
  ],
  "failedStep": 1
}

त्रुटियाँ

ये किसी भी step के चलने से पहले, टूल त्रुटियों के रूप में लौटती हैं:

संदेश कब क्या करें
steps is a list of 1 to 1000 {"action": …} objects. steps मौजूद नहीं है, खाली है, बहुत लंबी है, या उसमें बिना action वाली एंट्री है 1 से 1000 step objects भेजें
Failed to deserialize the JSON body into the target type: … अज्ञात action, कोई फ़ील्ड गायब या ज़्यादा, या गलत type का फ़ील्ड संदेश में बताया गया step ठीक करें
selector needs nodeId, text, id, value, or role किसी step का selector कुछ नहीं बताता कोई फ़ील्ड जोड़ें
batch timeoutMs exceeds 600000 कोई timeoutMs 600000 से ज़्यादा है अधिकतम 600000 भेजें
batch sleep exceeds 60000 ms कोई sleep 60000 से ज़्यादा है अधिकतम 60000 भेजें, या कई sleeps
invalid tap duration किसी tap की duration 0 से 60 के बाहर है 0 से 60 भेजें
invalid slider percent किसी slider का percent 0 से 100 के बाहर है 0 से 100 भेजें
adjust steps must be nonzero किसी adjust में steps: 0 है शून्य के अलावा कोई संख्या भेजें
drag requires finite coordinates, duration 0.05..=60 seconds and steps 2..=1000 कोई drag range के बाहर है duration या steps ठीक करें

साथ ही वे त्रुटियाँ जो हर Simulator टूल लौटा सकता है: देखें start_simulator।

उदाहरण

{"name": "simulator_batch", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "steps": [
  {"action": "tap", "selector": {"id": "title-field"}},
  {"action": "input", "event": {"type": "type", "text": "Groceries"}},
  {"action": "tap", "selector": {"text": "Save", "exact": true}},
  {"action": "wait-hidden", "selector": {"id": "title-field"}, "timeoutMs": 5000}
]}}