How Seentio Maps Strategy Names to Templates
When you ask Claude Code "build me Greenblatt's strategy," there's a quiet but important step happening behind the scenes: Claude doesn't compose the strategy spec from training memory. It looks the name up in a curated dictionary first. This guide explains why we built that dictionary, how it works, and what happens when a name doesn't match.
What you'll learn
How the lookup_strategy MCP tool turns fuzzy user requests into precise template references, the alias dictionary that powers it, and the fallback path when nothing matches.
Why a lookup tool exists
Picture two users:
-
User A says: "Build me Magic Formula." They mean Joel Greenblatt's textbook value-quality strategy from The Little Book That Beats the Market. Earnings yield + return on capital, top 30, hold a year.
-
User B says: "Build me Magic Formula." They read a quant blog last week that called a single-factor low-P/E screen "the magic formula." They want low P/E, top 50, hold quarterly.
If Claude infers the spec from its training knowledge, it'll pick Greenblatt's version every time (because that's the dominant reference in academic literature). User B will get something they didn't ask for. They might not notice until the backtest comes back looking unfamiliar — or worse, until real money is rebalanced into the wrong portfolio.
This is what we call the name-collision problem. Strategy names are ambiguous; AI inference is non-deterministic; the combination produces silent mistakes. The fix is a deterministic name-to-template lookup with explicit aliases and disambiguation.
How lookup_strategy works
When the user mentions a strategy by name, Claude calls lookup_strategy(query=<their words>) as the first move. The tool hits our backend's /api/strategies/templates-lookup endpoint, which scores each template against the query.
Scoring tiers
| Match type | Score |
|---|---|
| Query exactly equals template ID or display name | 1.0 |
| Query exactly equals an alias | 0.95 |
| Query is substring of name (or name is substring of query) | 0.85 |
| Query is substring of an alias | 0.75 |
| Token overlap with name + aliases | up to 0.7 |
| Description keyword match (length ≥ 4) | 0.4 |
The "confident match" rule
A match is declared confident when: - The top score is ≥ 0.7, AND - No other alternate scores ≥ 0.55 (no near-tie ambiguity)
If both conditions hold, the response shape is:
{
"query": "Greenblatt",
"confident_match": { "id": "greenblatt_magic_formula", "name": "...", "score": 0.95 },
"alternates": [],
"guidance": "Use confident_match.id with get_template..."
}
Claude reads the confident match and proceeds to fetch the full spec via get_template, then run dry_run_ranking, then create_strategy.
When matches are ambiguous
If the top score is below 0.7, OR there's a near-tie (multiple alternates above 0.55), the response surfaces alternates instead of picking one:
{
"query": "value quality",
"confident_match": null,
"alternates": [
{ "id": "greenblatt_magic_formula", "score": 0.65 },
{ "id": "top_n_large_cap", "score": 0.55 }
],
"guidance": "Multiple matches — ASK the user which one they meant before creating."
}
The MCP system prompt tells Claude: when there's no confident match, don't guess — ask the user to pick from alternates by name and description. This forces an explicit confirmation rather than a silent inference.
The current alias dictionary
Today (May 2026) we ship four templates with the following aliases:
Greenblatt Magic Formula
greenblatt,magic formula,joel greenblatt,little book that beats the market,earnings yield roic,value quality,ebit ev
Top N Dividend
dividend,high yield,income,dividend champions,dividend aristocrats,income strategy
High Momentum
momentum,trend following,jegadeesh titman,12-1 momentum,price momentum,trend
Top N Large Cap
large cap,mega cap,top n,fama french size,size factor,market cap weighted
You can see them all by asking Claude:
What strategy templates are available?
Claude calls list_strategy_templates and returns the catalog with each template's id, name, description, default cadence, factor count, and top_n. Useful for browsing.
What happens when no template matches
If you ask for something exotic — "Build me Piotroski F-score" or "Buffett-style quality" — lookup_strategy returns:
{
"query": "piotroski",
"confident_match": null,
"alternates": [],
"guidance": "No built-in template matches 'piotroski'. Compose a custom ranking block per the cookbook in your MCP system prompt. Restate the strategy intent back to the user before calling create_strategy."
}
Now Claude falls back to custom strategy authoring. It uses the cookbook of factor derivations baked into the MCP system prompt:
| Factor user might mention | Cookbook expression |
|---|---|
| Earnings yield (EBIT/EV) | 1 / ev_ebitda |
| ROIC / Return on capital | roa |
| FCF Yield | 1 / price_to_cash |
| Book Yield (Fama-French) | 1 / pb |
| EBITDA Yield | ebitda / market_cap |
| Quality (composite) | (roa + operating_margin + gross_margin) / 3 |
| Low Vol | 1 / max(beta, 0.01) |
| 12-1 Momentum | ret_1y - ret_1m |
| Trend Strength | sma_20_pos + sma_50_pos + sma_200_pos |
| GARP | 1 / max(peg, 0.1) |
| Dividend Safety | max(1 - payout_ratio, 0) |
Claude composes a ranking block using these expressions, then restates its interpretation back to you before calling create_strategy. Something like:
I don't have a built-in Piotroski template. The closest custom version uses three quality components from our snapshot: ROA + operating margin + gross margin, equally weighted. We don't have year-over-year change data needed for the full 9-component F-score. Want me to proceed with the simplified version?
That restate-before-creating pattern is the safety check for the no-match case. The dry-run preview (showing actual tickers) is the second safety check.
What about fields we don't have at all?
Some strategies need data Seentio's snapshot doesn't include. The classic example: debt_to_equity. EODHD's API has the field name in the schema, but it's universally null in our daily snapshot — we'd need a different data feed to populate it reliably. We document these in our field inventory and lookup_strategy will surface a warning if you accidentally try to use one.
When this happens, Claude is instructed to propose a substitute and ask rather than silently failing. For debt_to_equity specifically, the substitute is operating_margin (operational efficiency) or 1/pb (leverage indirectly via book value).
Tips & common questions
-
The lookup is your safety net. Even when you're confident a strategy has a clear name, asking Claude to look it up first costs nothing and protects against the name-collision problem. Make it a habit.
-
Aliases are case-insensitive. "GREENBLATT", "greenblatt", "Greenblatt" — all match. Spaces, hyphens, and underscores are normalized: "magic_formula" and "magic formula" both work.
-
The catalog grows over time. We ship templates conservatively — each one is a vetted academic strategy with documented behavior. If a strategy you'd want is missing, email us at contact@app-seentio.com. Common requests: Piotroski F-score, Quality (QMJ), Low Volatility, Momentum + Quality combos.
-
Custom strategies still work. When the lookup fails, Claude composes a ranking block from the cookbook. You're not stuck — you just need to confirm the interpretation before saving.
-
The summary echo-back is the second safety net. After
create_strategysaves, the response includes a plain-English summary of EXACTLY what got saved. Claude surfaces this verbatim. Read it. If anything's off, ask Claude to update or delete-and-recreate. -
Lookup failures are logged. Every
lookup_strategycall shows up in your S3 conversation log atwyn-associates/open_ledger/copilot_sessions/{user_id}/mcp_{date}.jsonl. We use these to grow the alias list — if "garp ratio" returns no match for 5 different users, we know to add it.
What's next
- Create your first strategy using Claude Code — try saying "Greenblatt" first to see lookup_strategy in action.
- Run a backtest on whatever strategy you create.
- Read how the alert system fires so you know what to expect post-activation.
Need more help? Visit our Chat page to ask Seentio's AI assistant, or reach out at contact@app-seentio.com.