File tree Expand file tree Collapse file tree 2 files changed +50
-2
lines changed Expand file tree Collapse file tree 2 files changed +50
-2
lines changed Original file line number Diff line number Diff line change @@ -121,4 +121,28 @@ func Example_prompts() {
121121
122122### Pagination
123123
124- <!-- TODO -->
124+ Server-side feature lists may be
125+ [ paginated] ( https://modelcontextprotocol.io/specification/2025-06-18/server/utilities/pagination ) ,
126+ using cursors. The SDK supports this by default.
127+
128+ ** Client-side** : The ` ClientSession ` provides methods returning
129+ [ iterators] ( https://go.dev/blog/range-functions ) for each feature type.
130+ These iterators are an ` iter.Seq2[Feature, error] ` , where the error value
131+ indicates whether page retrieval failed.
132+
133+ - [ ` ClientSession.Prompts ` ] ( https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp#ClientSession.Prompts )
134+ iterates prompts.
135+ - [ ` ClientSession.Resource ` ] ( https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp#ClientSession.Resource )
136+ iterates resources.
137+ - [ ` ClientSession.ResourceTemplates ` ] ( https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp#ClientSession.ResourceTemplates )
138+ iterates resource templates.
139+ - [ ` ClientSession.Tools ` ] ( https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp#ClientSession.Tools )
140+ iterates tools.
141+
142+ The ` ClientSession ` also exposes ` ListXXX ` methods for fine-grained control
143+ over pagination.
144+
145+ ** Server-side** : pagination is on by default, so in general nothing is required
146+ server-side. However, you may use
147+ [ ` ServerOptions.PageSize ` ] ( https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp#ServerOptions.PageSize )
148+ to customize the page size.
Original file line number Diff line number Diff line change @@ -48,4 +48,28 @@ Set [`ClientOptions.PromptListChangedHandler`](https://pkg.go.dev/github.com/mod
4848
4949### Pagination
5050
51- <!-- TODO -->
51+ Server-side feature lists may be
52+ [ paginated] ( https://modelcontextprotocol.io/specification/2025-06-18/server/utilities/pagination ) ,
53+ using cursors. The SDK supports this by default.
54+
55+ ** Client-side** : The ` ClientSession ` provides methods returning
56+ [ iterators] ( https://go.dev/blog/range-functions ) for each feature type.
57+ These iterators are an ` iter.Seq2[Feature, error] ` , where the error value
58+ indicates whether page retrieval failed.
59+
60+ - [ ` ClientSession.Prompts ` ] ( https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp#ClientSession.Prompts )
61+ iterates prompts.
62+ - [ ` ClientSession.Resource ` ] ( https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp#ClientSession.Resource )
63+ iterates resources.
64+ - [ ` ClientSession.ResourceTemplates ` ] ( https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp#ClientSession.ResourceTemplates )
65+ iterates resource templates.
66+ - [ ` ClientSession.Tools ` ] ( https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp#ClientSession.Tools )
67+ iterates tools.
68+
69+ The ` ClientSession ` also exposes ` ListXXX ` methods for fine-grained control
70+ over pagination.
71+
72+ ** Server-side** : pagination is on by default, so in general nothing is required
73+ server-side. However, you may use
74+ [ ` ServerOptions.PageSize ` ] ( https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp#ServerOptions.PageSize )
75+ to customize the page size.
You can’t perform that action at this time.
0 commit comments