glm_refactor
Refactor code with targeted instructions to improve structure and cleanup. Provide file path and working directory to receive refactored code and a clear explanation.
Instructions
Refactor code using GLM.
Use for: improving code structure, applying patterns, cleanup.
Args: file_path: Path to file to refactor instructions: Refactoring instructions working_directory: Project directory model: "haiku" or "sonnet"
Returns: Refactored code and explanation
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": {
"file_path": "<file_path>",
"instructions": "<instructions>",
"working_directory": "<working_directory>"
},
"name": "glm_refactor"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | sonnet | |
| file_path | Yes | ||
| instructions | Yes | ||
| working_directory | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |