Package group.worldstandard.pudel.api.agent
package group.worldstandard.pudel.api.agent
AI Agent Tools API for plugin developers.
This package provides the interfaces and classes needed to create custom tools that the AI agent can use when processing user requests. Plugins can register tools that extend the agent's capabilities with domain-specific functionality.
Key Components:
AgentTool- Annotation for marking methods as agent toolsAgentToolProvider- Interface for tool provider classesAgentToolRegistry- Registry for managing agent toolsAgentToolContext- Context provided during tool executionToolDefinition- Programmatic tool definition builderToolResult- Result of tool execution
Creating a Tool:
public class WeatherTools implements AgentToolProvider {
@AgentTool(
name = "get_weather",
description = "Get the current weather for a location",
keywords = {"weather", "temperature"}
)
public String getWeather(AgentToolContext context, String location) {
return "Weather in " + location + ": Sunny, 25°C";
}
}
// Register in your plugin:
@OnEnable
public void onEnable(PluginContext context) {
context.getAgentToolRegistry().registerProvider("my-plugin", new WeatherTools());
}
- Since:
- 2.3.0
-
ClassDescriptionMarks a method as an AI Agent Tool.Permission levels for agent tools.Provides contextual information about the environment in which an agent tool is being executed.Interface for classes that provide agent tools.Registry for managing agent tools from plugins.Marks a method as an MCP (Model Context Protocol) tool.MCP-compatible tool definition with JSON Schema for parameters.Functional interface for MCP tool execution.Registry for MCP (Model Context Protocol) tools.Definition of an agent tool.Builder class for constructing ToolDefinition instances.Represents a parameter for a tool, defining its characteristics such as name, type, description, whether it is required, and its default value.Result of executing an agent tool.