asset_list
Retrieve all assets in a hierarchical structure to track personal finances through the Money Manager MCP Server.
Instructions
Retrieves all assets in a hierarchical structure.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/handlers.ts:411-438 (handler)The main handler function for the asset_list tool. Fetches asset data from the Money Manager API endpoint /getAssetData, parses input with AssetListInputSchema, calculates total balance using the toNumber helper by summing assetMoney across all assets in groups, and returns AssetListResponse with assetGroups and totalBalance.export async function handleAssetList( httpClient: HttpClient, input: unknown, ): Promise<AssetListResponse> { AssetListInputSchema.parse(input); const rawResponse = await httpClient.get<AssetGroup[]>("/getAssetData"); // Calculate total balance from all asset groups let totalBalance = 0; const assetGroups: AssetGroup[] = Array.isArray(rawResponse) ? rawResponse : []; for (const group of assetGroups) { if (group.children) { for (const asset of group.children) { // API returns assetMoney as string, need to parse it totalBalance += toNumber(asset.assetMoney); } } } return { assetGroups, totalBalance, }; }
- src/schemas/index.ts:198-200 (schema)Zod input schema for the asset_list tool, which requires no parameters (empty object). Used for validation in the handler.export const AssetListInputSchema = z.object({}); export type AssetListInput = z.infer<typeof AssetListInputSchema>;
- src/index.ts:217-223 (registration)MCP tool registration in the TOOL_DEFINITIONS array, defining the asset_list tool with its name, description, and empty input schema for the Model Context Protocol server.name: "asset_list", description: "Retrieves all assets in a hierarchical structure.", inputSchema: { type: "object" as const, properties: {}, }, },
- src/tools/handlers.ts:807-807 (registration)Internal registration mapping the 'asset_list' tool name to the handleAssetList handler function in the toolHandlers object, used by executeToolHandler.asset_list: handleAssetList,
- src/types/index.ts:166-169 (schema)TypeScript interface defining the output structure of the asset_list tool response, including hierarchical assetGroups and computed totalBalance.export interface AssetListResponse { assetGroups: AssetGroup[]; totalBalance: number; }