upstash/context7 · error

searchResult.message || "Try a different description"

Error message

searchResult.message || "Try a different description"

What it means

After the 'Finding relevant sources...' search, if searchLibraries returns an error or an empty results array, generateCommand fails the spinner with 'No sources found' and logs searchResult.message (or the fallback 'Try a different description'). This surfaces upstream search API failures or no-match outcomes during expertise generation.

Solutions

  1. Rewrite the expertise description with clearer, more common technology terms and retry
  2. Check the logged searchResult.message for the upstream API error detail and fix accordingly
  3. Verify network connectivity and that your access token is valid/not expired
  4. Re-run `ctx7 generate` after addressing the cause

Example fix

// before
motivation = "stuff with databases"
// after
motivation = "Querying PostgreSQL with connection pooling in Node.js"
Defensive patterns

Strategy: retry

Validate before calling

if (!motivation || motivation.trim().length < 10) { console.warn('Describe the expertise with concrete technologies'); return; }

Try / catch

const res = await searchLibraries(motivation, accessToken);
if (res.error || !res.results?.length) {
  log.warn(res.message ?? 'Try a different description');
  return;
}

Prevention

When it happens

Trigger: `searchLibraries(motivation, accessToken)` resolves with { error: true } (API/network/auth failure) or results undefined/empty — the motivation matched no libraries.

Common situations: Vague or overly narrow expertise description; expired/invalid access token causing API error; network outage; no indexed library matches the domain described.

Related errors


AI-assisted analysis of upstash/context7@4416fb855b (2026-09-16). Data as JSON: /api/errors/f20439269fa67274. Report an issue: GitHub.

Appendix: 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 4416fb855b)