Use the Lightning Data Service (LDS) MCP Tools (Beta)

The LDS MCP tools help you work better with Salesforce records by providing guidance on the UI API and applying data consistency and referential integrity best practices.

MCP Tools for LWC is a pilot or beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Pilot Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this pilot or beta service is at the Customer's sole discretion.

  • guide_lds_development - LDS development guidelines and component integration
  • guide_lds_data_consistency - Data consistency patterns and best practices for using LDS-based components and wire adapters
  • guide_lds_referential_integrity - Referential integrity patterns for LDS data management
  • explore_lds_uiapi - Explores and documents Lightning Design System UI API capabilities
  • orchestrate_lds_data_requirements - Analyzes and clarifies LDS data requirements to produce PRD-ready specifications
  • guide_lds_graphql - Provides guidelines on implementing GraphQL patterns to work with Salesforce data through the GraphQL wire adapter
  • explore_lds_graphql_schema - Provides static GraphQL schema information that contains all the common types referred to by Salesforce GraphQL schemas
  • create_lds_graphql_read_query - Provides guidelines for creating GraphQL read queries

When working with these tools using Agentforce Vibes Extension, you must enable the a4d-general-rules-no-edit.md and a4d-lwc-rules-no-edit.md global rules. The a4d-general-rules-no-edit.md rule is enabled by default. For more information on configuring rules in Agentforce Vibes, see Agentforce Rules in the Agentforce Vibes Extension Developer Guide.

Here are some possible prompts that invoke the LDS MCP tools.

Ask about using UI API for LWC development.

  • List the available UI API wire adapters and when to use each.
  • Generate the UI API field schema and types for Account.Name, Account.Industry, Contact.Email.
  • Compare imperative vs wired UI API calls for fetching and updating records.

Ask about maintaining data consistency using LDS-based wire adapters and other data strategies.

  • Explain how to use getRecordNotifyChange to keep multiple components in sync.
  • Recommend strategies to handle concurrent edits and stale data with LDS.
  • Outline cache invalidation rules when creating, updating, and deleting related records.

Ask about evaluating a component using LDS development guidelines.

  • Recommend when to use base components (lightning-record-form) vs custom LDS wires.
  • Provide a checklist for building a record editor: validation, errors, toasts, and refresh.
  • Suggest performance tips for LDS-heavy pages (field minimization, batching, memoization).

Ask about referential integrity recommendations.

  • Describe how to prevent orphaned contact records when deleting a parent account.
  • Recommend validations before updating lookups to maintain relationship integrity.
  • Handle missing or soft-deleted related records gracefully in UI and data flows.

Ask about LDS data requirements covering objects and fields, relationships, data operations, security, offline considerations, and recommended UI API adapters vs Apex.

  • Generate a step-by-step LDS data requirements spec for my LWC.
  • Help me define objects, fields, and adapters for my LWC using LDS.
  • Create a PRD-ready LDS data access plan for my LWC.

Ask about working with Salesforce data through a standalone query or via the GraphQL wire adapter.

  • Design a read query for Account by Id with paginated Contacts, sorted by LastModifiedDate and filtered Opportunities.
  • How do I create a GraphQL query to read accounts with contact information?
  • Create a GraphQL query for displaying a case queue. Query case by status and priority, with cursor-based pagination.

The tool can further prompt you to select an introspection method: manual, Connect API, or Salesforce CLI. You can't skip introspection because the LDS GraphQL workflow requires it to avoid invalid field and relationship names. Alternatively, the tool prompts you to provide information such as the relationship name so it can generate a query without introspection.

The guide_lds_graphql tool can invoke these tools to help with task completion.

These tools aren't guaranteed to be invoked by guide_lds_graphql. See LWC MCP Tools Usage Considerations

For known limitations on using GraphQL with LWC, see GraphQL Wire Adapter Limitations in the GraphQL API Developer Guide.

Ask about GraphQL schema information, which contains all the common types referred to by Salesforce GraphQL schemas.

  • Show me the GraphQL schema for the account object.
  • Retrieve input operator definitions for Date, DateTime, and Picklist filtering.
  • List scalar types, enums, and directives for the GraphQL wire adapter.

Ask about creating GraphQL read queries, including query structure and syntax, field selection best practices, filtering and sorting techniques, and wire adapter integration.

  • How do I create a GraphQL query to read cases with description, priority, and status information?
  • Create a GraphQL query for an opportunity pipeline. Group by StageName, return counts and total amount.
  • How can I display opportunities using GraphQL? Filter by date ranges and query opportunities with CloseDate in the next 90 days with sorting.

If you try to invoke the create_lds_graphql_read_query tool, the tool prompts you to run the guide_lds_graphql tool first. Alternatively, you can invoke the create_lds_graphql_read_query tool by asking about creating or modifying a read query.

See Also