Skip to main content
Glama
KphungFROMM

motionworks-iec-mcp-server

by KphungFROMM

search_logic

Find where tags, blocks, or regex patterns are used across all POUs and networks, revealing which routines call a given block.

Instructions

Search for a tag, block or regex across every POU and network.

Answers "where is this used?" and "which routines call this block?". Matches symbol-table entries (declarations, block types, instances, pins) first, then raw Structured Text lines, so both a tag name and a regex work.

Note the pattern is an ordinary regex, so MC_ matches every MC_* block reference (the underscore is literal, and MC_\d+ would require digits after it and so match nothing).

Args: path: Project file or directory. pattern: Tag name, block name, or regex pattern. limit: Maximum number of matches to return.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
limitNo
patternYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it delivers: it discloses the two-phase match ordering (symbol-table entries first, then raw Structured Text lines) and explains the plain-regex-vs-glob gotcha with a concrete example. Minor gaps remain — no explicit read-only statement and no behavior on zero matches — but the non-obvious semantics are genuinely surfaced.

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 purpose is front-loaded in the first sentence, followed by usage context, search-order disclosure, and the regex caveat before a compact Args block. The regex note is slightly verbose and its example is project-specific, but every sentence contributes value and nothing is filler.

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?

An output schema exists, so return values need no explanation. The description covers search scope, match ordering, regex semantics, and all parameters — a complete picture for a search tool of this complexity. It would benefit from a read-only safety hint and no-match behavior, but given zero annotations, the description handles the core burden well.

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 0%, so the description must fully compensate, and it does. The Args section documents all three parameters with real semantics: path's target type, pattern's accepted forms (tag name, block name, or regex), and limit's meaning (maximum number of matches). The pattern parameter receives especially valuable interpretation guidance.

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 first sentence states a precise action — 'Search for a tag, block or regex across every POU and network' — with a defined scope that distinguishes it from the sibling search_library (which targets libraries, not POUs/networks). The question-answering framing ('where is this used?', 'which routines call this block?') reinforces its specific role in code navigation.

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?

The description gives clear usage context by posing the exact questions it resolves ('where is this used?' and 'which routines call this block?'), which tells an agent when to reach for it. However, it never names alternatives or states exclusions, so an agent facing siblings like search_library or get_tag must infer the boundary from scope wording rather than being routed explicitly.

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