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
| Tool | What it does | Kind |
|---|---|---|
workspace_info | Workspace and server info | read-only |
list_nodes | List node types | read-only |
describe_node | Describe a node type | read-only |
list_presets | List presets and species | read-only |
list_library | List saved projects in the user library | read-only |
list_samples | List bundled sample projects | read-only |
new_project | Create a project from a preset | may overwrite or delete |
read_project | Read a project | read-only |
validate_project | Validate a project | read-only |
save_project | Save a project document or copy | may overwrite or delete |
set_project_settings | Set name, seed, export defaults | writes |
set_params | Set node parameters | writes |
add_node | Add a node | writes |
connect | Connect two ports | writes |
disconnect | Remove a connection | may overwrite or delete |
remove_node | Remove a node | may overwrite or delete |
apply_patch | Apply a JSON Patch | may overwrite or delete |
build_project | Build and report stats | read-only |
render_preview | Render a PNG preview | writes |
export_project | Export model files | may overwrite or delete |
import_info | Inspect a mesh, manifest or texture pack | may overwrite or delete |
pack_textures | Write a .pbrpack texture pack | may overwrite or delete |
pack_project | Bundle a project into .treegenz | may overwrite or delete |
unpack_project | Unpack a .treegenz bundle | may overwrite or delete |
pbrgen_status | Check for PBRGenerator | read-only |
make_textures | Make a PBR texture set from an image | may overwrite or delete |
install_engine_package | Install 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.
| Argument | Type | What it does |
|---|---|---|
category | string | Only this category: generators, modifiers, foliage, meshers, materials, output. |
language (default "en") | en | pt | both | Language 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.
| Argument | Type | What it does |
|---|---|---|
type (required) | string | Node type, for example trunk, branches, leaves, bark_mesher, pbr_material, tree_output. |
language (default "en") | en | pt | both | Language 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.
| Argument | Type | What it does |
|---|---|---|
category | string | Only this category: broadleaf, conifer, palm, swamp, shrub, exotic. |
kind | base | species | base presets or species. |
language (default "en") | en | pt | both | Language 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.
| Argument | Type | What it does |
|---|---|---|
query | string | Case-insensitive text matched in the path, name and species. |
limit (default 100) | integer | Maximum 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.
| Argument | Type | What it does |
|---|---|---|
query | string | Case-insensitive text matched in the path, name and species. |
limit (default 100) | integer | Maximum 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.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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") | string | Preset or species name from list_presets. |
name | string | Project (and tree) display name; default is the preset's. |
seed | integer | Random seed (>= 0): the same graph with another seed is another tree of the same kind. |
overwrite (default false) | boolean | Replace 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.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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 | full | summary or full document. |
node | string | Node 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.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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). |
doc | object | Complete project document (format 'treegen', schema_version, graph). Not with copy_from. |
copy_from | string | Existing project to copy (any readable folder, including samples). Not with doc. |
name | string | New display name (copy_from only). |
overwrite (default false) | boolean | Replace an existing file. |
allow_invalid (default false) | boolean | Save 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.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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). |
name | string | Project name. |
seed | integer | Global seed, >= 0. |
export | object | Export 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.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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) | string | Node id (see read_project), for example 'trunk' or 'out'. |
params (required) | object | Param 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.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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) | string | Node type from list_nodes. |
id | string | Node id; unique in the project. |
params | object | Initial 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'.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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) | string | Source output, 'node.port'. |
to (required) | string | Target input, 'node.port'. |
replace (default false) | boolean | Replace 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).
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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) | string | Target input, 'node.port'. |
from | string | Source 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.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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) | string | Node id. |
force (default false) | boolean | Allow 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.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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) | boolean | Validate 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).
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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) | boolean | Also 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).
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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) | integer | Square image side in pixels, 64-1024. |
save_to | string | Also 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>.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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). |
formats | string[] | Formats to write; default: the project's export.default_format, else glb. |
all_formats (default false) | boolean | Write every format (overrides formats). |
out_dir | string | Output folder, inside an allowed folder. |
textures (default true) | boolean | Write texture files and bind them. |
atlas (default false) | boolean | Merge all materials into one atlas material. |
cards | object | Also write vegetation cards. |
impostor | boolean | true: 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 | blender | FBX 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.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | File to inspect (inside an allowed folder, samples included). |
project | string | Project file that manifest paths are relative to (default: workspace root). |
extract | string | Pack 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.
| Argument | Type | What it does |
|---|---|---|
manifest (required) | string | Path to <prefix>_manifest.json. |
out | string | Output .pbrpack (default beside the manifest). |
kind (default "generic") | bark | leaf | ground | generic | What the pack is for. |
name | string | Pack and material name (default: the manifest's output prefix). |
tile_size_m | number | Physical size of one texture tile in meters. |
alpha_mode | opaque | mask | opaque or mask. |
alpha_cutoff | number | Alpha cutoff for mask, 0-1. |
double_sided | boolean | Render 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.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | Project 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). |
out | string | Output .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.
| Argument | Type | What it does |
|---|---|---|
path (required) | string | The .treegenz file. |
out | string | Folder 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.
| Argument | Type | What it does |
|---|---|---|
image (required) | string | Source image (png, jpg, tif...), inside an allowed folder. |
kind (default "generic") | bark | leaf | ground | generic | What the set is for; chooses material defaults. |
name | string | Material and folder name (default: the image name). |
project | string | Project file: the set goes into the textures folder beside it. Without it, into <workspace root>/textures. |
out | string | Textures folder to write into (the set goes to out/<name>/); overrides the project's. |
input_kind (default "photo") | photo | height | normal | What the image is. |
preset | string | A PBRGenerator preset name. |
size | integer | Work at this square size in pixels. |
tile_size_m | number | Physical size of one tile in meters. |
seam_mode | string | How a photo is made to tile (for example periodic; default depends on kind). |
normal_strength | number | Normal map strength. |
timeout (default 300) | number | Seconds 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.
| Argument | Type | What it does |
|---|---|---|
engine (required) | unity | godot | unreal | Which engine. |
dest (required) | string | Existing 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) | boolean | Write a zip file into dest instead of copying the package. |
overwrite (default true) | boolean | Replace an existing install or zip (false: refuse when it exists). |
Resources
Read-only documents an agent can read without calling a tool:
| URI | What it does |
|---|---|
treegen://guide | workflow and conventions for agents |
treegen://nodes/catalog | the full node catalog (JSON) |
treegen://nodes/{type} | one node type, with a template (JSON) |
treegen://schema/project | the 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):
| Prompt | What it does | Arguments |
|---|---|---|
build_tree_from_description | Guides the model to pick a preset, tune it to a description and export it. | description (required), path (required), formats |
tune_tree | Guides the model to change an existing project according to feedback, checking each step. | path (required), feedback (required) |