Skip to main content
Glama

Generate Code Tests Tool

generate-code-tests

Use this when the user supplies source code and asks to generate unit, feature, integration, or framework-specific tests. State-changing generation action: consumes AI credits, creates a generation, and returns test code after authorization. Use browser guidance for local uploads or repository-wide test generation.

Input Schema

NameRequiredDescriptionDefault
nameNoOptional custom name used to identify the tests in generation history
filenameYesThe full file path of the file being tested (e.g., src/utils/helper.ts)
test_typeNoType of tests to generate (e.g., "unit tests", "integration tests")
source_codeYesThe source code to generate tests for
test_frameworkNoTesting framework to use (e.g., "Jest", "PHPUnit", "JUnit") or "auto-detect"
additional_instructionsNoAdditional instructions for test generation

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false, so the description's real contribution is the extra context it adds: the action consumes AI credits, creates a persistent generation record, and returns test code only after authorization. That is meaningful beyond the structured fields; only rate/credit limits or failure modes are missing.

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 with no padding. The trigger condition is front-loaded, the cost/authorization caveat follows, and the routing exclusion closes it out.

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 partially compensates by saying test code is returned after authorization. Combined with annotations and full schema coverage, an agent has enough to invoke correctly; only the shape/format of the returned test code is left implicit.

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 all six parameters (filename path format, framework, auto-detect, additional instructions) are already documented in the schema. The description adds only the mention of test kinds, which does not extend parameter meaning. Baseline 3 applies.

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 (generate) and resource (tests) and enumerates the supported test kinds: unit, feature, integration, framework-specific. This clearly separates it from the many generate-* documentation siblings, and an agent can classify a request 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?

Explicit trigger is given ("Use this when the user supplies source code and asks to generate ... tests"), plus an exclusion routing to browser guidance for local uploads or repository-wide generation. The alternative is described generically rather than by a concrete sibling tool name, which keeps it short of a 5.

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.