Skip to main content
Glama
NZKea

akahu-mcp

by NZKea

get_share_holdings

Retrieve your Sharesight investment portfolio details including total value, returns breakdown, and per-holding information like symbol, shares, and value.

Instructions

Return the user's Sharesight investment portfolio: total value, breakdown (returns / capital / currency / dividends) and the per-holding list (symbol, shares, value, returns).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The get_share_holdings tool handler: fetches fresh accounts from Akahu, finds the Sharesight account (by name/connection/type), and returns the investment portfolio data (total value, breakdown, per-holding list) from the account's balance and meta fields.
    @mcp.tool()
    async def get_share_holdings(force: bool = False) -> dict[str, Any]:
        """Return the user's Sharesight investment portfolio: total value,
        breakdown (returns / capital / currency / dividends) and the per-holding
        list (symbol, shares, value, returns)."""
        accounts = await sync.ensure_accounts_fresh(force=force)
        sharesight = next((a for a in accounts if _is_sharesight(a)), None)
        if sharesight is None:
            return {"error": "No Sharesight account found in your Akahu connections"}
        meta = sharesight.get("meta") or {}
        bal = sharesight.get("balance") or {}
        return {
            "account_id": sharesight["_id"],
            "account_name": sharesight.get("name"),
            "total_value": bal.get("current"),
            "currency": bal.get("currency"),
            "breakdown": meta.get("breakdown") or {},
            "portfolio": meta.get("portfolio") or [],
        }
  • The @mcp.tool() decorator registers get_share_holdings as a tool with the FastMCP server, making it available via stdio transport.
    @mcp.tool()
  • Helper function used by get_share_holdings to identify the Sharesight account among the user's accounts by checking if the name, connection name, or type matches Sharesight-related values.
    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"}
        )
  • Called by get_share_holdings to get the account list (from cache or fresh from Akahu API), which is then filtered to find the Sharesight account.
    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
Behavior3/5

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

No annotations are present, so the description carries the full burden. It states 'Return', implying read-only, and details the output data. However, it does not mention authentication needs, rate limits, or potential side effects, leaving some gaps for a read operation.

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 a single sentence that efficiently front-loads the main purpose and key outputs. No unnecessary words.

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

Completeness3/5

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

The description covers the main outputs sufficiently, and the existence of an output schema covers return value details. However, the 'force' parameter is completely undocumented, making the total context incomplete for a tool with one parameter.

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

Parameters1/5

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

The only parameter 'force' has 0% schema description coverage and is not mentioned in the tool description. The description adds no meaning beyond the default value in 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 returns the user's Sharesight investment portfolio with specific breakdowns including total value, returns, capital, currency, dividends, and per-holding list. It is a specific verb-resource combination and distinct from sibling tools list_accounts and list_transactions.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives (list_accounts, list_transactions). No explicit context, prerequisites, or exclusions are provided.

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