Skip to main content
Glama

Attach Drawing

attach_drawing
Destructive

Give a drawing (PDF, PNG or JPEG) to the part it belongs to, whatever the two files are called. Before a run: precheck_id from precheck_part and the row's component_key from get_precheck (or assembly, for the assembly's own drawing), with data_source_id of a drawing the precheck holds or the file as base64. The drawing goes with that part when upload_and_quote starts the precheck; attaching before the start is free and bills nothing. After a run: calculation_id of the part's own calculation (for an assembly, a component's) and the drawing. It becomes that part's drawing and, with run true (the default), the part is priced again as a new calculation, billable only if it succeeds; the same drawing again changes nothing. By default (apply=false) it only plans and attaches nothing; apply=true attaches. Returns where the precheck's drawings go, or the new calculation.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "attach_drawing"
  }
}

Input Schema

NameRequiredDescriptionDefault
runNoWith calculation_id: price the part again with the drawing (default true; billable only if it succeeds). False attaches only.
applyNoFalse (the default): plan only, read the target and say what would change; nothing is attached. True: attach.
precheck_idNoBefore the start: the precheck, as precheck_part returns it. With component_key; not with calculation_id.
component_keyNoWith precheck_id: the part the drawing belongs to, a row's component_key from get_precheck, or assembly for the assembly's own drawing.
calculation_idNoAfter a run: the calculation of the part, as upload_and_quote, quote_part or list_calculations return it (for an assembly, a component's own). Not with precheck_id.
data_source_idNoA drawing already stored: with precheck_id one the precheck holds (its drawings in get_precheck), with calculation_id a drawing of this organization that no unstarted precheck holds. Not with drawing_file_b64.
drawing_sha256NoSHA-256 (hex) of the drawing file itself; when sent, a file that arrives with another digest is refused (checksum_mismatch) and nothing is attached.
drawing_file_b64NoThe drawing itself, a PDF, PNG or JPEG as base64 (or a data: URI). With drawing_filename; not with data_source_id.
drawing_filenameNoThe file name of drawing_file_b64 with its extension, e.g. ZX-0001_A.pdf.
drawing_content_typeNoMIME type of drawing_file_b64, when known.

Output Schema

NameRequiredDescriptionDefault
targetYes`precheck`: placed before the start. `calculation`: attached to a calculated part.
appliedYesFalse: a plan only, nothing was attached. True: the drawing was attached.
changedNoFalse when this drawing already was the part's drawing: nothing was attached and nothing runs.
drawingsNoEvery drawing the precheck holds, and where each goes.
revisionNoThe precheck's revision, to start it with.
next_stepYesWhat happens next.
precheck_idNo
prices_againNoFor a calculated part: whether it is priced again — a new calculation, or a component's own in place. In a plan, what apply=true does.
component_keyNoThe part the drawing goes to on the precheck, or `assembly`.
calculation_idNo
data_source_idNoThe drawing, as stored.
precheck_statusNoThe precheck's status: `received` while a new drawing's title block is read, `ready` once answered.
new_calculation_idNoThe calculation that prices the part with this drawing, when run is true and the drawing changed.
rerun_calculation_idNoFor a component of an assembly: its own calculation, priced again in place.
new_calculation_statusNoIts status: `queued` is a run, `succeeded` an identical earlier run answering it unbilled, `blocked` a run held for quota.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / drawing_sha256
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "SHA-256 (hex) of the drawing file itself; when sent, a file that arrives with another digest is refused (checksum_mismatch) and nothing is attached."
      +}
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations flag destructiveHint=true and idempotentHint=false, and the description supplies the missing nuance: apply defaults to false and 'only plans and attaches nothing', apply=true actually attaches, and run=true re-prices the part with billing only on success. It also discloses an error path (checksum_mismatch refuses the file and attaches nothing) and that re-sending the same drawing changes nothing, which reconciles the non-idempotent hint with the tool's actual re-attach behavior.

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?

Purpose is front-loaded and the body is organized by scenario ('Before a run', 'After a run', 'By default', 'Returns'), so an agent can scan to the relevant branch. The prose is dense and clause-heavy (nested parentheticals like 'or assembly, for the assembly's own drawing'), which costs some readability in a 140-word description.

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?

This is a complex 10-parameter tool with two mutually exclusive invocation modes and billing consequences; the description covers both modes, the two boolean defaults that govern dry-run and re-pricing, the checksum guard, and a brief return note even though an output schema exists. Nothing an agent needs in order to call it safely and correctly is missing.

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 schema already documents every parameter; the description nevertheless adds cross-parameter meaning that the schema lists only locally — the precheck_id/component_key pairing versus the calculation_id path, the special 'assembly' component_key value, and which data_source_id values are legal in each mode. It does not restate formats or UUID constraints, so the gain is real but moderate.

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 opening sentence states a specific verb and resource: give a drawing (PDF, PNG or JPEG) to the part it belongs to, regardless of file names. It is clearly distinguishable from siblings like precheck_part, get_precheck and upload_and_quote, which are named as sources of the identifiers rather than as alternatives doing the same job.

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 splits usage into two explicit regimes — 'Before a run' (precheck_id + component_key) and 'After a run' (calculation_id) — and says exactly where each identifier comes from (precheck_part, get_precheck, upload_and_quote, quote_part, list_calculations). It also states the cost trade-off between the two paths (free before start, billable after), which is the deciding factor for an agent choosing when to call it.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.