Skip to content

Tool reference ​

INFO

This page is generated from the MCP server's tool list by scripts/docs_mcp.py. The descriptions are the ones an agent receives from tools/list.

Every tool that works on a project takes path: a .treegen.json file, relative to the workspace root or absolute inside an allowed folder. Editing tools save the file and return the validation of the result (ok, errors, warnings). A tool error (bad argument, refused path, invalid project) comes back as a normal result marked isError, with a message that says how to fix the call.

All tools ​

ToolWhat it doesKind
workspace_infoWorkspace and server inforead-only
list_nodesList node typesread-only
describe_nodeDescribe a node typeread-only
list_presetsList presets and speciesread-only
list_libraryList saved projects in the user libraryread-only
list_samplesList bundled sample projectsread-only
new_projectCreate a project from a presetmay overwrite or delete
read_projectRead a projectread-only
validate_projectValidate a projectread-only
save_projectSave a project document or copymay overwrite or delete
set_project_settingsSet name, seed, export defaultswrites
set_paramsSet node parameterswrites
add_nodeAdd a nodewrites
connectConnect two portswrites
disconnectRemove a connectionmay overwrite or delete
remove_nodeRemove a nodemay overwrite or delete
apply_patchApply a JSON Patchmay overwrite or delete
build_projectBuild and report statsread-only
render_previewRender a PNG previewwrites
export_projectExport model filesmay overwrite or delete
import_infoInspect a mesh, manifest or texture packmay overwrite or delete
pack_texturesWrite a .pbrpack texture packmay overwrite or delete
pack_projectBundle a project into .treegenzmay overwrite or delete
unpack_projectUnpack a .treegenz bundlemay overwrite or delete
pbrgen_statusCheck for PBRGeneratorread-only
make_texturesMake a PBR texture set from an imagemay overwrite or delete
install_engine_packageInstall engine support (Unity, Godot, Unreal)may overwrite or delete

A typical session: list_presets → new_project → describe_node → set_params → validate_project → build_project → render_preview → export_project.

Look around ​

workspace_info ​

Workspace and server info · read-only

Reports the folders this server may read and write, the user library and bundled samples folders, the export formats and the version. Call it first when you are unsure where files may go. Read-only.

No arguments.

list_nodes ​

List node types · read-only

Lists every node type of the tree graph with its category, one-line summary, input and output ports (typed: skeleton, foliage, volume, mesh, material) and how many parameters it has. A tree is a graph: generators (trunk, branches, space_colonization) make a skeleton of stems, modifiers (bend, prune, wobble, radius_rule) reshape it, meshers (bark_mesher, leaf_mesher) turn it into meshes, pbr_material adds materials and tree_output gathers everything for export. Use describe_node for the parameters of one type. Same data as askrgarden-cli nodes. Read-only.

ArgumentTypeWhat it does
categorystringOnly this category: generators, modifiers, foliage, meshers, materials, output.
language (default "en")en | pt | bothLanguage of labels and help: en, pt (Portuguese) or both.

describe_node ​

Describe a node type · read-only

Full description of one node type: its ports and every parameter with kind (float, int, bool, enum, string, path, list, vec3, texture, object), default, minimum, maximum, enum options, whether it is 'varying' (accepts a number, {value, variance} or {curve, domain}), group, and help text in English and Portuguese. Read it before set_params or add_node so that values are valid. Lengths are meters, angles degrees. Same data as askrgarden-cli nodes -v and the node catalog resource. Read-only.

ArgumentTypeWhat it does
type (required)stringNode type, for example trunk, branches, leaves, bark_mesher, pbr_material, tree_output.
language (default "en")en | pt | bothLanguage of labels and help: en, pt (Portuguese) or both.

list_presets ​

List presets and species · read-only

Lists the starting trees new_project can make: 5 base presets (broadleaf, conifer, colonized, birch, bush) and about 40 species (english_oak, scots_pine, royal_palm, weeping_willow, round_boxwood_ball...), each with category, bilingual label and researched height in meters (species only). Presets are colour-only: for textured trees see list_samples. Read-only.

ArgumentTypeWhat it does
categorystringOnly this category: broadleaf, conifer, palm, swamp, shrub, exotic.
kindbase | speciesbase presets or species.
language (default "en")en | pt | bothLanguage of labels and help: en, pt (Portuguese) or both.

list_library ​

List saved projects in the user library · read-only

Lists .treegen.json files in the user's library folder (default Documents/AskrGarden, organised as trees|bushes|grass/<category>/<name>.treegen.json). Each row gives the path to pass to the other tools. Read-only.

ArgumentTypeWhat it does
querystringCase-insensitive text matched in the path, name and species.
limit (default 100)integerMaximum rows, 1-500.

list_samples ​

