Skip to main content
Glama
surplus96

PM-MCP (Portfolio Management MCP Server)

by surplus96
reports.py1.42 kB
from __future__ import annotations from typing import Dict from jinja2 import Template DEFAULT_TEMPLATE = Template( """ # {{ title }} **Date**: {{ date }} **Tickers**: {{ tickers|join(', ') }} ## Summary {{ summary }} ## News (Condensed) {% if news_summary %}{{ news_summary }}{% else %}_No news summary_ {% endif %} ## SEC Filings (Condensed) {% if filings_summary %}{{ filings_summary }}{% else %}_No filings summary_ {% endif %} ## Scores | Ticker | Base | Dip bonus | Total | |---|---:|---:|---:| {% for t in scores %}| {{ t.ticker }} | {{ '%.3f'|format(t.base_score) }} | {{ '%.3f'|format(t.dip_bonus) }} | {{ '%.3f'|format(t.score) }} | {% endfor %} ## Factor Evidence | Ticker | Sector | PE | PB | EPS | ROE | RevG | ProfitM | Mom(3/6/12) | Event | |---|---|---:|---:|---:|---:|---:|---:|---:|---:| {% for t in scores %}| {{ t.ticker }} | {{ t.sector or '' }} | {{ t.pe if t.pe is not none else '' }} | {{ t.pb if t.pb is not none else '' }} | {{ t.eps if t.eps is not none else '' }} | {{ t.returnOnEquity if t.returnOnEquity is not none else '' }} | {{ t.revenueGrowth if t.revenueGrowth is not none else '' }} | {{ t.profitMargins if t.profitMargins is not none else '' }} | {{ '%.3f/%.3f/%.3f'|format(t.mom3 or 0.0, t.mom6 or 0.0, t.mom12 or 0.0) }} | {{ '%.3f'|format(t.eventScore or 0.0) }} | {% endfor %} """ ) def generate_report(payload: Dict) -> str: return DEFAULT_TEMPLATE.render(**payload)

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/surplus96/PM-MCP'

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