mcp: advertise a capability if and only if added (#93)

If tools are added to a Server when Run is called, it will send
toolCapabilities to the client. Otherwise it won't. Ditto for prompts
and resources.

For #56.
This commit is contained in:
Jonathan Amsterdam 2025-07-10 15:52:11 -04:00 • committed by GitHub
commit b4febf129b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,6 +66,9 @@ func (s *featureSet[T]) get(uid string) (T, bool) {
return t, ok
}
// len returns the number of features in the set.
func (s *featureSet[T]) len() int { return len(s.features) }
// all returns an iterator over of all the features in the set
// sorted by unique ID.
func (s *featureSet[T]) all() iter.Seq[T] {