Skip to main content
Glama

Read Output File

read_output_file

Read simulation results from a text file within the output directory, returning the first N lines. Use after running a model with a file output block.

Instructions

Прочитать текстовый файл с результатами расчёта.

Основной способ получить результаты: get_signal работает только у проекта с подключённой базой сигналов, а блок «В файл» пишет результат в текстовый файл независимо от базы. Каждая строка — один момент времени: «<время> <значение 1> … <значение n>».

Порядок работы: add_block("В файл", props="filename=<путь>,count=1,step=[0.1]") → соединить с выходом модели → run(to_time=…) → read_output_file(<путь>).

Читается только каталог результатов. По умолчанию это <временный каталог>/simintech-output (переопределяется переменной SIMINTECH_OUTPUT_DIR), и блок «В файл» должен писать внутрь него — иначе инструмент откажет. Это стандартное ограничение, а не опция: иначе инструмент превращается в «прочитать произвольный файл по пути от клиента». Относительный путь ищется внутри каталога результатов, символические ссылки раскрываются до проверки — поэтому .. и ссылки выйти наружу не помогают. Текущий каталог печатает help_text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesпуть к файлу внутри каталога результатов (абсолютный или относительный — тогда он ищется в этом каталоге).
max_linesNoсколько первых строк вернуть; значение по умолчанию — из сигнатуры.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It explains the file format (one time step per line with values), the restriction to the results directory, how relative paths are resolved, and that symlinks are expanded before checks so escaping via '..' or links is blocked. This is rich, actionable behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is moderately long but every sentence adds value: purpose, usage, file format, workflow, and security boundaries are all clearly separated. The most important information is front-loaded, and the rationale for the directory restriction is concise rather than rambling.

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

Completeness5/5

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

For a two-parameter tool with an output schema, the description is complete. It covers what the file contains, how to produce it, how to reference it, and the security constraints. The agent has everything needed to invoke read_output_file correctly without further exploration.

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?

Although schema coverage is 100%, the description adds substantial meaning beyond the schema: absolute versus relative path resolution, the requirement that the file live inside the results directory, and the per-line format. It also clarifies the default directory and how to override it with SIMINTECH_OUTPUT_DIR.

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 states a specific verb and resource: reading a text file of calculation results. It also distinguishes itself from the sibling get_signal by explaining that get_signal requires a signal database while this tool reads file output regardless. The scope is unambiguous.

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?

The description explicitly explains when to use this tool versus get_signal, and provides a full workflow: add_block('В файл'), connect, run, then read_output_file. It also states the security restriction on which directory may be read, so an agent knows the expected usage constraints.

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