get_account_portfolios
Retrieve all portfolios linked to a specific account ID using the Paper MCP Server, enabling streamlined account management and portfolio tracking.
Instructions
Get all portfolios for an account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | Yes | Account ID |
Implementation Reference
- src/index.ts:430-432 (handler)The handler logic for the 'get_account_portfolios' tool. It makes an authenticated GET request to the API endpoint `/accounts/${accountId}/portfolios` to retrieve all portfolios for the specified account.case 'get_account_portfolios': response = await api.get(`/accounts/${args.accountId}/portfolios`); break;
- src/index.ts:135-141 (schema)Input schema validation for the tool, requiring an 'accountId' string.inputSchema: { type: 'object', properties: { accountId: { type: 'string', description: 'Account ID' } }, required: ['accountId'] }
- src/index.ts:132-142 (registration)Tool registration in the tools array, including name, description, and schema. This is returned by the ListTools handler.{ name: 'get_account_portfolios', description: 'Get all portfolios for an account', inputSchema: { type: 'object', properties: { accountId: { type: 'string', description: 'Account ID' } }, required: ['accountId'] } },
- src/index.ts:53-57 (helper)Axios request interceptor that adds JWT Bearer token authentication to all API calls, using getAuthToken function and API_KEY env var.api.interceptors.request.use(async (config) => { const token = await getAuthToken(API_KEY!); config.headers.Authorization = `Bearer ${token}`; return config; });