Skip to main content
Glama
eng-toolkit

eng-toolkit

by Lin830326

Drawing Convert

drawing_convert

Convert DXF or DWG drawings to PDF, SVG, PNG, or a different DXF release at true scale, with damaged files repaired where possible.

Instructions

Convert a DXF drawing (any version R12 to R2018, text or binary, damaged files repaired where possible) to PDF, SVG, PNG or another DXF version. Model space only. The drawing is converted at true scale: 1 drawing unit is $INSUNITS-to-millimetres millimetres on the page times the scale, so a 100 mm line at 1:1 is 100 mm on the page (283.465 pt in the PDF); a drawing with no unit is taken as millimetres and says so in a warning. output_format: pdf (vector, one page), svg (vector), png (the PDF rasterised, greyscale, 150 dpi or less) or dxf (rewritten to dxf_version: R12, R2000, R2004, R2007, R2010, R2013, R2018). sheet: auto (the drawing extents plus 10 mm on every side) or A4, A3, A2, A1, A0 (ISO 5457, landscape, portrait when only that fits). scale: auto (1:1 on an automatic sheet when the page fits A0, else the largest ISO 5455 scale that does; on a named sheet the largest one, never an enlargement, that fits inside the 10 mm margins) or an ISO 5455 scale (50:1, 20:1, 10:1, 5:1, 2:1, 1:1, 1:2, 1:5, 1:10, 1:20, 1:50, 1:100, 1:200, 1:500, 1:1000, 1:2000, 1:5000, 1:10000). A sheet and scale that do not fit together are refused, not clipped. All ink is black; line weights are kept in millimetres on the page; dashes are the drawing's linetypes. Text becomes glyph outlines (no text layer in PDF, SVG, PNG). data.losses lists everything the target cannot carry or the renderer did not draw (colour, fonts replaced, text not searchable, MTEXT formatting, hatch patterns, ACIS solids and proxy objects, hidden layers, images, paper space, external references; for DXF output the entity types and properties the chosen release lacks, found by writing the file and reading it back), and data.entities counts the entities drawn and skipped per type. A DWG (R12, R2000 to R2018; also one named .dxf) is converted to DXF first by LibreDWG's dwg2dxf, which the user must have installed (ENG_TOOLKIT_DWG2DXF or PATH; the toolkit runs it as a separate program with a time, memory and size limit) and the DXF is then converted like any other; data.dwg names the release and the tool version, and LibreDWG may lose or change content. Without the program a DWG returns engine.unavailable with what to install. The file is untrusted: it is converted in a separate process with a time and 2048 MB limit; files over 50 MB, over 200000 entities or over 1000000 units of work (entities, vertices and text characters, block references expanded), block references that loop or nest deeper than 16, coordinates beyond 1e+12 mm and pages over 5080 mm are refused or cut, with a reason. NaN and infinite coordinates are removed and listed. The input is never changed; the output is converted. in the job directory. Needs the optional drawing engine (uv sync --extra drawing); png also needs uv sync --extra png.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "input_path": "<input_path>",
      "output_format": "<output_format>"
    },
    "name": "drawing_convert"
  }
}

Input Schema

NameRequiredDescriptionDefault
scaleNopdf, svg, png only. auto or an ISO 5455 scale: 50:1, 20:1, 10:1, 5:1, 2:1, 1:1, 1:2, 1:5, 1:10, 1:20, 1:50, 1:100, 1:200, 1:500, 1:1000, 1:2000, 1:5000, 1:10000auto
sheetNopdf, svg, png only. auto (extents plus 10 mm) or one of A4, A3, A2, A1, A0 (ISO 5457)auto
input_pathYesPath to the drawing: a .dxf, or a .dwg (needs LibreDWG's dwg2dxf, installed by the user; see the description)
dxf_versionNodxf only. One of R12, R2000, R2004, R2007, R2010, R2013, R2018R2018
output_formatYesOne of pdf, svg, png, dxf

Output Schema

NameRequiredDescriptionDefault
okYes
dataNoNon-quantity payload (reports, listings)
errorNo
valueNoPrimary quantity result
valuesNoAll named quantity results (includes the primary)
warningsNo
artifactsNo
provenanceYesWhat produced the result and from which inputs.
review_statusNounreviewed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A4.6/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 and does so thoroughly: separate-process isolation, time and 2048 MB limits, refusal thresholds (50 MB, 200000 entities, 1000000 units of work, block nesting >16, coordinates beyond 1e+12 mm, pages over 5080 mm), NaN/infinite handling, and the guarantee that the input is never modified. It even discloses degraded cases such as mutating-tool risks (LibreDWG may lose or change content) and engine.unavailable on missing dwg2dxf.

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

Conciseness3/5

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

Content is nearly all load-bearing, but the definition is a single dense block of roughly 400 words with no paragraphing, mixing prerequisites, limits, loss reporting and parameter semantics together. The scale and sheet enumerations are repeated verbatim from the schema descriptions, and a reader must scan the whole block to find the prerequisites buried at the end.

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 high-complexity conversion tool with five parameters, an output schema, and heavy safety surface, nothing an agent needs to call it correctly is missing. Return structure is partly described via data.losses / data.entities / data.dwg even though an output schema exists, which is redundant but harmless, and the failure modes are enumerated.

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 coverage is already 100%, but the description adds real meaning beyond it: it explains what png actually is (the PDF rasterised, greyscale, 150 dpi or less), what auto means for both sheet (extents plus 10 mm) and scale (largest fitting ISO 5455 scale, never an enlargement), and that a sheet/scale mismatch is refused rather than clipped. It also defines the true-scale unit semantics tied to $INSUNITS and the PDF point value, which no schema field conveys.

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?

"Convert a DXF drawing ... to PDF, SVG, PNG or another DXF version" names a specific verb and resource and enumerates both accepted inputs (DXF R12–R2018 text/binary, DWG via dwg2dxf) and the four output formats. It also draws the scope boundary (model space only) that separates it from inspection siblings like drawing_read.

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?

Context for use is clear: it states when the tool is the right choice (format conversion at true scale), prerequisites for the DWG path (LibreDWG's dwg2dxf installed via ENG_TOOLKIT_DWG2DXF or PATH) and optional engines (uv sync --extra drawing, --extra png). It never names an alternative tool or states when NOT to use it, so it stops short of explicit routing guidance.

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