search_transactions
Find transactions by searching partial or full words in names, merchants, and notes. Use for fuzzy recall when dates or amounts are unknown.
Instructions
Free-text search across transaction names, merchant names, and notes. Use when the user asks 'find that Whole Foods charge from last week' or 'when did I last pay Verizon?'. Different from query_transactions in that this is a fuzzy text search, not a structured filter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Search string. Matches partial words, case-insensitive. | |
| limit | No | Max rows (default 50). |
Implementation Reference
- tuskledger_mcp/client.py:118-123 (handler)The actual HTTP call for search_transactions — makes a GET to /api/transactions/search with the query string and limit params.
def search_transactions(self, q: str, limit: int = 50) -> Any: return self._request( "GET", "/api/transactions/search", params={"q": q, "limit": limit}, ) - tuskledger_mcp/server.py:92-110 (schema)Tool definition/registration in the TOOLS list — defines name, description, and JSON Schema input for search_transactions.
Tool( name="search_transactions", description=( "Free-text search across transaction names, merchant names, and " "notes. Use when the user asks 'find that Whole Foods charge " "from last week' or 'when did I last pay Verizon?'. Different " "from query_transactions in that this is a fuzzy text search, " "not a structured filter." ), inputSchema={ "type": "object", "required": ["q"], "properties": { "q": {"type": "string", "description": "Search string. Matches partial words, case-insensitive."}, "limit": {"type": "integer", "description": "Max rows (default 50)."}, }, "additionalProperties": False, }, ), - tuskledger_mcp/server.py:281-282 (registration)Dispatch branch that routes the 'search_transactions' tool name to the client method, extracting required 'q' and optional 'limit' from arguments.
if name == "search_transactions": return client.search_transactions(q=a["q"], limit=a.get("limit", 50)) - tuskledger_mcp/server.py:92-93 (registration)The Tool object itself is part of the TOOLS list which is registered via server.list_tools() returning the list.
Tool( name="search_transactions", - tests/test_server.py:96-99 (helper)Test that confirms missing required 'q' argument raises a KeyError, validating the dispatch logic.
def test_dispatch_search_transactions_requires_q(): client = MagicMock() with pytest.raises(KeyError): srv._dispatch("search_transactions", {}, client)