More extensible CallToolRequest

Offen
#910 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

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

Rechercherichtung

Beginne mit dem Lesen von McpJsonMapper.java und verfolge, wie CallToolRequest die Tool-Argumente deserialisiert. Definiere den unterstützten Erweiterungspunkt für die werkzeugspezifische Request-Analyse unter Beibehaltung des bestehenden map-basierten Verhaltens, und überprüfe das gewählte Verhalten mit relevanten Tests zur Request-Deserialisierung.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

waiting for triage

Expected Behavior

We want to define our own tool-specific requests with own parsers for 'params'.

Current Behavior

The arguments for tool calls are always Maps.

Context

We develop our own MCP server that offers features like querying and we have our own set of tools to parse, validate and execute them.

The problem is that request object is always de-serialised as a map and we need to serialise it back or figure out a way to reconstruct our objects from the maps. It works most of the time, but is rather inconvenient for queries.

There is https://github.com/modelcontextprotocol/java-sdk/blob/main/mcp-core/src/main/java/io/modelcontextprotocol/json/McpJsonMapper.java, but as far as I understand, it is mainly used to decouple Jackson from the rest of the code.

We could have used that but it looks rather technical.

What I would like to have: some way to define my own request objects and make their payloads shallow or leave them unparsed so the each individual tool can later parse its payload and decide what to do. Or stick with standard map-based one if that is fine for it.

Vorherrschende Sprache
Java
Sterne
3.7k
Forks
1.1k
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
9

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus modelcontextprotocol/java-sdk

Alle Issues in modelcontextprotocol/java-sdk

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

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