v146 · Agent Handshake Simulator

Agent Handshake Simulator

Step through the complete WebMCP interaction: an AI agent discovers the page's registered tools, selects the right one, sends a structured call, and the page handler returns a result. Every message is annotated.

Origin Trial simulation. This is a faithful simulation of the navigator.modelContext protocol — no real agent, no real OT token required.
Scenario:
Step 0 of 0
AI Agent
    Page (WebMCP)
    Pick a scenario and click Step → to begin.

    Protocol sequence

    // Phase 1: Discovery
    // The agent reads the tool manifest from the page
    const tools = await navigator.modelContext.tools;
    // tools = [{ name, description, inputSchema }, ...]
    
    // Phase 2: Selection
    // The agent's LLM picks the best tool for the current task
    const chosen = selectTool(tools, agentTask);
    
    // Phase 3: Invocation
    // Agent sends a structured call — inputs validated against inputSchema
    const result = await navigator.modelContext.callTool(
      chosen.name,
      { query: 'running shoes', category: 'footwear', limit: 5 }
    );
    
    // Phase 4: Response
    // Page handler ran, result passed back to agent
    // result = { products: [...] }
    
    // Phase 5: Agent action
    // Agent uses the result to continue the task
    // (render to user, chain another tool call, etc.)

    see also