{
 "documentation_revision": 10,
 "api_revision": 58,
 "source": "Commands + ToolSchemas + PlatformApi.openApi",
 "operation": {
  "path": "/v2/call",
  "method": "POST",
  "mcp_tool": "bridgit_peripheral_action",
  "idempotency_required": true,
  "documentation": "https://bridgit.cc/learn/operations/v2-peripheral.action.json",
  "operation_url": "https://bridgit.cc/learn/operations/v2-peripheral.action.json",
  "required_arguments": [
   "idempotency_key",
   "type"
  ],
  "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": {
    "description": "ble.read needs address, service_uuid and characteristic_uuid; ble.write also needs data_base64; usb.transfer needs device_id",
    "additionalProperties": false,
    "type": "object",
    "properties": {
     "data_base64": {
      "description": "Required for ble.write and for usb.transfer to an output endpoint",
      "type": "string",
      "maxLength": 90000
     },
     "seconds": {
      "description": "For ble.scan (default 5)",
      "maximum": 10,
      "type": "integer",
      "minimum": 1
     },
     "endpoint": {
      "description": "For usb.transfer (default 0)",
      "type": "integer",
      "minimum": 0
     },
     "address": {
      "description": "Required for ble.read and ble.write",
      "type": "string",
      "maxLength": 17
     },
     "service_uuid": {
      "description": "Required for ble.read and ble.write",
      "type": "string",
      "maxLength": 36
     },
     "device_id": {
      "description": "Required for usb.transfer",
      "type": "string",
      "maxLength": 256
     },
     "max_bytes": {
      "description": "For usb.transfer from an input endpoint",
      "maximum": 65536,
      "type": "integer",
      "minimum": 1
     },
     "type": {
      "type": "string",
      "enum": [
       "ble.scan",
       "ble.read",
       "ble.write",
       "usb.transfer"
      ]
     },
     "characteristic_uuid": {
      "description": "Required for ble.read and ble.write",
      "type": "string",
      "maxLength": 36
     },
     "interface": {
      "description": "For usb.transfer (default 0)",
      "type": "integer",
      "minimum": 0
     }
    },
    "required": ["type"]
   },
   "request_schema": {
    "additionalProperties": false,
    "type": "object",
    "required": [
     "tool",
     "arguments"
    ],
    "properties": {
     "arguments": {
      "description": "ble.read needs address, service_uuid and characteristic_uuid; ble.write also needs data_base64; usb.transfer needs device_id",
      "additionalProperties": false,
      "type": "object",
      "properties": {
       "data_base64": {
        "description": "Required for ble.write and for usb.transfer to an output endpoint",
        "type": "string",
        "maxLength": 90000
       },
       "seconds": {
        "description": "For ble.scan (default 5)",
        "maximum": 10,
        "type": "integer",
        "minimum": 1
       },
       "endpoint": {
        "description": "For usb.transfer (default 0)",
        "type": "integer",
        "minimum": 0
       },
       "address": {
        "description": "Required for ble.read and ble.write",
        "type": "string",
        "maxLength": 17
       },
       "service_uuid": {
        "description": "Required for ble.read and ble.write",
        "type": "string",
        "maxLength": 36
       },
       "device_id": {
        "description": "Required for usb.transfer",
        "type": "string",
        "maxLength": 256
       },
       "max_bytes": {
        "description": "For usb.transfer from an input endpoint",
        "maximum": 65536,
        "type": "integer",
        "minimum": 1
       },
       "type": {
        "type": "string",
        "enum": [
         "ble.scan",
         "ble.read",
         "ble.write",
         "usb.transfer"
        ]
       },
       "characteristic_uuid": {
        "description": "Required for ble.read and ble.write",
        "type": "string",
        "maxLength": 36
       },
       "interface": {
        "description": "For usb.transfer (default 0)",
        "type": "integer",
        "minimum": 0
       }
      },
      "required": ["type"]
     },
     "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": ["peripheral.action"]
     }
    }
   }
  },
  "mcp_input_schema": {
   "description": "ble.read needs address, service_uuid and characteristic_uuid; ble.write also needs data_base64; usb.transfer needs device_id",
   "additionalProperties": false,
   "type": "object",
   "properties": {
    "data_base64": {
     "description": "Required for ble.write and for usb.transfer to an output endpoint",
     "type": "string",
     "maxLength": 90000
    },
    "seconds": {
     "description": "For ble.scan (default 5)",
     "maximum": 10,
     "type": "integer",
     "minimum": 1
    },
    "endpoint": {
     "description": "For usb.transfer (default 0)",
     "type": "integer",
     "minimum": 0
    },
    "address": {
     "description": "Required for ble.read and ble.write",
     "type": "string",
     "maxLength": 17
    },
    "service_uuid": {
     "description": "Required for ble.read and ble.write",
     "type": "string",
     "maxLength": 36
    },
    "device_id": {
     "description": "Required for usb.transfer",
     "type": "string",
     "maxLength": 256
    },
    "idempotency_key": {
     "description": "Unique per logical request. Retries reuse the same key and exact input.",
     "type": "string"
    },
    "max_bytes": {
     "description": "For usb.transfer from an input endpoint",
     "maximum": 65536,
     "type": "integer",
     "minimum": 1
    },
    "type": {
     "type": "string",
     "enum": [
      "ble.scan",
      "ble.read",
      "ble.write",
      "usb.transfer"
     ]
    },
    "characteristic_uuid": {
     "description": "Required for ble.read and ble.write",
     "type": "string",
     "maxLength": 36
    },
    "interface": {
     "description": "For usb.transfer (default 0)",
     "type": "integer",
     "minimum": 0
    }
   },
   "required": [
    "idempotency_key",
    "type"
   ]
  },
  "mcp": {
   "path": "/mcp",
   "arguments_schema": "mcp_input_schema",
   "tool": "bridgit_peripheral_action"
  },
  "required_arguments_transport": "mcp",
  "tool": "peripheral.action"
 }
}