List bundled sample projects · read-only

Lists the sample projects that ship with treegen (samples/ and the textured species library under samples/library/<category>/). They are read-only; start from one with save_project(path, copy_from=<its path>), which copies it into the workspace keeping its textures working. Read-only.

ArgumentTypeWhat it does
querystringCase-insensitive text matched in the path, name and species.
limit (default 100)integerMaximum rows, 1-500.

Projects ​

new_project ​

Create a project from a preset · may overwrite or delete

Writes a new .treegen.json from a preset or species (see list_presets), the same as askrgarden-cli new. The project is a complete, valid, buildable graph (colour materials, no textures). Refuses to replace an existing file unless overwrite is true. Next: read_project / set_params to tune it, build_project, render_preview, export_project.

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
preset (default "broadleaf")stringPreset or species name from list_presets.
namestringProject (and tree) display name; default is the preset's.
seedintegerRandom seed (>= 0): the same graph with another seed is another tree of the same kind.
overwrite (default false)booleanReplace the file if it exists.

read_project ​

Read a project · read-only

Reads a project file. view=summary (default) lists node ids, types, which params are explicitly set and the connections as 'node.port -> node.port', which is enough to plan edits. view=full returns the whole document JSON. With node, returns that node's stored params, its effective params (defaults filled in) and its connections. Read-only.

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
view (default "summary")summary | fullsummary or full document.
nodestringNode id: return just this node in detail.

validate_project ​

Validate a project · read-only

Checks a project file like askrgarden-cli validate: document shell, node types, parameter types and ranges, port names and value types, required inputs, cycles, tree_output presence, absolute paths. Returns blocking errors (each with node id and param path) and warnings (mostly nodes that do not reach tree_output). A project with errors cannot be built or exported. Read-only, never fails because the project is invalid: read ok and errors.

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).

save_project ​

Save a project document or copy · may overwrite or delete

Writes a project file in canonical form. Either doc (a complete project object, for example one you composed or fetched with read_project view=full) or copy_from (an existing project, such as a textured sample from list_samples; relative texture paths are rewritten to keep working). Refuses a document with blocking errors unless allow_invalid, and refuses to replace a file unless overwrite.

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
docobjectComplete project document (format 'treegen', schema_version, graph). Not with copy_from.
copy_fromstringExisting project to copy (any readable folder, including samples). Not with doc.
namestringNew display name (copy_from only).
overwrite (default false)booleanReplace an existing file.
allow_invalid (default false)booleanSave even with blocking errors.

set_project_settings ​

Set name, seed, export defaults · writes

Changes the project-level fields and saves the file: name, seed (the global random seed; another seed grows another tree from the same graph) and export defaults (for example {default_format: 'fbx'}, merged into the existing export block). Per-tree settings (LODs, wind data, impostor) are params of the tree_output node: use set_params.

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
namestringProject name.
seedintegerGlobal seed, >= 0.
exportobjectExport defaults to merge.

Edit the node graph ​

set_params ​

Set node parameters · writes

Sets one or more parameters of one node and saves the file. Every name and value is checked against the node registry (type, range, enum options) before anything is written, so a wrong call changes nothing. Values: numbers; booleans; enum strings; [x, y, z]; for 'varying' params a number, {value, variance} or {curve: [[t, v], ...], domain}; for object params (tree_output.impostor) the keys you give are merged into the existing object; null resets a param to its default. Lengths are meters, angles degrees. Use describe_node to see what is valid. Returns what changed and the validation of the saved project.

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
node (required)stringNode id (see read_project), for example 'trunk' or 'out'.
params (required)objectParam name -> new value.

add_node ​

Add a node · writes

Adds a node of the given type to the graph and saves the file. The node starts unconnected (a detached node only yields a warning). Optional id (letters, digits, _ and -; generated from the type when omitted) and initial params, validated like set_params. Returns the node id and its ports; wire it with connect. tree_output is unique per project.

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
type (required)stringNode type from list_nodes.
idstringNode id; unique in the project.
paramsobjectInitial param values (others use defaults).

connect ​

Connect two ports · writes

Adds an edge from an output port to an input port ('node_id.port_name' both) and saves the file. Ports must exist and have the same value type (skeleton, foliage, volume, mesh, material). An input that takes one connection and is already fed is refused unless replace is true. Example: from 'twigs.skeleton', to 'radius.skeleton'.

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
from (required)stringSource output, 'node.port'.
to (required)stringTarget input, 'node.port'.
replace (default false)booleanReplace the existing connection of a single-connection input.

disconnect ​

Remove a connection · may overwrite or delete

Removes the edge(s) into an input port and saves the file. With from, removes only that edge; without it, every edge into the input (needed for multi-connection inputs such as tree_output.meshes).

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
to (required)stringTarget input, 'node.port'.
fromstringSource output 'node.port'; omit to remove all edges into the input.

