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;
018
019import org.jspecify.annotations.NonNull;
020
021import javax.annotation.concurrent.ThreadSafe;
022
023/**
024 * Shallowly immutable arguments for one MCP tool invocation.
025 * <p>
026 * The arguments carrier is safe for concurrent access. The converted argument
027 * value is application-defined and retains its own mutability and thread-safety
028 * contract; this type's {@link ThreadSafe} annotation does not make that value
029 * thread-safe.
030 *
031 * @param <A> bound argument type
032 * @author <a href="https://www.revetkn.com">Mark Allen</a>
033 */
034@ThreadSafe
035public interface McpToolArguments<A> {
036        /**
037         * Returns arguments converted to the registration's declared Java type. The
038         * returned application value retains its own mutability and thread-safety
039         * contract.
040         *
041         * @return converted arguments
042         */
043        @NonNull
044        A getConvertedArguments();
045
046        /**
047         * Returns the validated immutable JSON object received on the wire.
048         *
049         * @return raw arguments
050         */
051        @NonNull
052        McpJsonObject getRawArguments();
053}