Skip to content

aai.json Descriptor

Overview

aai.json defines application capabilities using JSON Schema. Each file describes a single platform deployment.

Structure

json
{
  "schemaVersion": "1.0",
  "version": "1.0.0",
  "platform": "macos",
  "app": {
    "id": "com.example.app",
    "name": {
      "en": "Example App",
      "zh-CN": "示例应用"
    },
    "defaultLang": "en",
    "description": "Brief description"
  },
  "execution": {
    "type": "apple-events"
  },
  "tools": [
    {
      "name": "search",
      "description": "Search for items",
      "parameters": {
        "type": "object",
        "properties": { ... },
        "required": [ ... ]
      }
    }
  ]
}

Field Reference

Root Fields

FieldTypeRequiredDescription
schemaVersionstringYesAAI spec version ("1.0")
versionstringYesDescriptor version (semver)
platformstringYesTarget platform
appobjectYesApplication metadata
executionobjectNoExecution configuration
authobjectNoAuthentication config (web only)
toolsarrayYesTool definitions

Platform Values

PlatformTypical Execution TypeAuthorization
macosapple-eventsOperating System
linuxdbusOperating System
windowscomOperating System
webhttpAuth config

app Fields

FieldTypeRequiredDescription
idstringYesReverse-DNS identifier
nameobjectYesInternationalized name object. See Internationalized Name
defaultLangstringYesDefault language tag (must exist in name)
descriptionstringYesBrief description in English (for agent consumption)
aliasesstring[]NoAlternative names for app discovery

Internationalized Name

The name field uses a structured object with BCP 47 language tags:

json
{
  "name": {
    "en": "Reminders",
    "zh-CN": "提醒事项",
    "zh-TW": "提醒事項",
    "ja": "リマインダー"
  },
  "defaultLang": "en"
}

Language Tags (lowercase language, uppercase region):

  • en - English
  • zh-CN - Simplified Chinese (China)
  • zh-TW - Traditional Chinese (Taiwan)
  • zh-HK - Traditional Chinese (Hong Kong)
  • ja - Japanese
  • ko - Korean
  • de - German
  • fr - French
  • es - Spanish

Fallback Logic:

  1. Exact match: name[locale]
  2. Language family: zh-TWzh-CN
  3. Default: name[defaultLang]

Aliases

The aliases array provides additional keywords for fuzzy matching:

json
{
  "aliases": ["reminder", "todo", "待办", "tasks", "task manager"]
}

execution Fields

FieldTypeRequiredDescription
typestringYeshttp, stdio, acp, apple-events, dbus, or com
baseUrlstringhttp onlyBase URL
defaultHeadersobjectNoHeaders for all requests
commandstringstdio onlyCommand to start local adapter
argsarrayNoProcess args for stdio
envobjectNoEnvironment variables for stdio/acp
timeoutnumberNoOptional execution timeout in milliseconds
startobjectacp onlyACP process start config
bundleIdstringapple-events onlyTarget app bundle identifier
eventClassstringapple-events onlyFour-character Apple Event class
eventIdstringapple-events onlyFour-character Apple Event ID
servicestringdbus onlyDBus service name
objectPathstringdbus onlyDBus object path
interfacestringdbus onlyDBus interface name
busstringdbus onlysession or system
progIdstringcom onlyCOM ProgID

execution Examples

HTTP

json
{
  "execution": {
    "type": "http",
    "baseUrl": "https://api.example.com/v1",
    "defaultHeaders": { "Content-Type": "application/json" }
  }
}

Stdio

json
{
  "execution": {
    "type": "stdio",
    "command": "aai-anything-example",
    "args": ["--exec"],
    "timeout": 120000
  }
}

execution.start Fields (acp only)

FieldTypeRequiredDescription
commandstringYesCLI command to start agent
argsstring[]NoCommand-line arguments
envobject (string map)NoEnvironment variables
json
{
  "execution": {
    "type": "acp",
    "start": {
      "command": "opencode",
      "args": ["--mcp"],
      "env": {}
    }
  }
}

Apple Events

json
{
  "execution": {
    "type": "apple-events",
    "bundleId": "com.example.reminders",
    "eventClass": "AAI ",
    "eventId": "call"
  }
}

