get_top_merchants
Identify top merchants by total spending in a date range. Returns merchant name, total amount, transaction count, and monthly trend sparkline.
Instructions
Top N merchants by total spend in a date range. Returns merchant name, total amount, transaction count, and a sparkline of the monthly trend. Useful for 'who am I paying the most?'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start_date | No | ISO date. | |
| end_date | No | ISO date. | |
| limit | No | How many merchants to return (default 10). |
Implementation Reference
- tuskledger_mcp/server.py:286-289 (handler)Dispatch handler for get_top_merchants tool — sets default limit=10 and calls client.top_merchants().
if name == "get_top_merchants": params = {k: v for k, v in a.items() if v not in (None, "")} params.setdefault("limit", 10) return client.top_merchants(**params) - tuskledger_mcp/server.py:128-143 (schema)Tool registration/schema definition for get_top_merchants with inputSchema: start_date (string), end_date (string), limit (integer, default 10).
Tool( name="get_top_merchants", description=( "Top N merchants by total spend in a date range. Returns merchant " "name, total amount, transaction count, and a sparkline of the " "monthly trend. Useful for 'who am I paying the most?'." ), inputSchema={ "type": "object", "properties": { "start_date": {"type": "string", "description": "ISO date."}, "end_date": {"type": "string", "description": "ISO date."}, "limit": {"type": "integer", "description": "How many merchants to return (default 10)."}, }, "additionalProperties": False, }, - tuskledger_mcp/client.py:135-136 (helper)HTTP client method top_merchants — issues GET request to /api/analytics/top-merchants with provided filters.
def top_merchants(self, **filters) -> Any: return self._request("GET", "/api/analytics/top-merchants", params=filters)