Skip to main content
Glama

lag_analysis

Read-onlyIdempotent

Cross-correlation at multiple lags. Answers "does A lead or lag B?". Peak |r| at positive lag means A precedes B by that many periods. Common use: "is consumer confidence a leading indicator of retail sales?". Runs on any verified autario indicator (World Bank, FRED, Eurostat, OECD, IMF, WHO, ECB, US Census, SEC).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesFirst indicator id (candidate leading series)
bYesSecond indicator id (candidate lagging series)
timeNoOptional time window. "2010-2023" keeps 2010 through 2023, "2019-01-2024-06" works by month, and a single "2015" keeps 2015 onward. Omitted or unparseable = the whole series.
entityYesEntity code (e.g. USA)
max_lagNoMax lag in periods (1-20, default 5)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / time / description
      Added value: +"Optional time window. \"2010-2023\" keeps 2010 through 2023, \"2019-01-2024-06\" works by month, and a single \"2015\" keeps 2015 onward. Omitted or unparseable = the whole series."
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. The description adds genuine value beyond that: how to read the output ('peak |r| at positive lag means A precedes B') and which indicator sources are supported.

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 operation, then interpretation and an example, then data-source coverage. Each sentence earns its place; the provider list is the only slightly expendable element but it usefully signals coverage.

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

Completeness4/5

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

For a statistical tool with no output schema, the description covers what is computed, how to interpret the result, and the supported data universe. It omits return-shape details (e.g. whether a table of lag correlations is returned), which keeps it just short of fully complete.

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 description coverage is 100%, so the baseline is 3. The description goes slightly further by tying the parameters to interpretation – the positive-lag convention clarifies the role relationship between `a` (leading candidate) and `b` (lagging candidate) rather than just restating their labels.

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

Purpose4/5

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

States a specific analytical operation (cross-correlation at multiple lags) and its interpretive purpose ('does A lead or lag B?'), so the agent understands exactly what is computed. However, it never names or distinguishes itself from the sibling tool `correlate`, which is the nearest alternative.

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

Usage Guidelines4/5

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

Gives concrete usage context via an example ('is consumer confidence a leading indicator of retail sales?') and the interpretation rule for the result. It does not, however, state when NOT to use it or point to `correlate` for same-period correlation, so it stops short of full routing guidance.

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