0
0
Fork 0
Codesys-MCP-SP21-plus/src/scripts
Karstein Phobic Nyvold Kvistad 19d6cc3d8b fix(create_folder): dump dir(parent) on total-miss to diagnose unknown SPs
Empirical failure: TypeError create_folder() got an unexpected keyword argument 'name' (original v1).
Root cause: kwarg 'name=' rejected by SP21+; positional foldername is the canonical signature.
Fix: positional call (already landed in e0fea90); this commit adds a dir(parent) dump on total-miss for forward-compat diagnostics.
Docs: https://content.helpme-codesys.com/en/ScriptingEngine/ScriptObject.html

Note: the core fix (positional call + multi-strategy fallback) was already
landed in commit e0fea90. This commit only adds the dir(parent_object) dump
to the final error path -- per the bug doc's "dump dir(parent) on total
miss" recommendation -- so an SP that breaks all 5 strategies surfaces the
real API surface in the failure message instead of leaving the next
investigator blind.

### Manual smoke test
1. mcp__codesys__create_folder against any normally-functioning project
   should still succeed (Strategy 1 wins -- the dir() dump only triggers
   when ALL strategies fail).
2. To exercise the new dir() path, run create_folder against a project
   whose Application has been deleted (parent_object resolves to a
   container without create_folder/create_object/add): expect SCRIPT_ERROR
   ending with "parent api: <space-separated attr names>".
2026-04-28 20:51:32 +02:00
..
add_library.py fix(add_library): refuse to save unresolvable placeholders 2026-04-26 19:44:00 +02:00
bump_project_version.py fix(read_running_version_online): document the real root cause + fix 2026-04-26 20:13:25 +02:00
check_status.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
compile_project.py fix(compile): deep-walk message structures with _coerce_for_json before json.dumps 2026-04-28 20:50:15 +02:00
connect_to_device.py fix: 4 broken-tool fixes (compile json long, connect_to_device LoginMode, 2026-04-26 16:53:25 +02:00
create_dut.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
create_folder.py fix(create_folder): dump dir(parent) on total-miss to diagnose unknown SPs 2026-04-28 20:51:32 +02:00
create_gvl.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
create_method.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
create_pou.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
create_project.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
create_property.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
delete_object.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
disconnect_from_device.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
download_to_device.py fix(download_to_device): port login() probe + loginWaitSeconds from connect 2026-04-25 18:40:26 +02:00
ensure_online_connection.py fix(online tools): auto-login + non-CONSTANT version GVL 2026-04-26 19:54:13 +02:00
ensure_project_open.py fix: 4 broken-tool fixes (compile json long, connect_to_device LoginMode, 2026-04-26 16:53:25 +02:00
find_object_by_path.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
get_all_pou_code.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
get_application_state.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
get_compile_messages.py fix(compile): deep-walk message structures with _coerce_for_json before json.dumps 2026-04-28 20:50:15 +02:00
get_pou_code.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
get_project_structure.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
list_project_libraries.py feat(list_project_libraries): capture project compiler version 2026-04-26 19:18:31 +02:00
mirror_export.py fix(mirror): per-project mirror dir name when multiple .project files share a parent 2026-04-27 22:22:09 +02:00
open_project.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
read_running_version_online.py fix(read_running_version_online): document the real root cause + fix 2026-04-26 20:13:25 +02:00
read_variable.py fix(online tools): auto-login + non-CONSTANT version GVL 2026-04-26 19:54:13 +02:00
rename_object.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
save_project.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
set_pou_code.py fix(set_pou_code): omitted declaration/impl no longer wipes the POU 2026-04-26 18:41:48 +02:00
start_stop_application.py fix(online tools): auto-login + non-CONSTANT version GVL 2026-04-26 19:54:13 +02:00
watcher.py fix(watcher): use ASCII-only comments/log strings (IronPython 2.7 syntax error) 2026-04-25 15:10:21 +02:00
write_variable.py fix(online tools): auto-login + non-CONSTANT version GVL 2026-04-26 19:54:13 +02:00