up_list_accounts
Retrieve all your banking accounts with balances, account types, and ownership details. Filter by account type or ownership to view specific account information.
Instructions
List all accounts for the authenticated user. Returns account balances, types (SAVER, TRANSACTIONAL, HOME_LOAN), and ownership information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountType | No | Filter by account type | |
| ownershipType | No | Filter by ownership type |
Implementation Reference
- src/index.ts:123-142 (handler)Core handler function in UpApiClient that lists accounts with optional filters by constructing the API endpoint and calling makeRequest.async listAccounts(filters?: { accountType?: "SAVER" | "TRANSACTIONAL" | "HOME_LOAN"; ownershipType?: "INDIVIDUAL" | "JOINT"; }): Promise<{ data: AccountResource[] }> { let endpoint = "/accounts"; const params = new URLSearchParams(); if (filters?.accountType) { params.append("filter[accountType]", filters.accountType); } if (filters?.ownershipType) { params.append("filter[ownershipType]", filters.ownershipType); } if (params.toString()) { endpoint += `?${params.toString()}`; } return this.makeRequest(endpoint); }
- src/index.ts:397-411 (handler)MCP tool dispatch handler case that extracts arguments, calls client.listAccounts, and returns JSON-formatted result as text content.case "up_list_accounts": { const args = request.params.arguments as { accountType?: "SAVER" | "TRANSACTIONAL" | "HOME_LOAN"; ownershipType?: "INDIVIDUAL" | "JOINT"; }; const result = await client.listAccounts(args); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:231-245 (schema)Input schema defining optional filters for accountType and ownershipType.inputSchema: { type: "object", properties: { accountType: { type: "string", enum: ["SAVER", "TRANSACTIONAL", "HOME_LOAN"], description: "Filter by account type", }, ownershipType: { type: "string", enum: ["INDIVIDUAL", "JOINT"], description: "Filter by ownership type", }, }, },
- src/index.ts:227-246 (registration)Tool registration in TOOLS array, including name, description, and input schema.{ name: "up_list_accounts", description: "List all accounts for the authenticated user. Returns account balances, types (SAVER, TRANSACTIONAL, HOME_LOAN), and ownership information.", inputSchema: { type: "object", properties: { accountType: { type: "string", enum: ["SAVER", "TRANSACTIONAL", "HOME_LOAN"], description: "Filter by account type", }, ownershipType: { type: "string", enum: ["INDIVIDUAL", "JOINT"], description: "Filter by ownership type", }, }, }, },
- src/index.ts:100-117 (helper)Helper method used by listAccounts to make authenticated API requests to Up API.private async makeRequest<T>(endpoint: string): Promise<T> { const url = `${this.config.baseUrl}${endpoint}`; const response = await fetch(url, { headers: { Authorization: `Bearer ${this.config.apiToken}`, "Content-Type": "application/json", }, }); if (!response.ok) { const errorText = await response.text(); throw new Error( `Up API error: ${response.status} ${response.statusText}\n${errorText}` ); } return response.json(); }