list_documents
Retrieve documents from Frappe with custom filters, field selection, and sorting to efficiently query and manage data.
Instructions
List documents from Frappe with filters.
Args:
doctype: DocType name
filters: Filter string (optional). Uses custom syntax to bypass MCP validation issues.
fields: Comma-separated field names (optional). E.g. "name,customer,total"
limit: Maximum number of records to return (optional). E.g. "20"
order_by: Field to order by (optional, can include 'desc' like 'creation desc')
Filter Syntax:
- Simple equality: "field:value" -> {"field": "value"}
- Operators: "field:operator:value" -> {"field": ["operator", value]}
- Multiple filters: "field1:value1,field2:operator:value2"
Supported Operators:
- Equality: = (default), !=
- Comparison: <, >, <=, >=
- Pattern: like, not_like (use % for wildcards)
- Lists: in, not_in (separate values with |)
- Null checks: is:null, is:not_null, is_not:null
- Ranges: between (separate values with |)
Examples:
- list_documents("Bank Transaction", "status:Unreconciled") -> List unreconciled transactions
- list_documents("Task", "status:in:Open|Working", "name,subject", "10") -> List open tasks with specific fields
- list_documents("User", "name:like:%admin%") -> List users with 'admin' in name
Input Schema
Name | Required | Description | Default |
---|---|---|---|
doctype | Yes | ||
fields | No | ||
filters | No | ||
limit | No | ||
order_by | No |
Input Schema (JSON Schema)
{
"properties": {
"doctype": {
"title": "Doctype",
"type": "string"
},
"fields": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Fields"
},
"filters": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Filters"
},
"limit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Limit"
},
"order_by": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Order By"
}
},
"required": [
"doctype"
],
"title": "list_documentsArguments",
"type": "object"
}