Skip to main content
Glama

Wrap hardcoded JSX text

verbaly_wrap
DestructiveIdempotent

Finds hardcoded user-visible text in JSX/TSX files and wraps it in t tagged templates so the compiler can extract it for translation. Reports changes by default; set write to apply them safely.

Instructions

Find hardcoded user-visible text in JSX/TSX files and wrap it in a t tagged template so the compiler can extract it (what verbaly wrap does). This is how an existing codebase is onboarded, and verbaly_extract then adds the wrapped texts to the catalogs. It only reports unless write is set, and text already wrapped is skipped, so running it again is safe. Text it cannot wrap safely (a sentence split across markup, an expression rendering JSX) is listed as needing a human. A file that does not bind t is never written, because the rewrite would not compile. It comes back in blocked, with the binding this project needs there, so you can add it and run again.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "verbaly_wrap"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootNoProject root holding verbaly.config (defaults to the server working directory)
writeNoApply the rewrites instead of only reporting

Output Schema

NameRequiredDescriptionDefault
filesYesJSX/TSX files scanned
writeYes
blockedYes
changedYesFiles the rewrite touched, or would touch
skippedYes
wrappedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.82.0
    • addedOutput schema / properties / blocked / items / properties / binding
      Added value: +{
      +  "description": "What to add so t is in scope, for this framework",
      +  "type": "string"
      +}
    • changedOutput schema / properties / blocked / items / required
      Previous value: -[
      -  "file",
      -  "texts",
      -  "client"
      -]New value: +[
      +  "file",
      +  "texts",
      +  "client",
      +  "binding"
      +]
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the annotations: default is report-only, already-wrapped text is skipped so re-runs are safe, unwrappable cases are surfaced as needing a human, and files without a `t` binding are never written because the output would not compile. Given destructiveHint=true with a dry-run default, this is the context an agent needs; only the exact rewrite/backup mechanics are left implicit.

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?

One dense paragraph, front-loaded with the action and followed by the dry-run default, idempotency, and the blocked-file escape hatch — each sentence carries a distinct fact. Slightly long, but nothing is redundant 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?

With an output schema present and full parameter coverage, the description supplies exactly the remaining decision-relevant behavior: safety default, idempotency, partial-failure handling, and the blocked outcome it returns. Nothing an agent needs before invoking it is missing.

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?

Schema coverage is 100%, so both parameters are documented structurally, but the description adds real meaning for `write`: mutations happen only when it is set, otherwise the call is a pure report. The `root` parameter is not elaborated, leaving change-detection to the schema text.

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 concrete verb and resource: find hardcoded user-visible text in JSX/TSX files and wrap it in a `t` tagged template. It also pins the CLI equivalent (what `verbaly wrap` does) and distinguishes itself from verbaly_extract, which adds the wrapped texts to catalogs.

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?

Explicitly frames the tool as the onboarding step for an existing codebase and states the follow-up: verbaly_extract then populates catalogs. It also gives the operating condition (reports only unless `write` is set) and the retry loop after fixing a missing `t` binding.

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