{"record":{"id":"7721f0cd898636bd","repo":"slidevjs/slidev","slug":"nothing-to-update-provide-at-least-one-of-conten","errorCode":null,"errorMessage":"Nothing to update: provide at least one of `content`, `note`, or `frontmatter`.","messagePattern":"Nothing to update: provide at least one of `content`, `note`, or `frontmatter`\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/slidev/node/mcp/server.ts","lineNumber":160,"sourceCode":"      })\n    },\n  )\n\n  server.registerTool(\n    'slidev-update-slide',\n    {\n      title: 'Update slide',\n      description: 'Update the content, speaker note, and/or frontmatter of a slide. Only the provided fields are changed. Pass an empty string to clear the content or note. In `frontmatter`, only the given keys are patched; pass `null` as a value to delete that key.',\n      inputSchema: z.object({\n        no: noSchema,\n        content: z.string().optional().describe('New Markdown content of the slide (without frontmatter and note)'),\n        note: z.string().optional().describe('New speaker note (Markdown, stored as a trailing HTML comment)'),\n        frontmatter: frontmatterSchema,\n      }),\n    },\n    async ({ no, content, note, frontmatter }) => {\n      if (content == null && note == null && frontmatter == null)\n        throw new Error('Nothing to update: provide at least one of `content`, `note`, or `frontmatter`.')\n      const data = await ctx.getData()\n      const { slide } = await applySlidePatch(data, no, { content, note, frontmatter })\n      return result(`Updated slide ${no} in ${slide.source.filepath}.`)\n    },\n  )\n\n  server.registerTool(\n    'slidev-insert-slide',\n    {\n      title: 'Insert slide',\n      description: 'Insert a new slide after an existing slide (into the same markdown file). To add a slide at the very end, pass the last slide number.',\n      inputSchema: z.object({\n        after: z.number().int().min(1).describe('Slide number (1-based) after which the new slide is inserted'),\n        content: z.string().describe('Markdown content of the new slide'),\n        frontmatter: frontmatterSchema,\n        note: z.string().optional().describe('Speaker note of the new slide'),\n      }),\n    },","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/slidevjs/slidev/blob/0d798ace5828966d9f77f62094d5f7a971ad98f7/packages/slidev/node/mcp/server.ts#L142-L178","documentation":"Thrown by the slidev-update-slide MCP tool handler when all of content, note, and frontmatter are null/undefined. The tool is a partial-update primitive; a call that changes nothing is a programming error rather than a no-op, so it is rejected before any data is fetched or written.","triggerScenarios":"Calling slidev-update-slide with an input object missing all three optional fields, or explicitly setting each to null/undefined.","commonSituations":"An agent calls update-slide as a no-op probe; a client forwards an empty patch object; conditional logic that omits every field when no condition matched.","solutions":["Include at least one of content, note, or frontmatter in the call.","If the intent was to read the slide, use slidev-get-slide instead.","Pass an empty string ('') to clear content/note - that is a real change and is accepted."],"exampleFix":"// before: nothing to change\nawait tools['slidev-update-slide']({ no: 3 }) // throws\n\n// after: provide at least one field\nawait tools['slidev-update-slide']({ no: 3, content: '# Hello' })\n// or clear the note:\nawait tools['slidev-update-slide']({ no: 3, note: '' })","handlingStrategy":"validation","validationCode":"function hasUpdateField(p: { content?: unknown; note?: unknown; frontmatter?: unknown }): boolean {\n  return p.content != null || p.note != null || p.frontmatter != null\n}\n\n// before calling slidev-update-slide:\nif (!hasUpdateField({ content, note, frontmatter })) {\n  throw new Error('update-slide needs content, note, or frontmatter.')\n}","typeGuard":"function isNonEmptyPatch(p: unknown): p is { content?: string; note?: string; frontmatter?: Record<string, unknown> } {\n  if (!p || typeof p !== 'object') return false\n  const { content, note, frontmatter } = p as any\n  return content != null || note != null || frontmatter != null\n}","tryCatchPattern":"try {\n  await tools['slidev-update-slide']({ no, content, note, frontmatter })\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Nothing to update')) {\n    // route to a read instead\n    return await tools['slidev-get-slide']({ no })\n  }\n  throw e\n}","preventionTips":["Construct the update payload conditionally and abort if no field is set.","Use slidev-get-slide for reads; reserve update-slide for real changes.","Pass '' (empty string) to clear content/note - it counts as a change.","Validate the patch client-side before the MCP round-trip."],"tags":["mcp","validation","arguments","update"],"backgroundTag":null,"analyzedSha":"0d798ace5828966d9f77f62094d5f7a971ad98f7","analyzedAt":"2026-08-12T17:10:56.221Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}