Skip to main content
Glama

rewrite_pdw_metadata

Copy PDW metadata while preserving program and memory bytes, then update status pages, tables, or project title without overwriting workspace files or validating PLC semantics.

Instructions

Copy PDW metadata while retaining populated program and memory bytes exactly.

    Title defaults to output stem. Pages: null preserves, [] removes, list replaces.
    Tables: null preserves, [] removes; creating tables is unsupported.
    Retains unrelated/unknown records. Workspace files only, never overwrites. Validates byte
    preservation, not original instruction semantics, GUI compatibility or PLC behavior.
    

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": {
      "output_name": "<output_name>",
      "source_path": "<source_path>"
    },
    "name": "rewrite_pdw_metadata"
  }
}

Input Schema

NameRequiredDescriptionDefault
tablesNoTables: null preserves, [] removes. Nonempty definitions are limited to existing Modbus register-table edits: template_name and commands, with unchanged transaction count. Communication tables are not integer lists.
output_nameYesNew plain .pdw artifact filename.
source_pathYesExisting workspace .pdw source path.
project_nameNoCP950 project title; defaults to output stem.
status_pagesNoPages as in generate_project_pdw: name and items (ref, column_raw, row, display_format). null preserves, [] removes.
normalize_component_namesNoNormalize verified FF name padding; retain program and other data.

Output Schema

NameRequiredDescriptionDefault
errorNoValidation error code, message and written=false.
artifactNoArtifact metadata on success; absent when validation fails before writing.
warningsNoGeneration or verification warnings; empty when none were reported.
diagnosisNoLDR failure diagnosis, when available.
response_modeYesCompact or full response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.0

TDQS

A3.7/5.0
Behavior4/5

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

Adds real behavioral context beyond the annotations: unrelated/unknown records are retained, the target file is never overwritten, and validation covers only byte preservation, not instruction semantics, GUI compatibility, or PLC behavior. Annotations already declare readOnlyHint=false and destructiveHint=false, and the description is consistent with them, but it doesn't describe failure modes or what happens when a table edit is rejected.

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 guarantee (metadata copied, bytes retained), then compact line-per-parameter semantics and a scope limiter. Slightly redundant with the schema defaults, but no filler sentences.

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?

An output schema exists and annotations cover the safety profile, so the description's job is the preservation/validation contract, which it delivers, plus the workspace-only and no-overwrite constraints. It could add what happens on byte-validation failure, but nothing an agent needs to call 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% and the schema already documents defaulting, so the description's 'Title defaults to output stem', 'Pages: null preserves, [] removes, list replaces', and 'Tables: null preserves, [] removes' largely restate the schema. The one added constraint, that creating tables is unsupported, is a mild value-add over the table parameter's own description, but baseline 3 applies.

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?

States a specific verb and resource: copying PDW metadata while retaining program and memory bytes exactly. That is clearly distinct from generate_pdw / generate_project_pdw by implication (copy vs. generate), though it never names a sibling to contrast against.

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?

Usage is implied rather than stated: the tool is for producing a modified copy of an existing .pdw, and 'Workspace files only, never overwrites' scopes the input/refresh case. There is no explicit when-to-use vs. when-not-to-use guidance or routing to generate_pdw, generate_project_pdw, or inspect_pdw.

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