Skip to main content
Glama
Edge-JB
by Edge-JB

tc_module

List, create, and configure TcCOM module instances in TwinCAT. Supports XML read/write, symbol toggling, and execution context assignment.

Instructions

TcCOM module objects under TIRC^TcCOM Objects (paths use ^ separators). CONFIG-TIME ONLY — no INIT/PREOP/SAFEOP/OP transitions (not an Automation Interface feature); nothing here activates config, downloads, or touches the runtime/safety system. Actions: list (read-only) — enumerate module instances via ITcModuleManager3, returns {count,modules:[{moduleTypeName,moduleInstanceName,classId,oid,objectId,parentOid}]} (oids are DECIMAL; XAE shows hex). create (name, by="classid"|"name", id, before?) — CreateChild under TcCOM Objects: by=classid -> subType 0, id = module GUID/ClassID e.g. {8f5fdcff-...}; by=name -> subType 1, id = registered module type name e.g. "NewModule"; a malformed/ghost child is cleaned up and reported as an error. get_xml (path) — ProduceXml of the instance (Parameters / DataAreas / Symbols, with current CreateSymbol/CreateSymbols flags). set_xml (path, xml, returnXml?) — ConsumeXml escape hatch for parameters not exposed as typed properties. enable_symbols (path, parameters?, dataAreas?, returnXml?) — convenience toggle: sets CreateSymbol=true on Parameter nodes and/or CreateSymbols=true on DataArea AreaNo nodes via ProduceXml/ConsumeXml. CAVEAT: the XPath/attribute names are from a how-to summary, NOT verified against a literal ProduceXml dump — call get_xml on a real module first and fall back to set_xml if the toggle reports changed:false. To wire module DataArea symbols to PLC/IO/other-module variables (symbols must already exist via enable_symbols), use tc_link link/unlink. set_context (path, taskObjectId, contextId?) — assign the instance to a task's execution context; taskObjectId/contextId are DECIMAL oids (XAE shows hex). GUARDED: changes the activated mapping/runtime context, requires confirm="ALLOW_TWINCAT_MODULE_CONTEXT" and defaults to no-op.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byNo
idNo
xmlNo
nameNo
pathNo
actionYes
beforeNoinsert before this sibling under TcCOM Objects
confirmNo
contextIdNo
dataAreasNo
returnXmlNo
parametersNo
taskObjectIdNodecimal ObjectId of the target task (XAE shows it in hex)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv2.4.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Addedv2.1.1

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries full burden and delivers detailed behavioral traits: lists return structure, explains create error handling (ghost child cleanup), warns that XPath names for enable_symbols are unverified, and describes the guarded nature of set_context. All mutation effects are clearly stated.

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?

The description is long but well-structured: general scope first, then each action with its own details, followed by a caveat and cross-reference. While some redundancy exists (e.g., repeating the no-runtime-transition warning), the length is justified by the tool's multi-action nature. Slightly verbose for a single tool definition.

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?

Given the high parameter count (13), low schema coverage, and no output schema, the description provides extensive context: return shape for list, error behavior for create, usage order for enable_symbols, and the guarded guard for set_context. However, return structures for get_xml, set_xml, enable_symbols, and set_context are only implied, leaving minor ambiguity for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 15%, meaning the JSON schema provides almost no parameter context. The description compensates fully: explains the 'by' and 'id' semantics for create, describes 'path', 'xml', 'before', 'confirm', 'taskObjectId', 'contextId', and the boolean flags for enable_symbols. Much more detail than the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the target resource ('TcCOM module objects under TIRC^TcCOM Objects') and enumerates specific actions (list, create, get_xml, etc.), all of which are distinct from sibling tools. It distinguishes itself from tc_link by directing DataArea wiring to that sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states config-time-only usage and what the tool does NOT do ('no INIT/PREOP/SAFEOP/OP transitions', 'nothing here activates config, downloads, or touches the runtime/safety system'). Provides alternative for DataArea symbol wiring via tc_link, and warns about set_context requiring a confirm flag.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Edge-JB/TwinCAT-XAE-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server