Skip to main content
Glama
TIA Portal MCP Server

TIA Portal MCP Server

by BJM1122

Read TIA Block

tia_read_block
Read-onlyIdempotent

Read a single exported TIA Portal block, DB, UDT, or tag table as compact text, raw XML, interface, or context to inspect logic, members, and call relationships.

Instructions

Read one exported block, DB, UDT or tag table. Give exportDir with name/number/relativePath; view=text also accepts xmlPath for a single Simatic ML file such as an import candidate. Views: text (default) is compact text, the interface then one line per coil, assignment, instruction box or block call in each network (LAD/FBD), or the SCL source, with every instruction box shown including GET/PUT/MOVE; xml is the raw exported XML, only needed to prepare an import; interface is the flattened interface/member table; context is the metadata, direct callers, direct callees and same-number companion objects.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "tia_read_block"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo
viewNotext
limitNointerface members (default 500) or context relations (default 100, at most 300).
numberNo
xmlPathNoview=text only: a single Simatic ML file instead of an indexed block.
maxCharsNoDefault 40000 (text) or 60000 (xml).
networksNotext: only these network numbers.
exportDirNo
relativePathNo
includeCommentsNotext; default true.
includeInterfaceNotext; default true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.29.1

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so safety is covered. The description adds useful output-shape detail (one line per coil/assignment/instruction box per network, SCL source for STL/SCL). It says nothing about truncation behavior, error cases when neither xmlPath nor an index match is supplied, or identifier-resolution failures.

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?

Purpose and default are front-loaded in the first sentence, then parameter rules, then view meanings in a logical order. The view enumeration is one very long sentence with stacked clauses, which hurts scannability but every clause carries real information.

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?

With 11 parameters, zero required, and no output schema, the definition does its job by describing output shape and view semantics in prose. Remaining gaps are minor: no statement of what happens when no identifier is provided or how the maxChars truncation manifests to the caller.

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

Parameters4/5

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

Schema coverage is 55%, and the description compensates for the undisclosed parameters: it explains that exportDir must be supplied together with name/number/relativePath, and defines all four view enum values. It leaves the semantics of name vs. number vs. relativePath precedence implicit and does not touch limit, networks, or the includeComments/includeInterface defaults beyond what the schema states.

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?

States a specific verb and resource with scope: "Read one exported block, DB, UDT or tag table." It goes further to enumerate the four view modes and what each returns, letting an agent distinguish this from index/listing siblings without opening the schema.

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

Usage Guidelines4/5

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

Gives clear conditional guidance for view selection (xml is "only needed to prepare an import"; text accepts xmlPath for a standalone Simatic ML file) and states the default view. It stops short of naming alternative tools or stating when not to use it at all, e.g. versus tia_read_export_index or tia_get_current_block.

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