fix: search_tools now includes direct tools (snapshot_project etc.)

- searchTools() previously only searched routed tool categories, so
  direct tools like snapshot_project, save_project, create_project
  returned 0 results when Claude called search_tools('snapshot')
- Direct tools are now searched first, with a hint that they must be
  called directly (not via execute_tool)

Also includes routing.py zone-inset fix for rounded board corners
(already staged from previous session)
This commit is contained in:
Tom
2026-03-07 09:56:08 +01:00
parent b6e1b8b7b1
commit 0f1bfa3eff
2 changed files with 30 additions and 8 deletions

View File

@@ -228,16 +228,24 @@ export function searchTools(query: string): SearchResult[] {
const q = query.toLowerCase();
const matches: SearchResult[] = [];
// This is a placeholder - we'll populate descriptions from actual tool definitions
// For now, we'll search by name and category
// Search direct tools first
for (const toolName of directToolNames) {
if (toolName.toLowerCase().includes(q)) {
matches.push({
category: "direct",
tool: toolName,
description: `${toolName} (direct tool — call directly, no execute_tool needed)`
});
}
}
// Search routed tools by name and category
for (const category of toolCategories) {
// Check if category name or description matches
const categoryMatch =
category.name.toLowerCase().includes(q) ||
category.description.toLowerCase().includes(q);
for (const toolName of category.tools) {
// Check if tool name matches or category matches
if (toolName.toLowerCase().includes(q) || categoryMatch) {
matches.push({
category: category.name,