Skip to main content
Glama

Create or update a source file

websiteSourceCode_files_upsert

Creates or replaces one head file. Pages, components, and modules require name; singleton types take only type. Takes the edit lease when no leaseToken is sent and returns changed: false for identical content.

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": {
      "websiteId": "<websiteId>",
      "file": "<file>",
      "content": "<content>"
    },
    "name": "websiteSourceCode_files_upsert"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYes
contentYes
websiteIdYes
leaseTokenNoOmit to have Cactal take the edit lease for you; pass a token from websiteSourceCode.lease.acquire to take over from another editor.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Beyond the annotations, the description discloses two real behaviors: it silently acquires the edit lease when no token is sent, and it returns `changed: false` for identical content. That is the kind of side-effect and no-op information an agent cannot get from readOnlyHint/destructiveHint. Minor tension with idempotentHint=false, but explicable by the lease side effect, so not a contradiction.

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?

Three tightly packed sentences, front-loaded with the core action, with the schema-shape rule and the lease/return behavior following in descending importance. No filler.

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?

No output schema exists, and the description supplies the one return value that matters (`changed: false`), plus lease behavior. What remains unstated is what a successful non-no-op response contains and whether writes affect published output, but this is a modest gap for a four-parameter upsert.

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 only 25% (only leaseToken is documented in-schema), so the description carries real weight: it explains the conditional shape of `file` across page/component/module/server_function versus singleton types, and explains leaseToken semantics with its counterpart tool. It adds nothing for `content` or `websiteId`, which are self-evident.

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?

States a specific verb and resource ('Creates or replaces one head file') and enumerates the file kinds it accepts, which distinguishes it from siblings like websiteSourceCode_files_strReplace and websiteSourceCode_files_delete. It does not name an alternative sibling by name, so an agent must infer the routing rather than be told it.

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?

The `name`-vs-`type`-only rule is a useful selection hint among file kinds, and the leaseToken sentence implies when to supply one versus let the server take the lease. However there is no explicit guidance on when to use this whole-file upsert versus files_strReplace or files_delete, nor any stated prerequisites.

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