Maintaining consistency between human-visible guidance, API descriptions, and runtime capabilities is achieved by centralizing the source of truth at the controller routing layer. When a developer annotates a backend function, the continuous integration pipeline automatically generates the OpenAPI specification, the Schema.org Action JSON-LD elements, and the MCP inputSchema metadata. If a feature is disabled or lacks policy support, it is dynamically pruned from the human HTML documentation, the /.well-known/api-catalog linkset, and the MCP tools/list response simultaneously. This ensures that unsupported capabilities are explicit by their absolute omission across all client interfaces.
3.2 Concrete Onboarding Sequence and State Transitions
The following sequence demonstrates how diverse agents navigate this capability-adaptive environment automatically, reducing guessing and eliminating routine human assistance.
| State Transition Phase | Client Profile | Agent Action | Server Response and Capability Selection |
|---|---|---|---|
| 1. Unauthenticated Discovery | Legacy Browser / URL Reader | Issues HTTP GET / with Accept: text/html. | The server's content negotiation identifies the HTML preference. It returns the human-readable DOM, enriched with basic Schema.org metadata. |
| 1. Unauthenticated Discovery | Semantic Crawler | Issues HTTP GET / with Accept: application/ld+json. | The server honors the HTTP semantics, bypassing HTML generation and returning raw JSON-LD detailing the site's entities and available Action structures7. |
| 1. Unauthenticated Discovery | Autonomous Agent | Issues HTTP GET /.well-known/mcp-configuration2. | The server returns a static JSON document indicating the endpoint URI for the Model Context Protocol RPC gateway. |
| 2. Capability Negotiation | Autonomous Agent | Sends JSON-RPC initialize request detailing client capabilities (e.g., tools.listChanged: true)30. | The server responds with its supported capabilities, establishing a mutually agreed-upon baseline without human intervention41. |
| 3. Interface Exploration | Autonomous Agent | Sends JSON-RPC tools/list request27. | The server dynamically generates a deterministically ordered list of available tools, including their names, descriptions, and JSON Schema parameters29. |
| 4. State-Changing Execution | Autonomous Agent | Agent reasons that a state change is required. Sends tools/call for update_record30. | Safety Enforcement: The server evaluates the agent's bearer token. Finding only a global scope and lacking RAR intent, the server intercepts the request. It returns a safe "no-op" along with an RFC 9457 application/problem+json error detailing the requirement for RAR authorization6. |
| 5. Autonomous Recovery | Autonomous Agent | Parses the RFC 9457 problem detail. Contacts the Authorization Server, submitting an authorization_details array for update_record19. | The Authorization Server issues a constrained, intent-bound JWT containing the RAR parameters. |
| 6. Successful Completion | Autonomous Agent | Retries the tools/call using the new, tightly scoped JWT30. | The server verifies the token against local ACLs. The action is executed, and a structured success response is returned26. |
This progressive sequence allows the server to degrade gracefully. If a basic HTTP client requests an unsupported media type during discovery, the server relies on standard RFC 9110 HTTP semantics, returning a 406 Not Acceptable or 415 Unsupported Media Type, definitively indicating an output format problem42.
4. Transferability to Other MATM Systems
The evidence and architectural models synthesized in this report are not isolated to conventional web application infrastructure; they are highly transferable across independent MATM systems. The principles of deterministic discovery, structured error recovery, and intent-based authorization apply universally wherever software entities communicate over network boundaries.
In Internet of Things (IoT) and constrained environments, the mechanisms mirror these recommendations closely. For instance, while enterprise APIs utilize /.well-known/api-catalog for discovery, constrained CoAP-based IoT networks utilize the CoRE Link Format (RFC 6690) representing Web Links in CBOR to achieve the exact same deterministic capability discovery44.
Similarly, in decentralized network management, where Software-Defined Networking (SDN) controllers act as MCP clients managing fleets of physical routers (acting as MCP servers), the stateless JSON-RPC framework permits controllers to automatically discover Yang modules and CLI dialects. If a diagnostic tool fails, the router issues a standardized execution error, allowing the controller to self-correct its syntax without network engineer intervention40. The strict separation of public state reads from RAR-gated configuration writes ensures that network topology discovery remains frictionless while preventing catastrophic unauthorized reconfigurations.
5. Prioritized Feature Proposals
To implement this capability-adaptive architecture effectively across modern production services, the following three features must be prioritized for engineering and deployment.
Proposal 1: Universal Problem Details Engine (RFC 9457)
- The Problem: When API requests fail due to missing variables, format mismatches, or business logic violations, automated agents currently receive generic numeric status codes or proprietary, undocumented error strings18. This forces agents to guess the failure mode, leading to infinite retry loops and stalled operations.
- Agent-Visible Behavior: Every non-2xx HTTP response, and every execution failure within an MCP tools/call, returns an application/problem+json payload. This payload consistently features a resolvable type URI, an instance tracking ID, and domain-specific extensions (e.g., invalid_params arrays)19.
- Expected Benefit: Agents gain the ability to parse the exact syntactical or contextual cause of a failure. They can cross-reference the problem type with their internal schemas to correct their input parameters autonomously, or gracefully terminate the workflow if the error is non-recoverable19.
- Dependencies: Centralized exception handling at the API gateway or application framework layer. Frameworks like Spring Web natively support mapping exceptions to ProblemDetail abstractions46.
- Implementation Effort: Low to Medium. It requires mapping existing proprietary error models to the standardized five-field RFC 9457 structure and updating middleware to enforce the application/problem+json content type.
- Principal Failure Modes: Exposing sensitive internal stack traces or database architecture details within the detail or extensions fields, leading to profound security vulnerabilities22. This risk must be mitigated by strict output sanitization policies.
Proposal 2: Dynamic Capability Discovery via Linksets and Link-Templates
- The Problem: Agents waste bandwidth and trigger rate limits by sequentially crawling APIs to map hypermedia state transitions, a highly inefficient mechanism for autonomous discovery.
- Agent-Visible Behavior: An agent performs a single HTTP GET request to /.well-known/api-catalog and receives an application/linkset JSON document11. This document contains the entire universe of available operational routes. Where routes require parameters, the server provides Link-Template headers, instructing the agent on the exact syntax required to construct a valid URI dynamically13.
- Expected Benefit: Massive reduction in network overhead and round-trip latency. Agents immediately construct a deterministic map of the system's capabilities while strictly adhering to draft-ietf-httpapi-ratelimit-headers quotas11.
- Dependencies: A centralized registry that maps internal controller routing tables to external URI templates, capable of serializing this graph into the standardized Linkset syntax.
- Implementation Effort: Medium. Requires the integration of an automated pipeline that translates live application routes into static linkset JSON objects during the CI/CD build or deployment process.
- Principal Failure Modes: Serving stale linksets. If the application deploys new routes but the static /.well-known/ registry is not invalidated, agents will encounter 404 dead ends. Linksets must be tightly coupled to live deployment states.
Proposal 3: Intent-Based Authorization utilizing OAuth 2.0 RAR
- The Problem: Standard OAuth 2.0 global scopes grant agents broad, persistent access. If an autonomous agent hallucinates a destructive command or is compromised, coarse scopes provide no containment, creating a massive security blast radius23.
- Agent-Visible Behavior: An agent cannot execute any state-changing POST, PUT, or DELETE request (or an MCP tools/call that mutates state) using a basic token. The agent must formulate a specific JSON authorization_details payload detailing the exact type, locations, and actions required for the task. It submits this to the identity provider to receive a mathematically constrained JWT23.
- Expected Benefit: The absolute enforcement of explicit authorization boundaries. The principle of least privilege is maintained dynamically, and high-risk operations can be systematically isolated for human review without breaking the agent's workflow23.
- Dependencies: An advanced Identity Provider (IdP) or Authorization Server capable of parsing RFC 9396 requests, interacting with user-consent interfaces, and minting RAR-compliant JWTs26.
- Implementation Effort: High. Requires extensive refactoring of API gateway validation logic to interpret fine-grained RAR claims alongside traditional Access Control Lists (ACLs), ensuring parameter-level restrictions are enforced at runtime26.
- Principal Failure Modes: Agents may fail to construct valid RAR payloads due to misinterpreting complex authorization schemas. This failure mode is gracefully handled by ensuring the server returns an RFC 9457 error detailing the specific RAR schema requirements during an initial failed request.
6. Practical Adoption Sequence and Outlook
Transitioning a monolithic or legacy API architecture to a fully capability-adaptive MATM system is a complex undertaking that requires sequential implementation to maintain backward compatibility. The following sequence provides a practical roadmap.
6.1 Phased Adoption Sequence
- Phase 1: Semantic Foundation and Content Negotiation. Enforce strict HTTP semantics. Ensure Accept and Content-Type headers are respected, issuing 406 Not Acceptable and 415 Unsupported Media Type where appropriate. Implement Schema.org JSON-LD structured data on all public read interfaces.
- Phase 2: Error Standardization. Deprecate all proprietary API error messages. Implement middleware to catch non-2xx responses and format them strictly as RFC 9457 application/problem+json payloads. Guarantee that every error maps to a documented type URI.
- Phase 3: Deterministic Discovery. Provision the /.well-known/ directory. Publish baseline metadata including robots.txt, llms.txt, and an application/linkset catalog outlining available endpoints.
- Phase 4: Agent Runtimes. Expose a Model Context Protocol (MCP) server gateway parallel to the traditional REST API. Map existing internal microservices to MCP tools, enabling compatible agents to discover and invoke them over stateless JSON-RPC sessions.
- Phase 5: Granular Authorization. Phase out coarse OAuth 2.0 scopes for machine-to-machine state modifications. Mandate OAuth 2.0 RAR for all destructive endpoints, ensuring strict, intent-based boundaries and enforcing the UAIX No-Op protocol for policy violations.
6.2 Unresolved Questions
As MATM specifications evolve, several architectural questions remain unresolved across the industry: