Format Conversion
Convert various text formats to XML with customizable structure and formatting options
Вызовите этот инструмент из своего кода на трёх языках.
curl -X POST 'https://api.elysiatools.com/ru/api/tools/text-to-xml' \
-H 'Content-Type: application/json' \
-d '{"textInput":"Enter your text data to convert to XML:\nname,age,city\nJohn,25,New York\nJane,30,London\n\nOr paste JSON, key-value pairs, or other formats...","inputFormat":"auto","rootElement":"root","rowElement":"item","includeDeclaration":true,"includeAttributes":false,"attributeName":"value","cdataSections":false,"escapeSpecialChars":true,"prettyPrint":true,"indentSize":"2","showStats":false}'Отправьте POST-запрос с входными данными в JSON. Параметры типа «файл» требуют предварительной загрузки.
POST https://api.elysiatools.com/ru/api/tools/text-to-xml| Имя | Тип | Обязательный | Описание |
|---|---|---|---|
| textInput | textarea | Да | — |
| inputFormat | select | Да | — |
| rootElement | text | Нет | — |
| rowElement | text | Нет | — |
| includeDeclaration | checkbox | Нет | — |
| includeAttributes |
Добавьте этот инструмент на свой сервер Model Context Protocol, чтобы ИИ-агенты могли перечислять и вызывать его.
Добавьте этот блок в конфигурацию вашего MCP-клиента:
{
"mcpServers": {
"elysiatools-text-to-xml": {
"name": "text-to-xml",
"description": "Convert various text formats to XML with customizable structure and formatting options",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=text-to-xml",
"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": "text-to-xml",
"arguments": {
"textInput": "Enter your text data to convert to XML:\nname,age,city\nJohn,25,New York\nJane,30,London\n\nOr paste JSON, key-value pairs, or other formats...",
"inputFormat": "auto",
"rootElement": "root",
"rowElement": "item",
"includeDeclaration": true,
"includeAttributes": false,
"attributeName": "value",
"cdataSections": false,
"escapeSpecialChars": true,
"prettyPrint": true,
"indentSize": "2",
"showStats": false
}
}
}| checkbox |
| Нет |
| — |
| attributeName | text | Нет | — |
| cdataSections | checkbox | Нет | — |
| escapeSpecialChars | checkbox | Нет | — |
| prettyPrint | checkbox | Нет | — |
| indentSize | number | Нет | — |
| showStats | checkbox | Нет | — |
Текстовый результат
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Вопросы или проблемы? Свяжитесь с [email protected]