test_generate_unit
Generate unit tests for functions, classes, or modules directly from source code. Specify the programming language and test framework to get targeted test cases.
Instructions
Generate unit tests for functions, classes, or modules from source code
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": {
"source_code": "<source_code>"
},
"name": "test_generate_unit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_key | No | API key for authentication | |
| language | No | Programming language of the source code | |
| framework | No | Test framework: 'jest', 'mocha', 'vitest', 'pytest', 'junit' | |
| source_code | Yes | Source code to generate unit tests for |