Skip to main content
Glama

Patch Asset

patch_asset
Destructive

Apply targeted text changes to an existing asset (js, css, json, svg) without re-uploading the full file. Uses find/replace on the file content. Binary assets (images, fonts) are updated by re-uploading with overwrite: true instead.

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": {
      "project_id": "<project_id>",
      "slug": "<slug>",
      "patches": "<patches>"
    },
    "name": "patch_asset"
  }
}

Input Schema

NameRequiredDescriptionDefault
slugYesThe asset path to patch (e.g., "js/app.js", "css/style.css")
patchesYesArray of patch operations. Each patch needs: operation ("replace" or "delete"), find (exact string to locate). For replace: also include replace (new string).
project_idYesThe project ID
base_version_hashNoOptional. Content hash from get_asset response. If provided and mismatched, returns 409.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / base_version_hash
      Added value: +{
      +  "description": "Optional. Content hash from get_asset response. If provided and mismatched, returns 409.",
      +  "type": "string"
      +}
  2. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already establish destructiveHint=true and readOnlyHint=false, so the description does not need to restate that this modifies content. It adds useful behavioral detail: the operation uses find/replace on file content and that binary assets are explicitly out of scope for this tool. It stops short of describing failure behavior or what happens when a find match is absent, but the annotation coverage lowers the burden.

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?

Two sentences, no filler. The core purpose is front-loaded, and the binary-asset exception is stated as a clear alternative. Every sentence contributes useful guidance.

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 destructive text-patching tool, the description covers the main decision an agent needs: text vs binary assets. Parameters are fully described in the schema, and no output schema exists to explain return values. A minor gap is lack of explicit mention of the optional base_version_hash concurrency behavior, which is only in the schema.

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 baseline is 3 even without additional parameter detail in the description. The description's mention of find/replace aligns with the patches parameter but does not add meaning beyond the schema. It does not clarify the schema's slightly inconsistent patch operation descriptions, but that is not the description's job.

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 names a specific verb and resource ('Apply targeted text changes to an existing asset'), lists supported file types (js, css, json, svg), and explicitly contrasts with full re-upload. This clearly distinguishes patch_asset from sibling upload_asset and other asset tools.

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 states exactly when to use the tool: for targeted text changes to text-based assets without re-uploading the full file. It also gives the alternative path for binary assets ('updated by re-uploading with overwrite: true instead'), effectively routing the agent to upload_asset without naming it explicitly.

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.