Skip to main content
Glama

Write site files

write_site_files
Destructive

Call get_site_context first. Push NEW files (HTML/CSS/JS/images) into a site's DRAFT. To CHANGE an existing page use patch_site_file instead (find/replace on the current file) — rewriting a whole page from memory drops or duplicates things; overwriting an existing .html needs base_hash from read_site_file. Use this when YOU are writing the code yourself instead of asking sitectrl's AI. Text files go in 'content'; binary files (images/fonts) in 'content_base64'. Max 40 files/call, 2 MB/file. Keep the include on every HTML page (the site's built-in private analytics — publish re-adds it if missing). Use clearly-marked placeholder contact info unless the user provided real details. For working forms, POST to /_sc/form/submit with a hidden _form name field — submissions reach the owner's dashboard + email (never use mailto:). Every HTML file is checked before it's written (DOCTYPE, charset, and any invariant this site has declared) — a file that fails is refused and comes back in 'refused' with what's wrong and the exact fix; other files in the same call still write. Site rules: keep sc-track.js, the data-sc-carry canonical/og:url tags and the sc-badge block; never add noindex or 'Disallow: /' on a site with its own domain. Follow with publish_site to go live.

Input Schema

NameRequiredDescriptionDefault
slugYes
filesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / files / items / properties / base_hash
      Added value: +{
      +  "description": "The 'hash' read_site_file returned for this path. Required to overwrite an existing .html file; the write is refused if the file changed since.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already flag this as a destructive write, but the description adds critical behavioral details beyond them: per-call file limits (40), per-file size limit (2 MB), validation behavior ('a file that fails is refused and comes back in "refused" ... other files in the same call still write'), required analytics script inclusion, and site-level invariants. This is unusually rich context for a mutation tool.

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 long but front-loaded with the most important routing instruction ('Call get_site_context first') and the key alternative (patch_site_file). Nearly every sentence carries actionable information, though the density is high and a couple of site-rule details could be skimmed.

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

Completeness5/5

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

Given the complexity of writing validated site files, the lack of an output schema, and the destructive nature of the operation, the description covers all the decision-critical aspects: prerequisites, limits, validation/refusal behavior, content-type routing, required page invariants, and the recommended follow-up (publish_site).

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

Parameters5/5

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

Schema coverage is reported at 0%, so the description must carry parameter meaning and does: it explains that text files belong in 'content' while binary files (images/fonts) belong in 'content_base64,' and that overwriting an existing .html requires base_hash. These distinctions are not fully captured by the input schema and materially affect correct invocation.

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 and resource: 'Push NEW files (HTML/CSS/JS/images) into a site's DRAFT.' It immediately distinguishes itself from the sibling patch_site_file, so an agent can tell when to use which without opening either 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?

It gives explicit routing guidance: 'Call get_site_context first,' 'To CHANGE an existing page use patch_site_file instead,' and 'overwriting an existing .html needs base_hash from read_site_file.' It also clarifies the authoring scenario ('when YOU are writing the code yourself instead of asking sitectrl's AI').

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources