Skip to content

SDK: no-match search returns no libraries; Source Reputation label; clean tool errors - #3299

Merged
ramazanoacar merged 4 commits into
masterfrom
fix/ai-sdk-tool-output
Nov 11, 2026
Merged

ramazanoacar merged 4 commits into
masterfrom
fix/ai-sdk-tool-output

Conversation

@enesgules

@enesgules enesgules commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Why

  • No-match search: a search that matches nothing is not an error. The SDK threw a 404 Context7Error, so every caller needed a try/catch for the normal "nothing found" case. The AI SDK tool also passed that error through as Error searching for libraries: No libraries found for "x". Try a different search term.. Check your API key and try again. That text has a double period and a wrong hint.
  • Label: the SDK's text output said Trust Score. The MCP server and the tool prompts say "Source Reputation".

What

  • @upstash/context7-sdk (minor):
    • searchLibrary returns [] on a 404 from the API. With type: "txt", it returns "No libraries found matching your query. Try a different search term or check the library name."
    • Other errors still throw.
    • Text results print - Source Reputation: High|Medium|Low|Unknown.
    • getContext and search still throw on 404, because an unknown library ID is a real error that the caller must fix.
  • @upstash/context7-tools-ai-sdk (patch):
    • resolveLibraryId returns the SDK result as it is.
    • queryDocs turns a 404 into its "No documentation found … use resolveLibraryId" hint.
    • Errors no longer get the extra ". Check your API key and try again."
  • Docs: the resolveLibraryId no-match example uses the new message. The SDK searchLibrary example on master already checks libraries.length === 0, which now works.

Checks

  • SDK tests: 45 passed. The new test fails when the 404 handling is removed.
  • tools-ai-sdk typecheck passes.
  • The 4 live-model tests need OPENROUTER_API_KEY, and they fail without it, with or without this change.
  • Live API run of the built tools:
    • Next.js gives Source Reputation: High.
    • /invalid/library gives the "No documentation found" hint.

@mintlify

mintlify Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
context7 🟢 Ready View Preview Nov 11, 2026, 1:07 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@context7

context7 Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Docs7 for context7.com

Result Status Action
Deployment ✅ Ready Open preview
Content review ✅ Passed. No problems found. —

Commit e8dc683 · Updated 2026-11-11 13:08 UTC · View build details

enesgules added a commit that referenced this pull request Oct 1, 2026
@enesgules enesgules changed the title fix(sdk, tools-ai-sdk): label Source Reputation and return no-match messages on 404 SDK: no-match search returns no libraries; Source Reputation label; clean tool errors Oct 1, 2026
@context7
context7 Bot temporarily deployed to Docs7 Preview: fix/ai-sdk-tool-output October 1, 2026 13:35 Destroyed
ramazanoacar added a commit that referenced this pull request Nov 11, 2026
* docs: usage metrics reset each calendar month on every plan

* docs: fix factual errors in Docs7 docs

* docs: correct security pages against current code

* docs: fix factual errors in client, SDK and tool docs

* docs: recommend an API key instead of anonymous usage

* docs: fix factual errors in the Enterprise on-premise docs

* docs: fix factual errors in core how-to pages

* docs: fix admin button image alt text

* docs: remove internal details from verification, refresh, analytics, file types and privacy pages

* docs: remove details that do not help readers

* docs: keep the AI SDK tool output examples; the code now matches them (#3299)

* docs: keep the SDK no-match example and drop the hex-only callout note (code changes in #3299 and docs7)

* docs: remove the anonymous-usage line from the Pi page

* docs: recommend an API key in two client setups added on master

* docs: link the subprocessor list and keep the API key storage note short

* docs: use live React library IDs and state the CLI Node.js requirement

/facebook/react and /facebook/react-native now return library_redirected,
so every example that used them printed a redirect notice and no docs.
Examples now use /reactjs/react.dev (the first search result for React),
/react/react-native, and /react/react/v19.2.8 for the versioned example.

The ctx7 CLI needs Node.js 22.13 or later (commander 15 needs 22.12+,
@InQuirer needs 22.13+ on the 22 line), not Node.js 18.

* docs: link the ChatGPT Developer Mode help article

The developers.openai.com Developer Mode guide now returns 404.

---------

Co-authored-by: Ramazan Onur Acar <ramazanonuracar@gmail.com>
@vercel

vercel Bot commented Nov 11, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
context7-admin-mcp Ignored Ignored Nov 11, 2026 1:07pm UTC

Request Review

@context7
context7 Bot temporarily deployed to Docs7 Preview: fix/ai-sdk-tool-output November 11, 2026 13:08 Destroyed

@ramazanoacar ramazanoacar 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.

Checked against master: the API answers 404 on /v2/libs/search only when nothing matches, so returning an empty list is right. The label now matches the MCP server, and the tool messages lose the misleading API key hint. CI passes on current master.

@ramazanoacar
ramazanoacar merged commit bdd9bf7 into master Nov 11, 2026
7 checks passed
@ramazanoacar
ramazanoacar deleted the fix/ai-sdk-tool-output branch November 11, 2026 13:17

This branch was successfully deployed

1 active deployment
Docs7 Preview: fix/ai-sdk-tool-output — e8dc6838 Deployed Nov 11, 2026 by context7[bot]
staging - docs — e8dc6838 Deployed Nov 11, 2026 by mintlify[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.

2 participants