Technical reference for building MCP tools that access FrameworX runtime data.
ReferenceMCP for Runtime Developer Reference


Overview

This document provides technical details for developers building MCP tools that interact with FrameworX runtime. It covers data access APIs, path syntax, available namespaces, and tool design guidelines.

For the object model structure, see Object Model Quick Reference.

Core APIs

GetCurrentValue

Primary API for reading any value from the runtime.

csharp

bool success = TMCPServer.DataAccess.GetCurrentValue(
    string path,           // Full path to object
    out object value,      // Returned value
    out int quality,       // 0=Bad, 192=Good
    out DateTime timestamp // Last update time
);

This API accepts any namespace path:

Path ExampleReturns
Tag.Temperature1Tag current value
Tag.Temperature1.DescriptionTag description string
Tag.Temperature1.QualityQuality code
Tag.Pump1.SpeedUserType member value
Server.SystemMonitor.CPUUsageSystem CPU percentage
Alarm.TotalCountActive alarm count
Device.Channel.Modbus1.StatusChannel connection status


GetChildrenElements

Returns children of any path as a DataTable.

csharp

DataTable children = TK.GetChildrenElements(string path);

Behavior depends on path type:

Path TypeExampleReturns
FolderTag.Plant1/Line2Tag names in that folder
TagTag.Temperature1Tag properties (Value, Quality, Description, etc.)
UserType TagTag.Pump1Member names (Speed, Status, Fault, etc.)
NamespaceServerNamespace members
Namespace ObjectAlarm.GroupAll alarm group names


GetTagHistorian

Query time-series data from the Historian.

csharp

DataTable history = TK.GetTagHistorian(
    string tagName,
    DateTimeOffset startTime,
    TimeSpan duration
);

Returns columns: Timestamp, Value, Quality


Path Syntax

Separators


SeparatorPurposeExample
/Hierarchy nodes (folders)Tag.Plant1/Line2/Tank1
.Member accessTag.Pump1.Speed, Server.DateTimeInfo.Day

Path Structure

Tag.Plant1/Line2/Temperature1.Value
?   ?      ?     ?            ??? Property (member access with .)
?   ?      ?     ??? Tag name
?   ?      ??? Subfolder (hierarchy with /)
?   ??? Root folder (hierarchy with /)
??? Namespace

Path Examples


TypePathDescription
Root tagTag.Temperature1Tag at root level
Nested tagTag.Plant1/Line2/PressureTag in folder hierarchy
Tag propertyTag.Temperature1.DescriptionTag metadata
UserType memberTag.Motor1.SpeedMember of UserType-based tag
UserType member propertyTag.Motor1.Speed.QualityQuality of UserType member
Server propertyServer.ComputerNameServer namespace
Nested server propertyServer.SystemMonitor.CPUUsageNested namespace object
Alarm propertyAlarm.TotalCountAlarm module property
Alarm groupAlarm.Group.Critical.TotalCountSpecific alarm group
Device statusDevice.Channel.Modbus1.StatusDevice channel status



Tag Properties

Properties accessible via Tag.{name}.{property}:

PropertyTypeDescription
ValuevariesCurrent value
QualityintOPC quality (0=Bad, 192=Good)
TimestampDateTimeLast update time
DescriptionstringHuman-readable description
UnitsstringEngineering units (e.g., "°C", "PSI")
EngUnitsstringAlternative engineering units property
MinvariesMinimum valid value
MaxvariesMaximum valid value
TypeintData type ID (see Tag Types in Object Model Quick Reference)
CategorystringUser-defined classification



Server Namespace Properties

Server.SystemMonitor.*


PropertyTypeDescription
CPUUsagedoubleSystem CPU percentage
MemoryUsagedoubleSystem memory percentage
TServerCPUUsagedoubleRuntime process CPU
TServerMemoryMBdoubleRuntime process memory (MB)
UptimeTimeSpanTime since solution started
StartedDateTimeDateTimeWhen solution started
NumberOfTagsDefinedintTotal tags in solution
NumberOfTagsLoadedintTags currently in memory
TagUpdatesPerSeconddoubleData throughput
TotalDevicePointsintCommunication points

