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 org.apache.juneau.marshall.*;
020
021/**
022 * MCP tool descriptor ({@code tools/list} entry).
023 */
024@Marshalled
025public class Tool {
026
027   private String name;
028   private String description;
029   private JsonSchema inputSchema;
030   private JsonSchema outputSchema;
031
032   /**
033    * Tool name.
034    *
035    * @return The name, or {@code null} if not set.
036    */
037   public String getName() {
038      return name;
039   }
040
041   /**
042    * Sets the tool name.
043    *
044    * @param value The new value.  Can be <jk>null</jk> to unset the property.
045    * @return This object (for method chaining).
046    */
047   public Tool setName(String value) {
048      name = value;
049      return this;
050   }
051
052   /**
053    * Human-readable description.
054    *
055    * @return The description, or {@code null} if not set.
056    */
057   public String getDescription() {
058      return description;
059   }
060
061   /**
062    * Sets the description.
063    *
064    * @param value The new value.  Can be <jk>null</jk> to unset the property.
065    * @return This object (for method chaining).
066    */
067   public Tool setDescription(String value) {
068      description = value;
069      return this;
070   }
071
072   /**
073    * JSON Schema for tool arguments.
074    *
075    * @return The input schema, or {@code null} if not set.
076    */
077   public JsonSchema getInputSchema() {
078      return inputSchema;
079   }
080
081   /**
082    * Sets the input schema.
083    *
084    * @param value The new value.  Can be <jk>null</jk> to unset the property.
085    * @return This object (for method chaining).
086    */
087   public Tool setInputSchema(JsonSchema value) {
088      inputSchema = value;
089      return this;
090   }
091
092   /**
093    * JSON Schema for the structured content returned by the tool.
094    *
095    * <p>MCP 2025-06-18 requires this, when present, to be an object schema, but enforcement of that
096    * constraint belongs to the REST adapter, not this DTO.
097    *
098    * @return The output schema, or {@code null} if not set.
099    */
100   public JsonSchema getOutputSchema() {
101      return outputSchema;
102   }
103
104   /**
105    * Sets the output schema.
106    *
107    * @param value The new value.  Can be <jk>null</jk> to unset the property.
108    * @return This object (for method chaining).
109    */
110   public Tool setOutputSchema(JsonSchema value) {
111      outputSchema = value;
112      return this;
113   }
114}