Skip to main content
Glama
w1ne
by w1ne

apply_ratings_batch

Write darktable ratings to XMP sidecars for a batch of raw photos, updating only the rating value to preserve edit history. Supports -1 to 5 stars and logs each change for audit.

Instructions

Write XMP sidecars (xmp:Rating) for a batch of {stem: rating} pairs. Each sidecar sits next to its raw file at .xmp and is picked up automatically by darktable on import. Rating range: -1 (reject), 0 (unrated), 1-5 (stars). Each rating is also appended to /ratings.jsonl for replay/audit. An existing sidecar is never replaced: only its rating value is rewritten, so darktable edit history survives. A sidecar with no recognisable rating is skipped with an error rather than overwritten.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
logNoAppend entries to ratings.jsonl
forceNoDestructive: replace an existing sidecar wholesale instead of patching its rating. This discards any darktable edit history in that file. Only use when the user has explicitly asked to reset the sidecars.
ratingsYesMap of file stem (e.g. 'DSC_1234') to rating int in [-1, 5]. When the same stem occurs in more than one subdirectory the bare stem is rejected as ambiguous — use a source-relative path instead (e.g. 'store_00010001_DCIM_100NCD80/DSC_1234').
source_dirYesDirectory holding the raw files

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.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 provided, the description fully carries the behavioral disclosure burden. It explains sidecar placement, darktable auto-import, the audit log, the 'never replace existing sidecar' behavior, and the error handling for unrecognizable sidecars. It also highlights the destructive force option via the schema.

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?

The description is front-loaded with the core action and efficiently conveys side effects, error behavior, and integration details in five concise sentences. No sentence is redundant or 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?

Given no output schema and no annotations, the description covers the essential invocation context: file locations, side effects, rating semantics, audit logging, and safety behavior. It does not explicitly describe the function's return value or success/failure response, but the described side effects make the tool's behavior highly predictable.

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

Parameters4/5

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

The input schema already describes all four parameters with 100% coverage. The description adds value by explaining the rating scale semantics (-1 reject, 0 unrated, 1-5 stars), sidecar naming, and the purpose of the ratings.jsonl log, going beyond the schema's basic type and range constraints.

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?

The description clearly states a specific action ('Write XMP sidecars') on a specific resource ('a batch of {stem: rating} pairs'). It makes the tool's purpose unambiguous, though it does not explicitly differentiate it from the sibling rate_photos tool by name.

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

Usage Guidelines3/5

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

The description implies this tool is for batch-rating operations by writing XMP sidecars that darktable picks up automatically. However, it does not explicitly state when to prefer this over siblings like rate_photos, or when not to use it.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/w1ne/darktable-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server