Skip to content

Conversation

mdonnalley
Copy link
Contributor

What does this PR do?

Implements a RAG for listing tools so that we can limit the amount of tokens used when calling sf-list-tools

What issues does this PR fix or reference?

@W-19126747@

const filteredResults = searchResults.labels
.map((id) => assets.tools.find((c) => c.id === id)!)
.filter((tool) => !enabledToolNames.has(tool.name))
.slice(0, 5);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought: What if we had the "return count" be a parameter that defaults to 5? We could instruct the LLM to increase the tools or commands returned if the user does not initially find the tool/command they are looking for.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also help with this type of question. If someone wants to know what all the tools are, this new approach does not work.
image

@iowillhoit
Copy link
Collaborator

In most cases, this is finding the correct tool to enable 🎉
image

// Filter search results to exclude enabled tools and get top 5
const filteredResults = searchResults.labels
.map((id) => assets.tools.find((c) => c.id === id)!)
.filter((tool) => !enabledToolNames.has(tool.name))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This !enabledToolName might cause some trouble... Check out this video, it all looked like it was going well until the model chose to run sf-list-all-tools a second time. Since the result filters out enabled tools, the sf-query-org tool was not returned the second time and it chose to build an sf command instead.

In the second call the query was:

{
  "query": "query SOQL records from Salesforce org"
}

Maybe this can be fixed by tweaking the description? Something like: "Don't run this tool twice for the same basic query." or "Always check enabled tools before running sf-list-all-tools?

Screenshare.-.2025-08-12.10_54_45.AM.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants