Skip to main content
Glama
davidesg

ART MCP Server

by davidesg

meg_reformulate

Reformulate a model to make a seasonal frequency stochastic after MEG detection: build the recommended model from the last .pre file, re-estimate, and write the output without manual editing.

Instructions

Reformulate the model for STOCHASTIC seasonality at frequency freq, after the MEG (DCD_f / Shin-Fuller AR_f) has concluded stochastic there.

Builds the model the MEG recommends, FROM THE LAST .pre, without editing files by hand. It loads the last fitted model (base_pre_path if given, else inp_path), activates the seasonal AR_f unit root at freq (ifadf[freq]=1: the operator 1-2cos(w)B+B^2 for an interior frequency, or 1+B at the Nyquist f=s/2), removes the now-annihilated deterministic harmonics at freq, re-estimates, writes the reformulated .pre/.out to output_path and shows the model equation + diagnosis.

with_witness=True (DEFAULT) also adds the free invertible MA_f testigo (1-2λcos(w)B+λ²B²), so the reformulated model is EXACTLY what the MEG/DCD_f contrasts — the AR_f unit root AND the MA_f witness together. This is the correct stochastic model S. After fitting, run formal_tests to read the witness DCD_f: LR>crit ⇒ genuine stochastic; λ→boundary (−1) ⇒ quasi-cancellation (frontier).

with_witness=False gives the AR-only form (no witness): this OVER-DIFFERENCES the seasonal (inflated σ, exploded Q-test) and is only a diagnostic subproduct, NOT S. Use it only to inspect the bare over-differenced residuals.

Multiple stochastic frequencies: call iteratively (strongest first), passing the previous output's .pre as base_pre_path, re-running formal_tests after each — the per-frequency MEG on the all-deterministic model has cross-frequency contamination.

Parameters

inp_path : source .inp/.pre (series data; also the model if base_pre_path="") freq : seasonal frequency to make stochastic (1..s/2) output_path : path to write the reformulated model (.pre/.out alongside) base_pre_path : the last .pre (the deterministic model); if empty, uses inp_path with_witness : add the free MA_f testigo (default True → the correct S model)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
freqYes
inp_pathYes
output_pathYes
with_witnessNo
base_pre_pathNo
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It clearly states that the tool 'writes the reformulated .pre/.out to output_path', 're-estimates', and 'shows the model equation + diagnosis'. It also explains the behavioral difference between with_witness=True and False, including the consequence of over-differencing (inflated sigma, exploded Q-test). A minor gap is that it does not explicitly warn about overwriting existing output files, but overall transparency is strong.

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?

The description is longer than average, but the complexity of the tool justifies the length. It is well-structured: an opening definition, then a detailed explanation of the two modes, iterative guidance, and a parameter list. While not as terse as the highest-caliber examples, every sentence adds value and the structure is logical.

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?

Given the tool's complexity, the lack of output schema, and no annotations, the description is remarkably complete. It explains the prerequisite (MEG conclusion), the underlying math (AR_f unit root, MA_f witness), the output side effects, and the intended follow-up workflow (formal_tests). This fully equips an agent to invoke it correctly.

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

Parameters5/5

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

With 0% schema description coverage, the description must explain each parameter. It does so in a dedicated Parameters section, covering inp_path, freq, output_path, base_pre_path, and with_witness with meaningful context (e.g., 'ifadf[freq]=1', 'the free invertible MA_f testigo'). This goes far beyond the bare 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 opens with a specific verb-resource combination: 'Reformulate the model for STOCHASTIC seasonality at frequency `freq`' and immediately ties it to the MEG workflow, distinguishing it from sibling tools like formal_tests or identification_analysis. The scope is clear and unambiguous.

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?

The description explicitly states when to use the tool ('after the MEG... has concluded stochastic there'), provides clear guidance on the with_witness parameter ('Use it only to inspect the bare over-differenced residuals' for False), and, for multiple stochastic frequencies, instructs to 'call iteratively (strongest first)'. It also references the next step (`formal_tests'), giving full contextual usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/davidesg/art-python'

If you have feedback or need assistance with the MCP directory API, please join our Discord server