Skip to main content
Glama

Secedgar Compare Companies

secedgar_compare_companies
Read-onlyIdempotent

Compare 2-10 named companies across 1-8 XBRL concepts, aligned on calendar periods. This is the middle shape between secedgar_get_financials (one company, one concept, full history) and secedgar_fetch_frames (one concept, one period, every reporting company) — reach for it when the question names the companies. One companyfacts read per company, resolved through the same frame dedup and tag priority as secedgar_get_financials so the numbers agree. Balance-sheet and entity-info concepts are filed as point-in-time values and align on the calendar year (annual) or quarter (quarterly) their snapshot falls in, so they sit in the same matrix as income-statement lines. The inline matrix covers the most recent periods up to periods, trimmed further when companies x concepts x periods is too large to return in one response; the full aligned series is materialized as df_ for growth rates and spreads — inspect it with secedgar_dataframe_describe, then analyze it with secedgar_dataframe_query. A company that fails to resolve is reported in failed_companies and the comparison proceeds with the rest, and a company that does not report a concept is reported in gaps with the tags that were tried — never interpolated or zero-filled. A company that reports a concept only for periods older than the inline window is named in caveats with its newest period. A concept that is neither a friendly name nor an XBRL tag is reported once in unknown_concepts with the closest supported names, and fails the call only when every concept is one. Off-calendar filers and unit mismatches are surfaced in caveats rather than silently mixed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodsNoUpper bound on how many recent periods the inline matrix covers, newest first — not a guarantee. The matrix is companies x concepts x periods cells, and the inline window drops further older periods when that product is too large to return in one response. The full aligned series is always registered to the dataframe, so dropped periods stay queryable via secedgar_dataframe_query.
conceptsYesConcepts to compare — friendly names like "revenue" or "net_income" (discover them with secedgar_search_concepts) or raw XBRL tags.
taxonomyNoXBRL taxonomy to resolve concepts under. Use ifrs-full only when every company in the list reports under IFRS; mixing IFRS and US GAAP filers in one call resolves them all under the same taxonomy.us-gaap
companiesYesCompanies to compare, as ticker symbols (preferred) or CIK numbers. A company that does not resolve is reported in failed_companies and the rest of the comparison still runs.
period_typeNoAlign on full calendar years (annual) or calendar quarters (quarterly). Quarterly comparisons of off-calendar filers are missing at least one calendar quarter per year — see caveats.annual

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
capNoThe periods cap applied.
gapsNoCompany-concept pairs with no value in any period (never zero-filled). A pair with values only before the inline window appears in caveats instead.
cellsNoInline matrix values, covering the periods listed in periods[].
errorNoPresent when the call failed. Absent on success.
shownNoNumber of periods shown inline.
noticeNoGuidance when the inline matrix dropped periods, or the full series is staged as a dataframe.
caveatsNoComparability warnings (company-specific ones prefixed with the name), else empty: missing quarters; a concept stopping 2+ years behind the company's other reporting; period ends differing within a period; units differing across companies; values only before the inline window; merged inputs.
datasetNoDataframe of the full aligned series, every period, with cells[] columns. Absent when canvas is unavailable.
periodsNoPeriod keys in the inline matrix, newest first; shorter than requested when the cell count shrank it (see notice).
conceptsNoConcepts covered, in input order; inputs naming the same concept appear once, under the first spelling.
taxonomyNoTaxonomy the concepts were resolved under, echoed from input.
companiesNoCompanies included in the comparison.
truncatedNoTrue when the aligned series has more periods than the inline matrix shows.
period_typeNoPeriod alignment used, echoed from input.
failed_companiesNoCompanies excluded from the matrix; the rest still compare.
unknown_conceptsNoConcepts that are neither a supported name nor an XBRL tag, reported once instead of as per-company gaps; secedgar_search_concepts lists supported names. Empty when all resolved.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed17 schema fields changed
    • changedOutput schema / properties / caveats / description
      Previous value: -"Comparability warnings: a filer missing one or two calendar quarters from the frame-tagged series, a concept whose values stop at least two full years behind the rest of that company's reporting (either an XBRL tag SEC has retired, or a current tag the filer stopped using), period ends that differ inside one aligned period, concepts whose unit differs across companies, and — one line per concept — the companies that report a concept but have no value inside the inline periods, each with its newest period (its values are in the dataframe), and the concept inputs merged because they name the same concept. Company-specific warnings are prefixed with the company name. Empty when nothing needs flagging."New value: +"Comparability warnings (company-specific ones prefixed with the name), else empty: missing quarters; a concept stopping 2+ years behind the company's other reporting; period ends differing within a period; units differing across companies; values only before the inline window; merged inputs."
    • changedOutput schema / properties / cells / items / properties / frame / description
      Previous value: -"Underlying XBRL frame, which differs from period for point-in-time concepts (e.g. frame CY2024Q3I under period CY2024)."New value: +"Underlying XBRL frame; differs from period for point-in-time concepts (CY2024Q3I under CY2024)."
    • changedOutput schema / properties / cells / items / properties / tag / description
      Previous value: -"XBRL tag this value was reported under — one concept can walk several tags, so it can differ between periods of the same company."New value: +"XBRL tag this value was reported under; can differ between periods of one company."
    • changedOutput schema / properties / companies / items / description
      Previous value: -"One company that resolved and contributed to the matrix."New value: +"One company that contributed to the matrix."
    • changedOutput schema / properties / concepts / description
      Previous value: -"Concepts covered, in the order supplied. Inputs that name the same concept (revenue and Revenue, or one raw tag spelled twice) appear once, under the first spelling."New value: +"Concepts covered, in input order; inputs naming the same concept appear once, under the first spelling."
    • changedOutput schema / properties / concepts / items / properties / units / description
      Previous value: -"Distinct units this concept resolved to across the companies. More than one means the values are not directly comparable — see caveats."New value: +"Units this concept resolved to across companies; more than one means values are not directly comparable."
    • changedOutput schema / properties / dataset / description
      Previous value: -"Canvas dataframe holding the full aligned series across every period, not just the inline window. Columns match cells[]. Absent when canvas is unavailable."New value: +"Dataframe of the full aligned series, every period, with cells[] columns. Absent when canvas is unavailable."
    • changedOutput schema / properties / dataset / properties / name / description
      Previous value: -"Dataframe handle (df_XXXXX_XXXXX) — inspect its columns with secedgar_dataframe_describe, then query it with secedgar_dataframe_query."New value: +"Dataframe handle (df_XXXXX_XXXXX) for secedgar_dataframe_describe, then secedgar_dataframe_query."
    • changedOutput schema / properties / failed_companies / description
      Previous value: -"Companies excluded from the matrix. The comparison proceeds with the rest rather than failing the whole call."New value: +"Companies excluded from the matrix; the rest still compare."
    • changedOutput schema / properties / failed_companies / items / description
      Previous value: -"One company that could not be included, with a machine-readable reason."New value: +"One company that could not be included."
    • changedOutput schema / properties / failed_companies / items / properties / reason / description
      Previous value: -"Machine-readable failure. not_found: the input matched no CIK. ambiguous: it matched several, and the message lists them. no_company_facts: it resolved but the filer reports no XBRL. Match on this rather than the message."New value: +"not_found: no CIK matched. ambiguous: several matched; the message lists them. no_company_facts: resolved, but the filer reports no XBRL. Match on this, not the message."
    • changedOutput schema / properties / gaps / description
      Previous value: -"Company-concept pairs with no value in any period. Deliberately explicit — a missing value is never interpolated or zero-filled. A pair with values only in periods older than the inline window is not a gap; caveats names it."New value: +"Company-concept pairs with no value in any period (never zero-filled). A pair with values only before the inline window appears in caveats instead."
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when the inline matrix dropped periods, or when the full aligned series is staged as a dataframe."New value: +"Guidance when the inline matrix dropped periods, or the full series is staged as a dataframe."
    • changedOutput schema / properties / periods / description
      Previous value: -"Calendar period keys covered by the inline matrix, newest first. Shorter than the requested periods when the cell count forced the window to shrink — the enrichment trailer reports the drop."New value: +"Period keys in the inline matrix, newest first; shorter than requested when the cell count shrank it (see notice)."
    • changedOutput schema / properties / unknown_concepts / description
      Previous value: -"Requested concepts that are neither a supported friendly name nor an XBRL tag (UpperCamelCase, e.g. NetIncomeLoss), reported once each rather than as a gap per company — secedgar_search_concepts lists every supported name. Empty when every concept resolved."New value: +"Concepts that are neither a supported name nor an XBRL tag, reported once instead of as per-company gaps; secedgar_search_concepts lists supported names. Empty when all resolved."
    • changedOutput schema / properties / unknown_concepts / items / properties / concept / description
      Previous value: -"Concept as supplied (trimmed) — neither a supported friendly name nor an XBRL tag."New value: +"Concept as supplied, trimmed."
    • changedOutput schema / properties / unknown_concepts / items / properties / derivation / description
      Previous value: -"How to build it from supported concepts when it is a standard combination, e.g. \"operating_cash_flow − capex\"."New value: +"How to build it from supported concepts, when it is a standard combination (e.g., \"operating_cash_flow − capex\")."
  2. Changed8 schema fields changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "not": {
      -      "required": [
      -        "error"
      -      ]
      -    },
      -    "required": [
      -      "period_type",
      -      "taxonomy",
      -      "periods",
      -      "companies",
      -      "failed_companies",
      -      "concepts",
      -      "cells",
      -      "gaps",
      -      "caveats"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "error"
      -    ]
      -  }
      -]New value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "period_type",
      +      "taxonomy",
      +      "periods",
      +      "companies",
      +      "failed_companies",
      +      "concepts",
      +      "cells",
      +      "gaps",
      +      "unknown_concepts",
      +      "caveats"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • changedOutput schema / properties / caveats / description
      Previous value: -"Comparability warnings: a filer missing one or two calendar quarters from the frame-tagged series, a concept whose values stop at least two full years behind the rest of that company's reporting (either an XBRL tag SEC has retired, or a current tag the filer stopped using), period ends that differ inside one aligned period, and concepts whose unit differs across companies. Company-specific warnings are prefixed with the company name. Empty when nothing needs flagging."New value: +"Comparability warnings: a filer missing one or two calendar quarters from the frame-tagged series, a concept whose values stop at least two full years behind the rest of that company's reporting (either an XBRL tag SEC has retired, or a current tag the filer stopped using), period ends that differ inside one aligned period, concepts whose unit differs across companies, and — one line per concept — the companies that report a concept but have no value inside the inline periods, each with its newest period (its values are in the dataframe), and the concept inputs merged because they name the same concept. Company-specific warnings are prefixed with the company name. Empty when nothing needs flagging."
    • changedOutput schema / properties / cells / items / properties / tag / description
      Previous value: -"XBRL tag that produced the value."New value: +"XBRL tag this value was reported under — one concept can walk several tags, so it can differ between periods of the same company."
    • changedOutput schema / properties / concepts / description
      Previous value: -"Concepts covered, in the order supplied."New value: +"Concepts covered, in the order supplied. Inputs that name the same concept (revenue and Revenue, or one raw tag spelled twice) appear once, under the first spelling."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `no_companies_resolved`: None of the supplied company inputs resolved to a CIK. `no_comparable_data`: Companies resolved but not one of them reports any of the requested concepts for the requested period type. `rate_limited`: SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `no_companies_resolved`: None of the supplied company inputs resolved to a CIK. `no_comparable_data`: Companies resolved but not one of them reports any of the requested concepts for the requested period type. `unknown_concept`: Every requested concept is neither a supported friendly name nor shaped like an XBRL tag, so no request is sent. `rate_limited`: SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "no_companies_resolved",
      -  "no_comparable_data",
      -  "rate_limited"
      -]New value: +[
      +  "no_companies_resolved",
      +  "no_comparable_data",
      +  "unknown_concept",
      +  "rate_limited"
      +]
    • changedOutput schema / properties / gaps / description
      Previous value: -"Company-concept pairs with no data. Deliberately explicit — a missing value is never interpolated or zero-filled."New value: +"Company-concept pairs with no value in any period. Deliberately explicit — a missing value is never interpolated or zero-filled. A pair with values only in periods older than the inline window is not a gap; caveats names it."
    • addedOutput schema / properties / unknown_concepts
      Added value: +{
      +  "description": "Requested concepts that are neither a supported friendly name nor an XBRL tag (UpperCamelCase, e.g. NetIncomeLoss), reported once each rather than as a gap per company — secedgar_search_concepts lists every supported name. Empty when every concept resolved.",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "One requested concept that was not queried for any company.",
      +    "properties": {
      +      "concept": {
      +        "description": "Concept as supplied (trimmed) — neither a supported friendly name nor an XBRL tag.",
      +        "type": "string"
      +      },
      +      "derivation": {
      +        "description": "How to build it from supported concepts when it is a standard combination, e.g. \"operating_cash_flow − capex\".",
      +        "type": "string"
      +      },
      +      "suggestions": {
      +        "description": "Up to three closest supported friendly names. Empty when a derivation applies or no name is close.",
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "concept",
      +      "suggestions"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  3. Changed2 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `no_companies_resolved`: None of the supplied company inputs resolved to a CIK `no_comparable_data`: Companies resolved but not one of them reports any of the requested concepts for the requested period type Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `no_companies_resolved`: None of the supplied company inputs resolved to a CIK. `no_comparable_data`: Companies resolved but not one of them reports any of the requested concepts for the requested period type. `rate_limited`: SEC is rate-limiting this server's IP — SEC answered 429, or the call was refused without being sent while the cool-down after one runs. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "no_companies_resolved",
      -  "no_comparable_data"
      -]New value: +[
      +  "no_companies_resolved",
      +  "no_comparable_data",
      +  "rate_limited"
      +]
  4. Changed2 schema fields changed
    • changedOutput schema / properties / dataset / properties / name / description
      Previous value: -"Dataframe handle (df_XXXXX_XXXXX) — pass to secedgar_dataframe_query."New value: +"Dataframe handle (df_XXXXX_XXXXX) — inspect its columns with secedgar_dataframe_describe, then query it with secedgar_dataframe_query."
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Guidance when the inline matrix dropped periods, or when the full aligned series is staged as a dataframe.",
      +  "type": "string"
      +}
  5. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "period_type",
      +      "taxonomy",
      +      "periods",
      +      "companies",
      +      "failed_companies",
      +      "concepts",
      +      "cells",
      +      "gaps",
      +      "caveats"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `no_companies_resolved`: None of the supplied company inputs resolved to a CIK `no_comparable_data`: Companies resolved but not one of them reports any of the requested concepts for the requested period type Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "no_companies_resolved",
      +            "no_comparable_data"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "period_type",
      -  "taxonomy",
      -  "periods",
      -  "companies",
      -  "failed_companies",
      -  "concepts",
      -  "cells",
      -  "gaps",
      -  "caveats"
      -]
  6. Changed1 schema field changed
    • changedOutput schema / properties / caveats / description
      Previous value: -"Comparability warnings: a filer missing one or two calendar quarters from the frame-tagged series, a concept that resolved to an XBRL tag SEC has retired (so that company's values may stop years short of the others'), period ends that differ inside one aligned period, and concepts whose unit differs across companies. Company-specific warnings are prefixed with the company name. Empty when nothing needs flagging."New value: +"Comparability warnings: a filer missing one or two calendar quarters from the frame-tagged series, a concept whose values stop at least two full years behind the rest of that company's reporting (either an XBRL tag SEC has retired, or a current tag the filer stopped using), period ends that differ inside one aligned period, and concepts whose unit differs across companies. Company-specific warnings are prefixed with the company name. Empty when nothing needs flagging."
  7. Changed2 schema fields changed
    • changedInput schema / properties / period_type / description
      Previous value: -"Align on full calendar years (annual) or calendar quarters (quarterly). Quarterly comparisons of off-calendar filers are missing one calendar quarter per year — see caveats."New value: +"Align on full calendar years (annual) or calendar quarters (quarterly). Quarterly comparisons of off-calendar filers are missing at least one calendar quarter per year — see caveats."
    • changedOutput schema / properties / caveats / description
      Previous value: -"Comparability warnings: a filer missing a calendar quarter from the frame-tagged series, period ends that differ inside one aligned period, and concepts whose unit differs across companies. Empty when nothing needs flagging."New value: +"Comparability warnings: a filer missing one or two calendar quarters from the frame-tagged series, a concept that resolved to an XBRL tag SEC has retired (so that company's values may stop years short of the others'), period ends that differ inside one aligned period, and concepts whose unit differs across companies. Company-specific warnings are prefixed with the company name. Empty when nothing needs flagging."
  8. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover only safety (readOnly/idempotent/openWorld), and the description supplies everything else: per-company read count, shared frame dedup/tag priority guaranteeing numeric agreement, point-in-time alignment rules, partial-failure behavior (failed_companies), gap reporting with tried tags, no interpolate/zero-fill policy, unknown_concepts handling, and caveats for off-calendar filers and unit mismatches.

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?

Purpose is front-loaded in sentence one and the remaining sentences each carry distinct behavior, but the prose is dense and restates some schema-level detail (period window trimming appears in both the description and the `periods` param description).

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?

With an output schema present, the description needn't explain return values, and it still covers every edge case an agent must anticipate — partial failures, gaps, unknown concepts, caveats, and where the full series lives. Nothing needed for a correct call is missing.

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; the description nonetheless adds meaning beyond the schema by explaining the companies x concepts x periods matrix shape, that `periods` is an upper bound rather than a guarantee, and why a single taxonomy forces resolution across mixed IFRS/US-GAAP filers.

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?

Opens with a specific verb+resource+scope ('Compare 2-10 named companies across 1-8 XBRL concepts, aligned on calendar periods') and explicitly positions itself between two named siblings, so an agent can route 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?

Gives the decisive selection rule — 'reach for it when the question names the companies' — and contrasts it against secedgar_get_financials (one company) and secedgar_fetch_frames (one concept, one period), plus downstream guidance to describe/query the dataframe.

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.