Skip to main content
Glama
JosueM1109

personal-finance-mcp

Get Investment Holdings

get_investment_holdings
Read-only

Retrieve investment holdings with security metadata and institution data from all linked accounts.

Instructions

Return investment holdings with security metadata across all linked Items.

Joins holdings with the securities list returned in the same response to provide symbol, name, and security type. Adds institution to each holding.

Returns: {"holdings": [...], "warnings": [...]}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler for get_investment_holdings. Iterates over all linked items, calls Plaid's investments_holdings_get API, enriches each holding with security metadata via shape_holding, and adds institution name.
    def _get_investment_holdings_impl() -> dict:
        """Return investment holdings with security metadata across all linked Items.
    
        Joins holdings with the securities list returned in the same response to
        provide symbol, name, and security type. Adds institution to each holding.
    
        Returns:
            {"holdings": [...], "warnings": [...]}
        """
        api = build_api()
        holdings: list[dict] = []
        warnings: list[dict] = []
        for env_key, token, health in all_items(api):
            if health.status != "healthy":
                warnings.append(_warning_from_health(health))
                continue
            try:
                resp = api.investments_holdings_get(
                    InvestmentsHoldingsGetRequest(access_token=token.reveal())
                ).to_dict()
                secs_by_id = {s["security_id"]: s for s in resp.get("securities", []) or []}
                for h in resp.get("holdings", []) or []:
                    shaped = shape_holding(h, secs_by_id)
                    shaped["institution"] = health.institution_name
                    holdings.append(shaped)
            except ApiException as e:
                mapped = map_plaid_error(e, health.institution_name)["error"]
                warnings.append({"institution": health.institution_name, **mapped})
        return {"holdings": holdings, "warnings": warnings}
  • server.py:368-371 (registration)
    Tool registration using FastMCP's mcp.tool decorator with readOnlyHint annotation and name 'get_investment_holdings', wrapping _get_investment_holdings_impl.
    get_investment_holdings = mcp.tool(
        annotations={"readOnlyHint": True, "title": "Get Investment Holdings"},
        name="get_investment_holdings",
    )(_get_investment_holdings_impl)
  • Helper function shape_holding that joins a raw Plaid holding dict with security metadata (symbol, name, type) and renames fields (e.g., institution_value -> market_value).
    def shape_holding(raw_holding: dict, securities: dict[str, dict]) -> dict:
        """Shape a raw Plaid holding dict, joining with security data.
    
        - Looks up security metadata (symbol, name, type) by security_id.
        - Flattens institution_value -> market_value, institution_price -> price.
        - Handles missing security gracefully (returns None for symbol/name/type).
        """
        sec = securities.get(raw_holding.get("security_id"), {})
        return {
            "account_id": raw_holding.get("account_id"),
            "symbol": sec.get("ticker_symbol"),
            "name": sec.get("name"),
            "type": sec.get("type"),
            "quantity": raw_holding.get("quantity"),
            "cost_basis": raw_holding.get("cost_basis"),
            "market_value": raw_holding.get("institution_value"),
            "price": raw_holding.get("institution_price"),
            "currency": raw_holding.get("iso_currency_code"),
        }
  • Imports InvestmentsHoldingsGetRequest from Plaid SDK, used by the handler to build the API request.
    from plaid.model.investments_holdings_get_request import InvestmentsHoldingsGetRequest
  • Imports shape_holding helper and other utilities from plaid_client module used by the handler.
    from plaid_client import (
        ItemHealth,
        all_items,
        build_api,
        map_plaid_error,
        shape_account,
        shape_holding,
        shape_transaction,
    )
Behavior4/5

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

Annotations already declare readOnlyHint=true. Description adds value by explaining that it joins holdings with securities and adds institution info, providing context beyond the annotation.

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?

Three sentences plus a return format line. Every sentence is informative and no words are wasted. Front-loaded with the core action.

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 no parameters and presence of output schema, description is complete. It explains the join operation and the return structure (holdings, warnings), sufficient for agent understanding.

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?

No parameters defined, so baseline is 4. Description does not need to add parameter details, and it appropriately mentions what the tool returns.

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?

Description clearly states verb 'Return' and resource 'investment holdings'. It specifies joining with securities list and adding institution. However, it does not explicitly distinguish from sibling tools like get_investment_transactions, but the name and context imply the difference.

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?

No explicit guidance on when to use vs alternatives. Usage is implied by the tool's name and description, but lacks when-not or alternative suggestions.

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/JosueM1109/personal-finance-mcp'

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