naftiko: 1.0.0-alpha2 info: label: Trader API — Portfolio History description: 'Trader API — Portfolio History. 1 operations. Lead operation: Account Portfolio History. Self-contained Naftiko capability covering one Alpaca business surface.' tags: - Alpaca - Portfolio History created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: ALPACA_API_KEY: ALPACA_API_KEY capability: consumes: - type: http namespace: trading-portfolio-history baseUri: https://paper-api.alpaca.markets description: Trader API — Portfolio History business capability. Self-contained, no shared references. resources: - name: v2-account-portfolio-history path: /v2/account/portfolio/history operations: - name: getaccountportfoliohistory method: GET description: Account Portfolio History outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: period in: query type: string description: The duration of the data in + , such as 1D, where can be D for day, W for week, M for month and A for year. Defaults to 1M. - name: timeframe in: query type: string description: The resolution of time window. 1Min, 5Min, 15Min, 1H, or 1D. If omitted, 1Min for less than 7 days period, 15Min for less than 30 days, or otherwise 1D. - name: date_end in: query type: string description: The date the data is returned up to, in “YYYY-MM-DD” format. Defaults to the current market date (rolls over at the market open if extended_hours is false, othe - name: extended_hours in: query type: string description: If true, include extended hours in the result. This is effective only for timeframe less than 1D. authentication: type: apikey key: APCA-API-KEY-ID value: '{{env.ALPACA_API_KEY}}' placement: header exposes: - type: rest namespace: trading-portfolio-history-rest port: 8080 description: REST adapter for Trader API — Portfolio History. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/v2/account/portfolio/history name: v2-account-portfolio-history description: REST surface for v2-account-portfolio-history. operations: - method: GET name: getaccountportfoliohistory description: Account Portfolio History call: trading-portfolio-history.getaccountportfoliohistory with: period: rest.period timeframe: rest.timeframe date_end: rest.date_end extended_hours: rest.extended_hours outputParameters: - type: object mapping: $. - type: mcp namespace: trading-portfolio-history-mcp port: 9090 transport: http description: MCP adapter for Trader API — Portfolio History. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: account-portfolio-history description: Account Portfolio History hints: readOnly: true destructive: false idempotent: true call: trading-portfolio-history.getaccountportfoliohistory with: period: tools.period timeframe: tools.timeframe date_end: tools.date_end extended_hours: tools.extended_hours outputParameters: - type: object mapping: $.