|
2 | 2 |
|
3 | 3 | 本文件由源码中的 `[McpServerTool]` 静态抽取生成,运行时仍以 `tools/list` 为准。 |
4 | 4 |
|
5 | | -- 生成时间:2026-05-31 20:40:09 |
6 | | -- 工具数量:183 |
| 5 | +- 生成时间:2026-06-02 18:38:25 |
| 6 | +- 工具数量:180 |
7 | 7 |
|
8 | 8 | ## L0 |
9 | 9 |
|
|
69 | 69 | | ImportPlcTagTable | [L1][PLC-Software]Import one PLC tag table XML file into PLC software (best-effort) | |
70 | 70 | | CompileSoftware | [L1][PLC-Software] Compile all blocks in the PLC software. Requires: Connect + OpenProject. Returns basic success/failure. For structured error/warning details use CompileAndDiagnosePlc instead. Must compile before ExportBlock if any blocks are inconsistent. After adding new blocks via import, always compile to catch type/interface mismatches. | |
71 | 71 | | GetSoftwareTree | [L1][PLC-Software] Get the full PLC block/type/external-source hierarchy as ASCII tree. Requires: Connect + OpenProject. softwarePath from GetProjectTree (e.g. 'PLC_1'). ALWAYS call before ExportBlock/ImportBlock to get exact group paths (e.g. 'Program blocks/FBs/FB_Motor'). Returns OB/FB/FC/GlobalDB/UDT/ExternalSource blocks with group hierarchy. | |
72 | | -| ImportBlock | [L1][PLC-Software] Import a single XML block file into PLC software. Requires: Connect + OpenProject. importPath must be an absolute path to a .xml file. After import, call CompileAndDiagnosePlc to verify. For multiple files use ImportBlocksFromDirectory; for JSON-built blocks use PlcBuildAndImport. | |
| 72 | +| ImportBlock | [L1][PLC-Software] Import a single SimaticML XML block file into PLC software. Requires: Connect + OpenProject. importPath must be an absolute path to a .xml file. After import it reads back to confirm the block is present (Meta.verified); call CompileAndDiagnosePlc for full consistency. Pick the right tool: SCL/.s7dcl text → ImportFromDocuments; multiple XML files → ImportBlocksFromDirectory; a full exported program (UDTs+tags+blocks) → ImportPlcProgramFromDirectory; JSON-built blocks → PlcBuildAndImport. | |
73 | 73 | | CompileAndDiagnosePlc | [L1][PLC-Software] PREFERRED compile tool. Compiles PLC and returns structured errors/warnings by recursively walking CompilerResult.Messages (V20/V21 PublicAPI). Leaf diagnostics include Path + Description; optional Line/Column via GetAttribute when exposed. Requires: Connect + OpenProject. | |
74 | 74 | | ImportType | [L1][PLC-Software]Import a type from file into the plc software | |
75 | 75 |
|
|
90 | 90 | | OpenProject | [L1][Project] Open a local TIA Portal project (.apXX) or multi-user session (.alsXX) file, where XX is the TIA version number (e.g. .ap21, .als21). Requires: Connect. Closes any currently open project first. After success, call GetProjectTree to explore its structure. | |
91 | 91 | | AttachToOpenProject | [L1][Project]Attach MCP to an already-open TIA Portal project by name (avoids disposed project handles). | |
92 | 92 | | CreateProject | [L1][Project] Create a new empty TIA Portal project. Requires: Connect. After creation, call AddDevice to add PLCs/HMIs, then GetProjectTree to verify. The project is automatically opened after creation — no separate OpenProject call needed. | |
| 93 | +| ScaffoldProject | [L1][Project] One-shot project generator: from a single JSON spec it creates the project, adds PLC (and optional Unified HMI) hardware, builds UDTs/global DBs/PLC tag tables, imports SCL external sources and LAD S7DCL documents, compiles, sets up the HMI connection/screens/tags, and saves — collapsing the ~20-step runbook into one call. Auto-connects if needed. Critical-step failures (connect/createProject/PLC device) abort; per-element failures are collected and reported. Spec keys: projectName(required); directoryPath?(default %TEMP%); plcName?(PLC_1); plcFamily?(S7-1500); plcMlfb?; hmiName?(omit to skip all HMI); hmiFamily?(WinCCUnifiedPC); hmiSoftwarePath?(HMI_RT_1); connectionName?(HMI_Connection_1); udt?/globalDb?/tagTable? = arrays of the same json objects PlcBuildAndImport accepts; sclSourceFiles? = array of .scl file paths; ladDocs? = array of {importPath,name}; hmiScreens? = array of {screenName,width,height,designJson(object)}; hmiTags? = array of {tagTableName?,tagName,hmiDataType?,plcTag?,address?}; compile?(true); save?(true). Returns a per-step report with compile error/warning counts. Pass dryRun=true to validate the spec offline (PLC block JSON shapes, SCL/LAD file paths, designJson) WITHOUT connecting to TIA or creating anything. | |
93 | 94 | | SaveProject | [L1][Project] Save the currently open project or session to disk. Requires: Connect + OpenProject. Call after any significant change (device add, block import, HMI edit). Compile first if there are pending changes to ensure consistency. | |
94 | 95 | | CloseProject | [L1][Project] Close the currently open project or multi-user session. Requires: Connect + OpenProject. Any unsaved changes are lost — call SaveProject first. After closing, the connection remains active but no project is open. | |
95 | 96 | | GetProjectTree | [L1][Project] Get the full project device/software tree as ASCII art. Requires: Connect + OpenProject. ALWAYS call this first after opening a project to discover the exact softwarePath (e.g. 'PLC_1') and device paths needed by all other PLC/HMI/hardware tools. Returns device names, software nodes, and HMI nodes. | |
|
267 | 268 | | GetBlockInfo | [L2][PLC-Software] Get detailed info for one block (attributes, language, number, modification time). Requires: Connect + OpenProject. blockPath must be fully qualified: 'Group/Subgroup/BlockName' — get it from GetSoftwareTree or GetBlocksWithHierarchy. Returns: IsConsistent (false = must compile before export). | |
268 | 269 | | GetBlocks | [L2][PLC-Software] Get a flat list of all blocks in PLC software. Requires: Connect + OpenProject. Use GetBlocksWithHierarchy instead when you need group/folder paths for ExportBlock. Returns: block name, number, type (OB/FC/FB/GlobalDB/InstanceDB), programming language. | |
269 | 270 | | GetBlocksWithHierarchy | [L2][PLC-Software]Get a list of all blocks with their group hierarchy from the plc software. | |
270 | | -| ExportBlock | [L2][PLC-Software] Export one block to an XML file. Requires: Connect + OpenProject + block must be consistent (compile first if IsConsistent=false). blockPath must be fully qualified 'Group/Subgroup/Name' from GetSoftwareTree — bare names return InvalidParams with suggestions. For batch export use ExportBlocks. | |
271 | | -| ExportBlockToTemp | [L2][PLC-Software]Export one block to a temporary directory and return written file paths | |
272 | | -| ImportBlocksFromDirectory | [L2][PLC-Software]Batch import PLC block .xml files from a directory into a block group (V21 recommended path) | |
| 271 | +| ExportBlock | [L2][PLC-Software] Export one block to an XML file. Requires: Connect + OpenProject + block must be consistent (compile first if IsConsistent=false). blockPath must be fully qualified 'Group/Subgroup/Name' from GetSoftwareTree — bare names return InvalidParams with suggestions. Pick the right tool: batch → ExportBlocks; readable SCL/.s7dcl text → ExportAsDocuments. | |
| 272 | +| ImportBlocksFromDirectory | [L2][PLC-Software] Batch import PLC block .xml (SimaticML) files from a directory into a block group. Pick the right tool: SCL/.s7dcl text → ImportBlocksFromDocuments; a full mixed program with UDTs+tag tables+blocks auto-ordered → ImportPlcProgramFromDirectory; a single XML file → ImportBlock. | |
273 | 273 | | ImportPlcProgramFromDirectory | [L2][PLC-Software] HIGH-LEVEL batch import tool. Recursively scans a directory for PLC XML files, auto-classifies them as UDT/TagTable/Block, imports in correct dependency order (UDTs first, then tag tables, then blocks), and optionally compiles. Requires: Connect + OpenProject. Best for importing a full exported PLC program or a set of generated XML blocks. | |
274 | 274 | | RepairAndReimportBlock | [L2][PLC-Software]Try import a block XML; if compile fails, return diagnostics and best-effort suggestions (no destructive actions). | |
275 | | -| ExportBlocks | [L2][PLC-Software]Export all blocks from the plc software to path | |
276 | | -| ExportBlocksToTemp | [L2][PLC-Software]Export blocks to a temporary directory and return written file paths | |
| 275 | +| ExportBlocks | [L2][PLC-Software] Export all (or regexName-filtered) blocks to a directory as SimaticML XML. Pick the right tool: readable SCL/.s7dcl text → ExportBlocksAsDocuments; a single block → ExportBlock. | |
277 | 276 | | GetTypeInfo | [L2][PLC-Software]Get a type info from the plc software | |
278 | 277 | | GetTypes | [L2][PLC-Software]Get a list of types from the plc software | |
279 | 278 | | ExportType | [L2][PLC-Software]Export a type from the plc software | |
280 | | -| ExportTypeToTemp | [L2][PLC-Software]Export one type to a temporary directory and return written file paths | |
281 | 279 | | SeedProjectFromReference | [L2][PLC-Software]Seed PLC blocks/types and HMI screens/tagtables from a reference directory (manifest.json + {{PLACEHOLDER}} replace) | |
282 | 280 | | ExportTypes | [L2][PLC-Software]Export types from the plc software to path | |
283 | | -| ExportTypesToTemp | [L2][PLC-Software]Export types to a temporary directory and return written file paths | |
284 | 281 | | ExportAsDocuments | [L2][PLC-Software] PREFERRED on V21+ for exporting one block. Exports a single program block to SIMATIC SD textual / SCL document format (.s7dcl + .s7res) — far more readable/diff-friendly than SimaticML XML (ExportBlock). Requires TIA Portal V20 or newer. | |
285 | 282 | | ExportBlocksAsDocuments | [L2][PLC-Software] PREFERRED on V21+ for batch export. Exports multiple program blocks to SIMATIC SD textual / SCL document format (.s7dcl + .s7res) — far more readable/diff-friendly than SimaticML XML. Requires TIA Portal V20 or newer. | |
286 | | -| ImportFromDocuments | [L2][PLC-Software] PREFERRED on V21+ for importing one block. Imports a single program block from SIMATIC SD textual / SCL documents (.s7dcl + .s7res) into PLC software. Requires TIA Portal V20 or newer. | |
| 283 | +| ImportFromDocuments | [L2][PLC-Software] PREFERRED on V21+ for importing one block. Imports a single program block from SIMATIC SD textual / SCL documents (.s7dcl + .s7res) into PLC software. Requires TIA Portal V20 or newer. After import it reads back to confirm the block is present (Meta.verified). | |
287 | 284 | | ImportBlocksFromDocuments | [L2][PLC-Software] PREFERRED on V21+ for batch import. Imports multiple program blocks from SIMATIC SD textual / SCL documents (.s7dcl + .s7res) into PLC software. Requires TIA Portal V20 or newer. | |
288 | 285 |
|
289 | 286 | ### PLC-TechnologyObjects |
|
0 commit comments