Development
Count occurrences of specific elements in arrays with support for multiple counting modes and statistical analysis
Call this tool from your code in three languages.
curl -X POST 'https://api.elysiatools.com/en/api/tools/array-element-counter' \
-H 'Content-Type: application/json' \
-d '{"arrayInput":"Enter array elements separated by delimiter...\napple, banana, apple, orange, banana, apple","countMode":"all","targetElements":"Enter elements to count (comma-separated)","delimiter":"comma","customDelimiter":"Enter custom delimiter","sortBy":"count-desc","outputFormat":"table","caseSensitive":false,"includeStats":true}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/array-element-counter| Name | Type | Required | Description |
|---|---|---|---|
| arrayInput | textarea | Yes | — |
| countMode | select | Yes | — |
| targetElements | text | No | — |
| delimiter | select | Yes | — |
| customDelimiter | text | No | — |
| sortBy |
Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-array-element-counter": {
"name": "array-element-counter",
"description": "Count occurrences of specific elements in arrays with support for multiple counting modes and statistical analysis",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=array-element-counter",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "array-element-counter",
"arguments": {
"arrayInput": "Enter array elements separated by delimiter...\napple, banana, apple, orange, banana, apple",
"countMode": "all",
"targetElements": "Enter elements to count (comma-separated)",
"delimiter": "comma",
"customDelimiter": "Enter custom delimiter",
"sortBy": "count-desc",
"outputFormat": "table",
"caseSensitive": false,
"includeStats": true
}
}
}| select |
| Yes |
| — |
| outputFormat | select | Yes | — |
| caseSensitive | checkbox | No | — |
| includeStats | checkbox | No | — |
Text result
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Questions or issues? Contact [email protected]