get_all_crypto
Retrieve all cryptocurrency holdings, including both synced and manually managed assets.
Instructions
Get all cryptocurrency holdings from the v1 crypto endpoint. Returns both synced and manually managed crypto assets.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/crypto.ts:16-32 (handler)The handler function for 'get_all_crypto'. It calls apiV1.get('/crypto') and returns the crypto assets data.
async () => { try { const response = await apiV1.get("/crypto"); if (!response.ok) { return handleApiError( response, "Failed to get crypto assets", ); } const data: { crypto: CryptoAsset[] } = await response.json(); return dataResponse(data); } catch (error) { return catchError(error, "Failed to get crypto assets"); } }, - src/tools/crypto.ts:6-33 (registration)Registration of the 'get_all_crypto' tool via server.registerTool() inside registerCryptoTools().
export function registerCryptoTools(server: McpServer) { server.registerTool( "get_all_crypto", { description: "Get all cryptocurrency holdings from the v1 crypto endpoint. Returns both synced and manually managed crypto assets.", annotations: { readOnlyHint: true, }, }, async () => { try { const response = await apiV1.get("/crypto"); if (!response.ok) { return handleApiError( response, "Failed to get crypto assets", ); } const data: { crypto: CryptoAsset[] } = await response.json(); return dataResponse(data); } catch (error) { return catchError(error, "Failed to get crypto assets"); } }, ); - src/types.ts:135-148 (schema)The CryptoAsset type used for the response schema of get_all_crypto.
export interface CryptoAsset { id?: number | null; zabo_account_id?: number | null; source: "manual" | "synced"; name: string; display_name: string | null; balance: string; balance_as_of?: string; currency: string; status: string; institution_name: string | null; created_at: string; to_base?: number | null; } - src/index.ts:14-33 (registration)Import and call of registerCryptoTools in the main server entry point.
import { registerCryptoTools } from "./tools/crypto.js"; import { registerPrompts } from "./prompts.js"; const require = createRequire(import.meta.url); const { version } = require("../package.json"); const server = new McpServer({ name: "lunchmoney-mcp", version, }); registerUserTools(server); registerCategoryTools(server); registerTagTools(server); registerTransactionTools(server); registerRecurringItemsTools(server); registerBudgetTools(server); registerManualAccountTools(server); registerPlaidAccountTools(server); registerCryptoTools(server); - src/api.ts:155-160 (helper)apiV1 helper used by the handler to make the GET request to the v1 crypto endpoint.
export const apiV1 = { get: (path: string) => apiRequest("GET", path, undefined, "https://dev.lunchmoney.app/v1"), put: (path: string, body: unknown) => apiRequest("PUT", path, body, "https://dev.lunchmoney.app/v1"), };