Skip to main content
Glama

MetricDuck — Financial Analysis

Metric Lineage

get_metric_lineage
Read-only

The DERIVATION of one COMPUTED metric — its human formula + immediate inputs (each value + source), one level at a time. The audit / verify affordance for derived figures (margins, ratios, ROIC, FCF, adj-EBITDA): call it ONLY when the query asks how a metric is computed, which definition MetricDuck used, or to verify / audit the derivation — NOT to get the value itself (use get_metric_history / get_company_overview for that).

Drillable (lazy, one level per call):

  • a derived input points to its OWN derivation — call get_metric_lineage(ticker, that_symbol) to go deeper.

  • a base input is an as-filed XBRL fact — open its filing handle, or get_xbrl_facts(ticker, search="") to land on the exact fact.

Use Cases:

  • "How is AAPL's net_margin calculated?" -> get_metric_lineage("AAPL", "net_margin")

  • "Which ROIC definition does this use?" -> get_metric_lineage("AAPL", "roic")

  • "Audit / verify gross_margin for Q2 FY2025" -> get_metric_lineage("AAPL", "gross_margin", fiscal_year=2025, fiscal_period="Q2")

Computed metrics only — a base as-filed figure has no derivation (the tool says so and points to get_xbrl_facts).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricYesMetric id of a COMPUTED metric (e.g. 'net_margin', 'roic', 'fcf', 'ev_ebitda').
tickerYesCompany ticker symbol (e.g., 'AAPL'). Must be exact.
segmentNoReporting segment id. Omit for the consolidated figure.
fiscal_yearNoPin the fiscal year (e.g. 2025). Omit for the latest period.
period_typeNoQ = quarterly, FY = fiscal year, TTM = trailing 12 months.Q
fiscal_periodNoPin the fiscal period. Omit for the latest.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover safety (readOnly/openWorld/non-destructive), and the description adds substantial non-obvious behavior: lazy one-level-per-call drill-down, that 'derived' inputs point to their own lineage while 'base' inputs are XBRL facts, and that non-computed metrics return a message pointing to get_xbrl_facts. This is context the annotations cannot convey.

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?

Front-loaded with the core definition, then structured into drillable behavior and use cases. Every section earns its place, though the length is on the longer side for what remains a fairly simple read operation.

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?

No output schema exists, yet the description explains the return structure (formula + inputs with source), the drill affordance, and the base-case fallback. An agent has everything needed to call it correctly and interpret results.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds meaning: it explains the metric param must be a COMPUTED metric, and demonstrates segment/fiscal_year/fiscal_period usage in the audit example. It adds value beyond the schema, though it does not fully re-specify every parameter.

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 (derivation) and resource (computed metric lineage: formula + immediate inputs), with clear scope ('one level at a time'). It explicitly distinguishes itself from siblings by naming get_metric_history, get_company_overview, and get_xbrl_facts as the alternatives for the value itself.

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 'call it ONLY when' conditions (how a metric is computed, which definition, verify/audit) paired with the exclusion ('NOT to get the value itself') and named alternatives. Three concrete use-case examples map queries to calls.

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