Documentation
¶
Overview ¶
Package tools provides the tool system for AI agents. It follows patterns from pi-agent and clawdbot for tool registration, execution, and policy enforcement.
Index ¶
- Constants
- Variables
- func IsBossTool(toolName string) bool
- func IsPluginTool(tool *Tool) bool
- func IsSessionTool(toolName string) bool
- func PluginIDForTool(tool *Tool) (string, bool)
- func ReadBool(params map[string]any, key string, defaultVal bool) bool
- func ReadInt(params map[string]any, key string, required bool) (int, error)
- func ReadIntDefault(params map[string]any, key string, defaultVal int) int
- func ReadMap(params map[string]any, key string, required bool) (map[string]any, error)
- func ReadNumber(params map[string]any, key string, required bool) (float64, error)
- func ReadString(params map[string]any, key string, required bool) (string, error)
- func ReadStringArray(params map[string]any, key string) []string
- func ReadStringDefault(params map[string]any, key, defaultVal string) string
- func ReadStringSlice(params map[string]any, key string, required bool) ([]string, error)
- type AgentData
- type AgentStoreInterface
- type BossToolExecutor
- func (e *BossToolExecutor) ExecuteCreateAgent(ctx context.Context, input map[string]any) (*Result, error)
- func (e *BossToolExecutor) ExecuteDeleteAgent(ctx context.Context, input map[string]any) (*Result, error)
- func (e *BossToolExecutor) ExecuteEditAgent(ctx context.Context, input map[string]any) (*Result, error)
- func (e *BossToolExecutor) ExecuteForkAgent(ctx context.Context, input map[string]any) (*Result, error)
- func (e *BossToolExecutor) ExecuteListAgents(ctx context.Context, _ map[string]any) (*Result, error)
- func (e *BossToolExecutor) ExecuteListModels(ctx context.Context, _ map[string]any) (*Result, error)
- func (e *BossToolExecutor) ExecuteModifyRoom(ctx context.Context, input map[string]any) (*Result, error)
- func (e *BossToolExecutor) ExecuteRunInternalCommand(ctx context.Context, input map[string]any) (*Result, error)
- type ContentBlock
- type ModelData
- type Registry
- type Result
- type ResultStatus
- type RoomData
- type SubagentConfig
- type Tool
- type ToolInfo
- type ToolType
Constants ¶
const ( GroupSearch = toolpolicy.GroupSearch GroupCalc = toolpolicy.GroupCalc GroupBuilder = toolpolicy.GroupBuilder GroupMessaging = toolpolicy.GroupMessaging GroupSessions = toolpolicy.GroupSessions GroupMemory = toolpolicy.GroupMemory GroupWeb = toolpolicy.GroupWeb GroupMedia = toolpolicy.GroupMedia GroupStatus = toolpolicy.GroupStatus GroupOpenClaw = toolpolicy.GroupOpenClaw GroupFS = toolpolicy.GroupFS )
Tool group constants for policy composition (OpenClaw-style shorthands).
Variables ¶
var ( MessageTool = &Tool{ Tool: mcp.Tool{ Name: toolspec.MessageName, Description: toolspec.MessageDescription, Annotations: &mcp.ToolAnnotations{Title: "Message"}, InputSchema: toolspec.MessageSchema(), }, Type: ToolTypeBuiltin, Group: GroupMessaging, } WebFetchTool = &Tool{ Tool: mcp.Tool{ Name: toolspec.WebFetchName, Description: toolspec.WebFetchDescription, Annotations: &mcp.ToolAnnotations{Title: "Web Fetch"}, InputSchema: toolspec.WebFetchSchema(), }, Type: ToolTypeBuiltin, Group: GroupWeb, } SessionStatusTool = &Tool{ Tool: mcp.Tool{ Name: toolspec.SessionStatusName, Description: toolspec.SessionStatusDescription, Annotations: &mcp.ToolAnnotations{Title: "Session Status"}, InputSchema: toolspec.SessionStatusSchema(), }, Type: ToolTypeBuiltin, Group: GroupStatus, } MemorySearchTool = &Tool{ Tool: mcp.Tool{ Name: toolspec.MemorySearchName, Description: toolspec.MemorySearchDescription, Annotations: &mcp.ToolAnnotations{Title: "Memory Search"}, InputSchema: toolspec.MemorySearchSchema(), }, Type: ToolTypeBuiltin, Group: GroupMemory, } MemoryGetTool = &Tool{ Tool: mcp.Tool{ Name: toolspec.MemoryGetName, Description: toolspec.MemoryGetDescription, Annotations: &mcp.ToolAnnotations{Title: "Memory Get"}, InputSchema: toolspec.MemoryGetSchema(), }, Type: ToolTypeBuiltin, Group: GroupMemory, } ImageTool = &Tool{ Tool: mcp.Tool{ Name: toolspec.ImageName, Description: toolspec.ImageDescription, Annotations: &mcp.ToolAnnotations{Title: "Image"}, InputSchema: toolspec.ImageSchema(), }, Type: ToolTypeBuiltin, Group: GroupMedia, } ImageGenerateTool = &Tool{ Tool: mcp.Tool{ Name: toolspec.ImageGenerateName, Description: toolspec.ImageGenerateDescription, Annotations: &mcp.ToolAnnotations{Title: "Image Generate"}, InputSchema: toolspec.ImageGenerateSchema(), }, Type: ToolTypeBuiltin, Group: GroupMedia, } TTSTool = &Tool{ Tool: mcp.Tool{ Name: toolspec.TTSName, Description: toolspec.TTSDescription, Annotations: &mcp.ToolAnnotations{Title: "TTS"}, InputSchema: toolspec.TTSSchema(), }, Type: ToolTypeBuiltin, Group: GroupMedia, } GravatarFetchTool = &Tool{ Tool: mcp.Tool{ Name: toolspec.GravatarFetchName, Description: toolspec.GravatarFetchDescription, Annotations: &mcp.ToolAnnotations{Title: "Gravatar Fetch"}, InputSchema: toolspec.GravatarFetchSchema(), }, Type: ToolTypeBuiltin, Group: GroupOpenClaw, } GravatarSetTool = &Tool{ Tool: mcp.Tool{ Name: toolspec.GravatarSetName, Description: toolspec.GravatarSetDescription, Annotations: &mcp.ToolAnnotations{Title: "Gravatar Set"}, InputSchema: toolspec.GravatarSetSchema(), }, Type: ToolTypeBuiltin, Group: GroupOpenClaw, } )
var ( ReadTool = newUnavailableBuiltinTool(unavailableBuiltinToolSpec{ name: toolspec.ReadName, description: toolspec.ReadDescription, title: "Read", inputSchema: toolspec.ReadSchema(), }) WriteTool = newUnavailableBuiltinTool(unavailableBuiltinToolSpec{ name: toolspec.WriteName, description: toolspec.WriteDescription, title: "Write", inputSchema: toolspec.WriteSchema(), }) EditTool = newUnavailableBuiltinTool(unavailableBuiltinToolSpec{ name: toolspec.EditName, description: toolspec.EditDescription, title: "Edit", inputSchema: toolspec.EditSchema(), }) )
var AgentsListTool = &Tool{ Tool: mcp.Tool{ Name: "agents_list", Description: "List agent ids you can target with sessions_spawn (based on allowlists).", Annotations: &mcp.ToolAnnotations{Title: "Agents List"}, InputSchema: toolspec.EmptyObjectSchema(), }, Type: ToolTypeBuiltin, Group: GroupSessions, }
AgentsListTool lists agent ids allowed for sessions_spawn.
var ApplyPatchTool = newUnavailableBuiltinTool(unavailableBuiltinToolSpec{ name: toolspec.ApplyPatchName, description: toolspec.ApplyPatchDescription, title: "Apply Patch", inputSchema: toolspec.ApplyPatchSchema(), })
var BeeperDocsTool = newConnectorOnlyTool( toolspec.BeeperDocsName, toolspec.BeeperDocsDescription, "Beeper Docs", toolspec.BeeperDocsSchema(), )
BeeperDocsTool is the Beeper help documentation search tool.
var BeeperSendFeedbackTool = newConnectorOnlyTool( toolspec.BeeperSendFeedbackName, toolspec.BeeperSendFeedbackDescription, "Beeper Send Feedback", toolspec.BeeperSendFeedbackSchema(), )
BeeperSendFeedbackTool is the Beeper feedback submission tool.
var Calculator = &Tool{ Tool: mcp.Tool{ Name: toolspec.CalculatorName, Description: toolspec.CalculatorDescription, Annotations: &mcp.ToolAnnotations{Title: "Calculator"}, InputSchema: toolspec.CalculatorSchema(), }, Type: ToolTypeBuiltin, Group: GroupCalc, Execute: executeCalculator, }
Calculator is the calculator tool definition.
var CreateAgentTool = &Tool{ Tool: mcp.Tool{ Name: "create_agent", Description: "Create a new AI agent with custom configuration", Annotations: &mcp.ToolAnnotations{Title: "Create Agent"}, InputSchema: toolspec.ObjectSchema(map[string]any{ "name": toolspec.StringProperty("Display name for the agent"), "description": toolspec.StringProperty("Brief description of what the agent does"), "model": toolspec.StringProperty("Model ID to use (e.g., 'anthropic/claude-sonnet-4.5'). Leave empty for default."), "system_prompt": toolspec.StringProperty("Custom system prompt for the agent"), "tools": toolPolicySchema(), "subagents": subagentSchema(), }, "name"), }, Type: ToolTypeBuiltin, Group: GroupBuilder, }
CreateAgentTool tool definition.
var CronTool = &Tool{ Tool: mcp.Tool{ Name: toolspec.CronName, Description: toolspec.CronDescription, Annotations: &mcp.ToolAnnotations{Title: "Scheduler"}, InputSchema: toolspec.CronSchema(), }, Type: ToolTypeBuiltin, Group: GroupOpenClaw, }
var DeleteAgentTool = &Tool{ Tool: mcp.Tool{ Name: "delete_agent", Description: "Delete a custom agent (preset agents cannot be deleted)", Annotations: &mcp.ToolAnnotations{Title: "Delete Agent"}, InputSchema: toolspec.ObjectSchema(map[string]any{ "agent_id": toolspec.StringProperty("ID of the agent to delete"), }, "agent_id"), }, Type: ToolTypeBuiltin, Group: GroupBuilder, }
DeleteAgentTool tool definition.
var EditAgentTool = &Tool{ Tool: mcp.Tool{ Name: "edit_agent", Description: "Modify an existing custom agent's configuration", Annotations: &mcp.ToolAnnotations{Title: "Edit Agent"}, InputSchema: toolspec.ObjectSchema(map[string]any{ "agent_id": toolspec.StringProperty("ID of the agent to edit"), "name": toolspec.StringProperty("New display name"), "description": toolspec.StringProperty("New description"), "model": toolspec.StringProperty("New model ID"), "system_prompt": toolspec.StringProperty("New system prompt"), "tools": toolPolicySchema(), "subagents": subagentSchema(), }, "agent_id"), }, Type: ToolTypeBuiltin, Group: GroupBuilder, }
EditAgentTool tool definition.
var ForkAgentTool = &Tool{ Tool: mcp.Tool{ Name: "fork_agent", Description: "Create a copy of an existing agent as a new custom agent", Annotations: &mcp.ToolAnnotations{Title: "Fork Agent"}, InputSchema: toolspec.ObjectSchema(map[string]any{ "source_id": toolspec.StringProperty("ID of the agent to copy"), "new_name": toolspec.StringProperty("Name for the new agent (defaults to '[Original Name] (Fork)')"), }, "source_id"), }, Type: ToolTypeBuiltin, Group: GroupBuilder, }
ForkAgentTool tool definition.
var ListAgentsTool = &Tool{ Tool: mcp.Tool{ Name: "list_agents", Description: "List all available agents (both preset and custom)", Annotations: &mcp.ToolAnnotations{Title: "List Agents"}, InputSchema: toolspec.EmptyObjectSchema(), }, Type: ToolTypeBuiltin, Group: GroupBuilder, }
ListAgentsTool tool definition.
var ListModelsTool = &Tool{ Tool: mcp.Tool{ Name: "list_models", Description: "List all available AI models", Annotations: &mcp.ToolAnnotations{Title: "List Models"}, InputSchema: toolspec.EmptyObjectSchema(), }, Type: ToolTypeBuiltin, Group: GroupSessions, }
ListModelsTool tool definition.
var ModifyRoomTool = &Tool{ Tool: mcp.Tool{ Name: "modify_room", Description: "Modify an existing room's configuration", Annotations: &mcp.ToolAnnotations{Title: "Modify Room"}, InputSchema: toolspec.ObjectSchema(map[string]any{ "room_id": toolspec.StringProperty("ID of the room to modify"), "name": toolspec.StringProperty("New display name for the room"), "agent_id": toolspec.StringProperty("New agent ID to assign to this room"), "system_prompt": toolspec.StringProperty("New system prompt override for this room"), }, "room_id"), }, Type: ToolTypeBuiltin, Group: GroupSessions, }
ModifyRoomTool tool definition.
var RunInternalCommandTool = &Tool{ Tool: mcp.Tool{ Name: "run_internal_command", Description: "Run an internal !ai command in a target room", Annotations: &mcp.ToolAnnotations{Title: "Run Internal Command"}, InputSchema: toolspec.ObjectSchema(map[string]any{ "command": toolspec.StringProperty("The !ai command to run (with or without prefix)"), "room_id": toolspec.StringProperty("Optional target room ID (defaults to the current room)"), }, "command"), }, Type: ToolTypeBuiltin, Group: GroupBuilder, }
RunInternalCommandTool tool definition.
var SessionsHistoryTool = &Tool{ Tool: mcp.Tool{ Name: "sessions_history", Description: "Fetch message history for a session. Use the sessionKey from sessions_list.", Annotations: &mcp.ToolAnnotations{Title: "Session History"}, InputSchema: toolspec.ObjectSchema(map[string]any{ "sessionKey": toolspec.StringProperty("Session identifier from sessions_list (preferred canonical target)"), "limit": toolspec.NumberProperty("Maximum number of messages to return (default: 200)"), "includeTools": toolspec.BooleanProperty("Whether to include tool calls in the returned history"), }, "sessionKey"), }, Type: ToolTypeBuiltin, Group: GroupSessions, }
SessionsHistoryTool tool definition.
var SessionsListTool = &Tool{ Tool: mcp.Tool{ Name: "sessions_list", Description: "List sessions with optional filters and last messages.", Annotations: &mcp.ToolAnnotations{Title: "List Sessions"}, InputSchema: toolspec.ObjectSchema(map[string]any{ "kinds": map[string]any{ "type": "array", "items": map[string]any{"type": "string"}, }, "limit": toolspec.NumberProperty("Maximum number of sessions to return (default: 50)"), "activeMinutes": toolspec.NumberProperty("Only include sessions active within this many minutes"), "messageLimit": toolspec.NumberProperty("Include the last N messages for each session"), }), }, Type: ToolTypeBuiltin, Group: GroupSessions, }
SessionsListTool tool definition.
var SessionsSendTool = &Tool{ Tool: mcp.Tool{ Name: "sessions_send", Description: "Send a message into another session. Prefer the sessionKey from sessions_list; label is fallback only.", Annotations: &mcp.ToolAnnotations{Title: "Send to Session"}, InputSchema: toolspec.ObjectSchema(map[string]any{ "sessionKey": toolspec.StringProperty("Session identifier from sessions_list (preferred canonical target)"), "label": toolspec.StringProperty("Session label fallback (can be ambiguous; sessionKey is preferred)"), "agentId": toolspec.StringProperty("Agent id filter for label lookups"), "message": toolspec.StringProperty("The message to send"), "timeoutSeconds": toolspec.NumberProperty("Optional timeout for the remote session"), }, "message"), }, Type: ToolTypeBuiltin, Group: GroupSessions, }
SessionsSendTool tool definition.
var SessionsSpawnTool = &Tool{ Tool: mcp.Tool{ Name: "sessions_spawn", Description: "Spawn a background sub-agent run in an isolated session and announce the result back to the requester chat.", Annotations: &mcp.ToolAnnotations{Title: "Spawn Session"}, InputSchema: toolspec.ObjectSchema(map[string]any{ "task": toolspec.StringProperty("Task description for the sub-agent."), "label": toolspec.StringProperty("Optional label for the sub-agent run."), "agentId": toolspec.StringProperty("Agent ID override for the sub-agent run."), "model": toolspec.StringProperty("Optional model override (provider/model)."), "thinking": toolspec.StringProperty("Optional thinking level override."), "runTimeoutSeconds": toolspec.NumberProperty("Optional run timeout in seconds."), "cleanup": map[string]any{ "type": "string", "enum": []string{"delete", "keep"}, "description": "Cleanup policy for the spawned session.", }, }, "task"), }, Type: ToolTypeBuiltin, Group: GroupSessions, }
SessionsSpawnTool tool definition.
var WebSearch = &Tool{ Tool: mcp.Tool{ Name: toolspec.WebSearchName, Description: toolspec.WebSearchDescription, Annotations: &mcp.ToolAnnotations{Title: "Web Search"}, InputSchema: toolspec.WebSearchSchema(), }, Type: ToolTypeBuiltin, Group: GroupSearch, Execute: executeWebSearch, }
WebSearch is the web search tool definition.
Functions ¶
func IsBossTool ¶
IsBossTool checks if a tool name is a Boss agent tool.
func IsPluginTool ¶
IsPluginTool reports whether the tool is a plugin tool.
func IsSessionTool ¶
IsSessionTool checks if a tool name is a session tool.
func PluginIDForTool ¶
PluginIDForTool returns the plugin id for a tool when available. This is used for OpenClaw-style plugin group expansion.
func ReadIntDefault ¶
ReadIntDefault reads an integer parameter with a default value.
func ReadNumber ¶
ReadNumber reads a numeric parameter from input. Following clawdbot's readNumberParam pattern.
func ReadString ¶
ReadString reads a string parameter from input. Following clawdbot's readStringParam pattern.
func ReadStringArray ¶
ReadStringArray reads a string array parameter, returning nil if not present. Convenience wrapper around ReadStringSlice that ignores errors.
func ReadStringDefault ¶
ReadStringDefault reads a string parameter with a default value.
Types ¶
type AgentData ¶
type AgentData struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Model string `json:"model,omitempty"`
SystemPrompt string `json:"system_prompt,omitempty"`
Tools *toolpolicy.ToolPolicyConfig `json:"tools,omitempty"`
Subagents *SubagentConfig `json:"subagents,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
IsPreset bool `json:"is_preset,omitempty"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
AgentData represents agent data for boss tools (avoids import cycle).
type AgentStoreInterface ¶
type AgentStoreInterface interface {
LoadAgents(ctx context.Context) (map[string]AgentData, error)
SaveAgent(ctx context.Context, agent AgentData) error
DeleteAgent(ctx context.Context, agentID string) error
ListModels(ctx context.Context) ([]ModelData, error)
ListAvailableTools(ctx context.Context) ([]ToolInfo, error)
RunInternalCommand(ctx context.Context, roomID string, command string) (string, error)
// Room management
CreateRoom(ctx context.Context, room RoomData) (string, error)
ModifyRoom(ctx context.Context, roomID string, updates RoomData) error
ListRooms(ctx context.Context) ([]RoomData, error)
}
AgentStoreInterface is the interface that the boss tools need. This matches the AgentStore interface in the agents package but avoids import cycle.
type BossToolExecutor ¶
type BossToolExecutor struct {
// contains filtered or unexported fields
}
BossToolExecutor handles boss tool execution with access to the agent store.
func NewBossToolExecutor ¶
func NewBossToolExecutor(store AgentStoreInterface) *BossToolExecutor
NewBossToolExecutor creates a new boss tool executor.
func (*BossToolExecutor) ExecuteCreateAgent ¶
func (e *BossToolExecutor) ExecuteCreateAgent(ctx context.Context, input map[string]any) (*Result, error)
ExecuteCreateAgent handles the create_agent tool.
func (*BossToolExecutor) ExecuteDeleteAgent ¶
func (e *BossToolExecutor) ExecuteDeleteAgent(ctx context.Context, input map[string]any) (*Result, error)
ExecuteDeleteAgent handles the delete_agent tool.
func (*BossToolExecutor) ExecuteEditAgent ¶
func (e *BossToolExecutor) ExecuteEditAgent(ctx context.Context, input map[string]any) (*Result, error)
ExecuteEditAgent handles the edit_agent tool.
func (*BossToolExecutor) ExecuteForkAgent ¶
func (e *BossToolExecutor) ExecuteForkAgent(ctx context.Context, input map[string]any) (*Result, error)
ExecuteForkAgent handles the fork_agent tool.
func (*BossToolExecutor) ExecuteListAgents ¶
func (e *BossToolExecutor) ExecuteListAgents(ctx context.Context, _ map[string]any) (*Result, error)
ExecuteListAgents handles the list_agents tool.
func (*BossToolExecutor) ExecuteListModels ¶
func (e *BossToolExecutor) ExecuteListModels(ctx context.Context, _ map[string]any) (*Result, error)
ExecuteListModels handles the list_models tool.
func (*BossToolExecutor) ExecuteModifyRoom ¶
func (e *BossToolExecutor) ExecuteModifyRoom(ctx context.Context, input map[string]any) (*Result, error)
ExecuteModifyRoom handles the modify_room tool.
func (*BossToolExecutor) ExecuteRunInternalCommand ¶
func (e *BossToolExecutor) ExecuteRunInternalCommand(ctx context.Context, input map[string]any) (*Result, error)
ExecuteRunInternalCommand handles the run_internal_command tool.
type ContentBlock ¶
type ContentBlock struct {
Type string `json:"type"` // "text", "image"
Text string `json:"text,omitempty"` // For text blocks
Data string `json:"data,omitempty"` // Base64 for images
MimeType string `json:"mimeType,omitempty"` // For images
}
ContentBlock supports multi-modal results (text, images, artifacts).
type ModelData ¶
type ModelData struct {
ID string `json:"id"`
Name string `json:"name"`
Provider string `json:"provider,omitempty"`
Description string `json:"description,omitempty"`
}
ModelData represents model data for boss tools.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages available tools with grouping and aliasing support.
func DefaultRegistry ¶
func DefaultRegistry() *Registry
DefaultRegistry returns a registry with all default tools registered.
type Result ¶
type Result struct {
Status ResultStatus `json:"status"` // success, error, partial
Content []ContentBlock `json:"content,omitempty"` // Multi-block: text, images
Details map[string]any `json:"details,omitempty"` // Structured metadata for parsing
Error string `json:"error,omitempty"`
}
Result standardizes tool output following clawdbot's jsonResult pattern.
func ErrorResult ¶
ErrorResult creates an error result. Follows clawdbot pattern: don't throw, return structured errors.
func JSONResult ¶
JSONResult creates a structured JSON result from any payload. Following clawdbot's jsonResult pattern.
type ResultStatus ¶
type ResultStatus string
ResultStatus indicates the outcome of tool execution.
const ( // ResultSuccess indicates the tool completed successfully. ResultSuccess ResultStatus = "success" // ResultError indicates the tool failed with an error. ResultError ResultStatus = "error" )
type RoomData ¶
type RoomData struct {
ID string `json:"id"`
Name string `json:"name"`
AgentID string `json:"agent_id,omitempty"`
SystemPrompt string `json:"system_prompt,omitempty"`
CreatedAt int64 `json:"created_at"`
}
RoomData represents room data for boss tools.
type SubagentConfig ¶
type SubagentConfig struct {
Model string `json:"model,omitempty"`
Thinking string `json:"thinking,omitempty"`
AllowAgents []string `json:"allowAgents,omitempty"`
}
SubagentConfig mirrors OpenClaw-style subagent defaults for tools API payloads.
type Tool ¶
type Tool struct {
mcp.Tool // Name, Description, InputSchema
Type ToolType // builtin, provider, plugin, mcp
Group string // group:search, group:code, etc.
PluginID string // Optional plugin id for grouping
Execute func(ctx context.Context, input map[string]any) (*Result, error) // nil for provider tools
}
Tool wraps an MCP tool with execution logic and metadata.
func BuiltinTools ¶
func BuiltinTools() []*Tool
BuiltinTools returns all locally-executable builtin tools.
func SessionTools ¶
func SessionTools() []*Tool
SessionTools returns the cross-session tools available to non-boss agents.
type ToolInfo ¶
type ToolInfo struct {
Name string `json:"name"`
Description string `json:"description"`
Type ToolType `json:"type"`
Group string `json:"group,omitempty"`
Enabled bool `json:"enabled"`
}
ToolInfo provides metadata about a tool for listing.
type ToolType ¶
type ToolType string
ToolType categorizes tools by their execution model.
const ( // ToolTypeBuiltin are tools implemented locally. ToolTypeBuiltin ToolType = "builtin" // ToolTypeProvider are tools handled by the AI provider's API. ToolTypeProvider ToolType = "provider" // ToolTypePlugin are external plugins (like OpenRouter's :online). ToolTypePlugin ToolType = "plugin" // ToolTypeMCP are tools from MCP servers. ToolTypeMCP ToolType = "mcp" )