upstash/context7 · warning

searchResult.message || "Try a different description"

Error message

searchResult.message || "Try a different description"

What it means

During `context7 skill generate`, after collecting the expertise description the CLI calls searchLibraries(motivation, accessToken). If that returns an error object or an empty/missing results array, the 'Finding relevant sources...' spinner fails with 'No sources found' and this warning prints searchResult.message (the API's own message) or falls back to 'Try a different description' when the API supplied none.

Source

Thrown at packages/cli/src/commands/generate.ts:160

  log.blank();
  console.log(
    pc.dim(
      "To generate this skill, we will read relevant documentation and examples\nfrom Context7.\n"
    )
  );
  console.log(
    pc.dim(
      "These sources are used to:\n• extract best practices and constraints\n• compare patterns across official docs and examples\n• avoid outdated or incorrect guidance\n"
    )
  );
  console.log(pc.dim("You can adjust which sources the skill is based on.\n"));

  const searchSpinner = ora("Finding relevant sources...").start();
  const searchResult = await searchLibraries(motivation, accessToken);

  if (searchResult.error || !searchResult.results?.length) {
    searchSpinner.fail(pc.red("No sources found"));
    log.warn(searchResult.message || "Try a different description");
    return;
  }

  searchSpinner.succeed(pc.green(`Found ${searchResult.results.length} relevant sources`));
  log.blank();

  if (searchResult.searchFilterApplied) {
    log.warn(
      "Your results only include libraries matching your teamspace's library filters. To adjust quality thresholds or blocked libraries, update your filters at https://context7.com/dashboard?tab=policies"
    );
    log.blank();
  }

  let selectedLibraries: LibrarySearchResult[];
  try {
    const formatProjectId = (id: string) => {
      return id.startsWith("/") ? id.slice(1) : id;
    };

View on GitHub (pinned to 5284672feb)

Solutions

  1. Rewrite the description around concrete technologies and patterns (e.g. 'react server components data fetching patterns')
  2. If searchResult.message indicates an auth problem, re-run `context7 login`
  3. Test the same phrasing with `context7 docs "<keywords>" search` to see whether anything matches
  4. Check network connectivity and teamspace filter settings

Example fix

# before — prompt input
"make my app faster"   → No sources found

# after
"react performance optimization patterns with memoization and virtualization"
Defensive patterns

Strategy: validation

Validate before calling

// dry-run the description through plain search before generating
const r = await searchLibraries(motivation, token);
if (r.error || !r.results?.length) {
  console.error(r.message || "Rewrite the description around concrete technologies");
  process.exit(1);
}

Type guard

function hasResults<T>(r: { results?: T[]; error?: string }): r is { results: T[] } {
  return !r.error && Array.isArray(r.results) && r.results.length > 0;
}

Prevention

When it happens

Trigger: Descriptions too abstract for the registry to match any library ('make my app good'); API errors carried in searchResult.error (invalid/expired access token, 5xx); all matches removed by teamspace filters; network failure reaching context7.com.

Common situations: Non-technical or overly broad motivations; stale login state from `context7 login`; org filters excluding every candidate; offline or proxied environments.

Related errors


AI-assisted analysis of upstash/context7@5284672feb (2026-08-18). Data as JSON: /api/errors/f20439269fa67274. Report an issue: GitHub.