remove_node ​

Remove a node · may overwrite or delete

Deletes a node and every edge touching it, and saves the file. Nodes that fed it keep their other connections. Refuses to remove tree_output unless force is true.

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
node (required)stringNode id.
force (default false)booleanAllow removing tree_output.

apply_patch ​

Apply a JSON Patch · may overwrite or delete

Generic fallback edit: applies RFC 6902 JSON Patch operations (add, remove, replace, move, copy, test) to the project document, all or nothing. Paths are JSON Pointers into the document, for example /graph/nodes/0/params/length or /graph/edges/- (append). Prefer set_params, add_node, connect, disconnect and remove_node: they check names, ranges and port types and are much harder to get wrong. Refuses a result that is not a treegen project; use dry_run to see the validation without saving.

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
operations (required)object[]Operations applied in order.
dry_run (default false)booleanValidate the patched document without saving.

Build, preview and export ​

build_project ​

Build and report stats · read-only

Evaluates the graph for every LOD and reports what the tree is, like askrgarden-cli build: height, crown radius and trunk radius in meters, bounds, stem count, leaf cards, triangles and vertices per LOD with screen sizes, material names and build warnings. Writes no files. Use it after edits to check size and budget; use export_project to get files. Errors if the project has blocking validation errors. The impostor is not baked unless impostor is true (slow: seconds).

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
impostor (default false)booleanAlso bake the impostor and report its metadata (slow).

render_preview ​

Render a PNG preview · writes

Renders a PNG picture of the tree so you can look at it: one orthographic three-quarter view from slightly above, on a transparent background, using the lowest-detail LOD that still has leaves, with textures and alpha masks. Deterministic. Returned as image content; save_to also writes the PNG into an allowed folder. About 0.2-1 s at 256 px. Use after edits to judge shape and proportions (height and crown numbers come from build_project).

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
size (default 256)integerSquare image side in pixels, 64-1024.
save_tostringAlso write the PNG here (must end with .png, inside an allowed folder).

export_project ​

Export model files · may overwrite or delete

Builds the tree and writes engine-ready files, like askrgarden-cli export: GLB/glTF, FBX (binary 7.4), OBJ+MTL and USDA, every LOD, with wind vertex data, PBR textures bound to bark and leaves, and a <name>_export.json manifest. Options: atlas merges all materials into one material and texture set (one mesh per LOD); cards adds crossed textured vegetation planes (planes 1 = billboard; cards.only writes just those); impostor bakes the billboard atlas as the last LOD (default: as the tree_output node says; baking takes seconds); textures=false writes no texture files (factors only, no impostor). Units are meters, +Y up (writers convert per format). Overwrites files of the same name in out_dir. Default out_dir: <root>/out/exports/<project name>.

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
formatsstring[]Formats to write; default: the project's export.default_format, else glb.
all_formats (default false)booleanWrite every format (overrides formats).
out_dirstringOutput folder, inside an allowed folder.
textures (default true)booleanWrite texture files and bind them.
atlas (default false)booleanMerge all materials into one atlas material.
cardsobjectAlso write vegetation cards.
impostorbooleantrue: bake and export the impostor even if the node has it off; false: leave it out; omit: follow the tree_output node.
fbx_via (default "native")native | blenderFBX writer: built-in native, or blender (needs Blender installed).

Files and packs ​

import_info ​

Inspect a mesh, manifest or texture pack · may overwrite or delete

Inspects a file without changing any project, like askrgarden-cli import: a mesh (.glb .gltf .obj .fbx) -> vertices, triangles, bounds; a PBRGenerator <prefix>_manifest.json -> the material slots it maps to; a .pbrpack / .zip texture pack -> name, kind and the pbr_material params it would set. With extract (packs only) the pack is unpacked into extract/<pack name> and the params to put on a pbr_material node are returned.

ArgumentTypeWhat it does
path (required)stringFile to inspect (inside an allowed folder, samples included).
projectstringProject file that manifest paths are relative to (default: workspace root).
extractstringPack only: folder to unpack into (must be writable).

pack_textures ​

Write a .pbrpack texture pack · may overwrite or delete

Bundles a PBRGenerator <prefix>_manifest.json and the maps it lists (they sit beside it) into one .pbrpack zip, like askrgarden-cli pack-textures, with an optional material descriptor (tile size in meters, alpha mode, cutoff, double sided). Deterministic bytes.

