code_format
Format or compress code across 18 programming languages. Uses Prettier for web formats, sql-formatter for SQL, and indentation beautification for others.
Instructions
代码格式化/压缩。language 可选:js、ts、json、css、html、yaml、markdown、sql、php、java、cs、c、cpp、python、ruby、perl、vbs、go。js/ts/json/css/html/yaml/markdown 走 prettier,sql 走 sql-formatter,其余语言为基础缩进美化
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": {
"code": "<code>",
"language": "<language>"
},
"name": "code_format"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | 要格式化的代码 | |
| action | No | format | |
| indent | No | 缩进空格数 | |
| language | Yes | 代码语言 |