
Description
Calculates quarterly financial KPIs from P&L data. P&L figures can be provided directly by the user or fetched from the financial data MCP server. Use when the user wants KPI calculations such as Gross Margin %, EBITDA Margin %, Operating Expense Ratio, or Revenue Growth % QoQ. Also use for quarterly performance review, P&L analysis, or interpreting financial ratios against benchmarks.
SKILL.md
Quarterly KPI Calculator
Calculates and interprets financial KPIs. P&L data is fetched from the financial MCP server or taken from figures the user provides.
Prerequisites
At minimum: Revenue and COGS (provided by user or fetched via get_financial_data). Optional: EBITDA, Operating Expenses, prior quarter Revenue for QoQ growth.
Steps
Step 1: Retrieve benchmark thresholds
Call the get_kpi_benchmarks tool to get current KPI formulas and benchmark values:
get_kpi_benchmarks()
Store the result — you will use the formulas and benchmarks in Steps 3 and 4.
Step 2: Get P&L data
If the user provided P&L figures directly (Revenue, COGS, EBITDA, Operating Expenses), use those values.
If the user specified only a quarter (e.g. "Q3 2025") without raw figures, call get_financial_data to retrieve them:
get_financial_data(period="Q3 2025")
If QoQ Revenue Growth is requested and prior quarter data is needed, call get_financial_data for the prior quarter as well:
get_financial_data(period="Q2 2025")
Step 3: Calculate KPIs
Use python_exec to calculate the following from the P&L data (use values from Step 2):
- Gross Margin % = (Revenue - COGS) / Revenue * 100
- EBITDA Margin % = EBITDA / Revenue * 100 (if EBITDA available)
- Operating Expense Ratio = Operating Expenses / Revenue * 100 (if OpEx available)
- Revenue Growth % QoQ = (Current - Prior) / Prior * 100 (if prior available)
Round all percentages to one decimal place.
Example:
revenue = 4200000
cogs = 1890000
ebitda = 1260000
opex = 1050000
prior_rev = 3800000
gross_margin = round((revenue - cogs) / revenue * 100, 1)
ebitda_margin = round(ebitda / revenue * 100, 1)
opex_ratio = round(opex / revenue * 100, 1)
rev_growth = round((revenue - prior_rev) / prior_rev * 100, 1)
print(f"Gross Margin: {gross_margin}%")
print(f"EBITDA Margin: {ebitda_margin}%")
print(f"Operating Expense Ratio: {opex_ratio}%")
print(f"Revenue Growth QoQ: {rev_growth}%")
Step 4: Interpret against benchmarks
Using general_benchmark values from get_kpi_benchmarks (Step 1), assign each KPI a status:
- GREEN : at or above general_benchmark
- YELLOW : within 5 percentage points below general_benchmark
- RED : more than 5 percentage points below general_benchmark
Step 5: Present results
Format your final response as:
- A KPI results table: | Metric | Value | Benchmark | Status |
- A 2–3 sentence executive commentary on the most significant finding.
More skills from the agentcore-samples repository
View all 6 skillscost-efficiency-analyzer
analyze cost efficiency and expenses
Jul 12AccountingAnalyticsCost OptimizationFinanceexecutive-financial-briefing
generate executive financial briefings
Jul 12AWSFinanceManagementReportingmulti-quarter-trend-analysis
analyze multi-quarter financial trends
Jul 12AnalyticsFinanceFinancial StatementsVariance Analysispdf
process and manipulate PDF documents
Jul 12AutomationDocumentsPDFrevenue-growth-analyst
analyze revenue growth patterns
Jul 12AnalyticsFinanceReportingSales
More from AWS Labs
View publisheragentcore-investigation
investigate Bedrock AgentCore runtime sessions
mcp
Jul 12AWSDebuggingLogsObservabilityamazon aurora dsql
build applications with Aurora DSQL
mcp
Jul 12AuroraAWSDatabaseServerless +1aurora dsql
build applications with Aurora DSQL
mcp
Jul 12AWSDatabaseServerlessSQLaws dsql
build applications with Aurora DSQL
mcp
Jul 12AWSDatabaseMigrationServerless +1distributed postgres
build applications with Aurora DSQL
mcp
Jul 12AWSDatabasePostgreSQLServerless +1distributed sql
build applications with Aurora DSQL
mcp
Jul 12AWSDatabaseServerlessSQL