Tools provides an iterator for all tools available on the server, automatically fetching pages and managing cursors. The params argument can set the initial cursor. Iteration stops at the first encountered error, which will be yielded.
(ctx context.Context, params *ListToolsParams)
| 1112 | // The params argument can set the initial cursor. |
| 1113 | // Iteration stops at the first encountered error, which will be yielded. |
| 1114 | func (cs *ClientSession) Tools(ctx context.Context, params *ListToolsParams) iter.Seq2[*Tool, error] { |
| 1115 | if params == nil { |
| 1116 | params = &ListToolsParams{} |
| 1117 | } |
| 1118 | return paginate(ctx, params, cs.ListTools, func(res *ListToolsResult) []*Tool { |
| 1119 | return res.Tools |
| 1120 | }) |
| 1121 | } |
| 1122 | |
| 1123 | // Resources provides an iterator for all resources available on the server, |
| 1124 | // automatically fetching pages and managing cursors. |