Description

Self improve generate tool

Generates a new tool scaffold in the sandbox (category: core | addon | self). Requires an active sandbox.

Included in Version 9

Dynamically extracted tool implementation.
How to register SelfImprovementToolscsharp
registry.Register(new AgentTool(            "self_improve_generate_tool",            "Generates a new tool scaffold in the sandbox (category: core | addon | self). Requires an active sandbox.",            InvokeGenerateTool,            new            {                type = "object",                properties = new                {                    tool_name = new { type = "string", description = "Snake_case tool name, e.g. summarize_file." },                    description = new { type = "string", description = "What the tool does (shown to the model)." },                    category = new { type = "string", description = "core, addon, or self." },                    invoke_body = new { type = "string", description = "Optional C# return expression/body, default returns OK." },                },                required = new[] { "tool_name", "description", "category" },            },            ToolCategory.Self));
Helper classes for SelfImprovementToolscsharp
    private string InvokeGenerateTool(string argumentsJson)    {        var paths = RequirePaths();        if (!Directory.Exists(paths.Sandbox))            return "Error: sandbox does not exist. Call self_improve_create_sandbox first.";        ToolScaffoldGenerator.ParseGenerateArgs(            argumentsJson,            out string toolName,            out string description,            out string category,            out string? invokeBody);        string path = ToolScaffoldGenerator.Generate(paths.Sandbox, toolName, description, category, invokeBody);        return $"Generated tool '{toolName}' ({category}) at {path}. Next: self_improve_build_sandbox, then self_improve_verify_sandbox_tool.";    }