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 021/** 022 * Supported scalar schema types for the programmatic MCP schema DSL. 023 * 024 * @author <a href="https://www.revetkn.com">Mark Allen</a> 025 */ 026public enum McpType { 027 STRING, 028 INTEGER, 029 NUMBER, 030 BOOLEAN, 031 UUID; 032 033 @NonNull 034 McpObject toSchemaValue() { 035 return switch (this) { 036 case STRING -> new McpObject(java.util.Map.of("type", new McpString("string"))); 037 case INTEGER -> new McpObject(java.util.Map.of("type", new McpString("integer"))); 038 case NUMBER -> new McpObject(java.util.Map.of("type", new McpString("number"))); 039 case BOOLEAN -> new McpObject(java.util.Map.of("type", new McpString("boolean"))); 040 case UUID -> new McpObject(java.util.Map.of( 041 "type", new McpString("string"), 042 "format", new McpString("uuid") 043 )); 044 }; 045 } 046}