Skip to main content
Glama

Extract messages

verbaly_extract
DestructiveIdempotent

Scans source files, adds new messages to locale catalogs, and refreshes generated types; optionally prunes unused keys or previews changes with dryRun.

Instructions

Scan the source files, add new messages to the locale catalogs and refresh the generated types (what verbaly extract does). It writes the catalogs unless dryRun is set, and with the same code a second run changes nothing. prune also drops keys the code no longer references, translations included, and waits while any source file fails to parse. In a project without Verbaly, run verbaly_init first; for text still hardcoded in JSX, verbaly_wrap.

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_extract"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootNoProject root holding verbaly.config (defaults to the server working directory)
pruneNoDrop keys no longer referenced (deletes their translations)
dryRunNoReport what would change, write nothing

Output Schema

NameRequiredDescriptionDefault
lockNoThis run created verbaly.lock, moved an older state file (from) into it, or rewrote it whole after a merge conflict (merged): it belongs in git with the catalogs, so tell the user to commit it
addedYes
dryRunYes
inCodeYesHow many of those messages the code writes as text: 0 when the project keeps its text in the catalog and reads it with t(key)
prunedYes
escapedYesPlural or format blocks inside a tagged template, which render as literal text
localesYes
renamedYesTagged templates on t under another name (const tr = useT()): never extracted, so they stay in the source language until the binding is named t
messagesYesMessages the source catalog holds after this run
replacedYesSource texts the code wrote over: before is what the catalog said, code is the text that ships. An edit made in the code reads like this too
unparsedYesSource files the parser could not read: their messages are not extracted, and prune drops nothing until they parse
collisionsYesKeys written with more than one text: every place shows the text of the first site, so give each text its own key
positionalYesMessages that hand a translator a nameless value like {_0}: put the value in a named variable first
stateProblemNoThe state file could not be read or written: the catalogs were written, drafts and outdated tracking were not

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructive, idempotent and non-read-only, but the description adds real context beyond them: it explains that it aborts and waits when any source file fails to parse, spells out that prune deletes translations along with keys, and clarifies that a second run with the same code is a no-op. This is strong disclosure of side effects and failure behavior.

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?

Front-loaded with the core action and free of filler; the CLI parenthetical is a useful anchor. The final sentence packs prune semantics and parse-failure behavior together, which is slightly dense but still readable.

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 mutating, prune-capable tool, the description covers prerequisites, write conditions, idempotency and the parse-failure abort. With a full output schema and full schema coverage, nothing an agent needs to invoke it correctly 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 coverage is 100%, so the schema already documents root, prune and dryRun. The description reinforces dryRun ('writes the catalogs unless dryRun is set') and prune ('drops keys the code no longer references, translations included'), but that largely restates the schema text, and root is never mentioned. Baseline 3 applies.

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 names three concrete operations – scan sources, add new messages to locale catalogs, refresh generated types – plus the CLI equivalent, so the agent knows exactly what the tool produces. It is clearly separable from siblings like verbaly_init and verbaly_wrap, which are named as different concerns.

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?

Explicit routing is given for both edge cases: run verbaly_init first in a project without Verbaly, and use verbaly_wrap for text still hardcoded in JSX. It also states the dryRun and prune conditions, so the when-to-use decision is fully determined.

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