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

TableJSON 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?

The description discloses that this is a state-changing action, consumes AI credits, creates a generation, and returns test code only after authorization. This adds meaningful context beyond the annotations (readOnlyHint=false, destructiveHint=false), which only say it is not read-only and not destructive. The description does not conflict with 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?

The description is three short, purposeful sentences: one scoping when to use, one stating behavioral consequences, and one offering guidance for edge cases (local uploads, repo-wide). No filler or redundant phrasing.

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?

With no output schema, the description explains that the tool returns test code after authorization, which is a helpful summary. Given the 6 parameters are all documented in the schema and the tool's complexity is moderate, this is complete enough for an agent to call it correctly, though it could mention what happens if authorization is not granted.

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 each parameter is already well-documented by the input schema (e.g., source_code, test_type, test_framework). The description adds no extra parameter-level detail beyond what the schema provides, so the baseline of 3 is appropriate.

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 states a specific action (generate tests) with a specific resource (source code) and enumerates the kinds of tests (unit, feature, integration, framework-specific). It is immediately distinguishable from sibling tools like generate-code-comments, generate-code-documentation, and generate-code-optimization because it focuses exclusively on test-generation.

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?

Provides a clear when-to-use condition: 'when the user supplies a URL to additional 4 test-generation of unit, feature, integration, or framework-specific tests.' It lacks explicit exclusions (e.g., don't use for comments or documentation), but the purpose statement indirectly differentiates from siblings.

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.

Resources