Documentation
¶
Overview ¶
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Package tools provides tool implementations used by the Gemini agent. Copyright 2025 Tomohiro Owada Copyright 2026 k-sub1995 SPDX-License-Identifier: Apache-2.0
Index ¶
- type ActivateSkillTool
- type AskUserTool
- type EditTool
- type EnterPlanModeTool
- type ExitPlanModeTool
- type GlobTool
- type GrepTool
- type InternalDocsTool
- type LsTool
- type MCPToolRef
- type MemoryTool
- type ReadFileTool
- type ReadManyFilesTool
- type Registry
- func (r *Registry) AllDeclarations() []api.FunctionDecl
- func (r *Registry) AllMCPDeclarations(schemas map[string]api.FunctionDecl) []api.FunctionDecl
- func (r *Registry) Get(name string) (Tool, bool)
- func (r *Registry) GetMCPRef(name string) (MCPToolRef, bool)
- func (r *Registry) RegisterMCPTool(serverName, toolName string)
- type RegistryOptions
- type ShellTool
- type TodosTool
- type Tool
- type ToolResult
- type WebFetchTool
- type WebSearchFunc
- type WebSearchTool
- type WebSource
- type WriteFileTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivateSkillTool ¶
type ActivateSkillTool struct {
// contains filtered or unexported fields
}
func NewActivateSkillTool ¶
func NewActivateSkillTool(opts RegistryOptions) *ActivateSkillTool
func (*ActivateSkillTool) Declaration ¶
func (t *ActivateSkillTool) Declaration() api.FunctionDecl
func (*ActivateSkillTool) Execute ¶
func (t *ActivateSkillTool) Execute(ctx context.Context, args map[string]interface{}) (*ToolResult, error)
func (*ActivateSkillTool) Name ¶
func (t *ActivateSkillTool) Name() string
type AskUserTool ¶
type AskUserTool struct {
// contains filtered or unexported fields
}
func NewAskUserTool ¶
func NewAskUserTool(opts RegistryOptions) *AskUserTool
func (*AskUserTool) Declaration ¶
func (t *AskUserTool) Declaration() api.FunctionDecl
func (*AskUserTool) Execute ¶
func (t *AskUserTool) Execute(ctx context.Context, args map[string]interface{}) (*ToolResult, error)
func (*AskUserTool) Name ¶
func (t *AskUserTool) Name() string
type EditTool ¶
type EditTool struct {
// contains filtered or unexported fields
}
func NewEditTool ¶
func NewEditTool(opts RegistryOptions) *EditTool
func (*EditTool) Declaration ¶
func (t *EditTool) Declaration() api.FunctionDecl
type EnterPlanModeTool ¶
type EnterPlanModeTool struct {
// contains filtered or unexported fields
}
func NewEnterPlanModeTool ¶
func NewEnterPlanModeTool(opts RegistryOptions) *EnterPlanModeTool
func (*EnterPlanModeTool) Declaration ¶
func (t *EnterPlanModeTool) Declaration() api.FunctionDecl
func (*EnterPlanModeTool) Execute ¶
func (t *EnterPlanModeTool) Execute(ctx context.Context, args map[string]interface{}) (*ToolResult, error)
func (*EnterPlanModeTool) Name ¶
func (t *EnterPlanModeTool) Name() string
type ExitPlanModeTool ¶
type ExitPlanModeTool struct {
// contains filtered or unexported fields
}
func NewExitPlanModeTool ¶
func NewExitPlanModeTool(opts RegistryOptions) *ExitPlanModeTool
func (*ExitPlanModeTool) Declaration ¶
func (t *ExitPlanModeTool) Declaration() api.FunctionDecl
func (*ExitPlanModeTool) Execute ¶
func (t *ExitPlanModeTool) Execute(ctx context.Context, args map[string]interface{}) (*ToolResult, error)
func (*ExitPlanModeTool) Name ¶
func (t *ExitPlanModeTool) Name() string
type GlobTool ¶
type GlobTool struct {
// contains filtered or unexported fields
}
func NewGlobTool ¶
func NewGlobTool(opts RegistryOptions) *GlobTool
func (*GlobTool) Declaration ¶
func (t *GlobTool) Declaration() api.FunctionDecl
type GrepTool ¶
type GrepTool struct {
// contains filtered or unexported fields
}
func NewGrepTool ¶
func NewGrepTool(opts RegistryOptions) *GrepTool
func (*GrepTool) Declaration ¶
func (t *GrepTool) Declaration() api.FunctionDecl
type InternalDocsTool ¶
type InternalDocsTool struct {
// contains filtered or unexported fields
}
func NewInternalDocsTool ¶
func NewInternalDocsTool(opts RegistryOptions) *InternalDocsTool
func (*InternalDocsTool) Declaration ¶
func (t *InternalDocsTool) Declaration() api.FunctionDecl
func (*InternalDocsTool) Execute ¶
func (t *InternalDocsTool) Execute(ctx context.Context, args map[string]interface{}) (*ToolResult, error)
func (*InternalDocsTool) Name ¶
func (t *InternalDocsTool) Name() string
type LsTool ¶
type LsTool struct {
// contains filtered or unexported fields
}
func NewLsTool ¶
func NewLsTool(opts RegistryOptions) *LsTool
func (*LsTool) Declaration ¶
func (t *LsTool) Declaration() api.FunctionDecl
type MCPToolRef ¶
MCPToolRef tracks which MCP server owns a tool.
type MemoryTool ¶
type MemoryTool struct {
// contains filtered or unexported fields
}
func NewMemoryTool ¶
func NewMemoryTool(opts RegistryOptions) *MemoryTool
func (*MemoryTool) Declaration ¶
func (t *MemoryTool) Declaration() api.FunctionDecl
func (*MemoryTool) Execute ¶
func (t *MemoryTool) Execute(ctx context.Context, args map[string]interface{}) (*ToolResult, error)
func (*MemoryTool) Name ¶
func (t *MemoryTool) Name() string
type ReadFileTool ¶
type ReadFileTool struct {
// contains filtered or unexported fields
}
func NewReadFileTool ¶
func NewReadFileTool(opts RegistryOptions) *ReadFileTool
func (*ReadFileTool) Declaration ¶
func (t *ReadFileTool) Declaration() api.FunctionDecl
func (*ReadFileTool) Execute ¶
func (t *ReadFileTool) Execute(ctx context.Context, args map[string]interface{}) (*ToolResult, error)
func (*ReadFileTool) Name ¶
func (t *ReadFileTool) Name() string
type ReadManyFilesTool ¶
type ReadManyFilesTool struct {
// contains filtered or unexported fields
}
func NewReadManyFilesTool ¶
func NewReadManyFilesTool(opts RegistryOptions) *ReadManyFilesTool
func (*ReadManyFilesTool) Declaration ¶
func (t *ReadManyFilesTool) Declaration() api.FunctionDecl
func (*ReadManyFilesTool) Execute ¶
func (t *ReadManyFilesTool) Execute(ctx context.Context, args map[string]interface{}) (*ToolResult, error)
func (*ReadManyFilesTool) Name ¶
func (t *ReadManyFilesTool) Name() string
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all available tools (built-in + MCP).
func NewRegistry ¶
func NewRegistry(opts RegistryOptions) *Registry
NewRegistry creates a registry populated with all built-in tools.
func (*Registry) AllDeclarations ¶
func (r *Registry) AllDeclarations() []api.FunctionDecl
AllDeclarations returns FunctionDeclarations for API request.
func (*Registry) AllMCPDeclarations ¶
func (r *Registry) AllMCPDeclarations(schemas map[string]api.FunctionDecl) []api.FunctionDecl
AllMCPDeclarations returns FunctionDeclarations for MCP tools. The caller must provide the actual MCP tool schemas.
func (*Registry) GetMCPRef ¶
func (r *Registry) GetMCPRef(name string) (MCPToolRef, bool)
GetMCPRef returns the MCP reference for a tool.
func (*Registry) RegisterMCPTool ¶
RegisterMCPTool adds an MCP-backed tool to the registry.
type RegistryOptions ¶
type RegistryOptions struct {
WorkDir string
AutoApprove bool
Sandbox bool
Debug bool
WebSearch WebSearchFunc
}
RegistryOptions configures tool behavior.
type ShellTool ¶
type ShellTool struct {
// contains filtered or unexported fields
}
func NewShellTool ¶
func NewShellTool(opts RegistryOptions) *ShellTool
func (*ShellTool) Declaration ¶
func (t *ShellTool) Declaration() api.FunctionDecl
type TodosTool ¶
type TodosTool struct {
// contains filtered or unexported fields
}
func NewTodosTool ¶
func NewTodosTool(opts RegistryOptions) *TodosTool
func (*TodosTool) Declaration ¶
func (t *TodosTool) Declaration() api.FunctionDecl
type Tool ¶
type Tool interface {
Name() string
Declaration() api.FunctionDecl
Execute(ctx context.Context, args map[string]interface{}) (*ToolResult, error)
}
Tool is the interface all built-in tools must implement.
type ToolResult ¶
ToolResult is the standard return value from tool execution.
type WebFetchTool ¶
type WebFetchTool struct {
// contains filtered or unexported fields
}
func NewWebFetchTool ¶
func NewWebFetchTool(opts RegistryOptions) *WebFetchTool
func (*WebFetchTool) Declaration ¶
func (t *WebFetchTool) Declaration() api.FunctionDecl
func (*WebFetchTool) Execute ¶
func (t *WebFetchTool) Execute(ctx context.Context, args map[string]interface{}) (*ToolResult, error)
func (*WebFetchTool) Name ¶
func (t *WebFetchTool) Name() string
type WebSearchFunc ¶
type WebSearchFunc func(ctx context.Context, query string) (text string, sources []WebSource, err error)
WebSearchFunc is a callback for performing web searches via the API.
type WebSearchTool ¶
type WebSearchTool struct {
// contains filtered or unexported fields
}
func NewWebSearchTool ¶
func NewWebSearchTool(opts RegistryOptions) *WebSearchTool
func (*WebSearchTool) Declaration ¶
func (t *WebSearchTool) Declaration() api.FunctionDecl
func (*WebSearchTool) Execute ¶
func (t *WebSearchTool) Execute(ctx context.Context, args map[string]interface{}) (*ToolResult, error)
func (*WebSearchTool) Name ¶
func (t *WebSearchTool) Name() string
type WriteFileTool ¶
type WriteFileTool struct {
// contains filtered or unexported fields
}
func NewWriteFileTool ¶
func NewWriteFileTool(opts RegistryOptions) *WriteFileTool
func (*WriteFileTool) Declaration ¶
func (t *WriteFileTool) Declaration() api.FunctionDecl
func (*WriteFileTool) Execute ¶
func (t *WriteFileTool) Execute(ctx context.Context, args map[string]interface{}) (*ToolResult, error)
func (*WriteFileTool) Name ¶
func (t *WriteFileTool) Name() string