AxTidy3D_generate_code
Generate executable Python code for Tidy3D FDTD and mode-solving simulations from a natural language problem description. Fixes failed code when given the previous code and error.
Instructions
Generate Python code for a Tidy3D simulation (FDTD, mode solving) from a natural language problem description. Returns executable code and an explanation. The code must be run separately using execute_code. If a previous attempt failed, pass previous_code and previous_error so the generator can fix it instead of starting over.
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": {
"problem_description": "<problem_description>"
},
"name": "AxTidy3D_generate_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| previous_code | No | The code from a prior failed attempt, if retrying | |
| previous_error | No | The error message from the prior failed attempt, if retrying | |
| problem_description | Yes | Natural language description of the simulation to build |