Skip to main content

What are Capabilities?

Capabilities are actions your pilot can perform. Each capability defines:
  • What the action does (name and description)
  • Input parameters (JSON Schema)
  • Output data (JSON Schema)
  • Events it may trigger

Capability Structure

Required Fields

Optional Fields


JSON Schema

Capabilities use JSON Schema Draft 2020-12 to define parameters and return values.

Why JSON Schema?

  • ✅ Self-documenting - Describes data structure
  • ✅ Validation - Qaptly validates params before sending
  • ✅ Type safety - Catches errors early
  • ✅ AI-friendly - AI can understand your API

Basic Types


Example Capabilities

1. Simple Action (No Parameters)

Get current WiFi status with no input parameters:

2. Action with Required Parameters

Connect to WiFi with required SSID and optional password:

3. Action with Array Parameters

Control multiple GPIO pins at once:

4. Action with Enum Choices

Set LED color from predefined options:

JSON Schema Features

Validation Constraints

Default Values

Enumerations

Nested Objects


Event Declaration

Declare which events a capability may trigger:
Best Practice: Only list events that are directly related to this action. Don’t list all possible events your pilot can emit.

Action Naming Conventions

Format

Standard Domains

Custom Domains

For vendor-specific actions, use:
Examples:
  • acme.motor.rotate
  • acme.motor.stop
  • acme.motor.set_speed

Description Best Practices

Good descriptions help AI understand your pilot:

❌ Bad Description

✅ Good Description

Guidelines

  1. Be specific - What exactly does it do?
  2. Mention key data - What information is returned?
  3. Include units - dBm, MHz, seconds, etc.
  4. Note side effects - Does it change state?
  5. Write for AI - Future AI integration will use descriptions

Complete Example

A comprehensive capability with all features:

Validation

Qaptly validates parameters before sending commands:

Dynamic Capabilities (Advanced)

For pilots with changing capabilities (e.g., detected sensors), you can:
  1. Initial registration - Register with basic capabilities
  2. Discovery - Detect available hardware
  3. Reconnect - Disconnect and reconnect with updated capabilities
Capability updates require disconnection and re-registration. Plan your pilot architecture accordingly.

Testing Capabilities

Test your JSON Schema definitions:

Next Steps

Protocol Reference

Message format specifications

Examples

Complete working implementations

Quick Start

Build your first pilot

Authentication

Security and key management