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)
timeNo
entityYesEntity code (e.g. USA)
max_lagNoMax lag in periods (1-20, default 5)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare the tool read-only, idempotent, and non-destructive, so the description does not need to repeat that. It adds useful behavioral interpretation: peak |r| at positive lag means A precedes B by that many periods, and the list of supported data sources clarifies scope. No contradiction with annotations exists.

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?

The description is three sentences with no wasted words. The core statistical behavior is front-loaded, followed by a concrete interpretation rule and a practical use case. The data-source enumeration is useful and not overly verbose.

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 read-only analytical tool with no output schema, the description explains the primary result semantics (peak correlation and lag direction). It would benefit from a note about what the full returned output looks like or how missing data is handled, but the current description is sufficient for an agent to select and invoke it correctly in most cases.

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 80%, and the schema already documents the key parameters including 'a' as candidate leading series, 'b' as candidate lagging series, entity, and max_lag. The description adds a little semantic value by explaining the lead/lag interpretation and the indicator-source domain, but it does not meaningfully elaborate on the individual parameters beyond 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?

The description states a specific statistical operation ('Cross-correlation at multiple lags') and the exact question it answers ('does A lead or lag B?'). This clearly distinguishes it from the sibling 'correlate' tool, since it focuses on lagged relationships rather than contemporaneous correlation.

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?

The common-use example, 'is consumer confidence a leading indicator of retail sales?', effectively illustrates when to apply the tool. The specification that it runs on verified autario indicators also sets input expectations. However, it does not explicitly say when not to use it or name an alternative such as 'correlate' for non-lagged relationships.

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