modelcontextprotocol / modelcontextprotocol/modelcontextprotocol

Proposal: Schema - list-schemas - new protocol element

Offen
#610 10 Kommentare 9 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

enhancement
Vorherrschende Sprache
TypeScript
Sterne
9.3k
Forks
1.8k
Ø Merge
1 T. 12 Std.
Gemergte PRs (30 T.)
25

Beschreibung

As originally discussed in:
#358
but now an official proposal.

The MCP protocol is quickly becoming the senses of LLMs. Now that we have both an input and output schema on our tools, we're able to tell the LLM exactly what they can expect from using it.

We can now feel with the tools that we have and grab resources and have structured conversations with prompts. Now we need some way to describe the world. Some way that works across tools and resources within the protocol to describe what we can expect from them. We need to be able to SEE!

The problem is that many tools use the same elements over and over again. If I can only specify the inputSchema and outputSchema to the tool, I end up having to repeat the same data over and over again wasting valuable context.

I propose a new list-schemas RPC command and a Schemas element be added to the central concept of the MCP protocol.

List schemas would return a list of JSON schemas that are named and can be referenced in the tools and resources (and maybe someday other parts of the protocol).

This is quite like the OpenAPI specification itself with it's concept of models.


export interface Schema {
  name: string
  description: string
  schema: {
    type: "object";
    properties?: { [key: string]: object };
    required?: string[];
  }
}

export interface SchemaReference {
  type: "ref/schema";
  /**
   * The name of the schema
   */
  name: string;
}

export interface ListSchemasRequest {}
export interface ListSchemasResponse {
  schemas: Schema[]
}

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Diskussion in #358 und vergleiche die bestehenden Tools, Ressourcen und Protokollelemente für Prompts. Bestimme, wie ein list-schemas RPC und benannte Schema-Referenzen in das zentrale MCP-Protokoll passen sollten, einschließlich ihrer Anfrage- und Antwortstruktur. Als abgeschlossen gilt die Aufgabe, wenn der Vorschlag eine abgestimmte Spezifikation und dokumentierte Integrationspunkte enthält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
api
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.