Fence calculator
calculate_fenceUse 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
| Name | Required | Description | Default |
|---|---|---|---|
| bag | No | Bag 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 |
| post | No | Width of a post along the fence by its nominal size; 101.6 (a 4 × 4 post) when left out, in millimeters. | |
| gates | No | Number of gates; none when left out. | |
| rails | No | Rails in each section of a picket fence, needed for pickets: 2 for a fence 4 ft tall, 3 for a fence 6 ft tall. | |
| spare | No | Percent of pickets added as spares; 10 when left out. | |
| wires | No | Tension 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. | |
| height | Yes | Height of the fence above the ground, in millimeters. | |
| infill | Yes | pickets: 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. | |
| length | Yes | Length of the fence line with its gates, in millimeters. | |
| corners | No | Corners of the fence line; each adds at most one section and one post. None when left out. | |
| spacing | No | Post 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. | |
| bagYield | No | Fresh concrete from that bag in liters, as printed on it, such as 12.5 for 25 kg. | |
| bagWeight | No | Weight in kilograms of another bag of dry mix; with bagYield, it replaces bag. | |
| boardFace | No | Height of the face of one board; needed with boards, in millimeters. | |
| gateWidth | No | Width of one gate opening; needed with gates, in millimeters. | |
| holeDepth | No | Depth of the post holes; one third of the fence height when left out, in millimeters. | |
| holeShape | No | round holes, or rectangular holes and square footings; round when left out. | |
| holeWidth | No | Width of rectangular holes across the fence; holeLength when left out, in millimeters. | |
| picketGap | No | Gap between pickets, in millimeters; none when left out. | |
| postDepth | No | Depth 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. | |
| braceEvery | No | Distance 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. | |
| holeLength | No | Length of rectangular holes along the fence; needed with rectangular holes, in millimeters. | |
| rollLength | No | Length of one roll of mesh, such as 25000, or of barbed wire, such as 500000; needed with mesh and barbed wire, in millimeters. | |
| picketWidth | No | Actual width of one picket, such as 139.7 (5 1/2 in); needed for pickets, in millimeters. | |
| holeDiameter | No | Diameter of round post holes; three times the post width when left out, in millimeters. | |
| concretePosts | No | The 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. | |
| strainerDepth | No | Depth 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. | |
| gatesHavePosts | No | True 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. |