Format Conversion
Анализирует, проверяет и форматирует записи файла hosts
Вызовите этот инструмент из своего кода на трёх языках.
curl -X POST 'https://api.elysiatools.com/ru/api/tools/hosts-file-editor' \
-H 'Content-Type: application/json' \
-d '{"hostsInput":"Enter hosts file content...\n\n127.0.0.1 localhost\n192.168.1.1 router.local\n# This is a comment\n10.0.0.1 server.example.com","outputFormat":"json","includeComments":true}'Отправьте POST-запрос с входными данными в JSON. Параметры типа «файл» требуют предварительной загрузки.
POST https://api.elysiatools.com/ru/api/tools/hosts-file-editor| Имя | Тип | Обязательный | Описание |
|---|---|---|---|
| hostsInput | textarea | Да | — |
| outputFormat | select | Нет | — |
| includeComments | checkbox | Нет | — |
Текстовый результат
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Добавьте этот инструмент на свой сервер Model Context Protocol, чтобы ИИ-агенты могли перечислять и вызывать его.
Добавьте этот блок в конфигурацию вашего MCP-клиента:
{
"mcpServers": {
"elysiatools-hosts-file-editor": {
"name": "hosts-file-editor",
"description": "Анализирует, проверяет и форматирует записи файла hosts",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=hosts-file-editor",
"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": "hosts-file-editor",
"arguments": {
"hostsInput": "Enter hosts file content...\n\n127.0.0.1 localhost\n192.168.1.1 router.local\n# This is a comment\n10.0.0.1 server.example.com",
"outputFormat": "json",
"includeComments": true
}
}
}Вопросы или проблемы? Свяжитесь с [email protected]