Skip to main content
Glama

Write test

write_test

Save test code to the allowed Python or Java test path, creating the file and skipping existing ones unless overwrite is set.

Instructions

Write a test file. Python: into tests/ as test_*.py, *_test.py or conftest.py. Java: into src/test/java/ as a .java file (tests and Page Objects). Refuses other paths; won't overwrite unless asked.

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": {
      "path": "<path>",
      "code": "<code>"
    },
    "name": "write_test"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
pathYes
overwriteNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does disclose two real behaviors: invalid paths are refused, and existing files are not overwritten unless explicitly requested. It still omits failure modes, whether directories are created, and what a successful call returns.

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?

Three compact sentences, front-loaded with the core action, then language-specific rules, then constraints. No filler, though the language rules read as a terse list rather than a structured enumeration.

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

Completeness3/5

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

For a 3-parameter write tool with no annotations and no output schema, the description covers destination policy and overwrite safety but leaves the return value, error behavior, and directory-creation semantics unstated. Adequate to call correctly in the happy path, incomplete for edge cases.

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 coverage is 0%, so the description must compensate. It does add genuine meaning for path (per-language allowed patterns) and overwrite (default is safe, opt-in to replace), but the required code parameter is never described and no format or size expectations are given.

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 ("Write a test file") and immediately narrows it by enumerating accepted destinations for two languages. It doesn't name any sibling, so an agent must infer on its own that this differs from run_tests or capture_baseline, which keeps it short of a 5.

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 path rules implicitly tell the agent when this tool applies (test files, Page Objects) and the refusal clause tells it when the tool will reject a call. There is no explicit when-to-use versus alternatives, and no statement of prerequisites such as whether the target directory must already exist.

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