001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.bean.mcp.v20250618;
018
019import static org.apache.juneau.commons.utils.CollectionUtils.*;
020import static org.apache.juneau.commons.utils.Shorts.*;
021
022import java.util.*;
023
024import org.apache.juneau.marshall.*;
025
026/**
027 * Result payload for {@value McpMethods#TOOLS_LIST}.
028 */
029@Marshalled
030public class ListToolsResult {
031
032   private List<Tool> tools;
033   private String nextCursor;
034
035   /**
036    * Tool descriptors.
037    *
038    * @return The tools list, or {@code null} if not set.
039    */
040   public List<Tool> getTools() {
041      return u(tools);
042   }
043
044   /**
045    * Sets the tool descriptors.
046    *
047    * @param value The new value.  Can be <jk>null</jk> to unset the property.
048    * @return This object (for method chaining).
049    */
050   public ListToolsResult setTools(List<Tool> value) {
051      tools = value;
052      return this;
053   }
054
055   /**
056    * Sets the tool descriptors.
057    *
058    * @param value The new value.  Can be <jk>null</jk> to unset the property.
059    * @return This object (for method chaining).
060    */
061   public ListToolsResult setTools(Tool...value) {
062      tools = list(value);
063      return this;
064   }
065
066   /**
067    * Appends to the tool descriptors.
068    *
069    * @param value The values to append.
070    * @return This object (for method chaining).
071    */
072   public ListToolsResult addTools(Tool...value) {
073      if (tools == null)
074         tools = list();
075      Collections.addAll(tools, value);
076      return this;
077   }
078
079   /**
080    * Appends to the tool descriptors.
081    *
082    * @param value The values to append.
083    * @return This object (for method chaining).
084    */
085   public ListToolsResult addTools(Collection<Tool> value) {
086      if (tools == null)
087         tools = list();
088      tools.addAll(value);
089      return this;
090   }
091
092   /**
093    * Pagination cursor for the next page.
094    *
095    * @return The cursor, or {@code null} if not set.
096    */
097   public String getNextCursor() {
098      return nextCursor;
099   }
100
101   /**
102    * Sets the next cursor.
103    *
104    * @param value The new value.  Can be <jk>null</jk> to unset the property.
105    * @return This object (for method chaining).
106    */
107   public ListToolsResult setNextCursor(String value) {
108      nextCursor = value;
109      return this;
110   }
111}