Skip to content

feat(mcp): search_attributes query for specific attributes - #2209

Draft
nikkikapadia wants to merge 10 commits into
mainfrom
nikki/search-attributes/find-specific-attr
Draft

nikkikapadia wants to merge 10 commits into
mainfrom
nikki/search-attributes/find-specific-attr

Conversation

@nikkikapadia

Copy link
Copy Markdown
Member

Building on top of what we currently have on the search_attributes tool; 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 calls
config.ts -> the prompts that are put into the respective subagents
format.ts -> output formatting functions that format the results that get handed back to the caller agent
search.ts -> tooling decisions and returns to the caller agent

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 12, 2026 6:58pm UTC

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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,
}),
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bdf7108. Configure here.

}

const line = `- ${key} (${type})`;
return details.length > 0 ? `${line}: ${details.join(" ")}` : line;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bdf7108. Configure here.

This branch was successfully deployed

1 active and 1 inactive deployments
Actions — bdf7108c Deployed Nov 12, 2026 by nikkikapadia via eval #1817
Preview — bdf7108c Deployed Nov 12, 2026 by vercel[bot]
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.

1 participant