Flatten Deep Array
Flatten array completely using lodash _.flattenDeep
Recursively flatten an array to completely eliminate all nesting.
## Features:
- Accepts deeply nested JSON arrays of any depth
- Recursively flattens all levels of nesting
- Produces a single-level array
- Handles arrays with mixed data types
- Uses lodash _.flattenDeep for complete flattening
## Examples:
- Input: [1, [2, [3, [4]]], 5] → Output: [1, 2, 3, 4, 5]
- Input: [[["a", "b"], ["c", "d"]], ["e", "f"]] → Output: ["a", "b", "c", "d", "e", "f"]
- Input: [1, [2, [3, [4, [5]]]]] → Output: [1, 2, 3, 4, 5]
## Use Cases:
- **Deep Data Extraction**: Extract all elements from deeply nested structures
- **Data Normalization**: Convert complex nested arrays to simple lists
- **Search Operations**: Flatten data for easier searching and filtering
- **Array Manipulation**: Prepare data for algorithms that require flat arrays
API Documentation
Request Endpoint
POST /en/api/tools/flatten-deep-array
Request Parameters
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| array | textarea | Yes | Enter a valid JSON array with deeply nested elements |
Response Format
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}
Text:
Text
AI MCP Documentation
Add this tool to your MCP server configuration:
{
"mcpServers": {
"elysiatools-flatten-deep-array": {
"name": "flatten-deep-array",
"description": "Flatten array completely using lodash _.flattenDeep",
"baseUrl": "https://elysiatools.com/mcp/sse?toolId=flatten-deep-array",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}
You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.
If you encounter any issues, please contact us at [email protected]