UI Cards Schema

Standardized UI payloads returned by agents to display results.

Card Types

Summary Card

Display a list of items (messages, events, contacts, etc.)

return {
  type: "summary",
  title: "Your Meetings This Week",
  items: [
    {
      title: "Team Standup",
      subtitle: "Today at 9:00 AM",
      metadata: "Conference Room A",
      icon: "📅"
    },
    {
      title: "Product Review",
      subtitle: "Friday at 2:00 PM",
      metadata: "3 attendees",
      icon: "📅"
    }
  ],
  footer: "2 events found"
};

Schema

FieldTypeRequiredDescription
type"summary"YesCard type identifier
titlestringYesCard heading
itemsarrayYesList items (title, subtitle, metadata, icon)
footerstringNoBottom text (e.g., result count)

Suggestion Card

Offer actionable suggestions or choices

return {
  type: "suggestion",
  title: "Schedule meeting?",
  description: "I found an available slot on Friday at 2pm",
  actions: [
    {
      label: "Schedule it",
      action: "create_event",
      params: { start: "2024-03-22T14:00:00Z" }
    },
    {
      label: "Find another time",
      action: "search_availability"
    },
    {
      label: "Cancel",
      action: "cancel"
    }
  ]
};

Approval Card

Request user confirmation (rarely returned directly - use approval.request() instead)

// Usually handled by approval.request() API
// But you can return manually:
return {
  type: "approval",
  title: "Send message to team@company.com?",
  description: "This will send the Q4 report to 3 recipients",
  details: {
    to: ["alice@co.com", "bob@co.com", "carol@co.com"],
    subject: "Q4 2024 Report",
    preview: "Attached is the quarterly report..."
  },
  approveLabel: "Send",
  denyLabel: "Cancel"
};

Progress Card

Show ongoing operation with progress indicator

return {
  type: "progress",
  title: "Analyzing calendar...",
  description: "Finding available meeting times",
  progress: 45,  // 0-100
  status: "Processing 3 of 7 calendars"
};

Result Card

Confirm successful completion

return {
  type: "result",
  title: "✅ Meeting scheduled",
  description: "Created 'Product Review' for Friday at 2pm",
  details: {
    event: "Product Review",
    time: "Friday, March 22 at 2:00 PM",
    attendees: "3 people invited"
  },
  action: {
    label: "View in Calendar",
    url: "metaos://calendar/event/evt_abc123"
  }
};

Error Card

Display error message with optional recovery action

return {
  type: "error",
  title: "Permission denied",
  description: "This agent needs calendar access to schedule meetings",
  errorCode: "CAPABILITY_DENIED",
  action: {
    label: "Grant Permission",
    url: "metaos://settings/capabilities"
  }
};

Deep Links

Use metaos:// URLs in action buttons to link to OS features:

URL PatternOpens
metaos://calendarCalendar app
metaos://calendar/event/:idSpecific calendar event
metaos://messagesMessages app
metaos://messages/:idSpecific message thread
metaos://storage/:pathFile viewer
metaos://settings/capabilitiesPermission settings
metaos://agents/:idAgent details page

✨ Design Guidelines

  • Keep titles concise (under 60 characters)
  • Use emojis sparingly for visual cues (✅ ❌ 📅 📧)
  • Provide clear action labels ("Schedule Meeting" not "OK")
  • Include useful metadata (timestamps, counts, locations)
  • Always offer a way forward (recovery action for errors)