Browse Source

Add MCP tool to get watchlist

pull/7920/head
Thomas Kaul 4 weeks ago
parent
commit
a467b291f1
  1. 2
      apps/api/src/app/endpoints/mcp/mcp.controller.ts
  2. 2
      apps/api/src/services/portfolio-table/portfolio-table.service.spec.ts

2
apps/api/src/app/endpoints/mcp/mcp.controller.ts

@ -94,7 +94,7 @@ export class GhostfolioMcpController {
}, },
description: `Gives the watchlist of the user, sorted by name, with these columns: ${PortfolioTableService.getWatchlistTableColumnNames().join( description: `Gives the watchlist of the user, sorted by name, with these columns: ${PortfolioTableService.getWatchlistTableColumnNames().join(
', ' ', '
)}. A trend compares the average market price of the last 50 or 200 days with the average of the 50 or 200 days before. The change from the all time high is the difference between the current market price and the all time high in percentage.`, )}. A trend compares the average market price of the last 50 or 200 days with the average of the 50 or 200 days before. A trend is UNKNOWN if there is not sufficient market data. The change from the all time high is the difference between the current market price and the all time high in percentage.`,
name: 'get-watchlist' name: 'get-watchlist'
}) })
public async getWatchlist(@Impersonation() { userId }: ImpersonationContext) { public async getWatchlist(@Impersonation() { userId }: ImpersonationContext) {

2
apps/api/src/services/portfolio-table/portfolio-table.service.spec.ts

@ -126,7 +126,7 @@ function createWatchlistItem({
performances: { performances: {
allTimeHigh: { allTimeHigh: {
performancePercent, performancePercent,
date: new Date('2024-01-01') date: new Date('2024-01-01T00:00:00')
} }
}, },
trend50d: 'UP', trend50d: 'UP',

Loading…
Cancel
Save