Skip to main content
Glama

Simple House Planner

Fence calculator

calculate_fence
Read-only

Use this when someone plans a fence and asks how many posts, rails, boards, panels or bags of concrete they need. Calculates the materials for a fence: the fenced length (the length less the gates), the sections (fenced length ÷ post spacing, rounded up, plus at most one for each corner), the holes (one for each section, one to end the run and one for each gate) and the posts to buy (the holes less two for each gate set that brings its own posts), and the post length with the part in the ground, following the planning sheet of Outdoor Essentials. Pickets: equal sections, the rails (sections × rails in a section) and the pickets (fenced length ÷ (picket width + gap), plus 10 % spare). Panels and boards: sections one spacing wide and the last one cut (cut, given for a line without corners); panels (one for each section), or boards (up(height ÷ board face) rows in each section). Mesh and barbed wire: equal sections; rolls (fenced length ÷ roll for mesh, wires × fenced length ÷ roll for barbed wire); the length of all tension wire or barbed wire; braces: one at each end of a run (the start, the end and both sides of each gate), two at each corner and at each center post every braceEvery (Retissima, Moreda). Strainers counts the posts at the ends of runs, the corners and, on a wire fence, the braced center posts; strainerLength is the fence height plus strainerDepth. It also returns the concrete that sets the posts named by concretePosts (all, the strainers, or none), in liters for one line post (perPost) and one strainer post (perStrainer, at strainerDepth), the holes in concrete (concreted) and all concrete, and the bags of dry mix: for each hole its area (π ÷ 4 × diameter², or length × width) less the post (post × postDepth, or π ÷ 4 × post² as QUIKRETE counts a post), times the depth; a round hole is three times the post width and one third of the fence height deep unless given (QUIKRETE); bags by the yield of a bag from QUIKRETE's data sheets (1 cu ft = 28.3168 l), or of the given bagWeight and bagYield, with bagsWeight in kilograms.

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": {
      "length": "<length>",
      "height": "<height>",
      "infill": "<infill>"
    },
    "name": "calculate_fence"
  }
}

Input Schema

NameRequiredDescriptionDefault
bagNoBag of concrete mix by its weight: lb50 makes 0.375 cu ft, lb60 0.45 cu ft, lb80 0.60 cu ft, kg25 11.6 l, kg30 14 l. Used when bagWeight and bagYield are not given.lb50
postNoWidth of a post along the fence by its nominal size; 101.6 (a 4 × 4 post) when left out, in millimeters.
gatesNoNumber of gates; none when left out.
railsNoRails in each section of a picket fence, needed for pickets: 2 for a fence 4 ft tall, 3 for a fence 6 ft tall.
spareNoPercent of pickets added as spares; 10 when left out.
wiresNoTension wires of a mesh fence, from the Retissima table by mesh height when left out (up to 1.25 m: 2, 1.5 m: 3, 1.75 and 2 m: 4, 2.25 and 2.5 m: 5, 2.75 and 3 m: 6); rows of barbed wire, needed with barbed wire.
heightYesHeight of the fence above the ground, in millimeters.
infillYespickets: pickets nailed to rails; panels: panels that span from post to post; boards: horizontal boards slid between grooved posts; mesh: wire mesh from rolls, held by tension wires; barbed: rows of barbed wire.
lengthYesLength of the fence line with its gates, in millimeters.
cornersNoCorners of the fence line; each adds at most one section and one post. None when left out.
spacingNoPost spacing on center, which is the panel width for panels; 2438.4 (8 ft) when left out with pickets or panels, needed with boards, mesh and barbed wire, in millimeters.
bagYieldNoFresh concrete from that bag in liters, as printed on it, such as 12.5 for 25 kg.
bagWeightNoWeight in kilograms of another bag of dry mix; with bagYield, it replaces bag.
boardFaceNoHeight of the face of one board; needed with boards, in millimeters.
gateWidthNoWidth of one gate opening; needed with gates, in millimeters.
holeDepthNoDepth of the post holes; one third of the fence height when left out, in millimeters.
holeShapeNoround holes, or rectangular holes and square footings; round when left out.
holeWidthNoWidth of rectangular holes across the fence; holeLength when left out, in millimeters.
picketGapNoGap between pickets, in millimeters; none when left out.
postDepthNoDepth of a rectangular post across the fence, such as 40 for a 60 × 40 mm post; without it the post counts as round, post wide, in millimeters.
braceEveryNoDistance between center posts that carry two braces on a mesh or barbed wire fence, such as 25000 (Retissima) or 30000 (Moreda); none when left out, in millimeters.
holeLengthNoLength of rectangular holes along the fence; needed with rectangular holes, in millimeters.
rollLengthNoLength of one roll of mesh, such as 25000, or of barbed wire, such as 500000; needed with mesh and barbed wire, in millimeters.
picketWidthNoActual width of one picket, such as 139.7 (5 1/2 in); needed for pickets, in millimeters.
holeDiameterNoDiameter of round post holes; three times the post width when left out, in millimeters.
concretePostsNoThe posts set in concrete: all, only the strainer posts (the others tamped or driven), or none (all set in tamped soil, as Belgo builds barbed wire fences in Brazil); all when left out.
strainerDepthNoDepth of the holes of the strainer posts (end, corner and gate posts, and braced center posts of a wire fence), such as 1000 for Belgo's barbed wire fence or 914.4 (36 in) for NRCS; holeDepth when left out, in millimeters.
gatesHavePostsNoTrue when each gate set brings its own two posts: they take the places of the fence posts beside the opening, so posts counts fewer posts to buy while holes still counts their holes. False when left out.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.5/5.0
Behavior3/5

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

Annotations declare readOnlyHint=true, destructiveHint=false, openWorldHint=false, covering the safety profile. The description adds valuable behavioral context — that defaults follow QUIKRETE/Retissima/Outdoor Essentials planning data and that 'a round hole is three times the post width and one third of the fence height deep unless given' — but the majority is derivation math rather than behavior an agent needs to predict tool response. It's solid but not exceptional beyond the annotations.

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

Conciseness2/5

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

The description is a single unbroken paragraph of ~350 words dense with formulas and asides packed in parentheses. There is no front-loaded structure or line breaks to help an agent scan for the key facts. It over-delivers on derivation detail while failing to organize it, so conciseness and structure are weak despite the volume of content.

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

Completeness3/5

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

With 28 parameters, no output schema, and a complex materials calculation, the description does try to disclose the outputs (posts, holes, concrete in liters, bags) and their defaults. However, it conveys this through a sprawling narrative rather than a structured enumeration, leaving the agent to untangle which output field corresponds to which concept. Completeness is adequate but the delivery is muddled.

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 the baseline is 3, but the description goes further by explaining cross-parameter relationships — e.g., gates bring their own posts, so 'posts to buy = holes less two for each gate set that brings its own posts' — which maps directly to gatesHavePosts. It surfaces derived behavior not obvious from the raw schema, though the density and formula repetition reduce the net gain.

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 names a specific verb ('Calculates the materials for a fence') and then enumerates the exact outputs: posts, rails, boards, panels, bags of concrete. It clearly distinguishes itself from generic siblings by scope, though it doesn't explicitly contrast with calculate_concrete (the nearest sibling).

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?

It gives explicit trigger conditions ('Use this when someone plans a fence and asks how many posts...'), which directly seeds an agent to match user intent. What's missing is when NOT to use it — e.g., dividing concrete-only questions to calculate_concrete versus this combined calc — so a 4 rather than 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.

Resources