Sorted Index
Find the insertion index in a sorted array using lodash _.sortedIndex
Return the index where a value should be inserted to keep an array sorted.
**Highlights:**
- Uses lodash `_.sortedIndex`
- Works with sorted JSON arrays
- Returns the insertion index as text
**Example:**
- Array: `[10, 20, 30]`
- Value: `25`
- Result: `2`
API Documentation
Request Endpoint
POST /en/api/tools/sorted-index
Request Parameters
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| array | textarea | Yes | Enter a sorted JSON array |
| value | text | Yes | Value to insert (JSON or plain text) |
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-sorted-index": {
"name": "sorted-index",
"description": "Find the insertion index in a sorted array using lodash _.sortedIndex",
"baseUrl": "https://elysiatools.com/mcp/sse?toolId=sorted-index",
"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]