Categories

Count By

Count items by a derived key using lodash _.countBy

Count items by a derived key from a collection. **Highlights:** - Uses lodash `_.countBy` - Accepts JSON arrays or objects - Supports identity or property/path iteratees **Example:** - Collection: `[{"type":"a"},{"type":"b"},{"type":"a"}]` - Iteratee: `type` - Result: `{"a":2,"b":1}`

Enter a JSON array or object

Property name or path when using property iteratee

API Documentation

Request Endpoint

POST /en/api/tools/count-by

Request Parameters

Parameter Name Type Required Description
collection textarea Yes Enter a JSON array or object
iterateeType select No -
iteratee text No Property name or path when using property iteratee

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-count-by": {
      "name": "count-by",
      "description": "Count items by a derived key using lodash _.countBy",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=count-by",
      "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]