{"record":{"id":"f20439269fa67274","repo":"upstash/context7","slug":"searchresult-message-try-a-different-descripti","errorCode":null,"errorMessage":"searchResult.message || \"Try a different description\"","messagePattern":"searchResult\\.message \\|\\| \"Try a different description\"","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cli/src/commands/generate.ts","lineNumber":160,"sourceCode":"  log.blank();\n  console.log(\n    pc.dim(\n      \"To generate this skill, we will read relevant documentation and examples\\nfrom Context7.\\n\"\n    )\n  );\n  console.log(\n    pc.dim(\n      \"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\"\n    )\n  );\n  console.log(pc.dim(\"You can adjust which sources the skill is based on.\\n\"));\n\n  const searchSpinner = ora(\"Finding relevant sources...\").start();\n  const searchResult = await searchLibraries(motivation, accessToken);\n\n  if (searchResult.error || !searchResult.results?.length) {\n    searchSpinner.fail(pc.red(\"No sources found\"));\n    log.warn(searchResult.message || \"Try a different description\");\n    return;\n  }\n\n  searchSpinner.succeed(pc.green(`Found ${searchResult.results.length} relevant sources`));\n  log.blank();\n\n  if (searchResult.searchFilterApplied) {\n    log.warn(\n      \"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\"\n    );\n    log.blank();\n  }\n\n  let selectedLibraries: LibrarySearchResult[];\n  try {\n    const formatProjectId = (id: string) => {\n      return id.startsWith(\"/\") ? id.slice(1) : id;\n    };","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/upstash/context7/blob/5284672feb575908efead6fcf1b5e542f8d607bb/packages/cli/src/commands/generate.ts#L142-L178","documentation":"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.","triggerScenarios":"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.","commonSituations":"Non-technical or overly broad motivations; stale login state from `context7 login`; org filters excluding every candidate; offline or proxied environments.","solutions":["Rewrite the description around concrete technologies and patterns (e.g. 'react server components data fetching patterns')","If searchResult.message indicates an auth problem, re-run `context7 login`","Test the same phrasing with `context7 docs \"<keywords>\" search` to see whether anything matches","Check network connectivity and teamspace filter settings"],"exampleFix":"# before — prompt input\n\"make my app faster\"   → No sources found\n\n# after\n\"react performance optimization patterns with memoization and virtualization\"","handlingStrategy":"validation","validationCode":"// dry-run the description through plain search before generating\nconst r = await searchLibraries(motivation, token);\nif (r.error || !r.results?.length) {\n  console.error(r.message || \"Rewrite the description around concrete technologies\");\n  process.exit(1);\n}","typeGuard":"function hasResults<T>(r: { results?: T[]; error?: string }): r is { results: T[] } {\n  return !r.error && Array.isArray(r.results) && r.results.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Mention specific libraries/frameworks in the expertise description","Re-run `context7 login` if the API message mentions auth","Pre-test descriptions with `context7 docs \"<keywords>\" search`"],"tags":["search","no-results","generate","api","cli"],"backgroundTag":"empty-search-results","analyzedSha":"5284672feb575908efead6fcf1b5e542f8d607bb","analyzedAt":"2026-08-18T18:00:18.510Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}