Repository navigation
feat(search-mcp): look up people in the organization directory - #10435
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
1 issue found across 14 files
Confidence score: 4/5
search_peopleinapps/sim/lib/api/contracts/knowledge/mcp.tssilently ignoresqueryorcursorwhen combined withpersonId. Reject those combinations in the schema.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/lib/api/contracts/knowledge/mcp.ts">
<violation number="1" location="apps/sim/lib/api/contracts/knowledge/mcp.ts:131">
P2: `search_people` accepts `query` together with `personId` (or `cursor` with `personId`) and silently ignores the query or cursor. Reject that combination in the schema, as `readLiveDocumentMcpSchema` does for `documentId` and `documentIds`, so callers get a clear error instead of a result for a different request than they sent.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
[Medium impact] The PR appears safe to merge; no new blocking issue was found. SummaryAdds
|
d324564 to
16a6a97
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 15 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
16a6a97 to
c08060a
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Adds a search_people tool to the Search MCP server, offered when the organization has People on and the caller may browse its directory. It reads through the People list and profile use cases, now admitting personal API keys and OAuth tokens under search:read. A search matches people who hold every word in their name, email, title, department, or location; one match returns that person's manager chain and direct reports in the same call.
…alidating the check
5448656 to
c68f328
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 15 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
Summary
search_people: looks people up in the organization's People directory by name, email, title, department, or location. Each result carries personId, name, title, department, location, email, and manager name; empty fields are left outpersonId, returns that person withmanagerChain(direct manager first),directReports(with their own report counts), andtotalDirectReports, so "who is X's manager" / "who reports to X" takes one callsearchfor outside contactsorganization.member_directory). Onlytools/listpays for that check; a call is authorized by the use cases themselveslistandgetuse cases: their operations now also admit personal API keys and OAuth tokens undersearch:read(no new scope, so no re-consent; read-only keys qualify throughapi:read). Session behavior is unchanged. Thesearch:readconsent line now mentions people lookupPEOPLE_SEARCH_MAX_TERMS= 8 words) instead of the whole string as one substring. The People page gets this too, e.g. "design london" or "Jane Smith" in either order0475widensorganization_search_mcp_invocation_tool_checkto acceptsearch_people(swappedNOT VALIDin one statement, thenVALIDATE), so activity rows for the new tool are recordedType of Change
Testing
server.test.ts(a single match returns the reporting line; no match carries the pointer tosearch), both checked red against mutated codedirectory-read.integration.ts: multi-word search across fields, and a read-only personal API key reading list and profile (both fail on the old code); runs in CIcheck:migrations, drizzle generate in sync,check:api-validation:strict, biome on changed filessearch_peoplerejectspersonIdcombined withquery/cursor; a profile with more than 50 direct reports says how many are listed of the totalBench
Claude Sonnet as the MCP client against a sidecar serving this branch vs. the same base commit, on a test organization whose directory was filled through the People import. 2 rounds x 2 attempts per case, pooled; paired by case, 95% CI.
Targeted directory cases (14: who is X, X's manager, reports, reporting chain, title/department/location lookups, email, 2 unanswerable):
No-regression slice (43 cases: the general bundle's 13 people cases + 2 from every other category): correct 53.5% -> 57.0% (+3.5pp [-0.6, 7.6]), completeness +2.5pp [-2.4, 8.5], sourceRecall +0.7pp [-3.0, 4.1], citedGold 0.0pp [-5.5, 5.5], input tokens +1.2k [-4.9k, 6.9k] (tools/list grows ~1.2k chars), 0 flips. The client used
search_peopleon 20 of 172 attempts there and fell back tosearchfor people outside the organization.Checklist
test-auditauthoring gate)