Skip to main content
Glama
paperinvest

Paper MCP Server

by paperinvest

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
NameRequiredDescriptionDefault
accountIdYesAccount ID

Implementation Reference

  • 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;
  • 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'] } },
  • 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; });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/paperinvest/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server