Oacp.json Reference
Complete schema reference for oacp.json. Every field, every type, every default.
Place the file at app/src/main/assets/oacp.json. For Flutter apps, use android/app/src/main/assets/oacp.json.
Top-level fields
Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Protocol version. Currently |
| string | Yes | Always |
| string | Yes | Human-readable app name shown to the user. |
| string[] | No | Categories the app belongs to (e.g. |
| string[] | No | App-level keywords used for ranking during intent resolution. |
| string[] | No | Alternate names for the app (e.g. |
| Capability[] | Yes | Array of capability objects. See below. |
| EntityProvider[] | No | Dynamic entity sources queried at runtime. See Entity Providers. |
| EntityType[] | No | Custom entity type definitions referenced by parameters. |
Capability fields
Each object in the capabilities array has these fields.
Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Unique identifier. Use |
| string | Yes | What this capability does. One sentence. |
| string | No | Category (e.g. |
| string[] | No | Alternate phrasings that mean the same thing. |
| string[] | No | Real user utterances that should trigger this capability. |
| string[] | No | Extra ranking signals for intent resolution. |
| string[] | No | Rules for choosing between similar capabilities. |
| Parameter[] | No | Input parameters extracted from the utterance. |
| object | No | JSON Schema for parameters. Alternative to the |
| string | No | One of |
| string | No | What to ask the user before executing. Used with |
| string | No | What to say when the action runs (e.g. |
| string | No |
|
| boolean | No | Whether the user must be authenticated. Default |
| boolean | No | Whether the app must be in the foreground. Default |
| string | No | One of |
| string | No |
|
| string | No | Description of what changes (e.g. |
| boolean | No | Whether calling this twice has the same effect as calling it once. |
| boolean | No | Whether the device must be unlocked. |
| object | No | JSON Schema describing the result payload. |
| string[] | No | Known error codes the capability can return. |
| ResultTransport | No | How results are delivered back to the assistant. |
| boolean | No | Whether the action can be cancelled mid-execution. |
| string | No | ID of the capability that cancels this one. |
| InvokeConfig | Yes | Platform-specific invocation config. |
Parameter fields
Each object in the parameters array has these fields.
Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Parameter name. Used as the key in extras. |
| string | Yes | Semantic explanation of what this parameter represents. |
| string | No | Instruction for the slot-filling model (e.g. |
| string | Yes | One of |
| boolean | No | Whether the parameter must be present. Default |
| string[] | No | Valid values when |
| string[] | No | Example values for this parameter. |
| object | No | Maps enum values to alternate phrases (e.g. |
| string | No | What to ask the user if the parameter is missing (e.g. |
| any | No | Default value when not provided. |
| number | No | Minimum value for |
| number | No | Maximum value for |
| string | No | Regex pattern for validation. |
| EntityRef | No | Links this parameter to a dynamic entity provider. |
| EntitySnapshot[] | No | Small static set of valid entities. Inline alternative to a provider. |
Invoke config
The invoke object tells the assistant how to launch the capability on each platform.
type is either "broadcast" or "activity".
"broadcast": sends an AndroidIntentviasendBroadcast(). The app handles it in aBroadcastReceiver. Best for background operations."activity": starts anActivityviastartActivity(). Best when the user needs to see UI.
action is the intent action string. Use __APPLICATION_ID__ as the prefix so it resolves to your actual package name.
extrasMapping maps parameter names to intent extra keys. Each parameter value is placed into the intent extras under the corresponding key.
Confirmation semantics
The confirmation field controls whether the assistant asks before executing.
Value | Behavior |
|---|---|
| Invoke immediately. Show |
| Ask the user before invoking. Show |
| Confirm only if |
Completion modes
The completionMode field tells the assistant what to expect after invocation.
Value | Behavior |
|---|---|
| No result expected. The assistant moves on. |
| The app opens and the user sees the result in the app's UI. |
| The app runs in the background and broadcasts a result via |
Result transport
When completionMode is "async_result", define how the result comes back.
The app sends a broadcast with this action after completing the work. The result payload follows resultSchema if defined.
Entity types
Define custom entity types at the top level of oacp.json.
Parameters reference these types via entityRef. See Entity Providers for the full pattern.
Entity refs
Link a parameter to an entity type so the assistant can resolve dynamic values.
resolution can be "required" (must resolve to a known entity) or "optional" (free-form input is accepted as a fallback).
Full example
Two capabilities from the OACP Test App. increment_counter is a foreground action. get_battery is a background action that returns a result.
Tips for better voice matching
More aliases = more reliable matching. The intent resolver uses aliases alongside descriptions and examples. Think about how real people phrase things. "Turn on the light", "switch on the torch", "flashlight please" are all the same intent.
Examples should be real utterances, not descriptions. Write what a person would actually say out loud. "play my workout playlist" is a good example. "Plays a playlist selected by the user" is a description, not an example.
Keywords help with ranking. When two capabilities from different apps match equally well, keywords break the tie. Include the nouns and verbs specific to your capability.
disambiguationHints prevent wrong matches. If your app has "play song" and "play playlist", add hints like "Use this when the user mentions a specific song title" to help the resolver pick the right one.