Skip to content

Commit afb35fa

Browse files
handle the zero tool results in the semantic search
1 parent 34d3792 commit afb35fa

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/toolsets.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,11 @@ export class StackOneToolSet {
832832
(actionOrder.get(b.name) ?? Number.POSITIVE_INFINITY),
833833
);
834834

835+
// If semantic returned results but none matched MCP tools, fall back to local search
836+
if (topResults.length > 0 && matchedTools.length === 0) {
837+
return this.localSearch(query, allTools, mergedOptions);
838+
}
839+
835840
return new Tools(matchedTools);
836841
} catch (error) {
837842
if (error instanceof SemanticSearchError) {

0 commit comments

Comments
 (0)