@@ -303,7 +303,7 @@ public class McpAsyncClient {
303303 return Mono .empty ();
304304 }
305305
306- return this .listToolsInternal (init , McpSchema .FIRST_PAGE ).doOnNext (listToolsResult -> {
306+ return this .listToolsInternal (init , McpSchema .FIRST_PAGE , null ).doOnNext (listToolsResult -> {
307307 listToolsResult .tools ()
308308 .forEach (tool -> logger .debug ("Tool {} schema: {}" , tool .name (), tool .outputSchema ()));
309309 if (enableCallToolSchemaCaching && listToolsResult .tools () != null ) {
@@ -645,16 +645,27 @@ public Mono<McpSchema.ListToolsResult> listTools() {
645645 * @return A Mono that emits the list of tools result
646646 */
647647 public Mono <McpSchema .ListToolsResult > listTools (String cursor ) {
648- return this .initializer .withInitialization ("listing tools" , init -> this .listToolsInternal (init , cursor ));
648+ return this .initializer .withInitialization ("listing tools" , init -> this .listToolsInternal (init , cursor , null ));
649649 }
650650
651- private Mono <McpSchema .ListToolsResult > listToolsInternal (Initialization init , String cursor ) {
651+ /**
652+ * Retrieves a paginated list of tools with optional metadata.
653+ * @param cursor Optional pagination cursor from a previous list request
654+ * @param meta Optional metadata to include in the request (_meta field)
655+ * @return A Mono that emits the list of tools result
656+ */
657+ public Mono <McpSchema .ListToolsResult > listTools (String cursor , java .util .Map <String , Object > meta ) {
658+ return this .initializer .withInitialization ("listing tools" , init -> this .listToolsInternal (init , cursor , meta ));
659+ }
660+
661+ private Mono <McpSchema .ListToolsResult > listToolsInternal (Initialization init , String cursor ,
662+ java .util .Map <String , Object > meta ) {
652663
653664 if (init .initializeResult ().capabilities ().tools () == null ) {
654665 return Mono .error (new IllegalStateException ("Server does not provide tools capability" ));
655666 }
656667 return init .mcpSession ()
657- .sendRequest (McpSchema .METHOD_TOOLS_LIST , new McpSchema .PaginatedRequest (cursor ),
668+ .sendRequest (McpSchema .METHOD_TOOLS_LIST , new McpSchema .PaginatedRequest (cursor , meta ),
658669 LIST_TOOLS_RESULT_TYPE_REF )
659670 .doOnNext (result -> {
660671 // Validate tool names (warn only)
@@ -725,12 +736,31 @@ public Mono<McpSchema.ListResourcesResult> listResources() {
725736 * @see #readResource(McpSchema.Resource)
726737 */
727738 public Mono <McpSchema .ListResourcesResult > listResources (String cursor ) {
739+ return this .listResourcesInternal (cursor , null );
740+ }
741+
742+ /**
743+ * Retrieves a paginated list of resources provided by the server. Resources represent
744+ * any kind of UTF-8 encoded data that an MCP server makes available to clients, such
745+ * as database records, API responses, log files, and more.
746+ * @param cursor Optional pagination cursor from a previous list request
747+ * @param meta Optional metadata to include in the request (_meta field)
748+ * @return A Mono that completes with the list of resources result.
749+ * @see McpSchema.ListResourcesResult
750+ * @see #readResource(McpSchema.Resource)
751+ */
752+ public Mono <McpSchema .ListResourcesResult > listResources (String cursor , java .util .Map <String , Object > meta ) {
753+ return this .listResourcesInternal (cursor , meta );
754+ }
755+
756+ private Mono <McpSchema .ListResourcesResult > listResourcesInternal (String cursor ,
757+ java .util .Map <String , Object > meta ) {
728758 return this .initializer .withInitialization ("listing resources" , init -> {
729759 if (init .initializeResult ().capabilities ().resources () == null ) {
730760 return Mono .error (new IllegalStateException ("Server does not provide the resources capability" ));
731761 }
732762 return init .mcpSession ()
733- .sendRequest (McpSchema .METHOD_RESOURCES_LIST , new McpSchema .PaginatedRequest (cursor ),
763+ .sendRequest (McpSchema .METHOD_RESOURCES_LIST , new McpSchema .PaginatedRequest (cursor , meta ),
734764 LIST_RESOURCES_RESULT_TYPE_REF );
735765 });
736766 }
@@ -795,12 +825,31 @@ public Mono<McpSchema.ListResourceTemplatesResult> listResourceTemplates() {
795825 * @see McpSchema.ListResourceTemplatesResult
796826 */
797827 public Mono <McpSchema .ListResourceTemplatesResult > listResourceTemplates (String cursor ) {
828+ return this .listResourceTemplatesInternal (cursor , null );
829+ }
830+
831+ /**
832+ * Retrieves a paginated list of resource templates provided by the server. Resource
833+ * templates allow servers to expose parameterized resources using URI templates,
834+ * enabling dynamic resource access based on variable parameters.
835+ * @param cursor Optional pagination cursor from a previous list request
836+ * @param meta Optional metadata to include in the request (_meta field)
837+ * @return A Mono that completes with the list of resource templates result.
838+ * @see McpSchema.ListResourceTemplatesResult
839+ */
840+ public Mono <McpSchema .ListResourceTemplatesResult > listResourceTemplates (String cursor ,
841+ java .util .Map <String , Object > meta ) {
842+ return this .listResourceTemplatesInternal (cursor , meta );
843+ }
844+
845+ private Mono <McpSchema .ListResourceTemplatesResult > listResourceTemplatesInternal (String cursor ,
846+ java .util .Map <String , Object > meta ) {
798847 return this .initializer .withInitialization ("listing resource templates" , init -> {
799848 if (init .initializeResult ().capabilities ().resources () == null ) {
800849 return Mono .error (new IllegalStateException ("Server does not provide the resources capability" ));
801850 }
802851 return init .mcpSession ()
803- .sendRequest (McpSchema .METHOD_RESOURCES_TEMPLATES_LIST , new McpSchema .PaginatedRequest (cursor ),
852+ .sendRequest (McpSchema .METHOD_RESOURCES_TEMPLATES_LIST , new McpSchema .PaginatedRequest (cursor , meta ),
804853 LIST_RESOURCE_TEMPLATES_RESULT_TYPE_REF );
805854 });
806855 }
@@ -895,8 +944,26 @@ public Mono<ListPromptsResult> listPrompts() {
895944 * @see #getPrompt(GetPromptRequest)
896945 */
897946 public Mono <ListPromptsResult > listPrompts (String cursor ) {
898- return this .initializer .withInitialization ("listing prompts" , init -> init .mcpSession ()
899- .sendRequest (McpSchema .METHOD_PROMPT_LIST , new PaginatedRequest (cursor ), LIST_PROMPTS_RESULT_TYPE_REF ));
947+ return this .listPromptsInternal (cursor , null );
948+ }
949+
950+ /**
951+ * Retrieves a paginated list of prompts with optional metadata.
952+ * @param cursor Optional pagination cursor from a previous list request
953+ * @param meta Optional metadata to include in the request (_meta field)
954+ * @return A Mono that completes with the list of prompts result.
955+ * @see McpSchema.ListPromptsResult
956+ * @see #getPrompt(GetPromptRequest)
957+ */
958+ public Mono <ListPromptsResult > listPrompts (String cursor , java .util .Map <String , Object > meta ) {
959+ return this .listPromptsInternal (cursor , meta );
960+ }
961+
962+ private Mono <ListPromptsResult > listPromptsInternal (String cursor , java .util .Map <String , Object > meta ) {
963+ return this .initializer .withInitialization ("listing prompts" ,
964+ init -> init .mcpSession ()
965+ .sendRequest (McpSchema .METHOD_PROMPT_LIST , new PaginatedRequest (cursor , meta ),
966+ LIST_PROMPTS_RESULT_TYPE_REF ));
900967 }
901968
902969 /**
0 commit comments