MyronCMS Developers Hub Docs sandbox review

Reference

Action Metadata Reference

MyronActionMetadata is the declarative contract for one action. The dispatcher uses it for routing, schema validation, and scope checks. The manifest and MCP server use it for discovery. Documentation should treat this metadata as the source of truth for action shape.

Human Path

Extension authors fill out metadata in each action class:

public function metadata(): MyronActionMetadata
{
    return new MyronActionMetadata(
        uri: '/api/v1/x/my_vendor/status',
        method: 'GET',
        domain: 'x.my_vendor.status',
        resource: 'status',
        verb: 'get',
        inputSchema: ['type' => 'object', 'properties' => []],
        outputSchema: ['type' => 'object', 'properties' => ['ready' => ['type' => 'boolean']]],
        requiredScope: MyronApiScopes::CONTENT_READ,
        summary: 'Return this extension status.',
        sideEffects: [],
        preconditions: ['The extension is enabled and granted content.read.'],
        postconditions: [],
        audienceClass: 3,
        exposeToMcp: true,
    );
}

AI Path

An AI coding agent can author metadata locally. An installed AI client should discover loaded actions from /api/v1/manifest, MCP tools/list, or MCP resources rather than relying on a copied list from documentation.

Scopes

This reference page does not require a runtime scope to read. Individual actions declare their own requiredScope, and runtime callers must hold that scope before the dispatcher invokes the action. MCP tools/list also uses that field to omit tools the caller cannot invoke.

Field Reference

FieldTypeDefaultUsed byAI/MCP significanceSafety notes
uristringrequiredRegistry, dispatcher, manifest, MCP call routingDirect API path and underlying target for tools/call.Extension URIs must start with /api/v1/x/{vendor}/.
methodstringrequiredRegistry and dispatcherDetermines direct API verb and MCP dispatch method.Use GET for reads; use POST, PATCH, or DELETE for writes.
domainstringrequiredManifest, MCP tool naming, auditFirst part of default tool name.Extension domains must start with x.{vendor}..
resourcestringrequiredManifest, MCP tool namingSecond part of default tool name.Use a stable resource noun.
verbstringrequiredManifest, MCP tool naming, auditThird part of default tool name.Keep it stable; clients may cache discovery.
inputSchemaarrayrequiredDispatcher validation, MCP tool schemaTells AI clients what arguments are accepted.Extension schemas must not be empty arrays.
outputSchemaarrayrequiredManifest and compatibility documentationHelps clients understand result shape.Extension schemas must not be empty arrays.
requiredScopestring or nullrequiredAuth, dispatcher, MCP list filteringTells clients which caller scope is needed.null means public action; do not use public scope for private extension data.
summarystringrequiredManifest and MCP tool descriptionMain short context for AI tool choice.Keep concise and action-specific.
sideEffectslist<string>[]Manifest, docs, audit contextHelps AI decide whether a call mutates state.Must be honest; do not leave writes undocumented.
preconditionslist<string>[]Manifest and docsTeaches clients what must be true before calling.Return declared errors when preconditions fail.
postconditionslist<string>[]Manifest and docsTeaches clients what should be true after success.Do not claim effects the action does not guarantee.
audienceClassint2Manifest and registry reviewIndicates intended audience class.Use established local meaning; do not invent public support.
adminAliaseslist<string>[]Registry auditMaps legacy admin POST verbs to registered actions.Internal drift guard aid, not an extension routing escape hatch.
snapshotIncludeboolfalseSystem snapshot composerMay include read results in live install snapshot.Only meaningful for GET actions; composer skips non-GET actions.
snapshotKeystring or nullnullSystem snapshot composerJSON path for snapshot placement.Required only when snapshotInclude:true.
exposeToMcpbooltrueMCP tools/listControls whether an action appears as an MCP tool.Hide only for documented policy reasons.
supportsProgressboolfalseMCP transportIndicates long-running progress support.Do not set true unless progress notifications are implemented.
liveContentResolutionarray[]Compatibility documentsDescribes content re-render behavior.Use only when the action participates in that contract.

toArray() emits these fields into the manifest shape. Documentation pages should use the field names as emitted: inputSchema, outputSchema, requiredScope, sideEffects, preconditions, postconditions, snapshotInclude, snapshotKey, exposeToMcp, supportsProgress, and liveContentResolution.

Extension Validation

ActionRegistry::registerExtension() applies extension-specific validation before the action is registered:

RuleRequired shape
Vendor^[a-z][a-z0-9_]*$
URI prefix/api/v1/x/{vendor}/
Domain prefixx.{vendor}.
Input schemanon-empty array
Output schemanon-empty array

These checks protect the extension namespace. They do not replace operator grants or caller scopes.

Manifest and Discovery

The action catalog is live. Clients should discover the current surface through the running install:

  • direct API manifest for full action metadata,
  • MCP tools/list for exposed, scope-allowed tools,
  • MCP resources for snapshot and compatibility documents.

Do not freeze a copied action list in docs. The docs explain contracts and examples; the install reports its actual registered actions.

Artifacts

Primary artifacts for this contract are:

  • MyronActionMetadata constructor arguments,
  • MyronActionMetadata::toArray() manifest output,
  • action classes under app/extensions/{vendor}/actions/,
  • direct API manifest output,
  • MCP tools/list tool definitions.

Safety Boundary

Metadata is not a permission bypass. requiredScope does not grant scope; it declares the gate. exposeToMcp:true does not make an action callable unless the action loads and the caller holds the required scope. exposeToMcp:false does not remove the action from the registry or manifest; it only hides the action from MCP tool listing.

Verification

For a new action:

  1. Confirm the action registers without namespace or schema errors.
  2. Read the manifest and confirm metadata fields are present.
  3. Call the direct API with a scoped caller.
  4. Call MCP tools/list and confirm exposure matches exposeToMcp and caller scope.
  5. If snapshotInclude:true, read the system snapshot or compatibility document and confirm placement under snapshotKey.

Failure Modes

FailureLikely sourceSafe fix
Action does not registerExtension namespace or schema validation failed.Check URI, domain, vendor, and non-empty schemas.
Tool missing from MCPexposeToMcp:false, action not loaded, or caller lacks scope.Check metadata, load state, and caller scope.
Manifest metadata is misleadingMetadata no longer matches implementation.Update action metadata with the same change as the implementation.
Snapshot entry absentsnapshotInclude false, non-GET method, missing snapshotKey, or caller scope filtering.Use snapshot fields only for suitable read actions.
AI client calls wrong tool nameClient cached an old name or inferred name incorrectly.Re-read tools/list from the running install.