read_project (read_open_project): structured content fails output-schema validation with additional-properties error

Aperta
#58 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api, backend

Direzione di ricerca

Start in src/tools/project.py and inspect ProjectListResponse and Project in src/models.py, then compare their generated output schema with a real /projects/read response. Check the related issues for the known schema mismatches; done means read_project structured content passes strict MCP output-schema validation without rejecting valid response fields.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Summary

A user's MCP client rejects the response from a project-read tool because the
returned structured content includes fields not declared in the tool's output
schema:

MCP error -32602: Structured content does not match the tool's output schema: data must NOT have additional properties

Reported client: VS Code + a third-party MCP-aware extension, tool invoked as
read_open_project (the client's display/prefixed name for the server's
read_project tool - see below).

Where this likely comes from

src/tools/project.py registers read_project / list_projects returning
ProjectListResponse (src/models.py, ~line 4783):

class ProjectListResponse(BaseModel):
    projects: Optional[List[Project]] = None
    versions: Optional[List[LeanVersion]] = None
    success: Optional[bool] = None
    errors: Optional[List[str]] = None

The tool's declared MCP outputSchema is generated from this model. If the
live /projects/read API response includes fields beyond what Project /
ProjectListResponse model, and the generated output schema sets
additionalProperties: false (the FastMCP default for a Pydantic-derived
schema), any MCP client that validates structured content strictly against
the declared output schema will reject the response with exactly this error -
even though the underlying API call succeeded.

Why this looks like the same bug family as #47 / #51 / #52 / #54 / #55 / #56 / #57

This repo already has several open, unresolved issues where a tool's declared
schema does not match the actual /projects/* or /backtests/* response
shape (wrong date-time format, boolean-as-string enum mismatch, list-vs-dict
mismatch, blanket "project reading tools fail"). This report is the same
underlying pattern - declared schema narrower than actual API response -
but manifests as an extra-property rejection rather than a type/format
mismatch, which suggests the response models back these tools are
systematically out of sync with the live QuantConnect API payloads rather
than a one-off typo in a single field.

Suggested fix

Audit ProjectListResponse / Project (and the other response models flagged
in #51/#54/#55) against a real /projects/read payload and either:

  • extend the Pydantic models to include every field the API actually returns, or
  • relax the generated output schema (additionalProperties: true, or omit
    strict structured-content validation) until the models are complete.

Reference

Intercom conversation 215475615937938 (no customer PII included above).

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di QuantConnect/mcp-server

Tutte le issue di QuantConnect/mcp-server

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.