Skip to main content
Glama

import_markdown

Imports a full multi-slide Markdown document into the current Slidev presentation from a file path or inline content, replacing or appending slides with validation and optional dry-run preview.

Instructions

Import a full multi-slide Markdown document into the current presentation in a single call — the token-efficient way to build or replace a large deck. Pass path to read the Markdown from disk (content never touches the model's tokens) or content to import inline. mode=replace swaps the entire slides.md (backing up the old one to slides.md.bak); mode=append adds the slides after the existing ones. The document is validated before writing; structural errors abort the import. Set dry_run=true to preview the diff without writing.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "import_markdown"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo'replace' (default): the imported Markdown becomes the entire slides.md (the previous slides.md is first copied to slides.md.bak). 'append': the imported slides are appended after the existing ones, keeping the current global frontmatter.replace
pathNoPath (relative to the project root) of a Markdown file to import, e.g. 'base.md'. PREFER THIS over `content` for bulk imports: the file is read on the server, so the slide Markdown never passes through the model's tokens. This is the cheapest way to build a deck whose content already exists on disk.
contentNoFull multi-slide Markdown to import inline. Use only when the content does not already exist as a file on disk; otherwise pass `path` to avoid spending tokens on the slide content.
dry_runNoPreview the change without writing slides.md or creating a backup. Returns dryRun, wouldWrite, diff.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full behavioral burden and does so well: it discloses that replace overwrites slides.md and backs it up to slides.md.bak, that append preserves existing global frontmatter, that validation runs before writing and structural errors abort, and that dry_run previews without writing or backing up. These are exactly the destructive-action and safety details an agent needs before a whole-deck replacement.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four dense sentences, front-loaded with the core action and the token-efficiency hook, then the input choice, then mode semantics, then validation and preview. No filler and no repetition that isn't reinforcing a decision the agent must make.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter, no-output-schema tool this covers the critical unknowns: overwrite behavior, backup, validation, and dry-run preview shape (dryRun, wouldWrite, diff). It is slightly thin on prerequisites — whether a presentation must already be initialized and what the non-dry-run success response looks like.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and each parameter already documents its enum, default, and the path-vs-content token tradeoff, so the description largely restates structured data. It reinforces the cost rationale for `path` but adds no format, constraint, or edge-case detail beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Import a full multi-slide Markdown document into the current presentation in a single call,' plus the deck-building intent. That clearly separates it from per-slide tools like add_slide or update_slide, though it never addresses how it differs from add_slides, which is the closest plausible overlap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear selection criteria between `path` and `content` ('Use only when the content does not already exist as a file on disk'), plus explicit replace vs append vs dry_run conditions. It stops short of naming sibling tools as alternatives, leaving the agent to infer that per-slide edits belong elsewhere.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.