Skip to content

feat(search-mcp): read_document reads pasted source links - #10434

Merged
waleedlatif1 merged 9 commits into
stagingfrom
feat/search-mcp-read-url
Nov 26, 2026
Merged

waleedlatif1 merged 9 commits into
stagingfrom
feat/search-mcp-read-url

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • read_document accepts a link to a source document wherever it accepts a document ID (documentId and documentIds), so a pasted Google Docs/Drive, Gmail, Calendar, Slack, Jira, Confluence, GitHub, GitLab, Linear, Notion or Fireflies link reads in one call instead of a search first
  • New live/links.ts parses each link into the exact reference that provider's reader takes (Slack permalink timestamps, Confluence page/blog/space IDs, Drive file IDs and editor MIME kinds, Calendar eid, GitHub issue/PR/commit/blob, GitLab /-/ pages, Linear keys)
  • Links that name their site rather than its API ID finish against the reader's own account in the session (locate): Atlassian host → cloud ID from the grant's accessible sites, GitLab host must equal the account's host, Linear key → UUID only when the issue is in the link's workspace
  • The located reference goes through the same verify → read → verify-current path as a read by document ID, so a link never reaches anything search could not return; accounts are tried in listing order (max 5) and the most specific failure is reported
  • The result's documentId is minted from the reader's own location fields, the ID a search of that account mints, so continuations and documentIds filters work unchanged
  • Unsupported links fail with a validation error naming what reads; no connected account for the provider says which source to connect
  • GitHub/GitLab file links resolve against the repository's default branch (branch names with slashes included), the only branch search and source checks cover; a link to another branch or commit gets an actionable error
  • fromLink read diagnostic
  • Search documentIds stays ID-only: a pasted link is a read, and filtering a search to one known document adds schema text for no new capability

Type of Change

  • New feature

Testing

  • links.test.ts (parser per provider, rejected forms, site/host/workspace isolation in locateDocumentLink) and a pasted-links block in application.test.ts (verify before read, account selection by site, failure ranking shown red against a weakened guard, no-account and unsupported-link errors)
  • lib/sim-search/live, lib/knowledge/mcp, contract tests; biome; check:api-validation:strict
  • Live probe against staging data: Drive, Gmail, Calendar, Slack, Confluence, GitHub and Fireflies links each read in one call (4–9 s)

Benchmark

Claude Sonnet 5.5 as the MCP client against this branch vs its staging base, 12 questions that paste a Drive/Slides, Gmail, Calendar, Slack, Confluence, GitHub or Fireflies link, 4 attempts each (paired by case):

  • tool calls 3.1 → 1.1, searches 2.0 → 0.1, tool errors 0.77 → 0 (CI excludes 0 for all three)
  • seconds 30.9 → 15.3 (p90 59.8 → 20.5), tool chars 36k → 11k, cost 5.2¢ → 1.6¢
  • source recall 58% → 100% (CI excludes 0), completeness 59% → 89% (CI excludes 0), correct 46% → 71% (CI spans 0; one Gmail case lost a point because the read thread window omitted an older message search had found)
  • Same 12 questions without links (k=2): correct 54% → 58%, seconds, tool calls, input tokens and tool chars flat — no regression for ordinary questions

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 26, 2026 8:17pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge, with the earlier reported failures addressed and no new actionable issues found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the earlier reported failures addressed and no new actionable issues found.

Summary

read_document now accepts source links, finds a connected account, checks access, and returns a document ID for later reads.

  • People can read supported source links directly with read_document.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Pasted source link] --> B[Parse document location]
  B --> C[Try connected accounts]
  C --> D[Find location within account]
  D --> E[Check access and source settings]
  E --> F[Read document]
  F --> G[Check current source settings]
  G --> H[Return content and document ID]
Loading

Reviews (6) · Last reviewed commit: "improvement(search-mcp): reserve more Gi..." · Reviewed by Greptile

Comment thread apps/sim/lib/sim-search/live/links.ts Resolved
Comment thread apps/sim/lib/sim-search/live/github.ts Resolved

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 13 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/links.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

Comment thread apps/sim/lib/sim-search/live/links.ts Resolved

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 11 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/links.ts Resolved
Comment thread apps/sim/lib/sim-search/live/links.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai 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.

All reported issues were addressed across 11 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/links.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai 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.

All reported issues were addressed across 11 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/links.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai 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.

All reported issues were addressed across 11 files

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

Comment thread apps/sim/lib/sim-search/live/links.ts Resolved
Comment thread apps/sim/lib/sim-search/live/links.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai 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.

No issues found across 11 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

@waleedlatif1
waleedlatif1 merged commit 771e931 into staging Nov 26, 2026
85 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/search-mcp-read-url branch November 26, 2026 21:31

This branch was previously deployed

1 inactive deployment
Preview — df69a22d Deployed Nov 26, 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