Mobile Device Protocol

Mobile Device Protocol

The specification for AgentCab Android app device capabilities. Define input schemas to collect device data automatically, and output actions to execute operations remotely on user devices.

Input Formats — Data Collection

In an agent's input_schema.properties, the format value on each field tells the app how to collect data. Formats fall into two categories: user-initiated file selection and automatic device data collection.

File Selection (User Manual)

These formats prompt the user to pick or capture a file. The result is always a file_id after upload.

FormatBehaviorData Type
imageOpens photo pickerfile_id
videoOpens video pickerfile_id
audioOpens audio file pickerfile_id
fileOpens system file pickerfile_id
cameraOpens camera to take a photofile_id
record_audioStarts recording, uploads on stopfile_id

Device Data (Auto Collection)

These formats collect data automatically from the device without user interaction. Each returns structured JSON.

FormatBehaviorData Type
device:photosScans photo library, extracts metadata[{name, dateAdded, size, width, height, path, bucket}]
device:photos_recentPhotos from the last 7 dayssame as above
device:photo_hashesComputes photo pHash (for deduplication){uri: hash}
device:calendarReads calendar events (default: next 30 days)[{id, title, startTime, endTime, location, allDay}]
device:calendar_weekThis week's calendar eventssame as above
device:contactsReads contacts list[{id, name, phoneNumbers, emails}]
device:call_logCall history[{name, number, type, date, duration}]
device:smsSMS messages[{address, body, date, type}]
device:appsInstalled non-system apps[{packageName, name}]
device:storageStorage statistics{totalBytes, freeBytes, usedBytes, *Formatted}
device:filesScans files in a specified directory[{name, path, isDirectory, size, lastModified, extension}]
device:files_downloadsFiles in Downloads directorysame as above
device:files_documentsFiles in Documents directorysame as above
device:locationCurrent GPS coordinates{latitude, longitude, accuracy}
device:clipboardReads clipboard contentstring
device:screenshotCaptures current screenfile_id
device:screen_contentReads screen text via Accessibility[{text, className, isClickable, isEditable, depth}]
device:batteryBattery level and charging state{level, isCharging}
device:wifiCurrent network info{ssid, ip}
device:device_infoDevice information{model, brand, osVersion, sdkVersion, screenWidth, screenHeight}
device:notificationsNotification history[{packageName, title, text, time}]
device:media_playingCurrently playing media{title, artist, packageName}

Parameter Modifiers (x-device-options)

Add an x-device-options object alongside format to customize collection behavior.

device:photos + options
{
  "format": "device:photos",
  "x-device-options": {
    "days": 7,
    "limit": 100,
    "include_hashes": true
  }
}
device:files + options
{
  "format": "device:files",
  "x-device-options": {
    "directory": "downloads",
    "recursive": true
  }
}
device:calendar + options
{
  "format": "device:calendar",
  "x-device-options": {
    "range_days": 30,
    "direction": "past"
  }
}
device:call_log + options
{
  "format": "device:call_log",
  "x-device-options": {
    "days": 7,
    "limit": 50
  }
}

Output Actions — Remote Execution

When the API response output contains an actions array, the app executes each action in sequence. Actions are grouped by category below.

File Operations

typeParametersBehaviorConfirm
delete_filepathDelete a fileYes
delete_filespaths: string[]Batch delete filesYes
move_filesource, destMove a fileYes
copy_filesource, destCopy a fileNo
create_directorypathCreate a directoryNo
write_filepath, contentWrite a text fileNo
download_fileurl, filename, mimeType?Download to deviceNo

Calendar

typeParametersBehaviorConfirm
create_eventcalendarId, title, startTime, endTime, description?, location?Create a calendar eventNo
delete_eventeventIdDelete a calendar eventYes
set_alarmhour, minute, message?Set an alarmNo

Communication

typeParametersBehaviorConfirm
send_smsnumber, textSend an SMSYes
make_callnumberMake a phone callYes

Share & Clipboard

typeParametersBehaviorConfirm
share_texttext, title?Opens share sheetNo
share_fileurl, filename, mimeTypeShare a fileNo
copy_clipboardtextCopy to clipboardNo
open_urlurlOpen URL in browserNo

Notification

typeParametersBehaviorConfirm
notifytitle, bodySend a local notificationNo

App Operations

typeParametersBehaviorConfirm
launch_apppackageNameLaunch an appNo
uninstall_apppackageNameUninstall an appYes
open_deeplinkuriOpen app-specific pageNo
set_wallpaperurl | pathSet wallpaperYes

Accessibility (requires Accessibility Service)

typeParametersBehaviorConfirm
click_texttextClick element containing textYes
set_texttargetText, newTextFind text field and fill contentYes
long_presstextLong press element containing textYes
scrolldirection, amount?Scroll screenNo
swipestartX, startY, endX, endY, duration?Swipe gestureNo
press_back-Press back buttonNo
press_home-Press home buttonNo
open_notifications-Pull down notification shadeNo

Composite

typeParametersBehaviorConfirm
confirm_actionsmessage, actions: Action[]Show confirmation dialog, then batch executeYes
sequenceactions: Action[], delay_ms?Execute in order with optional delayNo

Permissions

The app requests each permission on first use. If the user denies a permission, the field sends null without blocking the API call.

Permission Policy

  • All device:* data collection requests the corresponding permission on first use
  • User denial sends null for that field — it does not block the call
  • Actions marked with confirmation show a dialog before executing
  • Accessibility actions check whether the Accessibility Service is enabled first
  • send_sms and make_call open the system UI for final user confirmation
CapabilityAndroid Permission
device:photosREAD_MEDIA_IMAGES
device:calendarREAD_CALENDAR, WRITE_CALENDAR
device:contactsREAD_CONTACTS
device:call_logREAD_CALL_LOG
device:smsREAD_SMS
device:locationACCESS_FINE_LOCATION
device:filesMANAGE_EXTERNAL_STORAGE
device:screen_contentAccessibility Service
record_audioRECORD_AUDIO
cameraCAMERA
send_smsSEND_SMS
make_callCALL_PHONE
device:notificationsBIND_NOTIFICATION_LISTENER_SERVICE

Examples

Two real-world agent schemas demonstrating how input formats and output actions work together.

1

Life Weekly Report

Collects recent photos, calendar, contacts, location, call log, and device info to generate a weekly life summary. The worker analyzes data with Claude and returns a report with share actions.

input_schema
{
  "input_schema": {
    "type": "object",
    "properties": {
      "photos": {
        "type": "array",
        "format": "device:photos_recent",
        "title": "Recent Photos"
      },
      "calendar": {
        "type": "array",
        "format": "device:calendar_week",
        "title": "This Week Events"
      },
      "contacts": {
        "type": "array",
        "format": "device:contacts",
        "title": "Contacts"
      },
      "location": {
        "type": "object",
        "format": "device:location",
        "title": "Current Location"
      },
      "call_log": {
        "type": "array",
        "format": "device:call_log",
        "title": "Recent Calls",
        "x-device-options": { "days": 7 }
      },
      "device": {
        "type": "object",
        "format": "device:device_info",
        "title": "Device Info"
      }
    },
    "required": ["photos", "calendar"]
  }
}
worker output (with actions)
{
  "report": "# Your Week\n\n## Places Visited\n...",
  "highlights": [
    "Worked late 3 days in a row",
    "Visited coffee shops 4 times this week"
  ],
  "actions": [
    {
      "type": "copy_clipboard",
      "text": "My AI Life Weekly Report..."
    },
    {
      "type": "share_text",
      "text": "My AI Life Weekly Report...",
      "title": "AI Life Weekly"
    }
  ]
}
2

Phone Slim Coach

Collects storage stats, photo hashes, downloads, documents, apps, and battery data to find duplicate photos and large files. Returns cleanup suggestions with confirm_actions for safe deletion.

input_schema
{
  "input_schema": {
    "type": "object",
    "properties": {
      "storage": {
        "type": "object",
        "format": "device:storage",
        "title": "Storage Stats"
      },
      "photo_hashes": {
        "type": "object",
        "format": "device:photo_hashes",
        "title": "Photo Hashes",
        "x-device-options": { "limit": 500 }
      },
      "downloads": {
        "type": "array",
        "format": "device:files_downloads",
        "title": "Downloads"
      },
      "documents": {
        "type": "array",
        "format": "device:files_documents",
        "title": "Documents"
      },
      "apps": {
        "type": "array",
        "format": "device:apps",
        "title": "Installed Apps"
      },
      "battery": {
        "type": "object",
        "format": "device:battery",
        "title": "Battery"
      }
    },
    "required": ["storage", "downloads"]
  }
}
worker output (with actions)
{
  "summary": "Your phone can free up 3.2GB of space",
  "sections": [
    {
      "title": "Duplicate Photos",
      "description": "Found 23 groups of duplicate photos",
      "saveable_mb": 450
    },
    {
      "title": "Large Files",
      "description": "5 files over 100MB in Downloads",
      "saveable_mb": 1200
    }
  ],
  "actions": [
    {
      "type": "confirm_actions",
      "message": "Delete 23 duplicate photos? (Free 450MB)",
      "actions": [
        { "type": "delete_file", "path": "/storage/.../IMG_001.jpg" },
        { "type": "delete_file", "path": "/storage/.../IMG_002.jpg" }
      ]
    },
    {
      "type": "confirm_actions",
      "message": "Delete 5 large files in Downloads? (Free 1.2GB)",
      "actions": [
        { "type": "delete_file", "path": "/storage/.../big_video.mp4" },
        { "type": "delete_file", "path": "/storage/.../old_backup.zip" }
      ]
    },
    {
      "type": "notify",
      "title": "Cleanup Complete",
      "body": "Freed 3.2GB of space"
    }
  ]
}