Action payload · devices:control
swipe
Swipe between normalized points. ms is an integer from 100 to 1200; default 300.
Payload
{
"type": "swipe",
"from": {
"x": 0.5,
"y": 0.8
},
"to": {
"x": 0.5,
"y": 0.2
},
"ms": 300
}Payload fields
typestringrequiredDiscriminator that selects the action or content shape.
"swipe"fromobjectrequiredStart point of the gesture, using normalized screen coordinates.
View child fields
xnumberrequiredHorizontal position: 0 is the left edge and 1 is the right edge of the current screen.
0.5ynumberrequiredVertical position: 0 is the top edge and 1 is the bottom edge of the current screen.
0.8Unknown fields are rejected.
toobjectrequiredEnd point of the gesture, using normalized screen coordinates.
View child fields
xnumberrequiredHorizontal position: 0 is the left edge and 1 is the right edge of the current screen.
0.5ynumberrequiredVertical position: 0 is the top edge and 1 is the bottom edge of the current screen.
0.2Unknown fields are rejected.
msintegeroptionalGesture duration in milliseconds. The valid range depends on the action type.
300300Unknown fields are rejected.
View JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"swipe"
],
"description": "Discriminator that selects the action or content shape."
},
"from": {
"type": "object",
"properties": {
"x": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Horizontal position: 0 is the left edge and 1 is the right edge of the current screen."
},
"y": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Vertical position: 0 is the top edge and 1 is the bottom edge of the current screen."
}
},
"required": [
"x",
"y"
],
"additionalProperties": false,
"description": "Start point of the gesture, using normalized screen coordinates."
},
"to": {
"type": "object",
"properties": {
"x": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Horizontal position: 0 is the left edge and 1 is the right edge of the current screen."
},
"y": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Vertical position: 0 is the top edge and 1 is the bottom edge of the current screen."
}
},
"required": [
"x",
"y"
],
"additionalProperties": false,
"description": "End point of the gesture, using normalized screen coordinates."
},
"ms": {
"type": "integer",
"minimum": 100,
"maximum": 1200,
"default": 300,
"description": "Gesture duration in milliseconds. The valid range depends on the action type."
}
},
"required": [
"type",
"from",
"to"
],
"additionalProperties": false,
"description": "Swipe between normalized points. ms is an integer from 100 to 1200; default 300.",
"example": {
"type": "swipe",
"from": {
"x": 0.5,
"y": 0.8
},
"to": {
"x": 0.5,
"y": 0.2
},
"ms": 300
}
}REST wraps this payload inside {requestId, command}. The matching MCP tool takes sessionId and requestId plus these fields, without the type discriminator.
Contract
Submit this as command to POST /sessions/{sessionId}/actions, pass it as the CLI action JSON, or use the matching MCP convenience tool. Command objects are strict and reject unknown fields.
Execution
Swipe between normalized points. ms is an integer from 100 to 1200; default 300.
Action status and driver result remain separate. A completed result can still require a fresh screenshot or hierarchy check to prove the intended visible effect.
