Skip to main content
Glama

valuation-api

This connector has been deprecated

Superseded by valuation-api on valuation.finance-tools.io (fresh connector with focused 12-tool set and current TDQS eval)

calculate_earnings_yield

Read-onlyIdempotent

Calculate the earnings yield: earnings per share divided by share price — the inverse of the P/E ratio, expressing the earnings return on the share price as a percentage. Formula: Earnings Yield = EPS / Share Price. WHEN TO USE: Use to compare equity earnings returns directly against bond yields or the risk-free rate, or as a quick value screen — a high earnings yield can signal a cheap stock. WHEN NOT TO USE: Do NOT use when EPS is negative or zero (the yield is meaningless); use it as a complement to, not a replacement for, the P/E ratio (calculate_pe_ratio). 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 or non-finite inputs returns an explicit error instead of a number. RETURNS: JSON object { earnings_yield: decimal (e.g. 0.05 = 5%), earnings_yield_pct: number (e.g. 5.0), pe_ratio: number (e.g. 20 = 20x), inputs }. The P/E ratio is the reciprocal of the earnings yield, returned so a client gets both figures from one call. PARAMETERS: earnings_per_share (required): Earnings per share (trailing or forward), e.g. 2.50. Must be > 0 for a meaningful yield. share_price (required): Current share price in currency units, e.g. 50.00. Must be > 0.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
share_priceYesCurrent share price in currency units, e.g. 50.00. Must be > 0.
earnings_per_shareYesEarnings per share (trailing or forward), e.g. 2.50. Must be > 0 for a meaningful yield.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/openWorld=false, but the description goes further: it states the calculation is pure and deterministic with no side effects or network/storage access, and that division by zero or non-finite input returns an explicit error rather than a number. That error contract is genuinely useful behavior not covered by annotations.

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

Conciseness4/5

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

Well front-loaded and cleanly sectioned (definition, WHEN TO USE, WHEN NOT TO USE, BEHAVIOUR, RETURNS, PARAMETERS), so an agent can scan it quickly. It is longer than needed, though: the formula is expressed three times ('EPS / Share Price', 'earnings per share divided by share price', and the explicit formula line), which is mild 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?

Although there is no output schema, the description fully documents the return object (earnings_yield, earnings_yield_pct, pe_ratio, inputs) including unit conventions and an example. For a two-parameter pure calculator, nothing needed to call or interpret it correctly 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 both parameters (share_price, earnings_per_share) are already fully documented including the > 0 constraint, so baseline 3 applies. The description restates the same constraints and only marginally adds the 'trailing or forward' interpretation of EPS, which does not meaningfully exceed the schema.

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?

States a specific verb+resource ('Calculate the earnings yield') and defines it precisely as EPS / Share Price, explicitly framing it as the inverse of the P/E ratio. This is enough to distinguish it from the other calculate_* financial siblings without opening any schema.

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?

Has explicit WHEN TO USE (compare against bond yields / risk-free rate, value screen) and WHEN NOT TO USE (negative or zero EPS, not a replacement for P/E). It names a complementary alternative, calculate_pe_ratio, and states the relationship rather than just pointing at it.

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.

Resources