{
 "documentation_revision": 10,
 "api_revision": 58,
 "source": "Commands + ToolSchemas + PlatformApi.openApi",
 "operation": {
  "path": "/v2/call",
  "method": "POST",
  "mcp_tool": "bridgit_ui_sequence",
  "idempotency_required": true,
  "documentation": "https://bridgit.cc/learn/operations/v2-ui.sequence.json",
  "operation_url": "https://bridgit.cc/learn/operations/v2-ui.sequence.json",
  "required_arguments": [
   "idempotency_key",
   "session_id",
   "fence",
   "steps"
  ],
  "http": {
   "path": "/v2/call",
   "headers": {
    "Authorization": "Bearer <your key>",
    "Idempotency-Key": "Required: one UUID per logical action; preserve it on retries"
   },
   "instructions": "Send JSON {tool, arguments}. HTTP retry identity belongs in the Idempotency-Key header, never arguments.idempotency_key; MCP uses idempotency_key inside its tool arguments.",
   "method": "POST",
   "arguments_schema": {
    "additionalProperties": false,
    "type": "object",
    "properties": {
     "session_id": {
      "description": "A control session id from session.request, once the owner approved it",
      "type": "string"
     },
     "fence": {
      "description": "The session's current fence, from session.list or screen.observe",
      "type": "string"
     },
     "steps": {
      "minItems": 1,
      "maxItems": 8,
      "type": "array",
      "items": {
       "additionalProperties": false,
       "type": "object",
       "properties": {
        "expect": {
         "description": "Postcondition: give package, text or both",
         "additionalProperties": false,
         "type": "object",
         "properties": {
          "package": {
           "description": "App that must be in front",
           "type": "string",
           "maxLength": 256
          },
          "text": {
           "description": "Text that must be visible",
           "type": "string",
           "maxLength": 512
          }
         },
         "required": []
        },
        "package": {
         "description": "App the step runs in; must be in the session",
         "type": "string",
         "maxLength": 256
        },
        "resource_id": {
         "type": "string",
         "maxLength": 512
        },
        "label": {
         "type": "string",
         "maxLength": 512
        },
        "text": {
         "description": "Required for set_text",
         "type": "string",
         "maxLength": 4096
        },
        "type": {
         "type": "string",
         "enum": [
          "tap",
          "long_press",
          "set_text",
          "scroll"
         ]
        },
        "direction": {
         "type": "string",
         "enum": [
          "forward",
          "backward"
         ]
        }
       },
       "required": [
        "type",
        "package",
        "expect"
       ]
      }
     }
    },
    "required": [
     "session_id",
     "fence",
     "steps"
    ]
   },
   "request_schema": {
    "additionalProperties": false,
    "type": "object",
    "required": [
     "tool",
     "arguments"
    ],
    "properties": {
     "arguments": {
      "additionalProperties": false,
      "type": "object",
      "properties": {
       "session_id": {
        "description": "A control session id from session.request, once the owner approved it",
        "type": "string"
       },
       "fence": {
        "description": "The session's current fence, from session.list or screen.observe",
        "type": "string"
       },
       "steps": {
        "minItems": 1,
        "maxItems": 8,
        "type": "array",
        "items": {
         "additionalProperties": false,
         "type": "object",
         "properties": {
          "expect": {
           "description": "Postcondition: give package, text or both",
           "additionalProperties": false,
           "type": "object",
           "properties": {
            "package": {
             "description": "App that must be in front",
             "type": "string",
             "maxLength": 256
            },
            "text": {
             "description": "Text that must be visible",
             "type": "string",
             "maxLength": 512
            }
           },
           "required": []
          },
          "package": {
           "description": "App the step runs in; must be in the session",
           "type": "string",
           "maxLength": 256
          },
          "resource_id": {
           "type": "string",
           "maxLength": 512
          },
          "label": {
           "type": "string",
           "maxLength": 512
          },
          "text": {
           "description": "Required for set_text",
           "type": "string",
           "maxLength": 4096
          },
          "type": {
           "type": "string",
           "enum": [
            "tap",
            "long_press",
            "set_text",
            "scroll"
           ]
          },
          "direction": {
           "type": "string",
           "enum": [
            "forward",
            "backward"
           ]
          }
         },
         "required": [
          "type",
          "package",
          "expect"
         ]
        }
       }
      },
      "required": [
       "session_id",
       "fence",
       "steps"
      ]
     },
     "tool": {
      "description": "Dotted tool name, e.g. screen.observe (x-bridgit-tools lists the MCP names: drop the bridgit_ prefix and use dots)",
      "type": "string",
      "enum": ["ui.sequence"]
     }
    }
   }
  },
  "mcp_input_schema": {
   "additionalProperties": false,
   "type": "object",
   "properties": {
    "session_id": {
     "description": "A control session id from session.request, once the owner approved it",
     "type": "string"
    },
    "idempotency_key": {
     "description": "Unique per logical request. Retries reuse the same key and exact input.",
     "type": "string"
    },
    "fence": {
     "description": "The session's current fence, from session.list or screen.observe",
     "type": "string"
    },
    "steps": {
     "minItems": 1,
     "maxItems": 8,
     "type": "array",
     "items": {
      "additionalProperties": false,
      "type": "object",
      "properties": {
       "expect": {
        "description": "Postcondition: give package, text or both",
        "additionalProperties": false,
        "type": "object",
        "properties": {
         "package": {
          "description": "App that must be in front",
          "type": "string",
          "maxLength": 256
         },
         "text": {
          "description": "Text that must be visible",
          "type": "string",
          "maxLength": 512
         }
        },
        "required": []
       },
       "package": {
        "description": "App the step runs in; must be in the session",
        "type": "string",
        "maxLength": 256
       },
       "resource_id": {
        "type": "string",
        "maxLength": 512
       },
       "label": {
        "type": "string",
        "maxLength": 512
       },
       "text": {
        "description": "Required for set_text",
        "type": "string",
        "maxLength": 4096
       },
       "type": {
        "type": "string",
        "enum": [
         "tap",
         "long_press",
         "set_text",
         "scroll"
        ]
       },
       "direction": {
        "type": "string",
        "enum": [
         "forward",
         "backward"
        ]
       }
      },
      "required": [
       "type",
       "package",
       "expect"
      ]
     }
    }
   },
   "required": [
    "idempotency_key",
    "session_id",
    "fence",
    "steps"
   ]
  },
  "mcp": {
   "path": "/mcp",
   "arguments_schema": "mcp_input_schema",
   "tool": "bridgit_ui_sequence"
  },
  "required_arguments_transport": "mcp",
  "tool": "ui.sequence"
 }
}
