Skip to main content
Glama

proj_get_code

Read-only

Retrieve source code for a TwinCAT PLC object: declaration/implementation, line numbers, parsed VAR declarations, and sub-items for code inspection.

Instructions

Source of an object ('FB_Valve', 'FB_Valve.Open', 'MAIN'): declaration/implementation with file line numbers, parsed VAR declarations, sub-items.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
partNoboth
with_line_numbersNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds useful context about the content returned (parsed VAR declarations, sub-items, line numbers), but since an output schema exists, this is redundant, and it says nothing about auth requirements or limitations. Adds modest value on top of the annotations.

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?

A single, dense sentence that front-loads the resource and packs in return-content details and name-format examples without filler. Slightly example-heavy but no wasted prose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema is present, so return values needn't be described, yet the description partly does so. The main gap is usage context and parameter guidance for a 0%-coverage schema; for a simple read-only getter with annotations, it is adequate but not complete.

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

Parameters3/5

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

Schema coverage is 0%, so the description carries the burden. It gives concrete examples for the required 'name' parameter ('FB_Valve', 'FB_Valve.Open') and its mention of 'declaration/implementation' and 'line numbers' loosely maps to the 'part' and 'with_line_numbers' parameters, but neither parameter is explicitly explained or its allowed values enumerated.

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

Purpose4/5

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

The description clearly states the tool returns the source (declaration/implementation) of a named object, with concrete examples like 'FB_Valve' and 'MAIN'. An agent can tell this fetches code rather than listing projects or reading raw files. It doesn't explicitly contrast with siblings like proj_read_file or proj_variables, but the verb+resource is specific.

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

Usage Guidelines2/5

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

No guidance on when to use this versus alternatives such as proj_read_file (raw file access), proj_variables, or proj_interface. The description states what is returned but never when to reach for it or what it is not suited for.

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

Deploy Server

Other Tools