Package dev.relism.flash.ext.mcp
Annotation Interface Tool
Marks a
.
McpTool subclass as an MCP tool and declares its metadata, discovered by
invalid reference
McpConfig#toolsPackage(String)
@Tool(
name = "get_weather",
description = "Get current weather for a city",
args = @ToolArg(name = "city", description = "City name", required = true)
)
public class GetWeatherTool extends McpTool {
@Override
public ToolResponse call(ToolArguments args) {
return ToolResponse.success(new TextContent(weatherService.fetch(args.getString("city"))));
}
}
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
name
String nameUnique tool name (used by clients intools/call). -
description
String descriptionHuman/model-readable description of what the tool does.- Default:
""
-
title
String titleOptional display title, distinct fromname().- Default:
""
-
args
ToolArg[] argsInput arguments — assembled into the tool's JSON SchemainputSchemaonce at boot.- Default:
{}
-