Skip to main content
Glama
U-C4N
by U-C4N

Plant: Cable Takeoff

cable_takeoff

Produce a per-load cable takeoff from P&ID and layout drawings: kW, phases, panels, lengths and sections, exported as XLSX and CSV with open items flagged.

Instructions

A cable takeoff: one row per electrical load, the shop's cable method made repeatable.

Power, phases, voltage, neutral and VFD come from the P&ID's electrical texts near each tag (Russian, Turkish and English spellings). Power is never invented: a load with no stated kW keeps an empty cell and an open item. The panel comes from the layout's wiring callouts ('Wiring to CP1' and its variants, normalised to CP-1), else from the P&ID ('к CP1'); a load neither places takes the nearest panel on the layout, flagged panel_inferred (panel_rule='stated' leaves it open). The length is the Manhattan distance on the layout from the load's tag to its panel's tag, and the cable is ROUNDUP(length x (1 + allowance)) to the metre. Room and panel totals count known power once: a load wired to a panel that states its own power is part of that package, and the package's power is counted instead of its children's - the rule is written on the method sheet. Sections only from section_rules; no standard table is applied. Open items: missing power, missing panel, a tag or panel not on the layout, no layout at all, a load no section rule covers.

Read-only on both drawings. With output it writes one workbook - Metraj, Özet, Kontrol, Metodoloji - as XLSX and, always, as CSV beside it.

Refused before a drawing is read: lang outside tr / en / ru, an allowance outside 0-1 and a malformed section rule (named by its path, section_rules[0].section: ...). A missing, unreadable or oversize drawing is refused by the reader, which names MAX_DXF_BYTES. Without openpyxl the XLSX is not written and files.refused carries capability: "xlsx_write" naming the office extra; the CSV files are written all the same.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
langNoHeaders and method text: tr | en | ru.en
outputNoWorkbook to write (.xlsx); the four sheets are also written as CSV beside it. Omit to return the rows only.
pid_pathNoThe P&ID carrying the electrical texts (kW, phases, voltage, VFD). Omit to read the current drawing.
allowanceNoAllowance before rounding up to the metre (0.20 = 20 %).
panel_ruleNoA load no wiring callout places: 'nearest' takes the nearest panel on the layout and flags the row panel_inferred; 'stated' leaves it open.nearest
layout_pathNoThe layout with the tags, the panels and the 'Wiring to CPn' callouts. Omitted, every length stays empty with an open item.
section_rulesNoYour own section table: [{max_kw, section, phases (1|3, optional)}], e.g. [{'max_kw': 5.5, 'section': '5x2.5'}]. Omitted, no section is proposed.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.6.0

TDQS

A4.4/5.0
Behavior5/5

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

The description discloses extensive behavior beyond the safety annotations: power is never invented, panel inference flags `panel_inferred`, length is Manhattan distance with rounding, totals count power once per package, open items are listed, and refusals occur for invalid lang/allowance/section rules or unreadable drawings. It also explains the write side-effect (XLSX/CSV output) and the fallback when openpyxl is missing. This is far richer than the readOnlyHint=false / destructiveHint=false 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?

The description is front-loaded with a one-sentence purpose, then proceeds through rules, outputs, and refusals in a logical order. It is dense, but each sentence conveys a distinct rule or constraint. There is minor repetition around section rules and open items, but overall it is appropriately sized for a complex 7-parameter tool.

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?

With an output schema present, the description need not explain return values. It covers prerequisites, defaults, validation refusals, output artifacts, and fallback behavior comprehensively. An agent has everything needed to invoke the tool correctly, including the read-only-on-drawings clarification against the write side-effect.

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 description coverage is 100%, so the baseline is 3. The description adds meaningful parameter constraints beyond the schema: `lang` values outside tr/en/ru are refused, `allowance` outside 0-1 is refused, malformed `section_rules` are named by path, and `output` writes four named sheets plus CSVs. These details go beyond the schema's own parameter descriptions, though some panel_rule behavior is repeated from the schema.

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 names a specific verb and scope: 'A cable takeoff: one row per electrical load, the shop's cable method made repeatable.' It clearly distinguishes this from generic extraction tools by focusing on electrical loads and a repeatable cable method. An agent can tell it apart from siblings like pipe_takeoff 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 Guidelines3/5

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

The description implies usage by describing the inputs it reads (P&ID, layout) and the output it produces, but it never explicitly states when to choose this tool over alternatives such as pipe_takeoff. No exclusions or 'when not to use' guidance are given. The context is clear enough to infer the tool's purpose, but routing guidance is absent.

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