DBus

json
{
  "execution": {
    "type": "dbus",
    "service": "com.example.files",
    "objectPath": "/com/example/files/Executor",
    "interface": "com.example.files.Executor",
    "bus": "session"
  }
}

COM

json
{
  "execution": {
    "type": "com",
    "progId": "Example.Application"
  }
}

tools[] Fields

FieldTypeRequiredDescription
namestringYesTool identifier (camelCase)
descriptionstringYesWhat the tool does
parametersobjectYesJSON Schema for parameters
returnsobjectNoJSON Schema for return value
executionobjectweb onlyTool-specific HTTP config

tools[].execution Fields (web only)

FieldTypeDescription
pathstringURL path
methodstringHTTP method
headersobjectAdditional headers

Authentication (web only)

Auth Types

TypeUse CaseDescription
oauth2User authorizationOAuth 2.0 with PKCE
apiKeyStatic API tokenNever expires (e.g., Notion, Yuque)
appCredentialEnterprise appsApp ID + Secret to get token (e.g., Feishu)
cookieNo official APIBrowser session cookies (e.g., Xiaohongshu)

oauth2 Fields

FieldTypeRequiredDescription
typestringYes"oauth2"
authorizationEndpointstringYesOAuth authorize URL
tokenEndpointstringYesToken exchange URL
scopesstring[]YesRequired scopes
pkceobjectNoPKCE config
pkce.methodstringYes"S256"
json
{
  "auth": {
    "type": "oauth2",
    "oauth2": {
      "authorizationEndpoint": "https://example.com/oauth/authorize",
      "tokenEndpoint": "https://example.com/oauth/token",
      "scopes": ["read", "write"],
      "pkce": { "method": "S256" }
    }
  }
}

apiKey Fields

FieldTypeRequiredDescription
typestringYes"apiKey"
locationstringYes"header" or "query"
namestringYesHeader/param name
prefixstringNoValue prefix (e.g., "Bearer")
obtainUrlstringYesURL to get API key
instructionsobjectNoUser guidance
json
{
  "auth": {
    "type": "apiKey",
    "apiKey": {
      "location": "header",
      "name": "X-Auth-Token",
      "obtainUrl": "https://example.com/settings/tokens",
      "instructions": {
        "short": "Get your API key from settings",
        "helpUrl": "https://example.com/docs/api"
      }
    }
  }
}

appCredential Fields

FieldTypeRequiredDescription
typestringYes"appCredential"
tokenEndpointstringYesURL to exchange credentials for token
tokenTypestringYes"tenantAccessToken", "appAccessToken", "userAccessToken"
expiresInnumberNoToken lifetime in seconds (default: 7200)
instructionsobjectNoUser guidance
json
{
  "auth": {
    "type": "appCredential",
    "appCredential": {
      "tokenEndpoint": "https://api.example.com/auth/token",
      "tokenType": "tenantAccessToken",
      "expiresIn": 7200,
      "instructions": {
        "short": "Get App ID and Secret from developer console",
        "helpUrl": "https://example.com/developers"
      }
    }
  }
}
FieldTypeRequiredDescription
typestringYes"cookie"
loginUrlstringYesURL to login
requiredCookiesstring[]YesCookie names to extract
domainstringYesCookie domain
instructionsstringNoUser guidance
json
{
  "auth": {
    "type": "cookie",
    "cookie": {
      "loginUrl": "https://example.com/login",
      "requiredCookies": ["session", "authToken"],
      "domain": ".example.com",
      "instructions": "Login in browser, then extract cookies from DevTools"
    }
  }
}

instructions Fields

FieldTypeRequiredDescription
shortstringYesBrief instruction
detailedstringNoDetailed steps
helpUrlstringNoLink to documentation
screenshotUrlstringNoScreenshot of the process

Parameter Schema

Tool parameters and returns follow JSON Schema Draft-07.

json
{
  "name": "search",
  "description": "Search for items",
  "parameters": {
    "type": "object",
    "properties": {
      "query": { "type": "string", "description": "Search query" },
      "limit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 100,
        "default": 10
      }
    },
    "required": ["query"]
  }
}

Version Specification

The version field follows Semantic Versioning: MAJOR.MINOR.PATCH

