frappe_search_docs
Search and filter documents in Frappe/ERPNext by specifying DocType, filters, fields, pagination, and ordering. Returns paginated results.
Instructions
Search or list documents of a given DocType with optional filters, field selection, pagination (default 20, max 200), and ordering. Returns a paginated list of matching documents. Use filters to narrow results by status, date range, amount, or any document field.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (default: 20, maximum: 200). Use for pagination. Frappe caps results at 200 per request. | |
| fields | No | Optional list of field names to return. Limits the response to only the specified fields for efficiency. Example: ['name', 'status', 'grand_total', 'posting_date']. When omitted, all fields are returned. | |
| doctype | Yes | The DocType to search within (e.g. 'Sales Invoice', 'Customer', 'Item', 'ToDo', 'Contact'). This parameter is required. | |
| filters | No | Optional list of filter conditions. Each filter is a triple [field, operator, value]. Supported operators: =, !=, >, <, >=, <=, like, not like, in, not in, between. Example: [['status','=','Open'], ['grand_total','>','1000']]. | |
| order_by | No | Field to sort by with direction. Format: 'fieldname direction'. Examples: 'creation desc' (newest first), 'modified asc' (oldest updated first), 'name asc' (alphabetical). Default ordering is by creation date descending. |