Skip to content

DX: first-class "gate any tool" helper (gateTool) + action-agnostic envelope for non-commerce #23

Description

@dzuluaga

DX finding (the big one). Commerce is turnkey — store.gate(policy), ~8 lines, and the storefront handles the gate tool, the checkout page, the ceremony, and recording. But the "gate ANY action" promise (the identity-first pitch) drops to primitives for anything non-commerce. In examples/gate-any-action.mjs, to gate a single tool you must:

  • hand-build buildVerificationRequired({ order: { id, total: 0, currency } }) (a $0 "order" — the action gets shoehorned into the commerce shape),
  • hardcode the approveUrl query string yourself,
  • resolve the per-order verification state yourself — the example literally fakes ctx.ageVerified; real wiring means understanding the mount ceremony + the verification store,
  • hand-write the agent instruction — the built-in envelopeInstruction() is checkout-worded ("buyer"/"placed"); the example itself flags this as a needed follow-up.

Capability for discussion. A first-class gateTool() / createGatedTool() that wraps an arbitrary MCP tool handler the way store.gate() wraps checkout — resolves verification from the mounted ceremony, builds the approve URL, returns the typed refusal, and emits an action-agnostic instruction. Plus a lightweight "action/subject" model so you don't pass a fake order.

Why it matters: today only commerce delivers cleanly on "gate ANY action with ANY credential." This closes that gap. (Note: #17's install skill is codegen for this; a runtime helper is the cleaner primitive it would target.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    dxDeveloper experienceroadmapRoadmap item

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions