Skip to main content
Glama

Update note type styling

update-note-type-styling
DestructiveIdempotent

Replaces the shared CSS for every card of one Anki note type, defaulting to a dry-run validation and requiring a design hash to block stale writes.

Instructions

Validates and replaces the CSS shared by every card of one note type. Defaults to dry-run mode; applying requires expectedDesignHash. Reports applied only after reading back the exact CSS and confirming the Note Type identity and unchanged templates. A write/readback error may follow an applied change; do not blindly retry.

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": {
      "modelName": "<modelName>",
      "css": "<css>"
    },
    "name": "update-note-type-styling"
  }
}

Input Schema

NameRequiredDescriptionDefault
cssYesComplete replacement CSS for the note type
dryRunNoWhen true, validate and report the proposed change without modifying Anki
modelNameYesAnki note type name. AnkiConnect calls note types "models" in its API.
expectedDesignHashNoHash returned by get-note-type-design; required when dryRun is false and blocks stale writes

Output Schema

NameRequiredDescriptionDefault
cssYes
dryRunYes
appliedYes
changedYes
afterHashYesSHA-256 hash of the current CSS and card templates
modelNameYes
beforeHashYesSHA-256 hash of the current CSS and card templates
validationYes
previousCssYes
scopeWarningYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only declare destructive/idempotent/not-read-only; the description adds the crucial non-obvious behavior: dry-run default, the hash gate blocking stale writes, readback verification of exact CSS plus Note Type identity and unchanged templates, and the warning that a write/readback error may follow an applied change. That last point meaningfully changes retry behavior.

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, action front-loaded, each carrying distinct information (validation, default mode, apply gate, verification semantics, retry warning). No filler or restatement of the name.

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

Completeness5/5

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

For a destructive, idempotent mutation on collection-wide state, the description covers the safety model, the apply precondition, what is verified on success, and the failure-after-apply edge case. Combined with an output schema and full parameter documentation, nothing an agent needs before calling is missing.

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 css, modelName, dryRun and expectedDesignHash are all documented in the schema, including the hash pattern and dry-run default. The description reinforces the dryRun/expectedDesignHash dependency but adds little meaning beyond it — baseline 3.

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+resource: 'Validates and replaces the CSS shared by every card of one note type.' The scoping phrase 'shared by every card' implicitly separates it from per-template tools like update-note-type-templates, but no sibling is named explicitly, so it falls short of a 5.

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 preconditions for the dangerous path: dry-run is the default and applying 'requires expectedDesignHash'. It also warns against retrying after a partial failure. It does not explicitly compare against alternatives such as update-note-type-templates or replace-note-type-text.

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