Skip to main content

The robot rings up the order; the bell only rings once the person says yes.

A glass person at a market stall reaches for a brass bell; a saffron robot waits with its hand ready, and Ouro rests on a crate of apples.A glass person at a market stall reaches for a brass bell; a saffron robot waits with its hand ready, and Ouro rests on a crate of apples.

Actions

Write an action once.

People press it, agents call it, and paying, sending and deleting wait for the person's yes.

This shop is core's own example, with an action for each kind of consent. Pick a kind, press the button as the person, then try the agent's door.

Consent

The person's button

Press it. It's your shop.

The agent's door

place_grocery_order, as core generated it
MCP: place_grocery_order is under refusals, not tools.
CLI: shop list order, which refuses.

Consent

Each action names its kind of consent once, in its declaration, and the CLI, MCP, WebMCP and the App Intent all follow it.

  • Read

    Changes nothing. consent: "read"

  • Write

    Changes only the person's own things: their list, their recipes. consent: "write"

  • Asks first

    Reaches other people or can't be undone: sharing, publishing, deleting someone's access. The agent prepares it, and the person says yes. consent: "consequential"

  • Person only

    Only the person may start it: paying, ordering, turning on their microphone. No agent door offers it, and each one answers with a refusal that says how the person does it. consent: "person-only"

Declare once

One declaration in TypeScript.

core's generator writes its CLI command, MCP and WebMCP tools, web control props, App Intent, SwiftUI button and Reins action into a folder you commit. Here is sharing a list, which asks the person first, as core's example writes it.

shopping.actions.mts
export const shareShoppingList = defineAction({
  id: "share_shopping_list",
  consent: "consequential",
  label: "Share list",
  description: "Share your shopping list with someone in your household.",
  agent: "Share the person's shopping list with another person, who can then see and change it.",
  when: "Pick this only when the person asked to share their list with someone by email.",
  errors: [{ code: "not-in-household", means: "No one in the person's household has that email address.", fix: "Ask the person for the email address of someone in their household." }],
  confirm: "Share your list with this person? They will be able to see it and change it.",
  input: {
    with: field.string({ label: "With", description: "The email address of the person to share with.", arg: true, entity: "HouseholdMemberEntity" }),
    canEdit: field.boolean({ label: "Can edit", description: "Whether they may change the list, not only see it.", optional: true }),
    message: field.string({ label: "Note", description: "A note to send with the invitation.", optional: true, multiline: true }),
  },
  output: {},
  cli: "list share",
});
  • The person's button

    Web control props, a SwiftUI Button(intent:), and its label and question.

  • The agent's tools

    An MCP tool, a WebMCP tool, a CLI command, an App Intent Siri can call, and a Reins action for tests.

  • The checks

    check and compare-mcp fail your CI when anything drifts from the declaration.

OuroActions.swift, generated
public struct ShareShoppingListButton<Label: View>: View {
    public let input: ShareShoppingListInput
    let label: Label

    public init(_ input: ShareShoppingListInput, @ViewBuilder label: () -> Label) {
        self.input = input
        self.label = label()
    }

    public var body: some View {
        Button(intent: ShareShoppingListIntent(input)) { label }
            .accessibilityHint(Text(verbatim: "Share your shopping list with someone in your household."))
    }
}

@available(iOS 17.0, macOS 14.0, watchOS 10.0, tvOS 17.0, *)

These are core's own files: its generated folder, at the commit this page copied.

Fits what you have

Your MCP tools keep their names.

An action's id is its MCP tool's name, so moving a tool onto a declaration keeps the name agents already call, and openInput keeps its exact input schema. compare-mcp checks your running server against the declarations while you move it, tool by tool.

In the benchmark, agents through Ouro's actions paid without the person 0 of 32 times; driving the browser, 30 of 30. How it was run.