Read-only maths tools for hidden Markov regime models and overfitting tests.
Server exposes 5 mathematical tools with complete JSON schemas and Pydantic Field annotations. Tool names are action-oriented (route_, blocked_, bayes_, select_, overfitting_). Descriptions are present and substantive (100 - 250 chars), explaining WHAT each tool does and WHEN to use it. All parameters have type constraints (min/max, enums, array bounds). However, descriptions lack explicit guidance on prerequisites, error recovery, and downstream tool chaining. Output schemas are not formally documented in the code, only inferred from return type hints. Error handling is minimal: no recovery guidance, no categorization of retryable vs fatal errors. Tool composition is sound (each does one thing), but no batch variants or pagination patterns despite potential for large matrix inputs.
One HMM Bayes update. predicted = prior @ transition (Markov step); posterior is predicted * likelihood, renormalised. Also returns the predictive density (the normaliser).
Build a purged random-block layout: |train|gap|TEST|gap|train| ... |gap|TEST(last days). Returns half-open [start, stop) index intervals and the smallest purged gap actually found between a train segment and a test block.
Stored results of the 30-seed study: blocked validation vs the last-126-day rule (Sharpe difference, paired tests, block bootstrap, by-year and by-period splits).
Decide whether a small-business question is purely mathematical (and which tools of this server help) or must be declined because it is about governance, legal, tax or compliance.
Choose the number of HMM states K for standardized features (rows = days, columns = variables) by penalized held-out log-likelihood. method 'blocked' uses purged random blocks plus the last 80 days; 'last_window' uses only the last validation_days (the original rule). candidate_states defaults to [2, 3, 4]. Needs the optional hmmlearn dependency and at least ~600 rows for 'blocked'.
Output schemas not formally documented. Return types are inferred from code (dict[str, Any]) but LLMs cannot see what fields to expect. Blocks downstream tool chaining and forces agents to guess response structure.
Error handling absent. No validation error messages, no recovery guidance, no categorization of retryable vs fatal errors. E.g., if 'features' array is malformed in select_hmm_order, the LLM gets a raw exception, not 'Invalid features: must be 2-D array with 600+ rows for blocked method.'
Tool descriptions lack dependency hints and prerequisites. E.g., select_hmm_order mentions 'Needs the optional hmmlearn dependency' but does not say 'Call route_small_business_question first to validate the question is mathematical.' Agents cannot plan multi-step workflows.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 64 | 2026-07-28+ | v2 |
overfitting_study_results has no input parameters and vague description ('Stored results...'). Unclear what data structure is returned, when to call it, or how it relates to other tools. Appears to be a static data dump rather than a computed result.
No pagination or result-limiting patterns. blocked_split_layout and select_hmm_order accept large arrays (up to 6000 rows, 30 columns). No guidance on max result size, chunking, or streaming for large datasets.