Skip to content

Commit c041d7d

Browse files
committed
improvement(search-mcp): tighten link read tests and comments
1 parent c5f7658 commit c041d7d

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎apps/sim/lib/api/contracts/knowledge/mcp.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ export function liveSearchMcpDefaultTopK(input: z.output<typeof liveSearchMcpSch
7575
/** Documents one read_document call may read; each counts as one read against the rate limit. */
7676
const MAX_MCP_READ_DOCUMENTS = 10
7777

78-
/** A document ID from search, or a link to the source document that a read resolves. */
7978
const mcpDocumentIdSchema = readDocumentInputSchema.shape.documentId.describe(
8079
'A document ID returned by search, or a link to the document in its source.'
8180
)

‎apps/sim/lib/sim-search/live/application.test.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ describe('authorized live retrieval', () => {
13341334
displayName: id,
13351335
})
13361336

1337-
it('reads a link from the account holding it and names it by an ID that reads back', async () => {
1337+
it('reads a Google Doc link and names it by an ID that reads back', async () => {
13381338
const result = await read('https://docs.google.com/document/d/1AbcDEFghijKLmn/edit')
13391339
expect(mocks.read).toHaveBeenCalledWith(
13401340
'google_drive',
@@ -1393,14 +1393,14 @@ describe('authorized live retrieval', () => {
13931393
)
13941394
})
13951395

1396-
it('reports the reason an account gave over another account not holding the link', async () => {
1397-
mocks.accounts.mockResolvedValue([confluence('site-a'), confluence('site-b')])
1396+
it('reports one account’s specific reason over another account not finding the link', async () => {
1397+
mocks.accounts.mockResolvedValue([confluence('site-a'), confluence('site-a-2')])
13981398
mocks.json
13991399
.mockResolvedValueOnce([{ id: 'cloud-a', url: 'https://a.atlassian.net' }])
1400-
.mockResolvedValueOnce([{ id: 'cloud-b', url: 'https://b.atlassian.net' }])
1401-
mocks.read.mockRejectedValue(
1402-
new NativeSearchError('reconnect', 'The provider denied access.')
1403-
)
1400+
.mockResolvedValueOnce([{ id: 'cloud-a', url: 'https://a.atlassian.net' }])
1401+
mocks.read
1402+
.mockRejectedValueOnce(new NativeSearchError('unavailable', 'Gone', undefined, 404))
1403+
.mockRejectedValueOnce(new NativeSearchError('reconnect', 'The provider denied access.'))
14041404
await expect(read('https://a.atlassian.net/wiki/spaces/ENG/pages/7')).rejects.toMatchObject({
14051405
code: 'unauthorized',
14061406
message: expect.stringContaining('Reconnect Confluence'),

0 commit comments

Comments
 (0)