Skip to main content

McpIntent

Enum McpIntent 

Source
pub enum McpIntent {
    RegisterMcpTool {
        tool_id: AccountId,
        bytecode: Vec<u8>,
        name: String,
        input_schema_json: Vec<u8>,
        category: u8,
        declared_reads: Vec<[u8; 32]>,
        declared_writes: Vec<[u8; 32]>,
        commutative_keys: Vec<[u8; 32]>,
        oracle_schema_ids: Vec<[u8; 32]>,
        registry_id: AccountId,
    },
    RegisterMcpResource {
        resource_id: AccountId,
        bytecode: Vec<u8>,
        name: String,
        uri_scheme: String,
        mime_type: String,
        initial_data: Vec<(Vec<u8>, Vec<u8>)>,
        declared_reads: Vec<[u8; 32]>,
        declared_writes: Vec<[u8; 32]>,
        oracle_schema_ids: Vec<[u8; 32]>,
        registry_id: AccountId,
    },
    RegisterMcpPrompt {
        prompt_id: AccountId,
        name: String,
        template_bytes: Vec<u8>,
        arguments: Vec<(String, String, bool)>,
        registry_id: AccountId,
    },
    RegisterAgent {
        agent_id: AccountId,
        policy_cell_id: AccountId,
        agent_registry_id: AccountId,
    },
    UpdateAgentPolicy {
        policy_cell_id: AccountId,
        updates: PolicyUpdate,
    },
    SuspendAgent {
        agent_id: AccountId,
        agent_registry_id: AccountId,
        reason: String,
    },
    ReinstateAgent {
        agent_id: AccountId,
        agent_registry_id: AccountId,
    },
    McpToolCall {
        agent_id: AccountId,
        tool_id: AccountId,
        tool_calldata: Vec<u8>,
        value: u128,
        gas_limit: u64,
        policy_cell_id: AccountId,
        action_log_id: Option<AccountId>,
        timestamp: u64,
    },
}
Expand description

All new MCP-related intent variants to be added to TransactionIntent. Design rule: every intent maps to deterministic state transitions. The parallel executor’s conflict domain extracts their storage keys.

Variants§

§

RegisterMcpTool

Deploy a tool cell and register it in the McpRegistry. The tool’s Axiom bytecode is its implementation. Schema lives in storage. Anyone can deploy a tool. The registry is permissionless.

Fields

§tool_id: AccountId

Desired tool cell address

§bytecode: Vec<u8>

Axiom bytecode implementing the tool’s logic

§name: String

Tool name (max 32 bytes)

§input_schema_json: Vec<u8>

Full JSON schema (stored as blake3 hash on-chain, full bytes in calldata)

§category: u8

0=read-only, 1=writes state, 2=admin

§declared_reads: Vec<[u8; 32]>

Storage slots the Axiom bytecode reads/writes (for parallel conflict detection)

§declared_writes: Vec<[u8; 32]>
§commutative_keys: Vec<[u8; 32]>
§oracle_schema_ids: Vec<[u8; 32]>
§registry_id: AccountId

Address of the McpRegistry to register into

§

RegisterMcpResource

Deploy a resource cell. Its storage IS the resource data. Agents read resources by calling get_cell_storage on specific slots.

Fields

§resource_id: AccountId
§bytecode: Vec<u8>
§name: String
§uri_scheme: String
§mime_type: String
§initial_data: Vec<(Vec<u8>, Vec<u8>)>

Initial content: map of slot_key -> content_bytes (hashed to storage key)

§declared_reads: Vec<[u8; 32]>
§declared_writes: Vec<[u8; 32]>
§oracle_schema_ids: Vec<[u8; 32]>
§registry_id: AccountId
§

RegisterMcpPrompt

Deploy a prompt template cell. Prompt templates go through the validator name registry for approval. An approved prompt has a validator-certified name on-chain.

Fields

§prompt_id: AccountId
§name: String
§template_bytes: Vec<u8>

Full template bytes (stored as hash on-chain, full bytes in calldata)

§arguments: Vec<(String, String, bool)>

Argument definitions: (arg_name, arg_description, required)

§registry_id: AccountId
§

RegisterAgent

Bind an agent’s public key to a policy cell. Only the owner_id account can call this. The agent cannot register itself.

Fields

§agent_id: AccountId
§policy_cell_id: AccountId
§agent_registry_id: AccountId
§

UpdateAgentPolicy

Owner updates agent’s policy by calling the policy cell directly. This IS a CallCell transaction on the policy cell. Listed here for clarity - the diff handler routes it as CallCell.

Fields

§policy_cell_id: AccountId
§

SuspendAgent

Owner suspends an agent immediately. Stored in AgentRegistry.

Fields

§agent_id: AccountId
§agent_registry_id: AccountId
§reason: String
§

ReinstateAgent

Owner reinstates a suspended agent.

Fields

§agent_id: AccountId
§agent_registry_id: AccountId
§

McpToolCall

The core MCP tool call intent.

This compiles into a CallCellChain:

  1. Call policy_cell with (agent_id, tool_id, calldata_hash) - reverts if blocked
  2. Call tool_cell with agent_calldata - executes the tool
  3. (Optional) Call action_log_cell with (tool_id, result_hash) - appends log entry

The ENTIRE chain is atomic. If policy rejects, nothing is written. If the tool fails, the policy gate’s side effects are also rolled back. The action log entry only lands if the tool succeeded.

Fields

§agent_id: AccountId
§tool_id: AccountId
§tool_calldata: Vec<u8>
§value: u128
§gas_limit: u64
§policy_cell_id: AccountId
§action_log_id: Option<AccountId>
§timestamp: u64

Trait Implementations§

Source§

impl Clone for McpIntent

Source§

fn clone(&self) -> McpIntent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for McpIntent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for McpIntent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for McpIntent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more