{"record":{"id":"fb9623b938cde18f","repo":"slidevjs/slidev","slug":"no-slide-found-with-title-input-title","errorCode":null,"errorMessage":"No slide found with title: \"${input.title}\".","messagePattern":"No slide found with title: \"(.+?)\"\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vscode/src/lmTools.ts","lineNumber":55,"sourceCode":"      throw new Error(`No content found for slide number ${input.slideNo} in entry: ${project.entry}. Available slides numbers: 1-${project.data.slides.length}`)\n    }\n\n    return `Content of slide number ${input.slideNo} in entry \"${project.entry}\" in file \"${slide.source.filepath}\":\\n\\n${stringifySlide(slide.source, 1)}`\n  })\n\n  // Get all slide titles\n  registerSimpleTool('slidev_getAllSlideTitles', (input: { entrySlidePath: string }) => {\n    const project = resolveProjectFromEntry(input.entrySlidePath)\n    const titles = project.data.slides.map((slide, idx) => `#${idx + 1}: ${slide.title || '(Untitled)'}`)\n    return formatList(titles)\n  })\n\n  // Find slide number by title\n  registerSimpleTool('slidev_findSlideNoByTitle', (input: { entrySlidePath: string, title: string }) => {\n    const project = resolveProjectFromEntry(input.entrySlidePath)\n    const idx = project.data.slides.findIndex(slide => slide.title === input.title)\n    if (idx === -1) {\n      throw new Error(`No slide found with title: \"${input.title}\".`)\n    }\n    return formatObject({\n      'Title': input.title,\n      'Slide number': idx + 1,\n    })\n  })\n\n  // List all loaded Slidev entries\n  registerSimpleTool('slidev_listEntries', () => {\n    const entries = [...projects.keys()]\n    if (entries.length === 0) {\n      return 'No loaded Slidev project entries.'\n    }\n    return formatList(entries)\n  })\n\n  // Get project preview port\n  registerSimpleTool('slidev_getPreviewPort', (input: { entrySlidePath: string }) => {","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/slidevjs/slidev/blob/0d798ace5828966d9f77f62094d5f7a971ad98f7/packages/vscode/src/lmTools.ts#L37-L73","documentation":"Thrown by the `slidev_findSlideNoByTitle` VS Code LM tool when `project.data.slides.findIndex(slide => slide.title === input.title)` returns -1. The match is exact and case-sensitive: it compares the whole title string, so any difference in casing, whitespace, or trailing punctuation fails. Slides without a title are stored as `undefined`/empty and will never equal a non-empty query.","triggerScenarios":"The LM passes a title that differs from the slide's actual `title` field — wrong case, extra spaces, missing punctuation, or a paraphrased title. Also fails when the target slide has no title at all, or when the model guessed a title instead of reading it from `slidev_getAllSlideTitles`.","commonSituations":"The model free-forms a title rather than copying it verbatim; the deck uses Markdown formatting in titles (e.g. `## Title`) that gets stripped/parsed differently; titles contain emoji or special chars the model normalized; multiple slides share partial title text but none match exactly.","solutions":["Call `slidev_getAllSlideTitles` first and copy the exact title string (case, spacing, punctuation) into `title`.","If unsure of the exact title, iterate titles from `slidev_getAllSlideTitles` and do your own case-insensitive/substring match client-side, then pass the slide number directly to `slidev_getSlideContent` instead.","Confirm the target slide actually has a title (untitled slides appear as `(Untitled)` in the list and cannot be found by title)."],"exampleFix":"// before: approximate title fails exact match\n{ entrySlidePath: 'slides.md', title: 'agenda' } // real title is 'Agenda'\n// after: use the verbatim title returned by the titles tool\n// slidev_getAllSlideTitles -> '#1: Agenda'\n{ entrySlidePath: 'slides.md', title: 'Agenda' }","handlingStrategy":"validation","validationCode":"// Do not guess titles. Fetch the canonical list and match exactly:\n// const titles = await tools.slidev_getAllSlideTitles(...)\n// each line is '#k: <title>' or '#k: (Untitled)'\nfunction findExactTitle(input: string, titles: string[]): number | null {\n  for (const line of titles) {\n    const m = line.match(/^#(\\d+): (.*)$/)\n    if (m && m[2] === input) return Number(m[1])\n  }\n  return null // caller should fall back to slidev_getSlideContent by number\n}","typeGuard":"function isKnownTitle(title: string, knownTitles: string[]): boolean {\n  return knownTitles.includes(title)\n}","tryCatchPattern":null,"preventionTips":["Never paraphrase titles; copy them verbatim from `slidev_getAllSlideTitles`.","Remember the match is case-sensitive and whole-string — trailing spaces fail.","If a title is uncertain, resolve it to a slide number client-side then use `slidev_getSlideContent`.","Untitled slides (shown as `(Untitled)`) cannot be found by title; use their number instead."],"tags":["slidev","vscode","language-model-tools","string-matching","exact-match"],"backgroundTag":null,"analyzedSha":"0d798ace5828966d9f77f62094d5f7a971ad98f7","analyzedAt":"2026-08-12T17:10:56.221Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}