SmartHopper
Information about the Tool Manager (AITools)
Install / Use
npx skills add architects-toolkit/SmartHopperInstalls into whichever agent you are using.
Devin Config
Devin AI agent config
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Skill content
View source on GitHubtrigger: model_decision description: Information about the Tool Manager (AITools)
AI tools
-
Purpose
- Define AI-callable tools and a central manager to discover, register, and execute them.
- Provide a safe, structured interface between model tool-calls and application functionality.
-
Core Types
- AITool (AITool.cs)
- Metadata:
Name, Description,Category. - Parameters:
ParametersSchema(JSON schema string). - Execution: Execute (
Func<AIToolCall, Task<AIReturn>>). - Compatibility:
RequiredCapabilities(AICapability) for upstream checks. Enableddefaults totrue; disabled tools are filtered out of provider tool lists and MCP exposure.
- Metadata:
- IAIToolProvider (IAIToolProvider.cs)
- Contract for tool sets discoverable at runtime.
- GetTools() returns an
IEnumerable<AITool>.
- AIToolManager (ToolManager.cs)
- Static registry and runtime manager.
- RegisterTool(AITool), GetTools(), ExecuteTool(AIToolCall), DiscoverTools().
- AITool (AITool.cs)
-
Discovery & Registration
- DiscoverTools() loads the
SmartHopper.Core.Grasshopperassembly and scans theSmartHopper.Core.Grasshopper.AIToolsnamespace. - Instantiates classes implementing IAIToolProvider, calls GetTools(), then RegisterTool() for each AITool.
- Discovery runs once (guarded by
_toolsDiscovered).
- DiscoverTools() loads the
-
Execution Flow
- ExecuteTool(AIToolCall) ensures discovery and fetches the target tool.
- Validates the AIToolCall via
toolCall.IsValid(). - Calls the tool's
Execute(toolCall)delegate to get anAIReturn. - Wraps the result in a manager-level AIReturn with
Request = toolCalland SetBody(result.Body). Errors are captured inErrorMessage.
-
Integration
- Works with AIToolCall and AIReturn from AICall/.
- Providers may use GetFormattedTools() (in
AIProviders/) to expose tool function definitions to models. RequiredCapabilitiesallows providers/models to filter tools based on model features (e.g., function-calling, JSON output).
-
Best Practices & Security
- Keep Execute implementations side-effect aware; validate and sanitize parameters against
ParametersSchema. - Prefer idempotent operations and clear error messages; log via
Debug.WriteLineas shown in manager code. - Tool discovery is restricted to a trusted assembly/namespace to reduce supply-chain risk.
- Avoid long-running or UI-thread operations in Execute unless explicitly marshaled to the Rhino UI thread when needed.
- Keep Execute implementations side-effect aware; validate and sanitize parameters against
-
Typical Usage
- Implement IAIToolProvider in
SmartHopper.Core.Grasshopper.AITools, return AITool instances. - Each AITool defines metadata, JSON schema, and an async Execute.
- The AI model issues a tool call; the system constructs an AIToolCall.
AIToolManager.ExecuteTool(toolCall)runs the tool and returns an AIReturn to the tool-calling loop.- Do not call
Execute(toolCall)directly in code; useAIToolCall.Exec()instead.
- Implement IAIToolProvider in
Related Skills
claude-howto
41.4kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
ai-job-search
40.9kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
guizang-ppt-skill
25.7kAI-agent Skill for generating polished HTML slide decks: editorial magazine and Swiss layouts, image prompts, social covers, and a WebGL/low-power presentation runtime.
reactive-resume
42.2kA one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
Security Score
Audited on Invalid Date
