MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / RemoveRoots

Method RemoveRoots

mcp/client.go:426–429  ·  view source on GitHub ↗

RemoveRoots removes the roots with the given URIs, and notifies any connected servers if the list has changed. It is not an error to remove a nonexistent root.

(uris ...string)

Source from the content-addressed store, hash-verified

424// and notifies any connected servers if the list has changed.
425// It is not an error to remove a nonexistent root.
426func (c *Client) RemoveRoots(uris ...string) {
427 changeAndNotify(c, notificationRootsListChanged, &RootsListChangedParams{},
428 func() bool { return c.roots.remove(uris...) })
429}
430
431// changeAndNotify is called when a feature is added or removed.
432// It calls change, which should do the work and report whether a change actually occurred.

Callers 1

TestEndToEndFunction · 0.95

Calls 2

changeAndNotifyFunction · 0.85
removeMethod · 0.80

Tested by 1

TestEndToEndFunction · 0.76