Data Processing
Convert flattened key-value pairs back to nested JSON objects with support for different key formats and data type inference
Chame esta ferramenta a partir do seu código em três idiomas.
curl -X POST 'https://api.elysiatools.com/pt/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}'Envie uma requisição POST com suas entradas em JSON. Parâmetros do tipo arquivo exigem upload prévio.
POST https://api.elysiatools.com/pt/api/tools/json-unflattener| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| dataInput | textarea | Sim | — |
| inputFormat | select | Sim | — |
| keyFormat | select | Sim | — |
| delimiter | text | Não | — |
| typeInference | select | Sim | — |
| arrayMode |
Adicione esta ferramenta ao seu servidor Model Context Protocol para que agentes de IA possam listá-la e chamá-la.
Adicione este bloco à configuração do seu cliente MCP:
{
"mcpServers": {
"elysiatools-json-unflattener": {
"name": "json-unflattener",
"description": "Convert flattened key-value pairs back to nested JSON objects with support for different key formats and data type inference",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=json-unflattener",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Após conectar ao endpoint SSE, liste as ferramentas expostas:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoque a ferramenta pelo seu id; os argumentos são construídos a partir de seus parâmetros:
{
"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 |
| Sim |
| — |
| mergeStrategy | select | Sim | — |
| preserveEmpty | checkbox | Não | — |
Resultado JSON
{
"key": {...},
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}Dúvidas ou problemas? Contate [email protected]