Skip to main content
Glama
@yawlabs/electron-mcp

@yawlabs/electron-mcp

Official
by YawLabs

electron_configure_csp

Read-onlyIdempotent

Generate a Content Security Policy tailored to your Electron app's bundler, framework, and dev-mode needs. Returns meta-tag and session.webRequest configurations.

Instructions

Generate a Content Security Policy for an Electron app. Accounts for the bundler (Vite, webpack), framework (React, Vue, Svelte), and whether dev-mode exceptions are needed. Returns both meta-tag and session.webRequest approaches.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "electron_configure_csp"
  }
}

Input Schema

NameRequiredDescriptionDefault
bundlerNoBundler used (affects script-src for HMR in dev mode). Defaults to 'vite'.
needsEvalNoWhether eval() is needed (some template compilers). Defaults to false.
externalImagesNoExternal origins for images, e.g. ['https://cdn.example.com']
needsInlineStylesNoWhether inline styles are required (e.g. CSS-in-JS). Defaults to false.
externalConnectionsNoExternal origins the app connects to, e.g. ['https://api.example.com', 'wss://ws.example.com']

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.7.2
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Changed2 schema fields changedv1.2.15
    • addedInput schema / properties / externalConnections / items / pattern
      Added value: +"^[^\\s;'\"]+$"
    • addedInput schema / properties / externalImages / items / pattern
      Added value: +"^[^\\s;'\"]+$"
  3. First observedv1.2.13

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so safety is covered by structured data. The description still adds value by disclosing the dual output shape (meta-tag vs session.webRequest), which matters because there is no output schema. It does not specify the exact return type or whether the result is copy-paste ready.

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?

Three short sentences, front-loaded with the purpose and free of filler. The only blemish is that the framework clause is not actionable given the schema, making part of the second sentence waste.

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 a zero-required-parameter generation tool with full schema coverage and no output schema, the description supplies the essentials: what it generates, what factors it accounts for, and the two delivery formats. It falls short only on return format specifics and on the phantom framework input.

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 schema already documents every parameter, and baseline 3 applies. Notably, the description claims to account for "framework (React, Vue, Svelte)," but no framework parameter exists in the schema, which could send an agent hunting for a nonexistent input. The dev-mode mention does map loosely to the bundler parameter's HMR note.

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

Purpose4/5

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

The first sentence states a specific verb and resource: "Generate a Content Security Policy for an Electron app." That is clearly distinct from the audit/lint/scaffold siblings, though the description never names an alternative to route between. The follow-up sentence scopes what inputs shape the policy, reinforcing the purpose.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer this is the tool to call when it needs a CSP rather than an audit. There is no explicit when-to-use/when-not guidance, no mention of pairing with electron_audit_security or electron_lint_security, and no statement about prerequisites such as knowing the bundler or target environments.

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