Skip to main content
Glama

write_html_file

Creates or overwrites an HTML tool file under resources/html/, auto-injects the design-system baseline, and returns validation results to guide edits without manual base CSS.

Instructions

Create or overwrite one file inside an HTML tool folder (paths under resources/html/ only; tool.meta.json, tool.settings.json and tool_registry.json are managed and refused). HTML files get the design-system baseline auto-injected — never write base CSS yourself. The result includes a validation summary; if validation.issues is empty, do not read the file back. Use replace_in_html_file for targeted edits.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "workspacePath": "<workspacePath>",
      "filePath": "<filePath>",
      "content": "<content>"
    },
    "name": "write_html_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
contentYesFull file content to write
filePathYesFile path relative to the workspace root (e.g. "resources/html/my-tool/index.html")
workspacePathYesAbsolute path to the workspace directory

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.19.0
    • changedInput schema / properties / filePath / description
      Previous value: -"File path relative to the workspace root (e.g. \"resources/html/my-tool/script.js\")"New value: +"File path relative to the workspace root (e.g. \"resources/html/my-tool/index.html\")"
  2. First observedv0.6.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does well: it discloses that writes overwrite, that certain paths are refused, that a design-system baseline is auto-injected (a real side effect), and that a validation summary comes back. The remaining gap is failure semantics — it never says whether the file is written when validation fails, nor whether missing parent directories are created.

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?

Four dense sentences, front-loaded with the verb and the path restriction, then side effects, then the return-value rule, then the alternative. Nothing is redundant and no sentence could be dropped without losing information.

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?

There is no output schema, and the description compensates by telling the agent what the result contains and how to react to it, which covers the biggest gap for a write tool. It stops short of describing the shape of validation.issues or what a failed validation means for the written file.

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

Parameters4/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, but the description adds a real constraint the schema omits: filePath must resolve under resources/html/ and certain filenames are rejected. That is meaning beyond the schema for the most error-prone parameter.

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?

States a specific verb pair (create or overwrite) and a specific resource (one file inside an HTML tool folder), and immediately scopes it to paths under resources/html/. It also names the sibling it is not for (replace_in_html_file), so an agent can distinguish it without opening any schema.

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

Usage Guidelines5/5

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

Explicitly says to use replace_in_html_file for targeted edits, enumerates the managed files that will be refused (tool.meta.json, tool.settings.json, tool_registry.json), and gives a post-write rule (do not read the file back when validation.issues is empty). When-to-use, when-not-to-use, and the alternative are all present.

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