Referência das ferramentas
INFO
Esta página é gerada a partir da lista de ferramentas do servidor MCP por scripts/docs_mcp.py. As descrições ficam em inglês: são as que o agente recebe de tools/list.
Toda ferramenta que trabalha num projeto recebe path: um arquivo .treegen.json, relativo à raiz do espaço de trabalho ou absoluto dentro de uma pasta permitida. As ferramentas de edição salvam o arquivo e devolvem a validação do resultado (ok, errors, warnings). Um erro de ferramenta (argumento ruim, caminho recusado, projeto inválido) volta como resultado normal marcado isError, com uma mensagem que diz como corrigir a chamada.
Todas as ferramentas
| Ferramenta | O que faz | Tipo |
|---|---|---|
workspace_info | Workspace and server info | só leitura |
list_nodes | List node types | só leitura |
describe_node | Describe a node type | só leitura |
list_presets | List presets and species | só leitura |
list_library | List saved projects in the user library | só leitura |
list_samples | List bundled sample projects | só leitura |
new_project | Create a project from a preset | pode sobrescrever ou apagar |
read_project | Read a project | só leitura |
validate_project | Validate a project | só leitura |
save_project | Save a project document or copy | pode sobrescrever ou apagar |
set_project_settings | Set name, seed, export defaults | grava |
set_params | Set node parameters | grava |
add_node | Add a node | grava |
connect | Connect two ports | grava |
disconnect | Remove a connection | pode sobrescrever ou apagar |
remove_node | Remove a node | pode sobrescrever ou apagar |
apply_patch | Apply a JSON Patch | pode sobrescrever ou apagar |
build_project | Build and report stats | só leitura |
render_preview | Render a PNG preview | grava |
export_project | Export model files | pode sobrescrever ou apagar |
import_info | Inspect a mesh, manifest or texture pack | pode sobrescrever ou apagar |
pack_textures | Write a .pbrpack texture pack | pode sobrescrever ou apagar |
pack_project | Bundle a project into .treegenz | pode sobrescrever ou apagar |
unpack_project | Unpack a .treegenz bundle | pode sobrescrever ou apagar |
pbrgen_status | Check for PBRGenerator | só leitura |
make_textures | Make a PBR texture set from an image | pode sobrescrever ou apagar |
install_engine_package | Install engine support (Unity, Godot, Unreal) | pode sobrescrever ou apagar |
Uma sessão típica: list_presets → new_project → describe_node → set_params → validate_project → build_project → render_preview → export_project.
Explorar
workspace_info
Workspace and server info · só leitura
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.
Sem argumentos.
list_nodes
List node types · só leitura
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.
| Argumento | Tipo | O que faz |
|---|---|---|
category | string | Only this category: generators, modifiers, foliage, meshers, materials, output. |
language (padrão "en") | en | pt | both | Language of labels and help: en, pt (Portuguese) or both. |
describe_node
Describe a node type · só leitura
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.
| Argumento | Tipo | O que faz |
|---|---|---|
type (obrigatório) | string | Node type, for example trunk, branches, leaves, bark_mesher, pbr_material, tree_output. |
language (padrão "en") | en | pt | both | Language of labels and help: en, pt (Portuguese) or both. |
list_presets
List presets and species · só leitura
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.
| Argumento | Tipo | O que faz |
|---|---|---|
category | string | Only this category: broadleaf, conifer, palm, swamp, shrub, exotic. |
kind | base | species | base presets or species. |
language (padrão "en") | en | pt | both | Language of labels and help: en, pt (Portuguese) or both. |
list_library
List saved projects in the user library · só leitura
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.
| Argumento | Tipo | O que faz |
|---|---|---|
query | string | Case-insensitive text matched in the path, name and species. |
limit (padrão 100) | integer | Maximum rows, 1-500. |
list_samples
List bundled sample projects · só leitura
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.
| Argumento | Tipo | O que faz |
|---|---|---|
query | string | Case-insensitive text matched in the path, name and species. |
limit (padrão 100) | integer | Maximum rows, 1-500. |
Projetos
new_project
Create a project from a preset · pode sobrescrever ou apagar
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.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 (padrão "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 (padrão false) | boolean | Replace the file if it exists. |
read_project
Read a project · só leitura
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.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 (padrão "summary") | summary | full | summary or full document. |
node | string | Node id: return just this node in detail. |
validate_project
Validate a project · só leitura
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.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 · pode sobrescrever ou apagar
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.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 (padrão false) | boolean | Replace an existing file. |
allow_invalid (padrão false) | boolean | Save even with blocking errors. |
set_project_settings
Set name, seed, export defaults · grava
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.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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. |
Editar o grafo de nodes
set_params
Set node parameters · grava
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.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 (obrigatório) | string | Node id (see read_project), for example 'trunk' or 'out'. |
params (obrigatório) | object | Param name -> new value. |
add_node
Add a node · grava
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.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 (obrigatório) | 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 · grava
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'.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 (obrigatório) | string | Source output, 'node.port'. |
to (obrigatório) | string | Target input, 'node.port'. |
replace (padrão false) | boolean | Replace the existing connection of a single-connection input. |
disconnect
Remove a connection · pode sobrescrever ou apagar
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).
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 (obrigatório) | string | Target input, 'node.port'. |
from | string | Source output 'node.port'; omit to remove all edges into the input. |
remove_node
Remove a node · pode sobrescrever ou apagar
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.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 (obrigatório) | string | Node id. |
force (padrão false) | boolean | Allow removing tree_output. |
apply_patch
Apply a JSON Patch · pode sobrescrever ou apagar
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.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 (obrigatório) | object[] | Operations applied in order. |
dry_run (padrão false) | boolean | Validate the patched document without saving. |
Gerar, ver e exportar
build_project
Build and report stats · só leitura
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).
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 (padrão false) | boolean | Also bake the impostor and report its metadata (slow). |
render_preview
Render a PNG preview · grava
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).
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 (padrão 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 · pode sobrescrever ou apagar
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>.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 (padrão false) | boolean | Write every format (overrides formats). |
out_dir | string | Output folder, inside an allowed folder. |
textures (padrão true) | boolean | Write texture files and bind them. |
atlas (padrão 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 (padrão "native") | native | blender | FBX writer: built-in native, or blender (needs Blender installed). |
Arquivos e pacotes
import_info
Inspect a mesh, manifest or texture pack · pode sobrescrever ou apagar
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.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 · pode sobrescrever ou apagar
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.
| Argumento | Tipo | O que faz |
|---|---|---|
manifest (obrigatório) | string | Path to <prefix>_manifest.json. |
out | string | Output .pbrpack (default beside the manifest). |
kind (padrão "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 · pode sobrescrever ou apagar
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.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | 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 · pode sobrescrever ou apagar
Unzips a .treegenz into a folder and returns the project file inside, like askrgarden-cli unpack. Unsafe paths in the archive are refused.
| Argumento | Tipo | O que faz |
|---|---|---|
path (obrigatório) | string | The .treegenz file. |
out | string | Folder to unpack into (default: beside the bundle, named after it). |
Texturas com o PBrokkR
pbrgen_status
Check for PBRGenerator · só leitura
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.
Sem argumentos.
make_textures
Make a PBR texture set from an image · pode sobrescrever ou apagar
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.
| Argumento | Tipo | O que faz |
|---|---|---|
image (obrigatório) | string | Source image (png, jpg, tif...), inside an allowed folder. |
kind (padrão "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 (padrão "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 (padrão 300) | number | Seconds before the run is stopped. |
Pacotes de engine
install_engine_package
Install engine support (Unity, Godot, Unreal) · pode sobrescrever ou apagar
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.
| Argumento | Tipo | O que faz |
|---|---|---|
engine (obrigatório) | unity | godot | unreal | Which engine. |
dest (obrigatório) | 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 (padrão false) | boolean | Write a zip file into dest instead of copying the package. |
overwrite (padrão true) | boolean | Replace an existing install or zip (false: refuse when it exists). |
Recursos
Documentos só de leitura que o agente lê sem chamar ferramenta:
| URI | O que faz |
|---|---|
treegen://guide | fluxo de trabalho e convenções para agentes |
treegen://nodes/catalog | o catálogo completo de nodes (JSON) |
treegen://nodes/{type} | um tipo de node, com um modelo (JSON) |
treegen://schema/project | o JSON Schema do arquivo de projeto |
treegen://samples/<file> | um documento de projeto de exemplo |
Prompts
Instruções prontas que o cliente pode oferecer ao usuário (por exemplo como comandos com /):
| Prompt | O que faz | Argumentos |
|---|---|---|
build_tree_from_description | Guides the model to pick a preset, tune it to a description and export it. | description (obrigatório), path (obrigatório), formats |
tune_tree | Guides the model to change an existing project according to feedback, checking each step. | path (obrigatório), feedback (obrigatório) |