{"record":{"id":"ffe8c313b80a7d63","repo":"slidevjs/slidev","slug":"entryslidepath-is-required","errorCode":null,"errorMessage":"entrySlidePath is required.","messagePattern":"entrySlidePath is required\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vscode/src/lmTools.ts","lineNumber":84,"sourceCode":"    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 }) => {\n    const project = resolveProjectFromEntry(input.entrySlidePath)\n    return formatObject({\n      'Project entry': project.entry,\n      'Preview port': project.port.value || 'Not running',\n    })\n  })\n\n  // Choose active Slidev entry\n  registerSimpleTool('slidev_chooseEntry', (input: { entrySlidePath: string }) => {\n    if (!input.entrySlidePath) {\n      throw new Error('entrySlidePath is required.')\n    }\n    const project = resolveProjectFromEntry(input.entrySlidePath)\n    activeEntry.value = project.entry\n    return formatObject({\n      'Active entry switched to': project.entry,\n    })\n  })\n})\n\nfunction registerSimpleTool<T>(name: string, invoke: (input: T) => string) {\n  useDisposable(lm.registerTool<T>(name, {\n    invoke({ input }) {\n      try {\n        const result = invoke(input)\n        return new LanguageModelToolResult([\n          new LanguageModelTextPart(result),\n        ])\n      }","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/slidevjs/slidev/blob/0d798ace5828966d9f77f62094d5f7a971ad98f7/packages/vscode/src/lmTools.ts#L66-L102","documentation":"Thrown by the `slidev_chooseEntry` VS Code LM tool when `input.entrySlidePath` is falsy. Unlike other tools that fall back to `$ACTIVE_SLIDE_ENTRY` via `resolveProjectFromEntry`, `chooseEntry` explicitly requires a concrete path because its whole purpose is to SET the active entry — an empty value would make the operation a no-op, so it is rejected up front.","triggerScenarios":"The model invokes `slidev_chooseEntry` with an empty string, undefined, or omits `entrySlidePath` entirely. Because this tool's contract is to switch the active entry, there is no sensible default and the guard rejects the call before any state mutation.","commonSituations":"The LM omits the parameter assuming a default; passes `$ACTIVE_SLIDE_ENTRY` or `''` (which is meaningless for a setter); or guesses a path without first listing valid entries.","solutions":["Provide a non-empty `entrySlidePath` (an absolute path or a substring that uniquely identifies a loaded entry).","Call `slidev_listEntries` first to obtain the valid entry paths, then pass one verbatim.","Ensure the model treats `entrySlidePath` as a required parameter in its tool-call schema."],"exampleFix":"// before: missing required field\n{ entrySlidePath: '' }\n// after: pass a real entry from slidev_listEntries\n{ entrySlidePath: '/abs/path/to/slides.md' }","handlingStrategy":"validation","validationCode":"// Enforce the required field before calling slidev_chooseEntry:\nfunction hasEntryPath(input: { entrySlidePath?: string }): input is { entrySlidePath: string } {\n  return typeof input.entrySlidePath === 'string' && input.entrySlidePath.length > 0\n}","typeGuard":"function isNonEmptyEntryPath(s: unknown): s is string {\n  return typeof s === 'string' && s.trim().length > 0\n}","tryCatchPattern":null,"preventionTips":["Treat `entrySlidePath` as mandatory for `slidev_chooseEntry` — there is no default.","Call `slidev_listEntries` to obtain a valid path when unsure.","Do not pass `$ACTIVE_SLIDE_ENTRY` to `chooseEntry`; it is a setter, not a getter.","Validate the input schema in your LM tool definitions so the model always supplies the field."],"tags":["slidev","vscode","language-model-tools","validation","required-parameter"],"backgroundTag":null,"analyzedSha":"0d798ace5828966d9f77f62094d5f7a971ad98f7","analyzedAt":"2026-08-12T17:10:56.221Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}