Skip to content

MCP tool: workspace_edit — modify components and write back to XML #120

@TomProkop

Description

@TomProkop

Summary

New MCP tool for modifying workspace components and writing changes back to disk via XmlWorkspaceWriter. Full roundtrip: load → edit in-memory → write back.

API

workspace_edit (DESTRUCTIVE — agent must request confirmation)

Params:
  path:       string?  — path to workspace (default: cwd)
  type:       string   — component type
  id:         string   — component identifier
  operations: [{
    action:   string   — add-control, remove-control, move-control, set-label, add-attribute, ...
    target:   string   — path within component (tab/section/control id)
    params:   object   — action-specific parameters
  }]

Returns:
  modified_files: [string]  — list of changed files

Depends on (platform-metadata)

Implementation notes

  • Use TransactionalContext for buffered writes with rollback on failure
  • Use FormBuilder / EntityBuilder for type-safe manipulation
  • Roundtrip-safe via XmlWorkspaceWriter — preserve unknown XML, zero diff on untouched files
  • Marked as destructive in MCP — agent asks user for confirmation before executing

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions