Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Create LWC Jest Test

sf_create_lwc_jest_test
Idempotent

Generate a Jest test file for an existing Lightning Web Component and deploy it to the component's tests folder via Metadata API.

Instructions

Creates a Jest test file for an existing LWC component using @salesforce/lwc-jest conventions. The test file is placed in the tests subfolder of the component bundle and deployed via the Metadata API.

componentName: LWC component name in camelCase, e.g. 'myButton' testContent: Jest test file content (JavaScript) apiVersion: Salesforce API version

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiVersionNoAPI version, e.g. '62.0'66.0
testContentYesJest test file content (JavaScript)
componentNameYesLWC component name (camelCase), e.g. 'myButton'
Behavior4/5

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

Annotations already indicate non-read-only, idempotent, and non-destructive. The description adds valuable behavior details: file goes to __tests__ subfolder and is deployed via Metadata API. It does not state overwrite behavior, but the idempotent hint partially covers that.

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

Conciseness5/5

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

The description is concise and front-loaded with the main purpose, followed by a brief parameter list. Every sentence adds value with no redundancy.

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?

The description covers what the tool does, where the output is placed, deployment method, and conventions. With no output schema, this is largely sufficient. It could mention prerequisites more explicitly but is adequate for a focused creation tool.

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 description coverage is 100%, so the baseline is 3. The description repeats parameter names and examples already in the schema, adding no substantial new semantics beyond the structured definitions.

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 states a specific verb ('Creates') and resource ('Jest test file for an existing LWC component'), and includes placement and deployment details. This clearly distinguishes it from sibling tools like sf_create_lwc and sf_create_apex_test_class.

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?

The phrase 'for an existing LWC component' implies the appropriate use case (testing an already-created LWC) and sets the context. It does not explicitly name alternatives or exclusion conditions, but the context is clear enough.

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