001/*
002 * Copyright 2022-2026 Revetware LLC.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package com.soklet.annotation;
018
019import org.jspecify.annotations.NonNull;
020
021import java.lang.annotation.ElementType;
022import java.lang.annotation.Retention;
023import java.lang.annotation.RetentionPolicy;
024import java.lang.annotation.Target;
025
026/**
027 * Supplies published JSON-property metadata for a component of an ordinary
028 * typed tool input or output record.
029 * <p>
030 * Requiredness is inferred from the declared component type: {@code T} is
031 * required and {@code Optional<T>} is optional. A blank {@link #name()} uses
032 * the Java record-component name. Explicit names provide a stable public
033 * contract across Java refactoring.
034 *
035 * @author <a href="https://www.revetkn.com">Mark Allen</a>
036 */
037@Target(ElementType.RECORD_COMPONENT)
038@Retention(RetentionPolicy.RUNTIME)
039public @interface McpToolProperty {
040        /**
041         * The published property name.
042         *
043         * @return the property name, or an empty string to use the Java
044         * record-component name
045         */
046        @NonNull
047        String name() default "";
048
049        /**
050         * The optional human-readable property title.
051         *
052         * @return the title, or an empty string if none is configured
053         */
054        @NonNull
055        String title() default "";
056
057        /**
058         * The optional human-readable property description.
059         *
060         * @return the description, or an empty string if none is configured
061         */
062        @NonNull
063        String description() default "";
064}