Skip to main content
Glama

apply_world_code_patch

Stage exact code replacements atomically. Each existing file needs its current SHA-256 hash, nonempty oldText matching exactly once, and newText. Include context for ambiguous matches. Use create:true only for a new file. Patches preserve unrelated source and invalidate earlier checks. This never saves or publishes a world. Interface assets and preview image can be attached here when approved generated images are ready.

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": {
      "workspaceId": "<workspaceId>",
      "codeWorkspaceId": "<codeWorkspaceId>",
      "expectedRevision": "<expectedRevision>",
      "patches": "<patches>"
    },
    "name": "apply_world_code_patch"
  }
}

Input Schema

NameRequiredDescriptionDefault
patchesYes
workspaceIdYes
codeWorkspaceIdYes
interfaceAssetsNo
previewImageUrlNo
expectedRevisionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / codeWorkspaceId / $ref
      Removed value: -"#/properties/workspaceId"
    • addedInput schema / properties / codeWorkspaceId / pattern
      Added value: +"^[A-Za-z0-9_-]{1,128}$"
    • addedInput schema / properties / codeWorkspaceId / type
      Added value: +"string"
    • removedInput schema / properties / expectedRevision / $ref
      Removed value: -"#/properties/workspaceId"
    • addedInput schema / properties / expectedRevision / pattern
      Added value: +"^[A-Za-z0-9_-]{1,128}$"
    • addedInput schema / properties / expectedRevision / type
      Added value: +"string"
    • removedInput schema / properties / interfaceAssets / items / additionalProperties
      Removed value: -false
    • removedInput schema / properties / interfaceAssets / items / properties / mediaId / $ref
      Removed value: -"#/properties/workspaceId"
    • addedInput schema / properties / interfaceAssets / items / properties / mediaId / pattern
      Added value: +"^[A-Za-z0-9_-]{1,128}$"
    • addedInput schema / properties / interfaceAssets / items / properties / mediaId / type
      Added value: +"string"
    • removedInput schema / properties / patches / items / additionalProperties
      Removed value: -false
  2. Added

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the annotations, the description discloses atomicity, the SHA-256 precondition, the failure semantics of requiring a unique oldText match, that unrelated source is preserved, and that earlier checks are invalidated by a patch. It also clarifies that nothing is saved or published, which is exactly the kind of state-effect context the destructiveHint=false annotation cannot convey on its own.

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?

Dense, front-loaded, and free of filler; each sentence carries a distinct rule or constraint. The trailing sentence about interface assets and preview images reads slightly bolted-on relative to the code-patch focus, but still adds 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?

For a 6-parameter mutation with no output schema, the description covers the important behavioral contract: atomic staging, uniqueness of matches, preservation of unrelated code, and check invalidation. It does not say what the call returns (updated revision or hashes) or resolve the identifier parameters, which are the remaining gaps.

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?

With 0% schema description coverage the description carries the entire burden, and it explains the patches fields well (hash, oldText matching semantics, newText, create flag) and gestures at interfaceAssets and previewImageUrl. It leaves workspaceId, codeWorkspaceId, and the meaning of expectedRevision undefined, which is a real gap but not fatal given how much it does cover.

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?

"Stage exact code replacements atomically" gives a specific verb plus resource, and "This never saves or publishes a world" explicitly separates it from the save sibling. An agent can tell this is a staging/patch operation rather than a full save without opening the schema.

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

Usage Guidelines4/5

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

Guidance is strong on intra-call conditions: hash required per existing file, oldText must match exactly once, add context for ambiguous matches, create:true only for new files. What is missing is explicit routing to alternatives (e.g., read_world_code_file to obtain hashes, save_world_code_workspace to persist), which the agent must infer from the negative statement about saving.

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.