Skip to main content
Glama

Generate Tests

generate_tests
Read-only

Generate complete, runnable test files from implementation code, covering happy paths and edge cases. Specify framework and scenarios to get tailored tests.

Instructions

Generate test code for a given implementation.

Produces a complete, runnable test file that covers happy paths and edge cases. Specify the testing framework and any particular scenarios you want covered.

IMPORTANT: Always review the returned tests before accepting them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe implementation code to generate tests for.
languageYesProgramming language of the implementation.
frameworkNoTesting framework to use (e.g. 'pytest', 'jest', 'go test', 'junit'). Leave empty for the language's default.
max_tokensNoMax tokens override.
temperatureNoTemperature override.
requirementsNoSpecific scenarios, edge cases, or coverage requirements for the generated tests.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoThe generated artefact (code, tests, documentation). None on failure.
errorNoHuman-readable error message. None on success.
successYesWhether the generation completed successfully.
metadataNoAuxiliary data: token usage, elapsed time, quality warnings, etc.
Behavior4/5

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

Annotations provide readOnlyHint=true, and the description does not contradict this—generating test code produces output without mutating state. The description adds value beyond annotations by disclosing that the output is a complete, runnable file and by warning to always review returned tests before accepting, implying outputs may be imperfect. This is useful behavioral context.

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 compact—two concise sentences plus an IMPORTANT warning—with every sentence earning its place: it states the action, describes the output, guides input configurability, and advises on output review. No redundancy or irrelevant detail.

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 generative tool with 6 parameters and an output schema, the description adequately covers purpose, output nature, and optional input guidance. The review warning addresses output reliability risk. It doesn't discuss all potential failure modes, but full schema coverage and the output schema mitigate that gap, making the definition sufficient for correct invocation.

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 the baseline is 3. The description adds minimal parameter-level meaning by telling users to specify framework and scenarios, but the schema already documents framework, requirements, code, language, max_tokens, and temperature. No additional parameter semantics are provided beyond the schema.

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 verb-object pair ('Generate test code') and clearly defines the deliverable as a 'complete, runnable test file' covering happy paths and edge cases. This distinguishes it from sibling tools like generate_docs and implement_code, making its purpose unambiguous.

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 gives clear usage context: generate tests for a given implementation, and explicitly directs the agent to specify the testing framework and particular scenarios via the framework and requirements parameters. It lacks explicit exclusions or comparisons to alternatives, but the context is sufficient for an agent to know when to select it.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shreyashp77/Llama-Bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server