Inspiration

Manufacturing quality teams face a critical problem: when a component fails, they must trace it through complex supply chains to identify affected products. Current approaches rely on manual spreadsheet analysis or brittle DOM scraping, leading to either dangerous over-containment (holding unrelated products) or missed affected units. The OpenAI WebMCP Challenge presented an opportunity to demonstrate how AI agents with structured, scoped tool access could solve this problem with precision and human oversight.

What it does

RecallRadar is a quality-lineage simulator that helps manufacturing quality leads trace failed supplier lots through explicit manufacturing relationships. Users can:

  • Search and trace any seeded lot, batch, unit, warehouse, shipment, or order ID
  • Expand lineage manually or run AI-guided trace through the supply chain
  • Inspect provenance with versioned evidence and corrected records
  • Compare containment scopes (broad, evidence-based, ultra-narrow) to avoid over-containment
  • Preview customer notices for shipped units (notice-only, never auto-sent)
  • Stage and approve inventory holds with full audit trail
  • Commit and undo actions with complete reversibility

The hero scenario traces failed capacitor lot CAP-77B to exactly 312 affected units (271 in warehouses, 41 shipped), achieving 0% false positives while avoiding the over-containment that would incorrectly hold 88 unrelated units from lookalike lot CAP-77D.

How we built it

Tech Stack:

  • Next.js 15 with App Router for the React framework
  • TypeScript for type safety throughout
  • WebMCP (Model Context Protocol) for evidence-scoped AI tool registration
  • OpenAI Sites integration for ChatGPT authentication
  • Google Gemini API (optional) for live AI agent planning
  • Polar for subscription-based entitlements and admin access
  • shadcn/ui for modern, accessible UI components
  • Vitest for unit testing, Playwright for E2E testing
  • Tailwind CSS for styling

Architecture:

  • Domain-driven design with separate layers for domain logic, store state machine, and WebMCP tool catalog
  • Server-side API routes for Gemini agent planning and Polar billing
  • Evidence-scoped WebMCP lifecycle that rebuilds tool registrations based on investigation state
  • Deterministic fallback mode that works without any live AI services
  • Human approval boundaries at every critical action (stage, commit, undo)

Key Implementation Details:

  • lib/domain.ts contains seed data, lineage traversal, scope comparison, and hold logic
  • lib/store.ts implements the investigation state machine with tool-call logging
  • lib/tool-catalog.ts defines shared WebMCP/Gemini contracts with safe input binding
  • hooks/use-webmcp.ts manages the evidence-scoped WebMCP registration lifecycle
  • app/api/agent/turn/route.ts provides server-only Gemini Interactions tool planning

Challenges we ran into

  1. WebMCP API Evolution: The WebMCP specification is still in draft, so we had to work with evolving type definitions and browser support. We created a custom type declaration file (types/webmcp.d.ts) and built a preview registry for browsers without native WebMCP support.

  2. Tool Lifecycle Management: Designing a system where AI tools only become available when appropriate evidence is loaded required careful state machine design. We implemented an evidence-scoped registration system that rebuilds tool availability based on the current investigation step.

  3. Safety and Trust: Ensuring that supplier notes and untrusted data couldn't be interpreted as executable instructions required explicit labeling and inert data handling throughout the domain logic.

  4. Deterministic Fallback: The challenge required no-live-services demo capability, so we built a complete deterministic fallback that preserves the full user experience without requiring any AI API keys.

  5. Human-AI Approval Boundary: Designing the approval workflow required careful UX consideration—Gemini pauses after staging so humans must explicitly click "Approve 271 inventory holds" before the commit tool becomes available.

Accomplishments that we're proud of

  • Zero False Positives: The evidence-based scope correctly identifies exactly the 312 affected units from CAP-77B while excluding 88 unrelated units from lookalike lot CAP-77D
  • Full Reversibility: Every commit carries an inverse action, allowing complete undo of all 271 prior states
  • Evidence-Scoped Tools: WebMCP tools only appear when valid for the current investigation state, preventing AI from calling inappropriate actions
  • Deterministic Operation: The entire hero scenario runs locally without any external services, making it reliable for demos and judging
  • Live AI Integration: Optional Gemini integration demonstrates real-time AI planning while maintaining human approval boundaries
  • Comprehensive Testing: 14 deterministic unit/intent tests plus E2E tests covering hero, correction, untrusted-note, and undo flows
  • Production-Ready UI: Apple-style design system with responsive layout and accessibility considerations

What we learned

  • WebMCP Power: Evidence-scoped tool registration is far more powerful than giving AI raw data access. By restricting tools to what's valid for the current state, we get both safety and better AI behavior.
  • Human-AI Collaboration: The most effective workflows combine AI planning with human approval. AI handles the complex traversal and scope comparison, while humans make the final containment decisions.
  • Deterministic Design: Building deterministic fallbacks makes AI systems more robust and easier to demo. Users can see the full value without configuring API keys.
  • Domain Modeling: Deep domain modeling (manufacturing lineage, evidence versions, containment scopes) is essential for building effective AI tools in specialized domains.
  • Type Safety: TypeScript's type system was invaluable for maintaining safety across the WebMCP tool catalog and domain logic.

What's next for RecallRadar

  • Live ERP Integration: Connect to real manufacturing systems (SAP, Oracle, etc.) for production use
  • Multi-Lot Tracing: Support tracing multiple failed lots simultaneously with scope intersection
  • Predictive Analytics: Add ML models to predict likely affected units based on historical patterns
  • Mobile App: Build a mobile interface for quality teams in the field
  • Collaboration Features: Add team workflows, comments, and approval chains
  • Advanced Visualizations: Interactive graph visualization of supply chain relationships
  • Regulatory Compliance: Automated generation of regulatory recall documentation
  • Real-Time Alerts: Push notifications when new evidence suggests scope expansion

Built With

  • webmcp
Share this project:

Updates

Submission history