Primitive Grouping WG Meeting Notes - December 15, 2025 #1986
Replies: 2 comments 8 replies
-
Yes. Most json serialization libraries...by default...create copies of objects (like Tool, Resource, Prompt, etc) when they attempt to serialize multiple references to the same object.
No, that's not what I'm saying. What I'm saying is: there are well-known/established techniques for efficient json serialization of object graphs...and what we are talking about is serializing an object graph (a tree structure...where a Tool references a group, and that group references a parent group recursively, etc). Example: Jackson (Java serialization library for the current mcp-java-sdk) has an annotation called @JsonIdentityInfo. At serialization time, the first time a given instance of an object (e.g. Group) is encountered for serialization it assigns a unique id (integer in the default configuration), and serializes that object instance to the stream. Every subsequent time a given object is encountered an integer reference (value of '@id' field) is written to the stream instead of making a new copy (as it normally would do). So if 10 tools are defined to be in the same mcp-server-created Group, the first reference to the Group will be serialized (title, description, name, meta), and given a new property (called '@id' by default) with a value of 1. All of the other 9 references to t 10000 hat group (the other 9 Tools in that group) will not be copied to the stream, but instead represented by the number 1. On deserialization on mcp client the reverse occurs, and the output of the client parsing of the json stream is an object graph (tree) where in-memory references between instance represent the object graph (just as on the server). I've been using and testing @JsonIdentityInfo for the last few months with the Group enhancements to the mcp-java-sdk as described in this this post. This technique (serialization time addition of an '@id' field to the stream to get efficient serialization of tree structures is not limited to Jackson/Java. I've spent time with Pydantic (python sdk json schema lib) and I think it would be possible to do the same thing (for interoperability across languages) but I don't know the library well enough to implement it yet. I've also looked at the javascript json library as well as a couple of others, and all json libraries provide the means to customize the serialization of classes/types, so at worst it would mean someone providing a custom serializer for the Group type (only) in each language sdk once upon introduction of the Group primitive. There is also an open source library called JavaScript object graphs or jsog that has implemented in multiple languages the same serialization/deserialization strategy as @JsonIdentityInfo. So again: this (efficient object graph/tree structure serialization) is a very solvable problem technically, with well-known and already heavily used open implementations. I also looked for standardization (e.g. from json schema standard) of this approach and did not find it. If there already is a spec/standard for this approach then that would be much better but I wasn't able to find one. I'm not primarily involved in the json/json schema specification world, so I may have just not looked in the right place or with the right people.
Hopefully the above makes what I'm proposing clearer. Yes, dealing with the serialization/deserialization consequences of using json references make take some implementation work in the sdks. But FWIW, even without Group hierarchy, the same efficiency problem exists (just with 10 Tools all referencing the same Group...i.e. with no parent). That's due to the fact that Group is a collection of other objects. I'm happy to describe/detail/live demo the Java impl of the Group proposal as described here |
Beta Was this translation helpful? Give feedback.
-
|
Interesting discussion. I've been exploring a different angle: rather than grouping tools, what if skills compose other skills? This gives you hierarchy without a separate Group primitive - the composition IS the structure. It also solves the non-determinism problem because LLMs see fewer tools at each decision point (only the level they need). I've put together a proposal here: agentskills/agentskills#13 Would be curious if this addresses the underlying need you're exploring. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Primitive Grouping WG Meeting Notes - December 15, 2025
Attendees
Discussion
We had a poll last week about whether to propose both implementations we'd been considering (Groups via a new primitive, and Groups as resources). There were only 6 votes, but Groups via a new primitive won. Therefore discussion centered on the current shape of this option as written.
Group hierarchies and the
parentfield implementationA big point of contention is the implementation of the
parentfield in this new primitive. It enables hierarchies of groups.@scottslewis is strongly in favor of an implementation where the field, in the JSON schema, is a reference to the Group definition. This means that the
parentfield of a JSON representation of a group would be another complete group object. This leads the problem of duplication on the wire. If a group has 10 children, then a list containing them would necessarily contain 11 duplicate definition of the parent. Scott's remedy for this is to urge implementers to use libraries or custom code that serializes/de-duplicates the list before sending, and reconstitutes on the other side. @cliffhall pointed out that this is an extra burden on SDK developers, and that we shouldn't include in an SEP, which is meant to define protocol, not implementation.@cliffhall is in favor of the
parentfield being a string containing the unique parent group name, that the client can use reconstruct hierarchy upon receipt of the group list.@scottslewis suggests that LLMs would want to have all the parent hierarchy of a referenced group in a tool, resource, or prompt definition. The discussion unearthed no clear reason why this would be the case.
Deferring group hierarchies
When it became clear that there would be no consensus on the hierarchy implementation, @cliffhall suggested that we defer group hierarchies to a follow-on SEP. The reasoning being that it has already taken up quite a bit of time in our meetings and we still don't have consensus about the approach. Meanwhile we do have consensus about the new primitive (sans
parent) and why groups would be a worthwhile addition to the protocol. It would be a shame if we wasted more time on this aspect and the whole concept of Groups as a new primitive were to be shot down when reviewed by the core maintainers.Everyone agreed, this would be a good way to resolve the current logjam and get closer to an SEP. @scottslewis agreed to revise his draft to remove the hierarchy support.
Beta Was this translation helpful? Give feedback.
All reactions