Newer Version Available

This content describes an older version of this product. View Latest

Use the mobile Toolset

The mobile toolset contains tools to assist in creating Lightning web components that integrate with device-native capabilities such as calendar access, contact access, and document scanning.
  • create_mobile_lwc_calendar – Provides expert grounding to implement a mobile calendar service feature in a Salesforce Lightning web component (LWC).
  • create_mobile_lwc_contacts – Provides TypeScript API documentation for Salesforce LWC Contacts Service, offering expert guidance for implementing contacts management features in Lightning web components.
  • create_mobile_lwc_document_scanner – Provides TypeScript API documentation for Salesforce LWC Document Scanner, offering expert guidance for implementing document scanning features in Lightning web components.
  • create_mobile_lwc_geofencing – Provides TypeScript API documentation for Salesforce LWC Geofencing Service, offering expert guidance for implementing geofencing features in Lightning web components.
  • create_mobile_lwc_nfc – Provides TypeScript API documentation for Salesforce LWC NFC Service, offering expert guidance for implementing NFC features in Lightning web components.
  • create_mobile_lwc_payments – Provides TypeScript API documentation for Salesforce LWC Payments Service, offering expert guidance for implementing payment processing features in Lightning web components.
  • create_mobile_lwc_app_review – Provides TypeScript API documentation for Salesforce LWC App Review Service, offering expert guidance for implementing app review features in Lightning web components.
  • create_mobile_lwc_ar_space_capture – Provides TypeScript API documentation for Salesforce LWC AR Space Capture, offering expert guidance for implementing AR space capture features in Lightning web components.

The tools are invoked automatically based on your prompts. Here are some possible prompts that invoke the Mobile Native Capabilities MCP tools.

Mobile MCP tools for LWC development uses generative AI, which can produce inaccurate or harmful responses. The output generated by AI is often nondeterministic. Before using the generated output, review it for accuracy and safety. You assume responsibility for how the outcomes are applied to your organization.

Note

Calendar Service LWC Tool (create_mobile_lwc_calendar)

To generate an LWC that can add an event to the device's calendar, use a prompt that invokes the create_mobile_lwc_calendar tool.

  • Create a mobile-friendly Lightning Web Component (LWC) named appointmentScheduler.
    • The component should contain input fields for an appointment title and notes, along with a Save to Calendar button.
    • When the user taps the button, the component must open the device's native calendar application and pre-fill a new event with the provided title and notes.

Contacts Service LWC Tool (create_mobile_lwc_contacts)

To generate an LWC that saves information to the device's contacts, use a prompt that invokes the create_mobile_lwc_contacts tool.

  • Create a mobile-friendly Lightning Web Component (LWC) named leadContactSaver.
    • This component displays a lead's name, phone number, and email address. Include a button labeled Save to Device Contacts.
    • When tapped, the component should use the device's contacts service to save the lead's information as a new contact on the user's phone. Upon successful completion, display a "Contact Saved" message.

Document Scanner LWC Tool (create_mobile_lwc_document_scanner)

To generate an LWC that uses the device's camera to scan a document, use a prompt that invokes the create_mobile_lwc_document_scanner tool.

  • Create a mobile-friendly Lightning Web Component (LWC) named contractUploader.
    • The component must have a button with the label Scan Signed Contract.
    • Tapping this button should activate the device's native document scanner.
    • After the scan is successfully captured, display a preview of the scanned document within the component and provide a Confirm Upload button.

Geofencing Service LWC Tool (create_mobile_lwc_geofencing)

To generate an LWC that can monitor a geographic boundary, use a prompt that invokes the create_mobile_lwc_geofencing tool.

  • Create a mobile-friendly Lightning Web Component (LWC) named siteArrivalMonitor.
    • When the component is loaded, it should establish a geofence around a specific, hardcoded set of GPS coordinates representing a job site.
    • When the user's device enters this defined geographical area, the component should display a prominent notification message: "You have arrived at the job site."

NFC Service LWC Tool (create_mobile_lwc_nfc)

To generate an LWC that can read data from an NFC tag, use a prompt that invokes the create_mobile_lwc_nfc tool.

  • Create a mobile-friendly Lightning Web Component (LWC) named inventoryTagReader.
    • It should feature a Scan NFC Tag button.
    • When the user taps this button, the component should activate the device's NFC reader.
    • Upon a successful scan of an NFC tag, display the data payload from the tag within a text area.
    • The component should also include a Reset button to clear the text area for the next scan.

Payments Service LWC Tool (create_mobile_lwc_payments)

To generate an LWC that can process a payment using the device's native payment system, use a prompt that invokes the create_mobile_lwc_payments tool.

  • Create a mobile-friendly Lightning Web Component (LWC) named fieldPaymentProcessor.
    • The component needs to display a static invoice total (e.g., $99.99) and a Pay Now button.
    • When the user taps this button, it must initiate a payment request using the device's native payment service (like Apple Pay or Google Pay).
    • After the transaction is successfully completed, display a "Payment Complete" confirmation message.

App Review Service LWC Tool (create_mobile_lwc_app_review)

To generate an LWC that lets users rate the application, use a prompt that invokes the create_mobile_lwc_app_review tool.

  • Create a mobile-friendly Lightning Web Component (LWC) named appFeedback.
    • The component should feature a button labeled Rate Our App.
    • When the user taps this button, it should invoke the device's native app review prompt.
    • After the user completes or dismisses the review prompt, display a confirmation message, "Thank you for your feedback!"

AR Space Capture Service LWC Tool (create_mobile_lwc_ar_space_capture)

To generate an LWC that can scan a room using augmented reality, use a prompt that invokes the create_mobile_lwc_ar_space_capture tool.

  • Create a mobile-friendly Lightning Web Component (LWC) named roomScanner.
    • This component should include a Scan Room in AR button.
    • Tapping this button launches the device's native AR space capture functionality.
    • Once the scan is successfully completed, the component should display a confirmation message, "Room scan complete and saved," and present a Start a New Scan button to reset the process.