Cross-Domain Implementation Guide
Document Status: This document is informative. For normative protocol requirements, see MCP-AQL Specification v1.0.0.
On this page
Jump to a section
Use the outline to move through longer pages without losing your place.
- Abstract
- 1. Start with Domain Mapping
- 2. Choose Stable Resource Identifiers
- 3. Design Operations Around CRUDE
- 4. Build Introspection First
- 5. Use Predictable Response Shapes
- 6. Domain Examples
- 6.1 Database Management
- 6.2 File System Management
- 6.3 API Gateway Administration
- 6.4 IoT Device Control
- 7. Conformance Checklist
- 8. Implementation Templates
- 8.1 Operation Template
- 8.2 Introspection Detail Template
- 8.3 Collection Query Template
- 9. Common Pitfalls
- References
Version: 1.0.0-draft Status: Draft Last Updated: 2026-04-15
Document Status: This document is informative. For normative protocol requirements, see MCP-AQL Specification v1.0.0.
Abstract
This guide shows how to adapt MCP-AQL to domains beyond AI element management. It focuses on the practical translation step: taking an existing API or system, mapping its resources and operations into MCP-AQL, and preserving the discoverability and token-efficiency benefits that make the protocol useful for AI clients.
1. Start with Domain Mapping
Before you name any operations, identify three core pieces:
| Question | What you are mapping | Example |
|---|---|---|
| What are the primary resources? | MCP-AQL resource or type names | database, table, file, route, device |
| How are they identified? | Stable lookup parameters | database_name, table_name, file_path, route_id, device_id |
| Which actions matter most? | MCP-AQL operations | list_tables, get_file, update_route, execute_firmware_upgrade |
The best first pass is usually:
- list the nouns in your domain
- list the real tasks users perform
- group those tasks into CRUDE semantics
2. Choose Stable Resource Identifiers
MCP-AQL works best when identifiers are:
- stable across sessions
- explicit in parameter names
- specific enough to avoid ambiguity
Good examples:
database_nametable_namefile_pathroute_iddevice_id
Avoid vague identifiers like name or id when the operation could target more than one resource type.
3. Design Operations Around CRUDE
CRUDE (Create, Read, Update, Delete, Execute) maps each operation to its effect on system state. See the CRUDE Pattern for full classification rules.
Map each real action to the endpoint that best reflects its effect:
| Endpoint | Use for | Example |
|---|---|---|
CREATE |
Additive changes | create_route, create_table_snapshot |
READ |
Safe lookups and queries | list_tables, search_files, query_relationships |
UPDATE |
Mutations to existing state | update_device_config, update_route |
DELETE |
Removals | delete_route, delete_file_alias |
EXECUTE |
Runtime or non-idempotent actions | execute_backup, execute_firmware_upgrade |
If an action starts a process or can be retried/cancelled later, it usually belongs in EXECUTE, not UPDATE.
4. Build Introspection First
Note: The
introspectoperation (READ endpoint) is the only operation MCP-AQL requires all adapters to implement. Everything else is adapter-defined.
An adapter is much easier for AI clients to use when the introspect experience is accurate before the business logic is complete.
For each operation, make sure introspection can answer:
- what the operation is called
- which endpoint it belongs to
- which parameters are accepted
- which parameters are required
- what type comes back
- which optional query features it supports
For collection-oriented READ operations, document query-language controls such as:
queryfiltersortfieldsaggregate- pagination parameters
5. Use Predictable Response Shapes
Every operation should still return MCP-AQL’s discriminated response pattern:
{
"success": true,
"data": {
"items": []
}
}Single-resource lookups keep the same envelope but return one object:
{
"success": true,
"data": {
"device": {
"device_id": "dev_001",
"status": "online"
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_MISSING_PARAM",
"message": "Missing required parameter 'table_name'."
}
}That consistency matters more than the domain itself. It lets a client move from one adapter to another without re-learning the envelope. See Error Codes for the standard validation and execution error catalog.
6. Domain Examples
6.1 Database Management
Resources
databasetablequery_job
Representative operations
list_databaseslist_tablesget_table_schemaquery_rowsexecute_query_job
Identifier pattern
database_nametable_namequery_job_id
Useful query controls
fieldsfor projectionsfilterfor row predicatesaggregatefor counts and grouped summaries
6.2 File System Management
Resources
filedirectorypermission_entry
Representative operations
list_directoryget_filesearch_filesupdate_file_metadatadelete_file
Identifier pattern
file_pathdirectory_path
Useful query controls
queryfor name/content searchfieldsfor light listings- computed fields such as
_computed.size_human(see Field Selection for computed field semantics)
6.3 API Gateway Administration
Resources
routeserviceconsumerplugin
Representative operations
list_routesget_routecreate_routeupdate_routedelete_routequery_relationships
Identifier pattern
route_idservice_idconsumer_id
Useful query controls
- relationship queries for route-to-service and plugin-to-route traversal
aggregatefor route counts by status or environment
6.4 IoT Device Control
Resources
devicegroupfirmware_jobtelemetry_event
Representative operations
list_devicesget_deviceupdate_device_configexecute_firmware_upgradelist_telemetry_events
Identifier pattern
device_idgroup_idfirmware_job_id
Useful query controls
filteron status, site, or firmware version- computed fields like
_computed.is_stale
Long-running jobs such as execute_firmware_upgrade SHOULD expose lifecycle state through introspection so clients can discover supported statuses and follow-up actions.
7. Conformance Checklist
Use this as a pre-release checklist for a new domain adapter:
- Every operation has a stable snake_case name.
- Every operation is placed on the correct CRUDE endpoint.
introspectdocuments every accepted parameter.- Required parameters fail with structured validation errors.
- Collection READ operations document their supported query controls.
- READ responses use
fieldsand pagination consistently where supported. See Collection Querying and Pagination. - Errors avoid leaking implementation details.
- At least one round-trip create/read or update/read example is tested.
- Any domain-specific constraints are documented in introspection.
8. Implementation Templates
8.1 Operation Template
{
"name": "list_tables",
"description": "List tables within a database",
"endpoint": "READ",
"params": {
"database_name": {
"type": "string",
"required": true,
"description": "Database to inspect"
},
"query": {
"type": "string",
"required": false,
"description": "Optional free-text table search"
},
"fields": {
"type": "array",
"required": false,
"description": "Optional field projection"
}
},
"returns": {
"name": "TableList",
"kind": "object"
}
}8.2 Introspection Detail Template
{
"name": "list_tables",
"semantic_category": "READ",
"endpoint": "read",
"mcpTool": "mcp_aql_read",
"description": "List tables within a database.",
"permissions": {
"readOnly": true,
"destructive": false
},
"parameters": [
{
"name": "database_name",
"type": "string",
"required": true,
"description": "Database to inspect."
},
{
"name": "fields",
"type": "array",
"required": false,
"description": "Optional field projection."
}
],
"returns": {
"name": "TableList",
"kind": "object"
}
}8.3 Collection Query Template
{
"operation": "search_routes",
"params": {
"query": "payments",
"filter": {
"status": "active"
},
"sort": {
"field": "updated_at",
"order": "desc"
},
"fields": ["route_id", "path", "_computed.health_score"],
"first": 25
}
}9. Common Pitfalls
- Mirroring backend naming exactly instead of exposing a stable MCP-AQL surface.
- Using overly generic identifiers like
idwhenroute_idordevice_idis clearer. - Treating long-running actions as
UPDATEwhen they should beEXECUTE. - Forgetting to document compatibility pagination shapes (such as
limit/offset) or alias parameters that an adapter accepts alongside the preferred MCP-AQL names. - Adding query features in implementation without exposing them in introspection.