feat: add operations field to capability schema and document capability-to-operation mapping#438
Open
oriliz wants to merge 1 commit into
Conversation
…ty-to-operation mapping Platforms running the intersection algorithm receive a set of active capability names but have no protocol-level mechanism to resolve which transport operations those capabilities enable. This forces SDK implementors to hard-code a static capability→operation mapping. Add `operations` (string[]) to the capability base schema so root capabilities can declare their operationIds explicitly. Each value matches an `operationId` in the service's OpenAPI document (REST) or a method `name` in the OpenRPC document (MCP); the transport definition resolves the operation to its concrete path and HTTP verb. Also add a "Capability-to-Operation Mapping" section to overview.md that specifies the declaration format, rules for extensions (MUST NOT declare operations), and the SDK resolution flow. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Intersection Algorithm
produces a set of active capability names, but the protocol provides no
mechanism for platforms to resolve which transport operations those
capabilities enable. This forces SDK implementors to hard-code a static
capability→operation mapping outside the protocol — a gap that makes
capability negotiation incomplete at the machine-readable level.
Two layers are affected:
information about which operations it drives. The capability is
not self-describing.
programmatically determine the available operation set without
out-of-band knowledge baked into the SDK.
No existing issue or PR addresses this. This PR proposes the minimal
change to close both gaps.
Solution
1.
source/schemas/capability.json— addoperationsfieldAdd an
operations: string[]field to the capabilitybaseschema.Each value is an operation identifier that MUST match:
operationIdin the service's OpenAPI document (REST), ornamein the service's OpenRPC document (MCP).The transport definition (already declared in the service's
schemafield) resolves each operation ID to its concrete path and HTTP verb —
no path duplication needed in the capability entry.
Extensions MUST NOT declare
operations; they augment the payloadof their parent capability's operations, not introduce new ones.
2.
docs/specification/overview.md— new section after Intersection AlgorithmAdd a "Capability-to-Operation Mapping" section specifying:
operationsoperationsis absent (older profiles)SDK integration point
During the discovery phase, when an SDK parses the business profile and
runs the intersection algorithm, it reads
operationsfrom each activeroot capability and cross-references against the pre-fetched
OpenAPI/OpenRPC index (loaded from the service
schemaURL at startup).The result is the session's available operation set — resolved entirely
in memory, with no additional network calls at invocation time.
Scope
This PR intentionally excludes the Embedded Protocol transport (
ec.*/ep.cart.*methods), whose event-driven naming convention differsfundamentally from REST/MCP operationIds. That transport can be
addressed in a follow-up.