Skip to main content
Glama
NZKea

akahu-mcp

by NZKea

list_accounts

Retrieve a list of your bank and depository accounts from Akahu. Data is cached for 24 hours; use force=True to fetch fresh data.

Instructions

List the user's bank/depository accounts (excludes Sharesight, which has its own tool). Cached for 24h; pass force=True to refresh from Akahu.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Tool registration via @mcp.tool() decorator — the 'list_accounts' tool is registered as a FastMCP tool on the 'akahu' server.
    @mcp.tool()
    async def list_accounts(force: bool = False) -> list[dict[str, Any]]:
        """List the user's bank/depository accounts (excludes Sharesight, which has
        its own tool). Cached for 24h; pass force=True to refresh from Akahu."""
        accounts = await sync.ensure_accounts_fresh(force=force)
        return [_trim_account(a) for a in accounts if not _is_sharesight(a)]
  • Handler function — 'list_accounts' async function that calls ensure_accounts_fresh, filters out Sharesight accounts via _is_sharesight, and trims each result via _trim_account.
    @mcp.tool()
    async def list_accounts(force: bool = False) -> list[dict[str, Any]]:
        """List the user's bank/depository accounts (excludes Sharesight, which has
        its own tool). Cached for 24h; pass force=True to refresh from Akahu."""
        accounts = await sync.ensure_accounts_fresh(force=force)
        return [_trim_account(a) for a in accounts if not _is_sharesight(a)]
  • Helper function — _trim_account reduces the raw account dict to a slimmed-down version with id, name, type, formatted_account, balance (current/available/currency), and connection name.
    def _trim_account(acc: dict[str, Any]) -> dict[str, Any]:
        """Return a slimmed-down account dict suitable for an LLM."""
        bal = acc.get("balance") or {}
        return {
            "id": acc["_id"],
            "name": acc.get("name"),
            "type": acc.get("type"),
            "formatted_account": acc.get("formatted_account"),
            "balance": {
                "current": bal.get("current"),
                "available": bal.get("available"),
                "currency": bal.get("currency"),
            },
            "connection": (acc.get("connection") or {}).get("name"),
        }
  • Helper function — _is_sharesight filters out Sharesight/investment accounts by checking name, connection name, and type for 'sharesight', 'investment', or 'wealth'.
    def _is_sharesight(acc: dict[str, Any]) -> bool:
        name = (acc.get("name") or "").lower()
        conn_name = ((acc.get("connection") or {}).get("name") or "").lower()
        acc_type = (acc.get("type") or "").lower()
        return (
            "sharesight" in name
            or "sharesight" in conn_name
            or acc_type in {"investment", "wealth"}
        )
  • Helper function — ensure_accounts_fresh checks the SQLite cache first (24h TTL), and if stale or force=True, fetches accounts from the Akahu API via AkahuClient.get_accounts() and stores them in cache.
    async def ensure_accounts_fresh(force: bool = False) -> list[dict[str, Any]]:
        """Return the account list, refreshing from Akahu if cache is stale or `force`."""
        cache.init_db()
        if not force:
            cached = cache.get_accounts_cached(DEFAULT_TTL_SECONDS)
            if cached is not None:
                return cached
        logger.info("Refreshing accounts from Akahu (force=%s)", force)
        client = AkahuClient()
        accounts = await client.get_accounts()
        cache.put_accounts(accounts)
        return accounts
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses caching (24h) and refresh mechanism (force=True), which is good for a read tool. It does not mention auth requirements or error cases, but the core behavior is transparent.

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?

Two sentences, front-loaded with purpose, then additional details. Every word earns its place, no fluff.

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

Completeness5/5

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

Given the output schema exists (context signal), the description needn't explain return values. It covers purpose, scope, caching, and parameter usage. For a list tool with one optional parameter, this is 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?

The input schema has 0% parameter description coverage, so the description compensates by explaining the 'force' parameter: pass force=True to refresh from Akahu. This provides necessary semantics beyond the schema.

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 lists 'bank/depository accounts' and explicitly excludes Sharesight, which is handled by a sibling tool. The verb 'list' and specific resource make the purpose unambiguous.

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 tells when to use (for bank/depository accounts) and excludes Sharesight. It also explains caching behavior and how to refresh with force=True. It could explicitly mention alternatives (e.g., get_share_holdings for Sharesight) but the exclusion is sufficient.

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/NZKea/akahu-mcp'

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