Server.*


PropertyTypeDescription
ComputerNamestringServer hostname
ComputerIPstringServer IP address
HttpAddressstringWeb server address
OSVersionstringOperating system
IsRunningAsServiceboolRunning as Windows service
IsRunningOnDockerboolRunning in container

Server.Redundancy.*


PropertyTypeDescription
IsRedundancyEnabledboolHA configuration active
IsPrimaryboolThis server is primary
IsSecondaryboolThis server is secondary
PrimaryIPstringPrimary server IP
SecondaryIPstringSecondary server IP

Alarm Namespace Properties

Alarm.*


PropertyTypeDescription
TotalCountintTotal active alarms
UnAckCountintUnacknowledged alarm count
ActiveUnAckCountintActive and unacknowledged
QueryActive.TableDataTableFull active alarm table

Alarm.Group.{name}.*


PropertyTypeDescription
TotalCountintActive alarms in group
UnAckCountintUnacknowledged in group
DisableboolGroup disabled flag
DescriptionstringGroup description

Alarm History Database

Historical alarm records are stored in Dataset.DB.AlarmHistorian.

PropertyValue
DatabaseDataset.DB.AlarmHistorian
Table NameAlarmHistory
AccessSQL queries via Dataset module


Common columns: TagName, Message, ActiveTime, AckTime, NormTime, UserName, Priority, Area, GroupName


Quality Codes

Standard OPC quality values:

ValueMeaningDescription
0BadValue is not reliable
192GoodValue is valid and current



MCP Tool Design Guidelines

Tool Naming Conventions


PatternExampleUse Case
Get + NounGetValue, GetChildrenSimple retrieval
Get + Adjective + NounGetTagHistory, GetActiveAlarmsQualified retrieval
Query + SourceQueryAlarmDatabaseSQL-based queries
Search + TargetSearchTagsPattern-based discovery

Description Best Practices

Effective tool descriptions help AI assistants choose the right tool:

  1. First sentence: State the purpose clearly
  2. Returns: Describe what data is returned
  3. Use for: List appropriate use cases
  4. Do NOT use: Clarify when other tools are better (prevents misuse)
  5. Examples: Provide sample input values

Template:

"[What it does in one sentence]. " +
"Returns [what is returned]. " +
"Use for: [use case 1], [use case 2], [use case 3]. " +
"[When NOT to use, if applicable]. " +
"Examples: [example1], [example2], [example3]."

Parameter Description Best Practices

  1. State the expected format (e.g., "ISO 8601 format")
  2. Provide concrete examples
  3. Explain path syntax when relevant

Example:

csharp

[Description("Tag name (e.g., 'Tag.Temperature1', 'Tag.Plant1/Line2/Pressure')")]
string name

Built-in MCP Tools Reference

GetValue

Reads current value from any namespace path.

PropertyValue
Parametersname (string) — full path to tag or object
ReturnsJSON with Name, Value, Quality, Timestamp
Use forProcess values, system properties, alarm counts, device status


GetTagHistory

Queries time-series data from Historian.

PropertyValue
Parametersname, startDate, finishDate
ReturnsJSON table with Timestamp, Value, Quality columns
Use forTrend analysis, historical comparisons


GetActiveAlarms

Returns currently active alarms.

PropertyValue
ParametersNone
ReturnsJSON table of active alarm records
Use forAlarm status inquiries, problem investigation


GetChildren

Browses namespace structure.

PropertyValue
Parameterspath (string) — path to browse
ReturnsJSON table of children elements
Use forDiscovering available tags, understanding data structure


GetTagMetadata

Returns tag metadata without current value.

PropertyValue
Parametersname (string) — tag name
ReturnsJSON with Description, Units, Min, Max, Type, Category
Use forUnderstanding tag purpose before reading value



See Also

  • No labels