get_document
Retrieve a single ERPNext document by DocType and name, including child tables, while stripping system metadata and null fields; use fields and child_fields to return only needed data.
Instructions
Get a single document by DocType and name, including child tables. Response is automatically stripped of system metadata and null/default fields. Use 'fields' to select specific top-level fields, and 'child_fields' to select fields within child tables. 'name', 'docstatus', and 'status' are always included.
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": {
"doctype": "<doctype>",
"name": "<name>"
},
"name": "get_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Document name/ID (e.g., BOM-COM-HALPI2-007) | |
| fields | No | Top-level fields to include (e.g., ["item", "total_cost", "items"]). Child tables are included by fieldname. If omitted, all fields are returned (with system fields stripped). 'name' and 'docstatus' are always included. | |
| doctype | Yes | ERPNext DocType (e.g., Customer, Item) | |
| child_fields | No | Fields to include per child table, keyed by table fieldname (e.g., {"items": ["item_code", "qty", "rate"]}). If a child table is not listed here, all its fields are returned (stripped). 'name' (row ID) is always included. |