一键导入
plaid-investment-tracking
Track investment holdings, securities, and transactions using the Plaid Investments product. Covers holdings retrieval, security details, cost basis, and supported brokerages.
菜单
Track investment holdings, securities, and transactions using the Plaid Investments product. Covers holdings retrieval, security details, cost basis, and supported brokerages.
Verify bank accounts using Plaid Auth, micro-deposits, same-day micro-deposits, and database match. Use when the user needs account and routing numbers or ACH payment verification.
Search and retrieve Plaid API endpoint documentation including parameters, authentication requirements, response shapes, and rate limits. Use when the user needs to call a Plaid API or wants to know available endpoints.
Map Plaid personal finance categories to your application's taxonomy. Covers the primary/detailed hierarchy, building custom mapping layers, and common category use cases. Use when the user needs to categorize or display transaction categories.
Detect, classify, and recover from Plaid API errors including ITEM_LOGIN_REQUIRED, INVALID_CREDENTIALS, INSTITUTION_NOT_RESPONDING, rate limits, and network failures. Use when the user needs to handle Plaid errors gracefully.
Implement Plaid Identity and Identity Verification products for KYC flows, document verification, and match scores. Use when the user needs to verify account holder identity.
Search Plaid institutions by name, routing number, products supported, and country. Use when the user needs to find bank coverage, check institution availability, or look up institution details.
| name | plaid-investment-tracking |
| description | Track investment holdings, securities, and transactions using the Plaid Investments product. Covers holdings retrieval, security details, cost basis, and supported brokerages. |
| standards-version | 1.10.0 |
Use this skill when the user:
investments productConnect a brokerage account. Request the investments product during Link:
const tokenResponse = await plaidClient.linkTokenCreate({
user: { client_user_id: uniqueUserId },
client_name: "My App",
products: [Products.Investments],
country_codes: [CountryCode.Us],
language: "en",
});
Fetch holdings. Returns all current positions across accounts:
const response = await plaidClient.investmentsHoldingsGet({
access_token: accessToken,
});
// response.data.holdings - array of positions
// response.data.securities - details for each security
// response.data.accounts - investment accounts with balances
for (const holding of response.data.holdings) {
const security = response.data.securities.find(
(s) => s.security_id === holding.security_id,
);
console.log(
`${security?.ticker_symbol ?? security?.name}: ` +
`${holding.quantity} shares @ $${holding.institution_price} = $${holding.institution_value}`,
);
}
Security types. Each security has a type field:
| Type | Description | Example |
|---|---|---|
equity | Individual stocks | AAPL, MSFT |
etf | Exchange-traded funds | SPY, VTI |
mutual fund | Mutual funds | VFIAX |
fixed income | Bonds and treasuries | US Treasury |
option | Options contracts | AAPL 150C |
cryptocurrency | Crypto holdings | BTC, ETH |
cash | Cash and money market | Settlement fund |
derivative | Derivatives | Futures, swaps |
Investment transactions. Fetch buy, sell, dividend, and fee activity:
const txResponse = await plaidClient.investmentsTransactionsGet({
access_token: accessToken,
start_date: "2025-01-01",
end_date: "2026-04-01",
});
for (const tx of txResponse.data.investment_transactions) {
// tx.type: "buy" | "sell" | "dividend" | "cash" | "transfer" | "fee"
// tx.amount - positive for outflows (buys), negative for inflows (dividends)
// tx.quantity, tx.price, tx.security_id
console.log(`${tx.type}: ${tx.name} - $${tx.amount}`);
}
Pagination: if total_investment_transactions > investment_transactions.length, use offset and count to page through results.
Portfolio aggregation. Combine holdings across multiple items (brokerages):
const allHoldings: Map<string, { quantity: number; value: number }> = new Map();
for (const accessToken of userAccessTokens) {
const response = await plaidClient.investmentsHoldingsGet({
access_token: accessToken,
});
for (const holding of response.data.holdings) {
const security = response.data.securities.find(
(s) => s.security_id === holding.security_id,
);
const key = security?.ticker_symbol ?? security?.security_id ?? "unknown";
const existing = allHoldings.get(key) ?? { quantity: 0, value: 0 };
allHoldings.set(key, {
quantity: existing.quantity + holding.quantity,
value: existing.value + (holding.institution_value ?? 0),
});
}
}
Cost basis and gain/loss. When available, holdings include cost_basis:
for (const holding of response.data.holdings) {
if (holding.cost_basis != null && holding.institution_value != null) {
const gainLoss = holding.institution_value - holding.cost_basis;
const pct = ((gainLoss / holding.cost_basis) * 100).toFixed(2);
console.log(
`Gain/Loss: $${gainLoss.toFixed(2)} (${pct}%)`,
);
}
}
Not all brokerages provide cost basis. Check for null before calculating.
Major brokerages supported by Plaid Investments (sandbox uses ins_109508 and similar test institutions):
| Brokerage | Instant Data | Cost Basis |
|---|---|---|
| Fidelity | Yes | Yes |
| Charles Schwab | Yes | Yes |
| Vanguard | Yes | Partial |
| E*TRADE | Yes | Yes |
| TD Ameritrade | Yes | Yes |
| Robinhood | Yes | Yes |
| Coinbase | Yes | No |
| Wealthfront | Yes | Yes |
| Betterment | Yes | Yes |
Coverage varies. Use plaid_searchInstitutions with products: ["investments"] to check availability.
Sandbox institutions return synthetic investment data:
// Create a sandbox item with investments product
const createResponse = await plaidClient.sandboxPublicTokenCreate({
institution_id: "ins_109508",
initial_products: [Products.Investments],
});
// Exchange and fetch holdings
const exchangeResponse = await plaidClient.itemPublicTokenExchange({
public_token: createResponse.data.public_token,
});
const holdingsResponse = await plaidClient.investmentsHoldingsGet({
access_token: exchangeResponse.data.access_token,
});
// Returns synthetic holdings with various security types
User: "I want to show users their total investment portfolio across all connected brokerage accounts."
Agent:
investments product via plaid_createSandboxItemplaid_getInvestmentHoldingsinstitution_value| Step | MCP Tool | Description |
|---|---|---|
| Create sandbox item | plaid_createSandboxItem | Create a test item with investments product |
| Get accounts | plaid_getAccounts | List investment accounts with balances |
| Get holdings | plaid_getInvestmentHoldings | Fetch holdings and securities |
| Get balances | plaid_getBalance | Real-time balance check for investment accounts |
| Search institutions | plaid_searchInstitutions | Find brokerages supporting investments |
| Create Link token | plaid_createLinkToken | Create Link token with investments product |
HOLDINGS: DEFAULT_UPDATE webhook fires when new data is available.null before calculating gain/loss.investmentsTransactionsGet may not return all transactions in one call. Check total_investment_transactions and paginate with offset.amount means money left the account (buy), negative means money entered (dividend, sell proceeds).cash security type representing uninvested cash in the brokerage account. Include it in total value calculations.