Skip to main content
Glama

Honeyfield Marketing MCP

Strapi: Replace text

strapi_replace_text
Destructive

Text in einem Strapi-Eintrag gezielt ersetzen (z. B. einen Link, Satz oder Preis) — ohne das ganze Feld oder die ganze Dynamic Zone neu zu schicken. Schreibt NUR den Draft (Strapi 5); live geht es erst über strapi_publish_entry. replacements: Liste von {search, replace, field?, all?}:

  • search/replace: wörtlicher Text (kein Regex), z. B. {"search": "/kontakt-alt", "replace": "/kontakt"}.

  • field (optional): nur an dieser Stelle ersetzen, z. B. "excerpt" oder "content[2].faqs[0].answer" (Pfad wie im strapi_get_entry-Ergebnis).

  • all (optional, Standard false): alle Vorkommen ersetzen. Ohne all muss search genau EINMAL vorkommen — 0 oder mehrere Treffer brechen ALLE Ersetzungen ab, ohne zu schreiben (failed nennt Anzahl und Fundstellen). Das Tool liest den Draft selbst vollständig (auch tief verschachtelte Sektionen, Repeatables, Medien), ersetzt, schreibt nur die geänderten Felder zurück und liest zur Kontrolle zurück. Hat jemand den Draft zwischen Lesen und Schreiben im Admin geändert, kommt error=concurrent_modification und nichts wird geschrieben. Texte verknüpfter Einträge und Medien werden nicht angefasst. Rückgabe: applied [{search, count, field_paths}], changed_fields, draft_updated_at, verified. entry_id ist die documentId. locale wählt die Sprachversion (bei lokalisierten Content-Types immer angeben, sonst Default-Locale). Nur Strapi 5. Single Types (z. B. 'impressum', 'footer'): Singular-API-ID als collection; der Server spricht sie automatisch über ihre ID-lose Route an. entry_id wird dabei NICHT geprüft (ein Single Type hat nur ein Dokument) — die documentId aus dem Lesen mitgeben, sie dient nur als Platzhalter. collection: API-ID der Collection (Buchstaben, Ziffern, _ und -; keine Plugin-Routen wie users, upload, admin), sonst {"error":"invalid_collection"}. entry_id: documentId bzw. numerische ID (Buchstaben, Ziffern, _ und -), sonst {"error":"invalid_id"}. Antwortet Strapi nicht ({"error": "strapi_timeout"} bzw. "strapi_unreachable"), ist offen, ob die Änderung angekommen ist: erst nachsehen, nicht blind wiederholen. workspace: Slug des Kunden-Workspace (optional bei nur einem Workspace).

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": {
      "collection": "<collection>",
      "entry_id": "<entry_id>",
      "replacements": "<replacements>"
    },
    "name": "strapi_replace_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
localeNo
entry_idYes
workspaceNo
collectionYes
replacementsYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true and openWorldHint=true, and the description goes well beyond them: read-replace-write-back of only changed fields, a verify re-read, all-or-nothing abort on 0 or multiple matches without all=true, concurrent_modification detection when someone edited the draft in the admin, and non-touching of linked entries/media. The remaining gap is that it does not describe atomicity across multiple replacement items in detail beyond the abort rule, so it is very strong but not exhaustive.

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

Conciseness4/5

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

The core action and draft-only constraint are front-loaded, then structured into a bulleted replacements block followed by per-parameter rules; each section maps to something an agent needs. It is long, and the inline error-string notes (invalid_collection, invalid_id, strapi_timeout) could be tightened, but almost nothing is filler.

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 five-parameter mutation tool with 0% schema coverage, it covers matching semantics, path syntax, draft-vs-live behavior, concurrency, Single Types, locale and workspace defaults, and the failure modes where a blind retry is dangerous. Return values are spelled out even though an output schema exists, which is redundant but leaves an agent with nothing material missing.

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

Parameters5/5

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

Schema description coverage is 0% and replacements is an open object array, so the description carries the entire burden and does: search/replace are literal (no regex) with an example, field is an optional path like "content[2].faqs[0].answer", all defaults to false with exact-once semantics, entry_id is the documentId, locale selects the language version, collection takes an API-ID but not plugin routes, and workspace is the customer slug. This is meaning the schema alone would leave completely opaque.

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+resource ("Text in einem Strapi-Eintrag gezielt ersetzen") and immediately scopes it against the obvious alternative: it does not resend the whole field or Dynamic Zone. It also names the sibling needed for going live ("live geht es erst über strapi_publish_entry"), so an agent can distinguish it from strapi_update_entry and strapi_publish_entry without opening any schema.

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

Usage Guidelines5/5

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

It states when to use it (targeted single-string edits like a link, sentence or price), when the sibling is required (publishing via strapi_publish_entry), and includes preconditions such as "Nur Strapi 5", always passing locale for localized content types, and the Single Type workaround where entry_id is only a placeholder. It also gives exclusions (no plugin routes like users, upload, admin) and the timeout case where a retry is unsafe.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources