Skip to content

rust(feat): Improve search behavior in list tools - #710

Open
lineville wants to merge 2 commits into
mainfrom
search-improvements
Open

rust(feat): Improve search behavior in list tools#710
lineville wants to merge 2 commits into
mainfrom
search-improvements

Conversation

@lineville

Copy link
Copy Markdown
Contributor

Improves the behavior of the MCP's searching capabilities by providing clearer guidance on how to use CEL match expressions to pull less data and be better and finding what the prompter is looking for.

@lineville
lineville marked this pull request as ready for review July 31, 2026 23:02
means the pattern was too narrow, so retry a shorter fragment before you
tell the user that nothing exists. Each tool's description lists its own
filterable fields. When a request is too vague to filter on, sample with a
small `limit` and ask the user to narrow it rather than guessing.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
small `limit` and ask the user to narrow it rather than guessing.
small `limit` (e.g. 5) and ask the user to narrow it rather than guessing.

Comment on lines +509 to +510
Prefer a pattern over `==`: `name.matches(\"(?i)rover\")` is RE2, case-insensitive.
`contains`/`startsWith`/`endsWith` are case-SENSITIVE. Empty result: retry a shorter fragment.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

open discussion, but perhaps we should start with what we do want. This phrasing is a bit passive (and most models should be smart enough), but wondering if we want something like this: (I workedshopped this locally for a bit)

When filtering or searching, use `name.matches("(?i)rover")`, not `==`. Use
`==` only for an exact value from a prior result.
`contains`/`startsWith`/`endsWith` are case-SENSITIVE: `contains("Rover")`
silently misses `rover-01`. An empty result is not proof of absence — retry
once with a shorter fragment.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we'll then want to update all the instances in the tools with whatever we land on

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