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.rest.server.mcp;
018
019/**
020 * Revision-neutral declared argument of a prompt.
021 *
022 * <p>
023 * Supersedes the wire-level {@code PromptArgument} bean.
024 */
025public class McpPromptArgument {
026
027   private String name;
028   private String description;
029   private Boolean required;
030   private McpCompleter completer;
031
032   /**
033    * The argument name.
034    *
035    * @return The name, or <jk>null</jk> if not set.
036    */
037   public String getName() {
038      return name;
039   }
040
041   /**
042    * Sets the argument name.
043    *
044    * @param value The new value. Can be <jk>null</jk> to unset the property.
045    * @return This object.
046    */
047   public McpPromptArgument setName(String value) {
048      name = value;
049      return this;
050   }
051
052   /**
053    * The human-readable argument description.
054    *
055    * @return The description, or <jk>null</jk> if not set.
056    */
057   public String getDescription() {
058      return description;
059   }
060
061   /**
062    * Sets the argument description.
063    *
064    * @param value The new value. Can be <jk>null</jk> to unset the property.
065    * @return This object.
066    */
067   public McpPromptArgument setDescription(String value) {
068      description = value;
069      return this;
070   }
071
072   /**
073    * Whether the argument is required.
074    *
075    * @return The flag, or <jk>null</jk> if not set.
076    */
077   public Boolean getRequired() {
078      return required;
079   }
080
081   /**
082    * Sets whether the argument is required.
083    *
084    * @param value The new value. Can be <jk>null</jk> to unset the property.
085    * @return This object.
086    */
087   public McpPromptArgument setRequired(Boolean value) {
088      required = value;
089      return this;
090   }
091
092   /**
093    * The completer invoked for a {@code completion/complete} request targeting this argument.
094    *
095    * <p>
096    * This is server behavior only: it is never mapped into a dated {@code PromptArgument} wire bean. See
097    * {@link McpServerConfig#promptCompleter(String, String)} for the neutral lookup path that resolves this
098    * property by exact prompt/argument name.
099    *
100    * @return The completer, or <jk>null</jk> if not set.
101    */
102   public McpCompleter getCompleter() {
103      return completer;
104   }
105
106   /**
107    * Sets the completer invoked for a {@code completion/complete} request targeting this argument.
108    *
109    * @param value The new value. Can be <jk>null</jk> to unset the property.
110    * @return This object.
111    */
112   public McpPromptArgument setCompleter(McpCompleter value) {
113      completer = value;
114      return this;
115   }
116}