get_child_documents
Query child table rows by joining parent and child DocTypes, avoiding 403 errors from direct child queries and returning one row per matching child row.
Instructions
Query child table rows by joining parent and child DocTypes. Direct child table queries return 403; this tool queries the parent DocType with child table field joins. Returns one row per matching child table row.
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": {
"parent_doctype": "<parent_doctype>",
"child_doctype": "<child_doctype>"
},
"name": "get_child_documents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of rows to return (default: 100) | |
| child_fields | No | Fields from the child table (e.g., ["item_code", "qty", "rate"]). Automatically prefixed with child table reference. | |
| child_doctype | Yes | Child table DocType (e.g., BOM Item, Purchase Order Item, Sales Order Item) | |
| child_filters | No | Filters on child table fields as [field, operator, value] triples (e.g., [["item_code", "like", "%CM5%"]]) | |
| parent_fields | No | Fields from the parent document (e.g., ["name", "item", "total_cost"]). Defaults to ["name"]. | |
| parent_doctype | Yes | Parent DocType (e.g., BOM, Purchase Order, Sales Order) | |
| parent_filters | No | Filters on parent document fields, same format as get_documents filters (e.g., {"is_active": 1, "docstatus": ["=", "1"]}) |