validate_pou
Validate agent-written IEC code against project symbols to catch non-existent tags, undefined types, missing function blocks, and incorrect parameter names.
Instructions
Validate agent-written IEC code against the project's real symbols.
Call this on generated code before handing it to a user. It catches the mistakes an LLM actually makes: tags that do not exist in the project, types that are not defined, function blocks that are not in the library, and formal parameter names that the target block does not have.
Args: path: Project file or directory. code: The Structured Text body to check (no declaration blocks). declared_vars: Any VAR blocks the code relies on, so locally declared symbols are not reported as undeclared. pou_name: Optional name, used only for labelling the result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| path | Yes | ||
| pou_name | No | ||
| declared_vars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |