Skip to main content
Glama
BradMorphsters

tuskledger-mcp

query_transactions

Retrieve recent transactions with optional filters for account, category, or date range. Results are ordered by date, most recent first.

Instructions

List transactions matching optional filters. Returns the most recent matches first. Common filter combos: • account_id + start_date + end_date → 'all transactions in my checking account this month' • category='Coffee' + start_date='2026-01-01' → 'every coffee purchase since New Year' Defaults to no filter (returns the most recent 100 transactions across all accounts).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idNoFilter to a single account by id.
categoryNoFilter to a single category name (exact match).
start_dateNoISO date YYYY-MM-DD; inclusive lower bound.
end_dateNoISO date YYYY-MM-DD; inclusive upper bound.
limitNoMax rows to return (default 100, max 500).

Implementation Reference

  • Dispatch branch for query_transactions: filters out None/empty params, sets default limit=100, and delegates to client.list_transactions().
    if name == "query_transactions":
        # Trim None / missing keys so we don't send empty params
        params = {k: v for k, v in a.items() if v not in (None, "")}
        params.setdefault("limit", 100)
        return client.list_transactions(**params)
  • client.list_transactions – HTTP GET to /api/transactions/ with optional query params (account_id, category, start_date, end_date, limit).
    def list_transactions(self, **filters) -> list[dict]:
        # Backend accepts standard query params: account_id, category,
        # start_date, end_date, limit, offset, etc. Pass through.
        return self._request("GET", "/api/transactions/", params=filters)
  • Tool definition with name='query_transactions', description, and inputSchema (account_id, category, start_date, end_date, limit).
    Tool(
        name="query_transactions",
        description=(
            "List transactions matching optional filters. Returns the most "
            "recent matches first. Common filter combos:\n"
            "  • account_id + start_date + end_date  → 'all transactions in "
            "    my checking account this month'\n"
            "  • category='Coffee' + start_date='2026-01-01'  → 'every "
            "    coffee purchase since New Year'\n"
            "Defaults to no filter (returns the most recent 100 transactions "
            "across all accounts)."
        ),
        inputSchema={
            "type": "object",
            "properties": {
                "account_id": {"type": "integer", "description": "Filter to a single account by id."},
                "category":   {"type": "string",  "description": "Filter to a single category name (exact match)."},
                "start_date": {"type": "string",  "description": "ISO date YYYY-MM-DD; inclusive lower bound."},
                "end_date":   {"type": "string",  "description": "ISO date YYYY-MM-DD; inclusive upper bound."},
                "limit":      {"type": "integer", "description": "Max rows to return (default 100, max 500)."},
            },
            "additionalProperties": False,
        },
    ),
  • TOOLS list used in list_tools() handler; query_transactions is registered as one of the available MCP tools.
    TOOLS: list[Tool] = [
        Tool(
            name="list_accounts",
            description=(
                "List every connected account in Tusk Ledger with current "
                "balance, type (checking, savings, credit, investment, loan), "
                "and last-sync timestamp. Use this first to understand what "
                "accounts exist before drilling into transactions or holdings."
            ),
            inputSchema={"type": "object", "properties": {}, "additionalProperties": False},
        ),
        Tool(
            name="list_stale_accounts",
            description=(
                "Return accounts whose data is older than the freshness "
                "threshold (a week for synced accounts, a month for manual). "
                "Useful when the user asks 'why is my net worth wrong?' — "
                "stale balances are usually the cause."
            ),
            inputSchema={"type": "object", "properties": {}, "additionalProperties": False},
        ),
        Tool(
            name="query_transactions",
            description=(
                "List transactions matching optional filters. Returns the most "
                "recent matches first. Common filter combos:\n"
                "  • account_id + start_date + end_date  → 'all transactions in "
                "    my checking account this month'\n"
                "  • category='Coffee' + start_date='2026-01-01'  → 'every "
                "    coffee purchase since New Year'\n"
                "Defaults to no filter (returns the most recent 100 transactions "
                "across all accounts)."
            ),
            inputSchema={
                "type": "object",
                "properties": {
                    "account_id": {"type": "integer", "description": "Filter to a single account by id."},
                    "category":   {"type": "string",  "description": "Filter to a single category name (exact match)."},
                    "start_date": {"type": "string",  "description": "ISO date YYYY-MM-DD; inclusive lower bound."},
                    "end_date":   {"type": "string",  "description": "ISO date YYYY-MM-DD; inclusive upper bound."},
                    "limit":      {"type": "integer", "description": "Max rows to return (default 100, max 500)."},
                },
                "additionalProperties": False,
            },
        ),
        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,
            },
        ),
        Tool(
            name="get_spending_summary",
            description=(
                "Aggregated spending totals broken down by category for a date "
                "range. Returns totals + per-category subtotals + counts. "
                "Defaults to the current calendar month if no dates given."
            ),
            inputSchema={
                "type": "object",
                "properties": {
                    "start_date":    {"type": "string", "description": "ISO date YYYY-MM-DD."},
                    "end_date":      {"type": "string", "description": "ISO date YYYY-MM-DD."},
                    "exclude_business": {"type": "boolean", "description": "Drop transactions tagged as business (default false)."},
                },
                "additionalProperties": False,
            },
        ),
        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,
            },
        ),
        Tool(
            name="get_recurring_subscriptions",
            description=(
                "List detected recurring subscriptions: Netflix, Spotify, gym, "
                "etc. Returns merchant, cadence (monthly/annual/etc.), last "
                "amount, next expected date, and confidence. The user often "
                "asks 'what subscriptions do I have' — this answers it."
            ),
            inputSchema={"type": "object", "properties": {}, "additionalProperties": False},
        ),
        Tool(
            name="get_upcoming_bills",
            description=(
                "Forward 30-day calendar of expected bills + paychecks with a "
                "running balance. Returns each event's date, amount, source "
                "(merchant or paycheck), and the projected account balance "
                "after that event. Useful for 'is my account going to dip "
                "before payday?'."
            ),
            inputSchema={
                "type": "object",
                "properties": {
                    "days": {"type": "integer", "description": "How many days forward to look (default 30)."},
                },
                "additionalProperties": False,
            },
        ),
        Tool(
            name="get_net_worth",
            description=(
                "Current net worth (assets minus liabilities) plus a 12-month "
                "trend. Numbers are point-in-time from the last sync, not "
                "live-computed. Use list_stale_accounts to verify freshness."
            ),
            inputSchema={
                "type": "object",
                "properties": {
                    "history": {"type": "boolean", "description": "If true, return the full snapshot history instead of just latest."},
                },
                "additionalProperties": False,
            },
        ),
        Tool(
            name="get_holdings",
            description=(
                "Current investment holdings across every connected brokerage "
                "and 401(k). Returns symbol, account, quantity, current value, "
                "and unrealized gain/loss per position."
            ),
            inputSchema={"type": "object", "properties": {}, "additionalProperties": False},
        ),
        Tool(
            name="get_investments_summary",
            description=(
                "Roll-up of investment portfolio: total value, asset allocation "
                "(stocks/bonds/cash), top 5 holdings, % YTD gain. The 'how are "
                "my investments doing?' answer."
            ),
            inputSchema={"type": "object", "properties": {}, "additionalProperties": False},
        ),
        Tool(
            name="get_retirement_projection",
            description=(
                "Run the multi-decade Monte Carlo retirement simulator. Returns "
                "probability of success, depletion age, and summary at key "
                "milestones (retirement, age 73 for RMDs, etc.).\n\n"
                "Caveat: scenarios live in the Tusk Ledger UI's localStorage on "
                "the device the user last edited from — they aren't accessible "
                "to this tool. So the user (or their assistant) must supply at "
                "least current_age. Other params accept sensible defaults that "
                "match the standard 4% rule scenario; pass any you know to "
                "tighten the projection. To pull a saved scenario verbatim, the "
                "user can copy it out of the Retirement page in the UI and "
                "paste the values into the assistant's prompt."
            ),
            inputSchema={
                "type": "object",
                "required": ["current_age"],
                "properties": {
                    "current_age":           {"type": "integer", "description": "User's current age. Required."},
                    "retirement_age":        {"type": "integer", "description": "Target retirement age (default 65)."},
                    "spouse_age":            {"type": "integer", "description": "Spouse's current age. Optional — enables two-phase simulation when paired with spouse_retirement_age."},
                    "spouse_retirement_age": {"type": "integer", "description": "Age at which the spouse retires (in spouse's years)."},
                    "desired_annual_income": {"type": "number",  "description": "Target annual spending in retirement, today's dollars (default 80000)."},
                    "annual_contribution":   {"type": "number",  "description": "Annual contribution. Omit to auto-detect from last 12mo of investment-account inflows."},
                    "return_rate":           {"type": "number",  "description": "Real annual return during accumulation (default 0.06 = 6%)."},
                    "withdrawal_rate":       {"type": "number",  "description": "Safe withdrawal rate (default 0.04 = the 4% rule)."},
                    "pension_annual":        {"type": "number",  "description": "Annual pension income, today's dollars."},
                    "ss_annual":             {"type": "number",  "description": "Annual Social Security at the user's claim age."},
                    "ss_start_age":          {"type": "integer", "description": "Age at which to claim SS (62–70, default 67)."},
                    "inflation_rate":        {"type": "number",  "description": "Long-run inflation assumption (default 0.025)."},
                },
                "additionalProperties": False,
            },
        ),
        Tool(
            name="run_sync",
            description=(
                "Trigger a Plaid sync across all connected items. Same as "
                "clicking 'Sync Now' in the UI. Returns a summary of what was "
                "fetched (accounts updated, transactions added). Safe to call "
                "freely — Plaid dedupes."
            ),
            inputSchema={"type": "object", "properties": {}, "additionalProperties": False},
        ),
    ]
  • Test verifying dispatch strips empty strings/None and applies default limit=100 for query_transactions.
    def test_dispatch_query_transactions_strips_empty_params():
        client = MagicMock()
        srv._dispatch("query_transactions", {
            "account_id": 5,
            "category": "",            # empty string → drop
            "start_date": None,         # None → drop
            "end_date": "2026-01-01",
        }, client)
        # Should call with limit defaulted, no empty-string or None values
        call = client.list_transactions.call_args
        kwargs = call.kwargs
        assert kwargs.get("account_id") == 5
        assert kwargs.get("end_date") == "2026-01-01"
        assert "category" not in kwargs
        assert "start_date" not in kwargs
        assert kwargs.get("limit") == 100  # default applied
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description covers default ordering, default limit, and common use cases. It does not disclose any potential side effects, authentication needs, rate limits, or the exact structure of returned data, but the behavioral context given is adequate for basic usage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the main purpose and uses bullet-like examples efficiently. Each sentence contributes meaning, though the examples could be slightly condensed without losing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 5 parameters with full schema coverage, no output schema, and no annotations, the description covers ordering, filtering combos, defaults, and limits. It does not detail the return format, but for a list tool this is a minor gap; overall it is fairly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 100% schema coverage, the description adds significant value by providing example combos (e.g., account_id + start_date + end_date) and clarifying defaults (limit default 100, max 500). This contextualizes parameters beyond the schema's standalone descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists transactions matching optional filters and returns the most recent first. It distinguishes from siblings by focusing on filtering and ordering, though it does not explicitly contrast with the similar-sounding 'search_transactions'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides common filter combinations and default behavior (no filter returns 100 recent transactions across all accounts). However, it lacks explicit guidance on when not to use this tool or alternatives (e.g., search_transactions for more complex queries), leaving usage implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/BradMorphsters/tuskledger-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server