ArgumentTypeWhat it does
manifest (required)stringPath to <prefix>_manifest.json.
outstringOutput .pbrpack (default beside the manifest).
kind (default "generic")bark | leaf | ground | genericWhat the pack is for.
namestringPack and material name (default: the manifest's output prefix).
tile_size_mnumberPhysical size of one texture tile in meters.
alpha_modeopaque | maskopaque or mask.
alpha_cutoffnumberAlpha cutoff for mask, 0-1.
double_sidedbooleanRender both faces.

pack_project ​

Bundle a project into .treegenz · may overwrite or delete

Zips a project and every texture, manifest and mesh it references into one .treegenz file you can move to another computer, like askrgarden-cli pack. Missing files are skipped with a note on stderr.

ArgumentTypeWhat it does
path (required)stringProject file, name ending in .treegen.json. A relative path starts at the workspace root; an absolute path must be inside an allowed folder (see workspace_info).
outstringOutput .treegenz (default beside the project).

unpack_project ​

Unpack a .treegenz bundle · may overwrite or delete

Unzips a .treegenz into a folder and returns the project file inside, like askrgarden-cli unpack. Unsafe paths in the archive are refused.

ArgumentTypeWhat it does
path (required)stringThe .treegenz file.
outstringFolder to unpack into (default: beside the bundle, named after it).

Textures with PBrokkR ​

pbrgen_status ​

Check for PBRGenerator · read-only

Reports whether the sibling tool PBRGenerator (makes PBR texture sets from photos) is installed and found, its version, the command used, the texture kinds and the defaults each kind implies. Same as askrgarden-cli pbrgen. Call it before make_textures; when found is false the message says how to point treegen at it (the editor setting or the TREEGEN_PBRGEN environment variable). Read-only.

No arguments.

make_textures ​

Make a PBR texture set from an image · may overwrite or delete

Runs PBRGenerator on an image (a photo, or a height or normal map) and unpacks the resulting PBR set into <project folder>/textures/<name>/ (or out/<name>/), like askrgarden-cli make-textures. Returns the manifest and the pbr_material params that bind the set (feed them to set_params on a pbr_material node). Slow: seconds to minutes. Needs PBRGenerator (check pbrgen_status). Overwrites a set of the same name.

ArgumentTypeWhat it does
image (required)stringSource image (png, jpg, tif...), inside an allowed folder.
kind (default "generic")bark | leaf | ground | genericWhat the set is for; chooses material defaults.
namestringMaterial and folder name (default: the image name).
projectstringProject file: the set goes into the textures folder beside it. Without it, into <workspace root>/textures.
outstringTextures folder to write into (the set goes to out/<name>/); overrides the project's.
input_kind (default "photo")photo | height | normalWhat the image is.
presetstringA PBRGenerator preset name.
sizeintegerWork at this square size in pixels.
tile_size_mnumberPhysical size of one tile in meters.
seam_modestringHow a photo is made to tile (for example periodic; default depends on kind).
normal_strengthnumberNormal map strength.
timeout (default 300)numberSeconds before the run is stopped.

Engine packages ​

install_engine_package ​

Install engine support (Unity, Godot, Unreal) · may overwrite or delete

Installs the AskrGarden support package for a game engine (shaders, wind component, importer that set up exported trees by themselves) into an engine project, into any folder, or as a zip; same as treegen engine-package. dest must be an existing folder inside an allowed folder (see workspace_info). A Unity project (Assets + Packages) receives Packages/com.askrgarden.unity, a Godot project (project.godot) addons/askrgarden, an Unreal project (.uproject) Plugins/AskrGarden; any other folder gets the package folder inside it. With zip=true it writes AskrGarden-<Engine>-<version>.zip into dest instead (deterministic). An older install is replaced: files that no longer exist in the package are removed, nothing outside the package folder is touched. Returns the mode (project, folder, zip), the path written, the file count, whether a project was detected and a next-step hint to relay to the user.

ArgumentTypeWhat it does
engine (required)unity | godot | unrealWhich engine.
dest (required)stringExisting folder to install into (the engine project folder, or any folder), inside an allowed folder. With zip=true the folder for the zip file.
zip (default false)booleanWrite a zip file into dest instead of copying the package.
overwrite (default true)booleanReplace an existing install or zip (false: refuse when it exists).

Resources ​

Read-only documents an agent can read without calling a tool:

URIWhat it does
treegen://guideworkflow and conventions for agents
treegen://nodes/catalogthe full node catalog (JSON)
treegen://nodes/{type}one node type, with a template (JSON)
treegen://schema/projectthe JSON Schema of the project file
treegen://samples/<file>a sample project document

Prompts ​

Ready-made instructions a client can offer to the user (for example as slash commands):

PromptWhat it doesArguments
build_tree_from_descriptionGuides the model to pick a preset, tune it to a description and export it.description (required), path (required), formats
tune_treeGuides the model to change an existing project according to feedback, checking each step.path (required), feedback (required)