Skip to main content
Glama

write_sandbox_file

Destructive

Write a PHP file into the Keelhob sandbox so custom hooks and functions persist; content is syntax-checked before disk and runtime-fatal files are quarantined.

Instructions

Write a PHP file into the Keelhob sandbox (wp-content/keelhob-sandbox). Sandbox files are auto-loaded on every request so custom hooks/functions persist. Content is syntax-checked before it touches disk (rejected on a parse error, nothing written); a file that still fatals at runtime for some other reason is auto-quarantined on the next request so the site stays up. Include the opening <?php tag.

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": {
      "filename": "<filename>",
      "content": "<content>"
    },
    "name": "write_sandbox_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
contentYesFull PHP file contents, including <?php.
filenameYesFile name, e.g. my-feature.php

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.2

TDQS

A4.7/5.0
Behavior5/5

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

With only destructiveHint=true supplied, the description carries real weight: it discloses pre-write syntax checking, that a parse error means nothing is written to disk, and that runtime-fatal files are auto-quarantined on the next request to keep the site up. That is failure-mode and side-effect information an agent could not infer from the annotations.

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 sentences, front-loaded with destination, then persistence rationale, then safety behavior, then the one content caveat. Every sentence contributes and nothing is padded.

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 two-parameter mutating tool with no output schema, the description covers destination, purpose, validation, and failure handling well. It leaves one gap: it never says what happens when the filename already exists (overwrite vs. error), which matters given destructiveHint=true.

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 100%, so both parameters are already documented; the description's "Include the opening <?php tag" largely restates the schema's "Full PHP file contents, including <?php." Baseline 3 applies since the schema does the heavy lifting and the description adds no formatting or naming rules beyond it.

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 and resource ("Write a PHP file") plus an exact destination path (wp-content/keelhob-sandbox), which separates it from the generic write_file sibling without needing to name it. The narrow scope — PHP only, sandbox only — makes the tool unambiguous at a glance.

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?

The description explains the reason to pick this tool: sandbox files are auto-loaded on every request so hooks/functions persist, which is clear usage context. It stops short of explicit exclusions, never telling the agent when to use write_file, edit_file, or execute_php instead, so it earns a 4 rather than a 5.

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