# train

`station__dtree__train` · external (needs EXECUTION_BACKEND_URL configured) · domain `dtree` · pv-relevance `non-pv`

Train a decision tree classifier from labeled data. Returns the fitted tree as JSON for use with predict/prune/export. Use when building a classifier from tabular feature data.

> **Note:** This tool routes through an external execution backend. If `EXECUTION_BACKEND_URL` is unset on the server, calls return JSON-RPC error `-32603 "Tool execution backend not configured"`. Tools with `backend: native` execute in-process and are always callable.

## Agent metadata

- `idempotent`: unknown
- `read_only`: unknown
- `expected_latency_ms`: unknown (not yet contract-tested)
- `cost_tokens_estimate`: unknown

## Input schema

- `features` *array* (required) — 2D array of feature values (rows = samples, cols = features)
- `labels` *array* (required) — Array of class labels (one per sample)
- `feature_names` *array* — Names for each feature column
- `max_depth` *integer* — Maximum tree depth (default: 10)
- `min_samples_split` *integer* — Minimum samples to split a node (default: 2)
- `criterion` *string* — Split criterion: gini, entropy, or gain_ratio (default: gini)

## Example call

```json
POST /api/mcp
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "station__dtree__train",
    "arguments": {
      "features": [],
      "labels": []
    }
  }
}
```

## Related

- [/tools](/tools) — all 3062 tools
- [/tools/dtree__train](/tools/dtree__train) — HTML page
- [/tools/dtree__train/json](/tools/dtree__train/json) — JSON form (agent-friendly)
- [/api/mcp](/api/mcp) — endpoint
- [/AGENTS.md](/AGENTS.md) — agent guide
