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.v20260728; 018 019import org.apache.juneau.bean.jsonschema.*; 020import org.apache.juneau.marshall.*; 021 022/** 023 * MCP tool descriptor ({@code tools/list} entry). 024 * 025 * <p> 026 * Input and output schemas are direct Draft-2020-12 {@link JsonSchema} beans; there is no MCP-specific schema 027 * wrapper type. 028 */ 029@Marshalled 030@SuppressWarnings({ 031 "java:S1452" // Intentional public API return: the concrete JsonSchema<T> self-type is not known to this bean, and JsonSchema<?> is the only type that can expose the shared bean without binding callers to one subtype. 032}) 033public class Tool { 034 035 private String name; 036 private String description; 037 private JsonSchema<?> inputSchema; 038 private JsonSchema<?> outputSchema; 039 040 /** 041 * Tool name. 042 * 043 * @return The name, or {@code null} if not set. 044 */ 045 public String getName() { 046 return name; 047 } 048 049 /** 050 * Sets the tool name. 051 * 052 * @param value The new value. Can be <jk>null</jk> to unset the property. 053 * @return This object (for method chaining). 054 */ 055 public Tool setName(String value) { 056 name = value; 057 return this; 058 } 059 060 /** 061 * Human-readable description. 062 * 063 * @return The description, or {@code null} if not set. 064 */ 065 public String getDescription() { 066 return description; 067 } 068 069 /** 070 * Sets the description. 071 * 072 * @param value The new value. Can be <jk>null</jk> to unset the property. 073 * @return This object (for method chaining). 074 */ 075 public Tool setDescription(String value) { 076 description = value; 077 return this; 078 } 079 080 /** 081 * Draft-2020-12 JSON Schema for tool arguments. 082 * 083 * @return The input schema, or {@code null} if not set. 084 */ 085 public JsonSchema<?> getInputSchema() { 086 return inputSchema; 087 } 088 089 /** 090 * Sets the input schema. 091 * 092 * @param value The new value. Can be <jk>null</jk> to unset the property. 093 * @return This object (for method chaining). 094 */ 095 public Tool setInputSchema(JsonSchema<?> value) { 096 inputSchema = value; 097 return this; 098 } 099 100 /** 101 * Draft-2020-12 JSON Schema for structured tool output. 102 * 103 * @return The output schema, or {@code null} if not set. 104 */ 105 public JsonSchema<?> getOutputSchema() { 106 return outputSchema; 107 } 108 109 /** 110 * Sets the output schema. 111 * 112 * @param value The new value. Can be <jk>null</jk> to unset the property. 113 * @return This object (for method chaining). 114 */ 115 public Tool setOutputSchema(JsonSchema<?> value) { 116 outputSchema = value; 117 return this; 118 } 119}