Repository navigation
feat(mcp): search_attributes query for specific attributes - #2209
nikkikapadia wants to merge 10 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bdf7108. Configure here.
| attributes: rows, | ||
| limit: params.limit ?? FIND_LIMIT, | ||
| }), | ||
| }); |
There was a problem hiding this comment.
Agent errors skip attribute fallback
Medium Severity
Hint generation and shortlisting are meant to degrade to the already-fetched attribute list, but withProviderFallback only swallows LLMProviderError and AgentExecutionError. callEmbeddedAgent turns common model failures (invalid structured output, no object generated) into UserInputError, which bubbles out and fails search_attributes entirely. The caller then sees search-events copy such as “could not construct a valid query” instead of matches or the list fallback.
Reviewed by Cursor Bugbot for commit bdf7108. Configure here.
| } | ||
|
|
||
| const line = `- ${key} (${type})`; | ||
| return details.length > 0 ? `${line}: ${details.join(" ")}` : line; |
There was a problem hiding this comment.
Newlines break shortlist prompt lines
Medium Severity
formatAttributeLine embeds context.brief and examples into the shortlist prompt without flattening whitespace. The prompt contract is one attribute per line (- key (type): …). A description that contains a newline splits that row, so the model can miss or invent keys. Table formatting already flattens briefs for this reason; the agent prompt does not.
Reviewed by Cursor Bugbot for commit bdf7108. Configure here.


Building on top of what we currently have on the
search_attributestool; in addition to showing a list of all attributes, we now find attributes based on a user query. Users can define what attribute they're looking for and the tool will provide the best match and additional candidates.To achieve this behaviour we pass the query to a couple of subagents. The first agent will look at the user's query and provide substring hints that we can pass to the attributes endpoint. This happens because the attributes endpoint will return a limited number of attributes; so the attribute we're looking for may not be there. It will generate between 3-5 hints, query the attributes endpoint with these substrings and then merge all the results together. NOTE: If it notices that the total number of attributes is less than the attribute endpoints limit, it assumes those are all the attributes and will not generate these hints. This list of attributes gets formatted and passed to the second subagent. That subagent scans through all the attributes and gets max 10 candidates that the user might be talking about.
At the end we format the results and send it back to the agent that called the tool with suggested presentation but ultimately how that agent presents the information is up to them.
Some file guidance:
agents.ts-> all of the subagent callsconfig.ts-> the prompts that are put into the respective subagentsformat.ts-> output formatting functions that format the results that get handed back to the caller agentsearch.ts-> tooling decisions and returns to the caller agent