Skip to content

App Description File: aai.json

Each application supporting AAI provides aai.json in a unified AAI configuration directory.

File Location

PlatformPath
macOS / Linux~/.aai/<appId>/aai.json
Windows%USERPROFILE%\.aai\<appId>\aai.json

Examples:

  • macOS: ~/.aai/com.apple.mail/aai.json
  • Windows: C:\Users\Alice\.aai\com.microsoft.outlook\aai.json

Advantages:

  • No need to modify signed application packages
  • No administrator permissions required
  • Users or the community can freely add, modify, and delete configurations
  • Gateway only needs to scan a single directory to discover all applications

Structure Example

json
{
  "schema_version": "1.0",
  "appId": "com.apple.mail",
  "name": "Mail",
  "description": "Apple's native email client",
  "version": "1.0",
  "platforms": {
    "macos": {
      "automation": "applescript",
      "tools": [
        {
          "name": "send_email",
          "description": "Send a new email via Apple Mail",
          "parameters": {
            "type": "object",
            "properties": {
              "to": { "type": "string", "description": "Recipient email address" },
              "subject": { "type": "string", "description": "Email subject" },
              "body": { "type": "string", "description": "Email body content" }
            },
            "required": ["to", "subject", "body"]
          },
          "script": "tell application \"Mail\"\n  set newMessage to make new outgoing message with properties {subject:\"${subject}\", content:\"${body}\", visible:false}\n  tell newMessage\n    make new to recipient at beginning of to recipients with properties {address:\"${to}\"}\n    send\n  end tell\nend tell\nreturn \"{\\\"success\\\":true, \\\"message_id\\\":\\\"generated\\\"}\"",
          "output_parser": "result as text"
        },
        {
          "name": "search_emails",
          "description": "Search emails in mailbox",
          "parameters": {
            "type": "object",
            "properties": {
              "query": { "type": "string", "description": "Search query string" }
            },
            "required": ["query"]
          },
          "script": "tell application \"Mail\"\n  set results to (messages whose subject contains \"${query}\")\nend tell\nreturn \"{\\\"emails\\\":[\\\"result1\\\", \\\"result2\\\"]}\"",
          "output_parser": "result as text"
        }
      ]
    },
    "windows": {
      "automation": "com",
      "progid": "Outlook.Application",
      "tools": [
        {
          "name": "send_email",
          "description": "Send a new email via Microsoft Outlook",
          "parameters": {
            "type": "object",
            "properties": {
              "to": { "type": "string", "description": "Recipient email address" },
              "subject": { "type": "string", "description": "Email subject" },
              "body": { "type": "string", "description": "Email body content" }
            },
            "required": ["to", "subject", "body"]
          },
          "script": [
            { "action": "create", "var": "app", "progid": "Outlook.Application" },
            {
              "action": "call",
              "var": "mail",
              "object": "app",
              "method": "CreateItem",
              "args": [0]
            },
            { "action": "set", "object": "mail", "property": "To", "value": "${to}" },
            { "action": "set", "object": "mail", "property": "Subject", "value": "${subject}" },
            { "action": "set", "object": "mail", "property": "Body", "value": "${body}" },
            { "action": "call", "object": "mail", "method": "Send" },
            { "action": "return", "value": "{\"success\":true, \"message_id\":\"generated\"}" }
          ],
          "output_parser": "last_result"
        }
      ]
    },
    "linux": {
      "automation": "dbus",
      "service": "org.example.Mail",
      "object": "/org/example/Mail",
      "interface": "org.example.Mail",
      "tools": [
        {
          "name": "send_email",
          "description": "Send a new email",
          "parameters": {
            "type": "object",
            "properties": {
              "to": { "type": "string", "description": "Recipient email address" },
              "subject": { "type": "string", "description": "Email subject" },
              "body": { "type": "string", "description": "Email body content" }
            },
            "required": ["to", "subject", "body"]
          },
          "method": "SendEmail",
          "output_parser": "json"
        }
      ]
    },
    "android": {
      "automation": "intent",
      "package": "com.example.mail",
      "tools": [
        {
          "name": "send_email",
          "description": "Send a new email",
          "parameters": {
            "type": "object",
            "properties": {
              "to": { "type": "string", "description": "Recipient email address" },
              "subject": { "type": "string", "description": "Email subject" },
              "body": { "type": "string", "description": "Email body content" }
            },
            "required": ["to", "subject", "body"]
          },
          "action": "com.example.MAIL_SEND",
          "extras": {
            "to": "${to}",
            "subject": "${subject}",
            "body": "${body}"
          },
          "result_type": "content_provider",
          "result_uri": "content://com.example.mail/results"
        }
      ]
    },
    "ios": {
      "automation": "url_scheme",
      "scheme": "mailapp",
      "tools": [
        {
          "name": "send_email",
          "description": "Send a new email",
          "parameters": {
            "type": "object",
            "properties": {
              "to": { "type": "string", "description": "Recipient email address" },
              "subject": { "type": "string", "description": "Email subject" },
              "body": { "type": "string", "description": "Email body content" }
            },
            "required": ["to", "subject", "body"]
          },
          "url_template": "mailapp://send?to=${to}&subject=${subject}&body=${body}",
          "result_type": "app_group",
          "app_group_id": "group.com.example.mail"
        }
      ]
    },
    "web": {
      "automation": "restapi",
      "base_url": "https://api.notion.com/v1",
      "auth": {
        "type": "oauth2",
        "auth_url": "https://api.notion.com/v1/oauth/authorize",
        "token_url": "https://api.notion.com/v1/oauth/token",
        "scopes": ["read_content", "update_content"],
        "token_placement": "header",
        "token_prefix": "Bearer"
      },
      "default_headers": {
        "Notion-Version": "2022-06-28",
        "Content-Type": "application/json"
      },
      "tools": [
        {
          "name": "search",
          "description": "Search pages and databases",
          "parameters": {
            "type": "object",
            "properties": {
              "query": { "type": "string", "description": "Search query text" }
            },
            "required": ["query"]
          },
          "endpoint": "/search",
          "method": "POST",
          "body": { "query": "${query}" },
          "output_parser": "json"
        }
      ]
    }
  }
}

Field Descriptions

Common Fields

FieldTypeDescription
schema_versionstringSchema version of aai.json, used for compatibility checking
appIdstringUnique identifier (recommended to use reverse-DNS format)
namestringApplication name
descriptionstringApplication description
versionstringaai.json version number
platformsobjectAutomation configuration for each platform

macOS Specific Fields

FieldTypeDescription
platforms.macos.automationstringAutomation type: applescript or jxa
platforms.macos.tools[].scriptstringScript template, supports ${param} placeholders
platforms.macos.tools[].output_parserstringOutput parsing method: result as text (string), result as record (dictionary)
platforms.macos.tools[].timeoutintegerTimeout in seconds, default 30

Windows Specific Fields

FieldTypeDescription
platforms.windows.automationstringAutomation type: com
platforms.windows.progidstringCOM ProgID (e.g., Outlook.Application)
platforms.windows.tools[].scriptarrayCOM operation sequence
platforms.windows.tools[].script[].actionstringOperation type: create (create object), call (call method), set (set property), get (get property), return (return result)
platforms.windows.tools[].script[].varstringVariable name (for storing return values)
platforms.windows.tools[].script[].objectstringObject reference (e.g., mail, app)
platforms.windows.tools[].script[].progidstringProgID (only used in create operations)
platforms.windows.tools[].script[].methodstringMethod name (only used in call operations)
platforms.windows.tools[].script[].propertystringProperty name (only used in set/get operations)
platforms.windows.tools[].script[].valuestringProperty value (supports ${param} placeholders)
platforms.windows.tools[].script[].argsarrayMethod arguments (supports ${param} placeholders)
platforms.windows.tools[].output_parserstringOutput parsing method: last_result (return value of last operation)
platforms.windows.tools[].timeoutintegerTimeout in seconds, default 30

Linux Specific Fields

FieldTypeDescription
platforms.linux.automationstringAutomation type: dbus
platforms.linux.servicestringDBus service name (e.g., org.example.Mail)
platforms.linux.objectstringDBus object path (e.g., /org/example/Mail)
platforms.linux.interfacestringDBus interface name (e.g., org.example.Mail)
platforms.linux.tools[].methodstringDBus method name (e.g., SendEmail)
platforms.linux.tools[].output_parserstringOutput parsing method: json (assumes JSON return), string
platforms.linux.tools[].timeoutintegerTimeout in seconds, default 30

Android Specific Fields

FieldTypeDescription
platforms.android.automationstringAutomation type: intent
platforms.android.packagestringAndroid package name (e.g., com.example.mail)
platforms.android.tools[].actionstringIntent Action (e.g., com.example.MAIL_SEND)
platforms.android.tools[].extrasobjectIntent Extra parameters (supports ${param} placeholders)
platforms.android.tools[].result_typestringResult retrieval method: content_provider (Content Provider), broadcast (broadcast)
platforms.android.tools[].result_uristringContent Provider URI (only used when result_type=content_provider)
platforms.android.tools[].timeoutintegerTimeout in milliseconds, default 5000

iOS Specific Fields

FieldTypeDescription
platforms.ios.automationstringAutomation type: url_scheme
platforms.ios.schemestringURL Scheme (e.g., mailapp)
platforms.ios.tools[].url_templatestringURL template (supports ${param} placeholders)
platforms.ios.tools[].result_typestringResult retrieval method: app_group (App Groups), clipboard (clipboard)
platforms.ios.tools[].app_group_idstringApp Group ID (only used when result_type=app_group)
platforms.ios.tools[].timeoutintegerTimeout in seconds, default 10

Web App Specific Fields

FieldTypeDescription
platforms.web.automationstringAutomation type: restapi
platforms.web.base_urlstringBase URL for all API calls (e.g., https://api.notion.com/v1)
platforms.web.authobjectAuthentication configuration
platforms.web.auth.typestringAuth type: oauth2, api_key, or bearer
platforms.web.auth.auth_urlstringOAuth authorization endpoint (only for oauth2)
platforms.web.auth.token_urlstringOAuth token endpoint (only for oauth2)
platforms.web.auth.scopesarrayRequired OAuth scopes (only for oauth2)
platforms.web.auth.token_placementstringWhere to place token: header or query
platforms.web.auth.token_prefixstringToken prefix in header (e.g., Bearer)
platforms.web.auth.env_varstringEnvironment variable for API key / bearer token
platforms.web.auth.key_namestringHeader or query param name (only for api_key)
platforms.web.auth.key_placementstringheader or query (only for api_key)
platforms.web.default_headersobjectHeaders sent with every request
platforms.web.tools[].endpointstringAPI endpoint path (appended to base_url)
platforms.web.tools[].methodstringHTTP method: GET, POST, PUT, PATCH, DELETE
platforms.web.tools[].bodyobjectRequest body template (supports ${param} placeholders)
platforms.web.tools[].query_paramsobjectURL query parameters (supports ${param} placeholders)
platforms.web.tools[].headersobjectAdditional headers for this specific tool
platforms.web.tools[].output_parserstringjson (default) or text
platforms.web.tools[].timeoutintegerTimeout in seconds, default 30

Back to Spec Index

Released under the Apache 2.0 License.