Development
Сжимает HTML, удаляя комментарии, сворачивая пробелы и минифицируя встроенные CSS/JS
Вызовите этот инструмент из своего кода на трёх языках.
curl -X POST 'https://api.elysiatools.com/ru/api/tools/html-minifier' \
-H 'Content-Type: application/json' \
-d '{"htmlInput":"Enter HTML code to minify...","collapseWhitespace":true,"removeComments":true,"removeRedundantAttributes":true,"minifyInlineCss":true,"minifyInlineJs":true,"removeOptionalTags":false}'Отправьте POST-запрос с входными данными в JSON. Параметры типа «файл» требуют предварительной загрузки.
POST https://api.elysiatools.com/ru/api/tools/html-minifier| Имя | Тип | Обязательный | Описание |
|---|---|---|---|
| htmlInput | textarea | Да | — |
| collapseWhitespace | checkbox | Нет | Collapse consecutive whitespace characters into a single space |
| removeComments | checkbox | Нет | Strip HTML comments (conditional comments are preserved) |
| removeRedundantAttributes | checkbox | Нет | Drop attributes that match their element defaults (e.g. type="text" on inputs) |
| minifyInlineCss | checkbox |
Добавьте этот инструмент на свой сервер Model Context Protocol, чтобы ИИ-агенты могли перечислять и вызывать его.
Добавьте этот блок в конфигурацию вашего MCP-клиента:
{
"mcpServers": {
"elysiatools-html-minifier": {
"name": "html-minifier",
"description": "Сжимает HTML, удаляя комментарии, сворачивая пробелы и минифицируя встроенные CSS/JS",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=html-minifier",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}После подключения к SSE-endpoint выведите список доступных инструментов:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Вызовите инструмент по его id; аргументы формируются из его параметров:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "html-minifier",
"arguments": {
"htmlInput": "Enter HTML code to minify...",
"collapseWhitespace": true,
"removeComments": true,
"removeRedundantAttributes": true,
"minifyInlineCss": true,
"minifyInlineJs": true,
"removeOptionalTags": false
}
}
}Вопросы или проблемы? Свяжитесь с [email protected]
| Compress CSS inside <style> tags and style="" attributes |
| minifyInlineJs | checkbox | Нет | Compress JavaScript inside <script> tags and event handlers |
| removeOptionalTags | checkbox | Нет | Drop tags that browsers infer (e.g. closing </li>, </p>) |
Текстовый результат
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}