Change TypeVersion BumpExamples
Add new toolMINOR1.0.01.1.0
Add optional parameterMINOR1.0.01.1.0
Add tool descriptionPATCH1.0.01.0.1
Remove toolMAJOR1.0.02.0.0
Add required parameterMAJOR1.0.02.0.0
Rename toolMAJOR1.0.02.0.0
Change parameter typeMAJOR1.0.02.0.0

Rule of thumb: If existing Agents might break, bump MAJOR. Otherwise, MINOR for new features, PATCH for fixes.

Examples

Desktop (macOS)

json
{
  "schemaVersion": "1.0",
  "version": "1.0.0",
  "platform": "macos",
  "app": {
    "id": "com.example.reminders",
    "name": {
      "en": "Reminders",
      "zh-CN": "提醒事项",
      "zh-TW": "提醒事項",
      "de": "Erinnerungen",
      "fr": "Rappels"
    },
    "defaultLang": "en",
    "description": "Task and reminder management",
    "aliases": ["reminder", "todo", "待办", "tasks"]
  },
  "execution": { "type": "apple-events" },
  "tools": [ ... ]
}

Web with OAuth2

json
{
  "schemaVersion": "1.0",
  "version": "1.0.0",
  "platform": "web",
  "app": {
    "id": "com.example.api",
    "name": {
      "en": "Example API",
      "zh-CN": "示例API"
    },
    "defaultLang": "en",
    "description": "REST API service",
    "aliases": ["api", "rest"]
  },
  "execution": {
    "type": "http",
    "baseUrl": "https://api.example.com/v1",
    "defaultHeaders": { "Content-Type": "application/json" }
  },
  "auth": {
    "type": "oauth2",
    "oauth2": {
      "authorizationEndpoint": "https://example.com/oauth/authorize",
      "tokenEndpoint": "https://example.com/oauth/token",
      "scopes": ["read", "write"],
      "pkce": { "method": "S256" }
    }
  },
  "tools": [
    {
      "name": "search",
      "execution": { "path": "/search", "method": "POST" },
      "parameters": { ... }
    }
  ]
}

Web with API Key

json
{
  "schemaVersion": "1.0",
  "version": "1.0.0",
  "platform": "web",
  "app": {
    "id": "com.yuque.api",
    "name": {
      "en": "Yuque",
      "zh-CN": "语雀"
    },
    "defaultLang": "en",
    "description": "Knowledge management platform",
    "aliases": ["语雀", "yuque", "knowledge", "doc"]
  },
  "execution": {
    "type": "http",
    "baseUrl": "https://www.yuque.com/api/v2",
    "defaultHeaders": { "Content-Type": "application/json" }
  },
  "auth": {
    "type": "apiKey",
    "apiKey": {
      "location": "header",
      "name": "X-Auth-Token",
      "obtainUrl": "https://www.yuque.com/settings/tokens",
      "instructions": {
        "short": "Get your API token from Settings > Tokens",
        "helpUrl": "https://www.yuque.com/settings/tokens"
      }
    }
  },
  "tools": [ ... ]
}

Web with App Credential

json
{
  "schemaVersion": "1.0",
  "version": "1.0.0",
  "platform": "web",
  "app": {
    "id": "com.feishu.api",
    "name": {
      "en": "Feishu",
      "zh-CN": "飞书"
    },
    "defaultLang": "en",
    "description": "Enterprise collaboration platform",
    "aliases": ["飞书", "feishu", "lark"]
  },
  "execution": {
    "type": "http",
    "baseUrl": "https://open.feishu.cn/open-apis",
    "defaultHeaders": { "Content-Type": "application/json" }
  },
  "auth": {
    "type": "appCredential",
    "appCredential": {
      "tokenEndpoint": "https://open.feishu.cn/open-apis/auth/v3/tenantAccessToken/internal",
      "tokenType": "tenantAccessToken",
      "expiresIn": 7200,
      "instructions": {
        "short": "Get App ID and App Secret from Feishu Open Platform",
        "helpUrl": "https://open.feishu.cn/app"
      }
    }
  },
  "tools": [ ... ]
}

Back to Protocol

Released under the Apache 2.0 License.