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

Method ResourceTemplates

mcp/client.go:1140–1147  ·  view source on GitHub ↗

ResourceTemplates provides an iterator for all resource templates 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 *ListResourceTemplatesParams)

Source from the content-addressed store, hash-verified

1138// The params argument can set the initial cursor.
1139// Iteration stops at the first encountered error, which will be yielded.
1140func (cs *ClientSession) ResourceTemplates(ctx context.Context, params *ListResourceTemplatesParams) iter.Seq2[*ResourceTemplate, error] {
1141 if params == nil {
1142 params = &ListResourceTemplatesParams{}
1143 }
1144 return paginate(ctx, params, cs.ListResourceTemplates, func(res *ListResourceTemplatesResult) []*ResourceTemplate {
1145 return res.ResourceTemplates
1146 })
1147}
1148
1149// Prompts provides an iterator for all prompts available on the server,
1150// automatically fetching pages and managing cursors.

Callers 3

TestListFunction · 0.80
Example_resourcesFunction · 0.80
mainFunction · 0.80

Calls 1

paginateFunction · 0.85

Tested by 2

TestListFunction · 0.64
Example_resourcesFunction · 0.64