Skip to main content
Glama

Calculate yarn

calculate_yarn
Read-onlyIdempotent

Estimates the yarn for a punch needle design from its size, the share of each colour and the needle and loop height, or from a measured swatch. Returns metres, grams and whole skeins for each colour.

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": "calculate_yarn"
  }
}

Input Schema

NameRequiredDescriptionDefault
unitNoUnit of the width and height; the default is cm.
shapeNoShape of the design; the default is rectangle.
widthNoWidth of the design, or the diameter of a circle, in the chosen unit.
bufferNoSame value as extra_percent.
colorsNoSame value as colours.
heightNoHeight of a rectangular design in the chosen unit; a circle needs none.
needleNoOxford needle such as #14 fine, #13 fine, #10 fine, #10 regular, #9 regular or #8 regular. The default is #14 fine.
coloursNoColours with their share of the design area in percent; the shares add up to 100. A single colour at 100 percent is the default.
extra_percentNoExtra yarn for tails and finishing in percent, from 0 to 100. The default is 15.
swatch_yarn_mNoMetres of yarn used in the measured swatch.
loop_height_mmNoLoop height in mm: 3.2, 4.8, 6.4, 9.5 or 12.7.
skein_length_mNoLength in metres of one skein of the project yarn.
swatch_width_cmNoWidth in cm of a measured filled swatch; the four swatch values come together.
swatch_height_cmNoHeight in cm of the measured swatch.

Output Schema

NameRequiredDescriptionDefault
itemYes
viewYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description usefully discloses the return contents (metres, grams and whole skeins per colour), but says nothing about defaults (needle #14 fine, 15% extra, cm), how colour shares are normalized, or precedence between the aliased parameters. It adds real but limited context beyond the structured fields.

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?

Two sentences, front-loaded with the estimation action and input sources, closing with the return shape. Nothing is repeated from the schema and no sentence is filler.

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

Completeness4/5

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

For a 14-parameter, zero-required calculator with an output schema, the description covers the input modes and the result units, which is what an agent needs to choose a path. It omits edge-case behavior (shares not summing to 100, circle height being unnecessary, swatch values being required together), leaving those to the schema.

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 coverage is 100%, so a baseline of 3 applies, but the description earns a bump by grouping the 14 parameters into two coherent modes (design-geometry path vs swatch path), which the schema lists as a flat unordered set. It still leaves the colour-share-sum constraint and default values to the schema.

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 gives a specific verb (estimates) plus a specific resource (yarn for a punch needle design) and names the determining inputs and returned quantities. It is clearly distinguishable from the sibling pattern/material tools by subject matter, though it never explicitly contrasts itself with any of them.

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?

The phrase 'from its size, the share of each colour and the needle and loop height, or from a measured swatch' tells the agent there are two mutually exclusive calculation paths and which input groups select each. There is no explicit when-not-to-use guidance or named alternative, which keeps it below a 5.

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.