Data Processing
Преобразует выровненные пары ключ-значение обратно во вложенные JSON-объекты с поддержкой различных форматов ключей
Вызовите этот инструмент из своего кода на трёх языках.
curl -X POST 'https://api.elysiatools.com/ru/api/tools/json-unflattener' \
-H 'Content-Type: application/json' \
-d '{"dataInput":"{\n \"user.name\": \"John\",\n \"user.age\": \"30\",\n \"user.city\": \"New York\",\n \"settings.theme\": \"dark\",\n \"settings.notifications\": \"true\"\n}","inputFormat":"json","keyFormat":"nested","delimiter":".","typeInference":"auto","arrayMode":"numeric","mergeStrategy":"override","preserveEmpty":true}'Отправьте POST-запрос с входными данными в JSON. Параметры типа «файл» требуют предварительной загрузки.
POST https://api.elysiatools.com/ru/api/tools/json-unflattener| Имя | Тип | Обязательный | Описание |
|---|---|---|---|
| dataInput | textarea | Да | — |
| inputFormat | select | Да | — |
| keyFormat | select | Да | — |
| delimiter | text | Нет | — |
| typeInference | select | Да | — |
| arrayMode |
Добавьте этот инструмент на свой сервер Model Context Protocol, чтобы ИИ-агенты могли перечислять и вызывать его.
Добавьте этот блок в конфигурацию вашего MCP-клиента:
{
"mcpServers": {
"elysiatools-json-unflattener": {
"name": "json-unflattener",
"description": "Преобразует выровненные пары ключ-значение обратно во вложенные JSON-объекты с поддержкой различных форматов ключей",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=json-unflattener",
"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": "json-unflattener",
"arguments": {
"dataInput": "{\n \"user.name\": \"John\",\n \"user.age\": \"30\",\n \"user.city\": \"New York\",\n \"settings.theme\": \"dark\",\n \"settings.notifications\": \"true\"\n}",
"inputFormat": "json",
"keyFormat": "nested",
"delimiter": ".",
"typeInference": "auto",
"arrayMode": "numeric",
"mergeStrategy": "override",
"preserveEmpty": true
}
}
}| select |
| Да |
| — |
| mergeStrategy | select | Да | — |
| preserveEmpty | checkbox | Нет | — |
JSON-результат
{
"key": {...},
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}Вопросы или проблемы? Свяжитесь с [email protected]