Backtest read endpoints fail Pydantic validation on "created" datetime field
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
Direzione di ricerca
Inspect the Pydantic response models used by read_backtest, list_backtests, read_backtest_chart, and read_backtest_orders, then capture or examine a list_backtests response to confirm the created value's format. Align the affected models with the API response and add a regression test using a recorded response.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The four backtest read tools (read_backtest, list_backtests, read_backtest_chart, read_backtest_orders) fail Pydantic validation on the created datetime field. The QC API returns a datetime value whose format the current Pydantic model rejects, so the wrapper throws before the response is returned to the MCP client.
This is the same class of schema drift already tracked in #50 (parameterSet), #51/#52/#54 (liveForm booleans), #56 (status enum), #40 (securityType enum) — but isolated to the created field on the backtest read path.
Impact
All four read endpoints on the backtest path are unusable from MCP clients (Claude Desktop / Claude Code / Cursor), even though the underlying QC API call succeeds and the project has 19 backtests. Write endpoints (upload_file, create_compile, create_backtest) are unaffected.
Reported by
QuantConnect support ticket — customer's MCP client (Claude) diagnosed the issue and explicitly identified the created field as the rejection point. The customer's words:
The QC API IS returning data — the error message shows 19 backtests exist in the project — but the Pydantic schema validator in the MCP client rejects the
createddatetime field format from QC's response, so the wrapper throws before passing anything back to me. This affects all four read endpoints (read_backtest,list_backtests,read_backtest_chart,read_backtest_orders).Write endpoints work fine (upload, compile, create_backtest); only the read path is broken.
Proposed fix
One-liner in the MCP client's Pydantic model — either:
- Change
created: datetimetocreated: Optional[datetime]on the affected response models, or - Add a
field_validator/BeforeValidatorthat tolerates the QC API's datetime format (likely a non-RFC3339 representation — exact format to be confirmed from a captured response).
A quick fix would be to relax the type on the affected models; the more durable fix is to align the Pydantic model with the actual datetime shape the QC Platform API returns and add a regression test that feeds a recorded list_backtests response through the model.
Open questions
- Exact format of the
createdvalue the API is returning (need a captured response — the customer did not include the raw error string, only the diagnosis). - Whether the same field on
read_project/list_projectsis affected (those returned other Pydantic errors per #51/#54, so thecreatedrejection may have been masked).
Intercom
Reported in conversation 215474584084779.
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 80
- Fork
- 32
- Merge medio
- 1m
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di QuantConnect/mcp-server
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
QuantConnect/mcp-server#56 ·
-
list_projects and read_project fail with Pydantic validation error on liveForm boolean fieldsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
QuantConnect/mcp-server#51 · 2 commenti ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
QuantConnect/mcp-server#58 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
QuantConnect/mcp-server#55 ·
-
list_projects and other read calls fail with Pydantic ValidationError on liveForm boolean fieldsAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
QuantConnect/mcp-server#54 ·
Tutte le issue di QuantConnect/mcp-server
Issue simili
-
twilio.webhook() rejects valid requests when the query string has an encoded `?` and a `+` spaceAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
twilio/twilio-node#1232 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
virtualmin/virtualmin-gpl#1325 ·
-
🐛 bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
LibreChat-AI/LibreChat#17887 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
openhab/openhab-jruby#571 ·