Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Create Lightning Web Component

sf_create_lwc
Idempotent

Create and deploy a Lightning Web Component (LWC) to Salesforce, including HTML, JavaScript, CSS, and metadata. Specify targets for App Builder, Flow, Utility Bar, or Experience Cloud.

Instructions

Creates and deploys a new Lightning Web Component (LWC) to the Salesforce org. Provide the HTML template, JavaScript controller, optional CSS, and component metadata. The component is packaged into a deployment zip and deployed via the Metadata API. Specify targets to make the component available in Lightning App Builder (AppPage, RecordPage, HomePage), Flow Screen, Utility Bar, or Experience Cloud. Use isExposed:true to make it drag-and-drop in App Builder.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cssNoOptional CSS styles content
htmlYesHTML template content (the content of the .html file, including <template> tags)
targetsNoWhere this component can be placed in Lightning
isExposedNoMake the component available in Lightning App Builder
apiVersionNoAPI version for this component66.0
javascriptYesJavaScript controller content (the content of the .js file, including import statements and class)
descriptionNoDescription of the component
componentNameYesLWC component name in camelCase, e.g. 'accountCard', 'opportunityList'
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses that the component is 'packaged into a deployment zip and deployed via the Metadata API,' adding operational context beyond the annotations. It also explains the effect of isExposed, but does not detail side effects such as overwriting existing components or permissions required. Annotations already indicate a write operation (readOnlyHint=false) and idempotentHint=true, so the additional value is moderate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is 5 sentences long and front-loaded with the primary purpose. Each sentence adds useful operational detail, though the list of target examples partially duplicates the schema enum. It is slightly verbose but not wasteful, so a 4.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter tool with no output schema, the description covers the key workflow: inputs, packaging, deployment, and configurable exposure. It lacks information on error behavior or prerequisites, but given the schema's thorough parameter descriptions, it is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for all 8 parameters, so the baseline is 3. The description adds context for targets (e.g., 'Lightning App Builder') and isExposed, but these are already in the schema. It does not add new meaning beyond what the schema provides, so a 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Creates and deploys a new Lightning Web Component (LWC) to the Salesforce org,' with a specific verb and resource. It distinguishes from siblings like sf_update_lwc and sf_create_aura_component by explicitly mentioning LWC and the deployment step.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit instructions on required inputs (HTML template, JavaScript controller, optional CSS) and how to control exposure via targets and isExposed. However, it does not explicitly mention when this tool should be preferred over alternatives like sf_create_lwc_from_requirements or sf_update_lwc, so there's context but no exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/semwalajay83-sem/salesforce-metadata-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server