Initial library commit

This commit was merged in pull request #2.
This commit is contained in:
shahondin1624
2026-02-07 08:58:54 +01:00
committed by shahondin1624
parent 92adbc9515
commit 3da5013cbc
8 changed files with 668 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package mcp.tools;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotation to mark an {@link McpTool} for automatic discovery and registration.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface DefaultMcpTool {
/**
* Whether this tool is enabled for automatic registration.
*
* @return true if enabled, false otherwise.
*/
boolean enabled() default true;
}

View File

@@ -0,0 +1,18 @@
package mcp.tools;
import io.modelcontextprotocol.spec.McpSchema;
import java.util.Map;
/**
* Interface for implementing MCP tools.
* <p>
* Implementations must have a public no-args constructor if they are to be
* discovered automatically via {@link DefaultMcpTool}.
*/
public interface McpTool {
String name();
String description();
String schema();
McpSchema.CallToolResult call(McpSchema.CallToolRequest request, Map<String, Object> arguments);
}