Skip to main content
Glama

set_style

Manage CSS styling for Slidev presentations by applying global styles, slide-specific style blocks, or UnoCSS/Tailwind classes, with dry-run diff previews.

Instructions

Manage CSS styling for the Slidev presentation. Supports three modes: 'global' (writes to style.css, applied to all slides), 'slide' (injects a block into a specific slide), and 'unocss' (adds UnoCSS/TailwindCSS utility classes to a slide's frontmatter). Set dry_run=true to preview the file diff without writing. Reference: https://sli.dev/custom/directory-structure#style

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mode": "<mode>"
    },
    "name": "set_style"
  }
}

Input Schema

NameRequiredDescriptionDefault
cssNoCSS content to apply. Required for 'global' and 'slide' modes. For 'global': full CSS stylesheet (e.g. 'body { font-family: sans-serif; }'). For 'slide': CSS rules to inject in a <style> block (e.g. 'h1 { color: red; }'). For 'unocss': not used — use the 'classes' field instead. If mode='global' and css is omitted, a default minimal dark style is applied.
modeYesStyling mode: 'global' — Write CSS to style.css (auto-imported by Slidev for all slides). 'slide' — Add/replace a <style> block inside a specific slide. 'unocss' — Add UnoCSS/Windi utility classes to a slide's frontmatter (class field).
appendNoFor 'global' mode: if true, appends CSS to existing style.css instead of replacing it. Defaults to false (replace).
scopedNoFor 'slide' mode: whether styles are scoped to the slide (true) or global (false). Scoped styles use <style scoped>, unscoped use <style>. Defaults to true.
classesNoFor 'unocss' mode: space-separated UnoCSS/TailwindCSS utility classes to add to the slide's 'class' frontmatter field (e.g. 'text-center flex items-center'). These merge with any existing classes on the slide. Follow the base-style protection rule: BASE STYLE PROTECTION RULE — Do NOT add Tailwind/UnoCSS classes that override the MCP base styles already defined in style.css, unless the user explicitly requests it. FORBIDDEN — typography overrides (style.css controls these): text-xs/sm/base/lg/xl/2xl..9xl (font sizes set per element), font-sans/serif/mono (Inter + JetBrains Mono already applied), font-thin..black (font-weight set per element), leading-* (line-height set on p/li), tracking-* (letter-spacing set on h1/h3). FORBIDDEN — color overrides (breaks dark palette #0d0d0f/#e8e8f0): bg-white, bg-gray-50..200, bg-slate-50..100, bg-zinc-50..100, bg-neutral-50..100, bg-stone-50..100, text-black, text-gray-700..900, text-slate-800..900, text-zinc-800..900, border-gray-200..300, border-white, border-slate-200..300, shadow-*, ring-*. ALLOWED — layout/positioning only (no style.css conflict): text-center/left/right, flex, grid, items-*, justify-*, flex-col/row, p-*, m-*, gap-*, w-*, h-*, max-w-*, overflow-*, relative, absolute, z-*, col-span-*, row-span-*, rounded-*, self-*, truncate, line-clamp-*. ALLOWED — dark-compatible colors (only when color is explicitly needed): bg-transparent, bg-black/*, bg-gray-800..900, bg-zinc-800..900, text-white, text-gray-100..400, text-slate-100..300. PREFERRED: skip color/typography classes entirely — use <style scoped> with CSS variables: var(--color-bg), var(--color-text), var(--color-accent), var(--color-accent2), var(--color-accent3), var(--color-surface), var(--color-border).
dry_runNoPreview the change without writing style.css or slides.md. Returns dryRun, wouldWrite, and diff.
slide_numberNoTarget slide number (1-based) for 'slide' and 'unocss' modes. Not used for 'global' mode.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does reasonably well: it discloses that 'global' writes style.css, implies replacement semantics, and names the dry_run return fields (dryRun, wouldWrite, diff). It does not explicitly flag that global mode overwrites existing style.css unless 'append' is set, which is the main destructive risk, nor does it mention permissions or side effects on slides.md.

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?

Three tight sentences: purpose, mode breakdown, and preview behavior, plus a reference link. Front-loaded with the purpose and free of redundant filler.

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 7-parameter mutation tool with no annotations and no output schema, the description covers modes, write targets, and the dry_run preview return shape well enough to call correctly. Minor gaps remain around the replace-vs-append default and the slide-scoping behavior, but the schema fields fill those in.

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 description coverage is 100%, so the schema already explains mode, css, append, scoped, classes, dry_run, and slide_number in detail. The description mostly restates the mode enum and the dry_run flag rather than adding meaning beyond the schema, so baseline 3 applies.

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

Purpose5/5

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

States a specific verb and resource ('Manage CSS styling for the Slidev presentation') and immediately decomposes into three concrete modes with their write targets (style.css, inline <style> block, frontmatter class field). An agent can distinguish this from set_theme or update_slide without opening the schema.

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 when-to-use context for each mode and points to dry_run=true for previewing. It stops short of naming alternatives or exclusions (e.g., when to prefer set_theme or a full update_slide instead), so guidance is clear but not complete.

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