Categories

Fill Array

Fill array with value from start to end index using lodash _.fill

**Fill Array Tool** This tool uses lodash `_.fill()` method to populate array elements with a specified value. **Features:** - Fill array elements with any value (string, number, boolean, object) - Specify start and end positions for partial filling - Parse values as JSON for proper type handling - Support for nested arrays and objects **Examples:** 1. **Basic fill:** - Input: `[1, 2, 3, 4, 5]` - Value: `*` - Start: `1`, End: `4` - Output: `[1, '*', '*', '*', 5]` 2. **Fill entire array:** - Input: `[null, null, null]` - Value: `"filled"` - Start: `0`, End: (leave empty) - Output: `["filled", "filled", "filled"]` 3. **With JSON parsing:** - Input: `[1, 2, 3]` - Value: `true` (with parseValueAsJSON checked) - Output: `[true, true, true]` (boolean, not string)

API Documentation

Request Endpoint

POST /en/api/tools/fill-array

Request Parameters

Parameter Name Type Required Description
array textarea Yes -
value text Yes -
start number No -
end number No -
parseValueAsJSON checkbox No -

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-fill-array": {
      "name": "fill-array",
      "description": "Fill array with value from start to end index using lodash _.fill",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=fill-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]