Skip to main content
Glama

Valuation API

calculate_capm_cost_of_equity

Read-onlyIdempotent

Calculate the cost of equity using the Capital Asset Pricing Model (CAPM): the risk-free rate plus beta times the market risk premium. Formula: Re = Rf + beta x (Rm - Rf). WHEN TO USE: Use to estimate the required return on equity — an input to WACC (calculate_wacc) and DCF discount rates, or as a standalone return hurdle. WHEN NOT TO USE: Do NOT use for companies where beta is a poor risk measure (private companies without a traded beta — consider building up from comparable betas via calculate_unlever_beta / calculate_relever_beta first). BEHAVIOUR: pure deterministic calculation — no side effects, no network or storage access; idempotent and non-destructive; identical inputs always produce identical outputs. Division by zero, non-finite inputs, or mathematically undefined combinations return an explicit error instead of a number. RETURNS: JSON object { cost_of_equity: decimal (e.g. 0.115 = 11.5%), cost_of_equity_pct: number (e.g. 11.5), inputs }. PARAMETERS: risk_free_rate (required): Risk-free rate as a decimal, e.g. 0.04 = 4% (typically the 10-year government bond yield; never pass percentage points). beta (required): Equity beta (levered, if the company has debt), e.g. 1.2. Use unlevered/relevered betas when comparing capital structures. market_return (required): Expected market return (Rm) as a decimal, e.g. 0.10 = 10% (never pass percentage points). The market risk premium is computed internally as Rm - Rf.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
betaYesEquity beta (levered, if the company has debt), e.g. 1.2. Use unlevered/relevered betas when comparing capital structures.
market_returnYesExpected market return (Rm) as a decimal, e.g. 0.10 = 10% (never pass percentage points). The market risk premium is computed internally as Rm - Rf.
risk_free_rateYesRisk-free rate as a decimal, e.g. 0.04 = 4% (typically the 10-year government bond yield; never pass percentage points).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description goes well beyond the readOnly/idempotent annotations by specifying deterministic calculation, no network or storage access, and explicit error behavior for division by zero or non-finite inputs. It also clarifies that the market risk premium is computed internally. This fully discloses the tool's runtime behavior with no contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Though lengthy, the description is tightly structured with clear labels (formula, WHEN TO USE, WHEN NOT TO USE, BEHAVIOUR, RETURNS, PARAMETERS). Every section earns its place by addressing a distinct decision or execution need: purpose, routing, safety, output format, and unit pitfalls. No filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter numeric tool with no output schema, the description covers everything an agent needs: formula, application context, unit conventions, error handling, return shape with examples, and sibling routing. Nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description's PARAMETERS section essentially repeats the schema's already-detailed field descriptions (decimal format, 'never pass percentage points', beta examples), adding no new parameter-level meaning. The formula in the purpose section does add relational context, but not beyond what the schema fields already convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Calculate the cost of equity using the Capital Asset Pricing Model'), provides the exact formula, and distinguishes itself from siblings by naming WACC as a downstream consumer and by flagging when CAPM is inappropriate. This gives an agent a precise, non-confusable understanding of the tool's role.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'WHEN TO USE' and 'WHEN NOT TO USE' sections state both the intended contexts (WACC input, DCF discount rate, standalone hurdle) and the exclusion case (private companies without a traded beta), with concrete alternative tools named (calculate_unlever_beta / calculate_relever_beta). This is exactly the decision guidance an agent needs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.6/5.0
Disambiguation4/5

Most tools map cleanly to distinct valuation concepts (CAPM, WACC, DCF, multiples, NPV/IRR/MOIC, beta adjustment), so an agent can generally select correctly. The main ambiguity is that calculate_irr already includes MOIC and an IRR sensitivity table, making irr_sensitivity and calculate_moic partially overlapping in purpose despite their clarifications.

Naming Consistency4/5

The overwhelming pattern is calculate_<metric>, with clear snake_case and a consistent prefix throughout. The one outlier is irr_sensitivity, which drops the calculate_ prefix and breaks the established verb_noun convention.

Tool Count5/5

Twelve tools is a well-scoped size for a valuation calculation API, covering cost of capital, DCF, multiples, and return metrics without bloat. Each tool represents a meaningful standalone calculation an agent would need.

Completeness4/5

The core valuation workflow is well covered: cost of equity, WACC, DCF, enterprise value, multiples, and investment return metrics are all present. The notable gap is the reverse of calculate_enterprise_value—deriving equity value from enterprise value—and there is no standalone terminal value calculator, though both are workable gaps.