get_portfolio
Retrieve detailed portfolio information by specifying a portfolio ID, enabling users to manage and analyze trading data through the Paper MCP Server interface.
Instructions
Get portfolio details
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"portfolioId": "<portfolioId>"
},
"name": "get_portfolio"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| portfolioId | Yes | Portfolio ID |
Implementation Reference
- src/index.ts:121-131 (schema)Tool definition including name, description, and input schema for validating portfolioId parameter.
{ name: 'get_portfolio', description: 'Get portfolio details', inputSchema: { type: 'object', properties: { portfolioId: { type: 'string', description: 'Portfolio ID' } }, required: ['portfolioId'] } }, - src/index.ts:426-428 (handler)Core handler logic: performs authenticated GET request to the Paper Invest API endpoint for portfolio details using the provided portfolioId.
case 'get_portfolio': response = await api.get(`/accounts/portfolios/${args.portfolioId}`); break; - src/index.ts:388-392 (registration)Registers the listTools handler which exposes the get_portfolio tool (among others) to MCP clients.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });