Skip to main content
Glama

Point images to local files

journal-rewrite-images
DestructiveIdempotent

Replaces CDN-hosted image URLs in Foundry journal texts with local paths. Specify URL prefix and local folder; use dry run to preview changes first.

Instructions

Replace external image addresses in text pages with local paths, for imported adventures that load their images from a CDN. Every img whose src starts with urlPattern (ignoring case) gets localPrefix followed by the file name of the old address. Runs inside Foundry. Use dryRun first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dryRunNoOnly report what would change, without writing (default false). Run this first.
pageIdNoOnly this text page. Omit for every text page of the journal.
journalIdYesId of the journal, from list-journals.
urlPatternYesThe address prefix to replace, taken literally, e.g. "https://cdn.example.com/img/".
localPrefixYesThe folder the file names go under, e.g. "Bilder/Kampagnen/Abenteuer".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv14.2609.4

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructive and idempotent hints. The description adds value by specifying the transformation rule: 'Every img whose src starts with urlPattern (ignoring case) gets localPrefix followed by the file name of the old address.' This clarifies the case-insensitive matching and the exact replacement behavior, going beyond the schema and annotations.

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 sentences, each carrying essential information: purpose, transformation rule, and environment/safety. No filler, and the purpose is front-loaded before details.

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?

The tool has five parameters, full schema coverage, and annotations covering destructiveness and idempotency. The description explains the core behavior and the dryRun safety step. It could mention return values or edge cases (e.g., pages with no matches), but these are not essential for correct invocation given the schema richness.

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% with descriptive field explanations, so the baseline is 3. The description adds the case-insensitive matching rule and file-name derivation, which enriches understanding of urlPattern and localPrefix, but not substantially beyond the schema's own descriptions.

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?

The description opens with a specific verb and resource: 'Replace external image addresses in text pages with local paths.' It further scopes to imported adventures loading from a CDN and specifies Foundry, making it clearly distinct from sibling tools like world-rewrite-paths or journal-set-page.

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?

It gives a clear context for when to use it ('for imported adventures that load their images from a CDN') and includes a strong safety instruction ('Use dryRun first'). It does not explicitly mention alternatives or when not to use it, but the stated use case is specific enough to guide selection.

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

Deploy Server

Other Tools