Merge pull request #14 from dj-oyu/fix/tool-not-found-message

fix: include available tool names in tool-not-found error
This commit is contained in:
dj-oyu 2026-03-02 04:26:34 +09:00 committed by GitHub
commit ebc5fbfb47

View file

@ -82,11 +82,14 @@ func (r *ToolRegistry) ExecuteWithContext(
tool, ok := r.Get(name)
if !ok {
available := strings.Join(r.List(), ", ")
logger.ErrorCF("tool", "Tool not found",
map[string]any{
"tool": name,
})
return ErrorResult(fmt.Sprintf("tool %q not found", name)).WithError(fmt.Errorf("tool not found"))
return ErrorResult(fmt.Sprintf(
"tool %q not found. Available tools: %s", name, available,
)).WithError(fmt.Errorf("tool not found"))
}
// If tool implements ContextualTool, set context