Skip to main content
Glama
BradMorphsters

tuskledger-mcp

get_upcoming_bills

Retrieve a 30-day forecast of upcoming bills and paychecks with running balance to check if your account will dip before payday.

Instructions

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?'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoHow many days forward to look (default 30).

Implementation Reference

  • Tool definition (schema) for 'get_upcoming_bills': registers the MCP tool with name, description, and input schema (optional 'days' integer parameter). Included in the TOOLS list that is returned by list_tools().
    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 handler (dispatcher) for 'get_upcoming_bills' in _dispatch(): calls client.upcoming_bills() passing the 'days' argument from the caller (if provided).
    if name == "get_upcoming_bills":
        return client.upcoming_bills(**{k: v for k, v in a.items() if v not in (None, "")})
  • HTTP client helper method 'upcoming_bills' that sends a GET request to '/api/bills/upcoming' with optional query params (e.g., 'days'), returning a list of dicts.
    # bills
    def upcoming_bills(self, **params) -> list[dict]:
        return self._request("GET", "/api/bills/upcoming", params=params)
  • Server wiring in build_server() where list_tools() and call_tool() are registered as MCP handlers; the latter calls _dispatch() which routes to the get_upcoming_bills handler.
    @server.list_tools()
    async def list_tools() -> list[Tool]:
        return TOOLS
    
    @server.call_tool()
    async def call_tool(name: str, arguments: dict) -> list[TextContent]:
        log.info("tool call: %s args=%s", name, list((arguments or {}).keys()))
        try:
            # The HTTP calls are blocking; offload to a thread so we don't
            # stall the event loop. Backend is on localhost so latency is
            # tiny but doing this correctly keeps the door open for
            # async-aware tools later.
            payload = await asyncio.to_thread(_dispatch, name, arguments, cli)
            return [TextContent(type="text", text=_format_result(payload))]
        except TuskLedgerError as e:
            # Surface the error in a way the assistant can show the user.
            err_payload = {
                "error": True,
                "message": str(e),
                "status": e.status,
                "body": e.body,
                "hint": (
                    "If the backend is unreachable, run `./start.sh` from the "
                    "repo root. If the endpoint returned 404 or 500, run "
                    "`./tuskledger doctor --json` for a structured health check."
                ),
            }
            return [TextContent(type="text", text=_format_result(err_payload))]
        except Exception as e:  # pylint: disable=broad-except
            log.exception("tool %s crashed", name)
            err_payload = {
                "error": True,
                "message": f"Unexpected error in {name!r}: {type(e).__name__}: {e}",
                "hint": "Likely a bug in tuskledger-mcp; please file an issue.",
            }
            return [TextContent(type="text", text=_format_result(err_payload))]
    
    return server
Behavior4/5

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

Without annotations, the description carries the full burden. It discloses the output in detail (date, amount, source, projected balance) and implies read-only behavior. It could be improved by mentioning any prerequisites like synced accounts.

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

Conciseness5/5

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

The description is two sentences, front-loading the main functionality and ending with a practical use case. Every sentence adds value with no wasted words.

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 the tool's simplicity (one parameter, no output schema), the description adequately covers what the tool does and returns. It addresses a common user question, leaving minimal gaps in understanding.

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

Parameters3/5

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

Schema coverage is 100% with a clear description for the single parameter 'days'. The description adds little beyond the schema's parameter description, so a baseline score of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the tool returns a forward 30-day calendar of expected bills and paychecks with a running balance. It specifies the verb ('returns') and the resource ('calendar of expected bills + paychecks'), distinguishing it from siblings like get_recurring_subscriptions or query_transactions.

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

Usage Guidelines4/5

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

The description provides a clear use case: 'is my account going to dip before payday?'. However, it does not explicitly mention when not to use this tool or suggest alternatives among the siblings.

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