# Erpnext

Free and open-source integrated Enterprise Resource Planning software built on Frappe Framework

- **Category:** accounting
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 51
- **Triggers:** 0
- **Slug:** `ERPNEXT`
- **Version:** 20260312_00

## Tools

### Add Comment

**Slug:** `ERPNEXT_ADD_COMMENT`

Tool to add a comment to a document in ERPNext/Frappe. Use when you need to add comments or notes to any document type like ToDo, Issue, Task, or custom DocTypes.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `content` | string | Yes | The comment content/text to be added to the document |
| `comment_by` | string | Yes | Name or identifier of the person making the comment (typically same as comment_email) |
| `comment_email` | string | Yes | Email address of the person making the comment |
| `reference_name` | string | Yes | The name/ID of the specific document to add the comment to |
| `reference_doctype` | string | Yes | The DocType of the document to add comment to (e.g., 'ToDo', 'Issue', 'Task') |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Add Tag

**Slug:** `ERPNEXT_ADD_TAG`

Tool to add a tag to a document in ERPNext. Use when you need to categorize or label documents for organization and filtering purposes.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `dn` | string | Yes | Target document name (unique identifier) of the document to tag. This is the specific document instance within the DocType. |
| `dt` | string | Yes | Target DocType (document type) to which the tag will be added. Examples include 'ToDo', 'Sales Invoice', 'Customer', etc. |
| `tag` | string | Yes | Tag to add to the document. Can be any string value. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Apply Workflow

**Slug:** `ERPNEXT_APPLY_WORKFLOW`

Tool to apply a workflow action to a document in ERPNext/Frappe. Use when you need to transition a document through workflow states (e.g., approve, reject, submit). The document must have a workflow configured for its doctype.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `doc` | object | Yes | Document object to apply the workflow action to. Must include required fields like 'name', 'doctype', and other document-specific fields. |
| `action` | string | Yes | Workflow action name to apply (e.g., 'Approve', 'Reject', 'Submit'). Must be a valid action defined in the document's workflow. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Cancel Document

**Slug:** `ERPNEXT_CANCEL_DOCUMENT`

Cancel a submitted document in ERPNext/Frappe to change its status from Submitted to Cancelled. Use for submittable DocTypes when you need to reverse or cancel a submitted transaction. Document must be in Submitted state (docstatus=1) before cancellation.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | The unique name/ID of the submitted document to cancel. This is the document's primary identifier within ERPNext. The document must exist and be in Submitted state. |
| `doctype` | string | Yes | The DocType of the document to cancel. Only submittable DocTypes can be canceled. Examples: 'Journal Entry', 'Sales Invoice', 'Purchase Order', 'Delivery Note', 'Payment Entry', 'Stock Entry'. The document must be in Submitted state (docstatus=1). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Document

**Slug:** `ERPNEXT_CREATE_DOCUMENT`

Tool to create a new document of a specific DocType in ERPNext. Use when you need to create records like ToDo, Customer, Lead, Sales Invoice, etc. The document data should include all required fields for the specific DocType. Standard fields like creation, modified, and owner are automatically set by ERPNext.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | object | Yes | Document data as a dictionary of field names and values. The required fields depend on the specific DocType. Common fields include: name, description, title, status, etc. Refer to ERPNext documentation for specific DocType field requirements. |
| `doctype` | string | Yes | The DocType you'd like to create. For example: Customer, Supplier, Employee, Account, Lead, Company, Sales Invoice, Purchase Invoice, Stock Entry, ToDo, etc. This must be a valid DocType name in your ERPNext instance. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Timesheet

**Slug:** `ERPNEXT_CREATE_TIMESHEET`

Tool to create a new Timesheet record in ERPNext. Use when you need to log time entries for employees or projects.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `note` | string | No | Additional notes or comments for the timesheet |
| `company` | string | Yes | Company name for which the timesheet is being created |
| `employee` | string | No | Employee ID or name for the timesheet (optional) |
| `time_logs` | array | Yes | List of time log entries for the timesheet. Each entry must have activity_type, from_time, and to_time |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Document

**Slug:** `ERPNEXT_DELETE_DOCUMENT`

Tool to delete a specific document by DocType and name. Use when you need to remove a document from ERPNext. Requires delete permissions for the specified DocType.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `doctype` | string | Yes | The type of the document to delete. Examples: Customer, Supplier, Employee, Account, Lead, Company, Sales Invoice, Purchase Invoice, Stock Entry, Note, etc. The DocType must exist in your ERPNext instance and you must have delete permissions. |
| `document_name` | string | Yes | The unique name (ID) of the document to delete. This is the document's primary identifier, not the display title. Example: EMP001 (for Employee DocType) or a generated ID like 7l1epfhlls (for Note DocType). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Download file from ERPNext

**Slug:** `ERPNEXT_DOWNLOAD_FILE`

Tool to download a file from ERPNext by its URL. Use when you need to retrieve file content from the ERPNext instance using the file's URL path.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file_url` | string | Yes | URL of the file to download. This should be a relative path starting with /files/ or /private/files/ (e.g., '/files/test_file.txt'). The file must exist on the ERPNext instance. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Download PDF Document

**Slug:** `ERPNEXT_DOWNLOAD_PDF`

Tool to download a document as PDF from ERPNext with optional print format. Use when you need to retrieve a document in PDF format, optionally specifying a custom print format or excluding letterhead.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Document name/ID to download |
| `format` | string | No | Print format name to use for the PDF. If not specified, the default print format for the DocType will be used. |
| `doctype` | string | Yes | DocType of the document to download (e.g., 'User', 'Sales Invoice', 'Purchase Order') |
| `no_letterhead` | integer | No | Set to 1 to exclude letterhead from the PDF, set to 0 or omit to include letterhead |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get All Languages

**Slug:** `ERPNEXT_GET_ALL_LANGUAGES`

Tool to get a list of all available languages in the ERPNext/Frappe system. Use when you need to retrieve supported languages for translation or localization purposes.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `with_language_name` | boolean | No | Include language names along with language codes. When false or omitted, returns only an array of language codes (e.g., ['en', 'es']). When true, returns an array of objects with both language_code and language_name fields (e.g., [{'language_code': 'en', 'language_name': 'English'}]). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get All Roles

**Slug:** `ERPNEXT_GET_ALL_ROLES`

Tool to get a list of all roles available in the ERPNext system. Use when you need to retrieve all available roles for assignment or reference.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Document

**Slug:** `ERPNEXT_GET_CLIENT`

Tool to get a single document by DocType and name or filters from Frappe/ERPNext. Use when you need to retrieve a specific document's complete details.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | The unique name/identifier of the specific document to retrieve. If provided, this takes precedence over filters. |
| `doctype` | string | Yes | The DocType to query (e.g., 'User', 'Customer', 'Item'). DocTypes are the document types defined in your Frappe/ERPNext instance. |
| `filters` | object | No | Filter conditions to find the document when name is not provided. Should be a dictionary of field-value pairs. Example: {'email': 'user@example.com'} |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Document Count

**Slug:** `ERPNEXT_GET_COUNT`

Tool to get the count of documents matching specified filters in ERPNext/Frappe. Use when you need to know how many records exist for a specific DocType, optionally filtered by conditions.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `doctype` | string | Yes | The DocType name to count documents for (e.g., 'User', 'Task', 'Project'). Must be a valid DocType in the ERPNext/Frappe system. |
| `filters` | object | No | Optional filter conditions to apply when counting documents. Format: {field_name: value} or {field_name: ['operator', value]}. Example: {'status': 'Open'} or {'creation': ['>', '2024-01-01']}. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get DocType Metadata

**Slug:** `ERPNEXT_GET_DOCTYPE_META`

Tool to retrieve complete DocType metadata/schema including field definitions, field types, permissions, and configurations. Use when you need to understand the structure of a DocType, its fields, validation rules, or permissions before creating or querying documents.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `doctype` | string | Yes | The DocType name to retrieve metadata for (e.g., 'Customer', 'Sales Order', 'Item') |
| `with_parent` | boolean | No | Include parent DocType metadata if this DocType is a child table. Useful when retrieving metadata for child tables in reports. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Document

**Slug:** `ERPNEXT_GET_DOCUMENT`

Tool to retrieve a specific document by its DocType and name (ID). Returns the complete document with all fields. Use when you need to fetch details of a specific ERPNext document like Customer, Employee, Account, Sales Invoice, etc.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | The name (ID) of the document you'd like to receive. For example EMP001 (of type Employee). |
| `fields` | array | No | By default, only the "name" field is included in the listing. To add more fields, you can pass the fields param. For example, ["name", "country"] |
| `doctype` | string | Yes | The DocType you'd like to receive. For example Customer, Supplier, Employee, Account, Lead, Company, Sales Invoice, Purchase Invoice, Stock Entry, etc. |
| `filters` | array | No | You can filter the listing using sql conditions. Each condition is an array of the format, [doctype, field, operator, value]. For example, [["Customer", "country", "=", "India"]] |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Document with Metadata

**Slug:** `ERPNEXT_GET_DOC_WITH_META`

Tool to retrieve a document with full metadata including attachments, comments, activity logs, and related information. Use when you need complete document details beyond the basic fields returned by standard GET requests.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | The unique name/identifier of the document to retrieve |
| `doctype` | string | Yes | The DocType name (e.g., 'Account', 'Customer', 'Sales Order') |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Exchange Rate

**Slug:** `ERPNEXT_GET_EXCHANGE_RATE`

Tool to get the currency exchange rate between two currencies in ERPNext. Use when you need to convert amounts between different currencies or check current exchange rates.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `to_currency` | string | Yes | Target currency code in ISO 4217 format (e.g., 'EUR', 'USD', 'JPY'). This is the currency you are converting to. |
| `from_currency` | string | Yes | Source currency code in ISO 4217 format (e.g., 'USD', 'EUR', 'GBP'). This is the currency you are converting from. |
| `transaction_date` | string | No | Optional date for the exchange rate in YYYY-MM-DD format. If not provided, the current date's exchange rate will be used. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Fiscal Year

**Slug:** `ERPNEXT_GET_FISCAL_YEAR`

Tool to get fiscal year information for a given date in ERPNext. Use when you need to determine which fiscal year a specific date falls into or retrieve fiscal year boundaries.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `date` | string | No | Date to check for fiscal year in YYYY-MM-DD format. If not provided, the current date will be used. |
| `company` | string | No | Company name to get fiscal year for. If not provided, the default company will be used. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Framework Version

**Slug:** `ERPNEXT_GET_FRAMEWORK_VERSION`

Tool to get the Frappe framework version and all installed app versions. Use when you need to check the ERPNext/Frappe system version for compatibility or debugging purposes.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Item Details

**Slug:** `ERPNEXT_GET_ITEM_DETAILS`

Tool to get detailed item information including pricing, taxes, and stock details from ERPNext. Use when you need comprehensive item data for transactions like Sales Orders, Purchase Orders, or Invoices. This action retrieves item-specific information based on the provided context including customer, price list, warehouse, and currency.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `ctx` | object | Yes | Context object containing all required parameters for retrieving item details. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get List of Documents

**Slug:** `ERPNEXT_GET_LIST`

Tool to retrieve a list of documents from ERPNext/Frappe with filtering, field selection, and pagination. Use when you need to query documents of a specific DocType with optional filters, sorting, and field selection. The response contains an array of document objects with the requested fields.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `start` | integer | No | Pagination start index (zero-based). Use this with page_length for pagination. For example, start=0 gets first page, start=20 gets second page with page_length=20. |
| `fields` | array | No | List of field names to return in the response. If not specified, only the 'name' field is returned by default. Use this to specify which fields you want to retrieve (e.g., ['name', 'email', 'first_name']). |
| `doctype` | string | Yes | The DocType to query. This is the name of the document type you want to retrieve records from (e.g., 'User', 'Customer', 'Sales Order'). |
| `filters` | object | No | Filter conditions to apply to the query. Supports various filter operators. Can be a simple dict like {'status': 'Open'} or complex filters with operators like {'creation': ['>', '2024-01-01']}. |
| `order_by` | string | No | Sort order for the results. Specify field name with optional direction (e.g., 'modified desc', 'creation asc', 'name'). Default is descending order. |
| `page_length` | integer | No | Number of records to return per page. Default is 20 if not specified. Maximum value depends on server configuration. Use with start parameter for pagination. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Logged User

**Slug:** `ERPNEXT_GET_LOGGED_USER`

Tool to get the email/ID of the currently authenticated user. Use to verify authentication is working.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Party Details

**Slug:** `ERPNEXT_GET_PARTY_DETAILS`

Tool to get comprehensive customer or supplier details including addresses, contacts, and default financial settings. Use when creating transactions or updating party information in ERPNext.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `party` | string | Yes | Name (ID) of the customer or supplier |
| `company` | string | No | Company name for which to fetch party details. If not specified, default company is used. |
| `party_type` | string | Yes | Type of party - either 'Customer' or 'Supplier' |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Payment Entry

**Slug:** `ERPNEXT_GET_PAYMENT_ENTRY`

Tool to get payment entry details for an invoice or order from ERPNext. Use when you need to retrieve payment information for a Sales Invoice, Purchase Invoice, Sales Order, or Purchase Order. This returns a Payment Entry document with party details, payment amounts, accounts, exchange rates, and reference information.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `dn` | string | Yes | Document name (ID) of the specific document to get payment entry for (e.g., 'SINV-26-00001', 'PINV-2024-00001'). |
| `dt` | string | Yes | DocType for which to get payment entry details. Common values include 'Sales Invoice', 'Purchase Invoice', 'Sales Order', 'Purchase Order'. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Stock Balance

**Slug:** `ERPNEXT_GET_STOCK_BALANCE`

Tool to retrieve the current stock balance for a specific item in a warehouse. Use when you need to check inventory levels or available quantity.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_code` | string | Yes | The unique code/identifier of the item to check stock balance for. |
| `warehouse` | string | Yes | The name of the warehouse to check stock balance in. |
| `posting_date` | string | No | Date for balance calculation in YYYY-MM-DD format. If not provided, current date is used. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Timezones

**Slug:** `ERPNEXT_GET_TIMEZONES`

Tool to get a list of all available timezones in the ERPNext system. Use when you need to retrieve timezone options for user configuration or scheduling.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get User Roles

**Slug:** `ERPNEXT_GET_USER_ROLES`

Tool to get roles assigned to a user. Use when you need to check user permissions or access levels in ERPNext/Frappe.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `uid` | string | No | User ID to get roles for. If not provided, returns roles for the currently authenticated user. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Field Value

**Slug:** `ERPNEXT_GET_VALUE`

Tool to get specific field value(s) from a document in ERPNext. Use when you need to retrieve one or more field values without loading the entire document.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | The specific document name/ID to retrieve. Use this when you know the exact document identifier. Cannot be used together with filters parameter. |
| `doctype` | string | Yes | The DocType (document type) to query. Examples include 'User', 'Customer', 'Sales Invoice', 'Item', etc. |
| `filters` | string | No | Filter conditions as JSON string to match documents (e.g., '{"status": "Open"}' or '{"email": "user@example.com"}'). Returns the first matching document. Cannot be used together with name parameter. |
| `fieldname` | string | Yes | The field name(s) to retrieve. For multiple fields, provide a comma-separated list (e.g., 'full_name,email'). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Workflow Transitions

**Slug:** `ERPNEXT_GET_WORKFLOW_TRANSITIONS`

Tool to get available workflow transitions for a document. Use when you need to check what workflow actions are available for a specific document based on its current state and user permissions.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | The name/ID of the specific document to get workflow transitions for. |
| `doctype` | string | Yes | The DocType name of the document to get workflow transitions for. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Insert Document

**Slug:** `ERPNEXT_INSERT_DOCUMENT`

Tool to insert a new document in ERPNext/Frappe using the client API. Use when you need to create any type of document (ToDo, Customer, Item, etc.) by providing the doctype and required fields.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `doc` | object | Yes | Document object containing doctype field (required) and document-specific fields. The doctype must be a valid DocType name in your ERPNext instance (e.g., 'ToDo', 'Customer', 'Item'). Additional fields depend on the specific DocType schema. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Insert Multiple Documents

**Slug:** `ERPNEXT_INSERT_MANY`

Tool to insert multiple documents at once into ERPNext/Frappe. Use when you need to create multiple records (Notes, Customers, Items, etc.) in a single API call for better efficiency.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `docs` | array | Yes | Array of document objects to insert. Each document must have a 'doctype' field that specifies the type of document (e.g., 'Note', 'Customer', 'Item'). Additional fields depend on the specific doctype requirements. For example, a Note requires 'title' and 'content' fields. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List DocTypes

**Slug:** `ERPNEXT_LIST_DOCTYPES`

Tool to get a list of all DocTypes available in the ERPNext system. Use when you need to retrieve available DocTypes with optional filtering and pagination.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `fields` | array | No | Fields to include in the listing. By default, only the "name" field is included. Pass a list of field names to include additional fields, for example ["name", "module"]. |
| `filters` | array | No | SQL conditions to filter the listing. Each condition is an array of the format [doctype, field, operator, value]. For example, [["DocType", "module", "=", "Core"]] to filter DocTypes by module. |
| `limit_start` | integer | No | Starting offset for pagination. To request successive pages, pass a multiple of your limit_page_length. For example, to request the second page, pass limit_start as 20 (if limit_page_length is 20). |
| `limit_page_length` | integer | No | Number of items to return per page. By default, listings are paginated with 20 items per page. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List ERPNext Documents

**Slug:** `ERPNEXT_LIST_DOCUMENTS`

Tool to list documents of a specific DocType from ERPNext. Returns paginated results (default 20 items). Use when you need to retrieve multiple documents, with support for filtering, field selection, and pagination.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `fields` | array | No | Fields to include in the response. By default, only the 'name' field is included. Pass a list of field names to retrieve additional fields. For example: ['name', 'country'] |
| `doctype` | string | Yes | The DocType you'd like to receive. For example: Customer, Supplier, Employee, Account, Lead, Company, Sales Invoice, Purchase Invoice, Stock Entry, etc. |
| `filters` | array | No | SQL conditions to filter the listing. Each condition is an array of the format: [doctype, field, operator, value]. For example: [['Customer', 'country', '=', 'India']] |
| `limit_start` | integer | No | Offset for pagination. Pass a multiple of limit_page_length to request successive pages. For example, to request the second page with page length 20, pass 20. |
| `limit_page_length` | integer | No | Number of items to return per page. Default is 20. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Employees

**Slug:** `ERPNEXT_LIST_EMPLOYEES`

Tool to retrieve a list of Employee records from ERPNext. Use when you need to fetch employee information with optional filtering and pagination.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `fields` | array | No | List of fields to include in the response. By default, only the 'name' field is included. Pass field names as a list to retrieve additional fields. For example: ['name', 'employee_name', 'department', 'designation'] |
| `filters` | array | No | SQL conditions to filter the listing. Each condition is an array of the format [doctype, field, operator, value]. For example: [['Employee', 'status', '=', 'Active']] to filter active employees only. |
| `limit_start` | integer | No | Starting position for pagination. To request successive pages, pass a multiple of limit_page_length. For example, to request the second page with page size 20, pass limit_start=20. |
| `limit_page_length` | integer | No | Number of records to return per page. Default is 20. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Projects

**Slug:** `ERPNEXT_LIST_PROJECTS`

Tool to retrieve a list of Project records from ERPNext. Use when you need to get projects, optionally filtered and paginated.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `fields` | array | No | Fields to include in the response. By default, only the "name" field is included. Pass a list of field names to include additional fields. |
| `filters` | array | No | SQL conditions to filter the listing. Each condition is an array of the format: [doctype, field, operator, value]. For example: [["Project", "status", "=", "Open"]] |
| `limit_start` | integer | No | Offset for pagination. Pass a multiple of limit_page_length to request successive pages. For example, pass 20 to request the second page when limit_page_length is 20. |
| `limit_page_length` | integer | No | Number of items to return per page. Controls pagination size. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Timesheets

**Slug:** `ERPNEXT_LIST_TIMESHEETS`

Tool to get a list of Timesheet records from ERPNext. Use when you need to retrieve, search, or filter timesheets. Supports pagination and flexible field selection.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `fields` | array | No | List of fields to include in the response. By default, only the 'name' field is included. To add more fields, specify them in this list. For example: ['name', 'employee', 'total_hours', 'status'] |
| `filters` | array | No | SQL-style conditions to filter the listing. Each condition is an array of the format: [doctype, field, operator, value]. For example: [['Timesheet', 'status', '=', 'Submitted']] to get only submitted timesheets. Multiple filters can be combined: [['Timesheet', 'employee', '=', 'EMP-001'], ['Timesheet', 'status', '=', 'Draft']] |
| `limit_start` | integer | No | Starting position for pagination. To request successive pages, pass a multiple of your limit_page_length. For example, to request the second page with page length 20, pass limit_start=20. |
| `limit_page_length` | integer | No | Number of records to return per page. Controls the page size for pagination. Default is 20 records. Maximum is 1000. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Webhooks

**Slug:** `ERPNEXT_LIST_WEBHOOKS`

Tool to list webhook configurations in ERPNext. Use when you need to retrieve all configured webhooks or search for specific webhooks using filters.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `fields` | array | No | List of fields to include in the response. By default, only the 'name' field is included. Pass additional fields like ['name', 'webhook_doctype', 'webhook_docevent'] to get more data. |
| `filters` | array | No | SQL conditions to filter the listing. Each condition is an array of the format [doctype, field, operator, value]. For example: [['Webhook', 'enabled', '=', 1]] |
| `limit_start` | integer | No | Starting index for pagination. Pass a multiple of limit_page_length to get successive pages. For example, to get the second page with page size 20, pass 20. |
| `limit_page_length` | integer | No | Number of items to return per page. By default, the API returns 20 items. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Make Delivery Note

**Slug:** `ERPNEXT_MAKE_DELIVERY_NOTE`

Create a draft Delivery Note from an existing Sales Order in ERPNext. Use when you need to initiate shipment/delivery of items from a confirmed sales order. The created Delivery Note will be in draft state and can be modified before submission.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `source_name` | string | Yes | Sales Order name/ID from which to create the Delivery Note. The Sales Order must exist and be in a submitted state (docstatus=1). Example: 'SAL-ORD-2026-00002', 'SO-00123'. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Make Purchase Order

**Slug:** `ERPNEXT_MAKE_PURCHASE_ORDER`

Create a draft Purchase Order from an existing Material Request in ERPNext. Use when you need to initiate procurement of items from an approved material request. The created Purchase Order will be in draft state and can be modified before submission.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `source_name` | string | Yes | Material Request name/ID from which to create the Purchase Order. The Material Request must exist and be of type 'Purchase' with submitted state (docstatus=1). Example: 'MAT-MR-2026-00001', 'MR-00123'. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Make Sales Invoice

**Slug:** `ERPNEXT_MAKE_SALES_INVOICE`

Tool to create a Sales Invoice from an existing Sales Order in ERPNext. Use when you need to generate an invoice for a confirmed sales order. The created invoice will be in draft state and can be submitted separately if needed.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `source_name` | string | Yes | Sales Order name/ID to convert into a Sales Invoice. Must be a valid Sales Order identifier (e.g., 'SAL-ORD-2026-00001'). The Sales Order should exist in the system and be in a valid state for invoice creation. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Make Stock Entry

**Slug:** `ERPNEXT_MAKE_STOCK_ENTRY`

Tool to create a Stock Entry for material transfer, receipt, or issue in ERPNext. Use when you need to record inventory movements between warehouses or add/remove stock. For Material Receipt, include target warehouse and basic_rate. For Material Issue, include source warehouse. For Material Transfer, include both source and target warehouses.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `qty` | number | Yes | Quantity of the item to be transferred, received, or issued. Must be a positive number. |
| `source` | string | No | Source warehouse from which the item is being transferred or issued. Required for Material Transfer and Material Issue purposes. |
| `target` | string | No | Target warehouse to which the item is being transferred or received. Required for Material Transfer and Material Receipt purposes. |
| `purpose` | string ("Material Receipt" | "Material Issue" | "Material Transfer" | "Material Transfer for Manufacture" | "Material Consumption for Manufacture" | "Manufacture" | "Repack" | "Send to Subcontractor") | No | Enumeration of stock entry purposes. |
| `item_code` | string | Yes | Item code for the stock entry. Must be a valid Item in the ERPNext system. |
| `basic_rate` | number | No | Valuation rate per unit of the item. Required for Material Receipt when the item has no valuation rate defined to avoid validation errors. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Ping API

**Slug:** `ERPNEXT_PING`

Tool to check if the ERPNext/Frappe API is reachable. Use when you need to verify API connectivity or test authentication.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Rename Document

**Slug:** `ERPNEXT_RENAME_DOC`

Tool to rename an ERPNext document by changing its unique ID/name. Use when you need to change a document's primary identifier, optionally merging with an existing document.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `merge` | boolean | No | If True, merge with an existing document having the new_name. If False or omitted, rename without merging. |
| `doctype` | string | Yes | The DocType of the document to rename (e.g., 'Customer', 'Item', 'Sales Order'). |
| `new_name` | string | Yes | The new unique name/ID to assign to the document. |
| `old_name` | string | Yes | The current unique name/ID of the document to be renamed. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Save Document with Action

**Slug:** `ERPNEXT_SAVE_DOCS`

Tool to save, submit, cancel, or update a document in ERPNext. Use when you need to create or modify documents in ERPNext. The doc parameter must be a JSON-serializable dictionary containing the document fields.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `doc` | object | Yes | Document to save as a dictionary. Must include required fields: 'doctype' (the DocType name), 'name' (document ID if updating), and other relevant fields for the specific DocType. Example: {'doctype': 'ToDo', 'name': 'abc123', 'description': 'Task description', 'status': 'Open'} |
| `action` | string ("Save" | "Submit" | "Cancel" | "Update") | No | Action to perform on the document: Save (create or update), Submit (submit for approval), Cancel (cancel submitted document), Update (update after submission) |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Save Document

**Slug:** `ERPNEXT_SAVE_DOCUMENT`

Tool to save an existing ERPNext/Frappe document with changes. Use when you need to update an existing document in the system. Requires the complete document object including all system fields and the fields being updated.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `doc` | object | Yes | Complete document object to save. Must include 'doctype' and 'name' at minimum. Should also include system fields (owner, creation, modified, modified_by, docstatus, idx) and any doctype-specific fields you want to update. Additional fields beyond the base schema are allowed and will be passed to the API. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Global Search

**Slug:** `ERPNEXT_SEARCH_GLOBAL`

Tool to perform global text search across ERPNext documents. Use when you need to find documents, pages, or records by searching for keywords across the system. Results are ranked by relevance and include document type, name, content preview, and navigation route.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `text` | string | Yes | Search query text to find across documents |
| `limit` | integer | No | Maximum number of results to return |
| `scope` | string | No | Optional scope to narrow search to specific route/section |
| `start` | integer | No | Starting position for pagination (0-based index) |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Search Link Field Documents

**Slug:** `ERPNEXT_SEARCH_LINK`

Tool to search for documents to link in ERPNext/Frappe Link fields. Use when you need autocomplete suggestions for Link fields or to find documents by name/text.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `txt` | string | Yes | Search text to filter results. Can be empty string to return all results. |
| `query` | string | No | Custom search query function path (advanced usage) |
| `doctype` | string | Yes | DocType to search within (e.g., 'User', 'Customer', 'Item') |
| `filters` | object | No | Filter conditions to apply to the search as a dictionary of field-value pairs |
| `page_length` | integer | No | Number of results to return per page |
| `searchfield` | string | No | Specific field to search within (if not provided, searches default fields) |
| `link_fieldname` | string | No | Name of the link field being searched (used for context) |
| `reference_doctype` | string | No | Document type containing the link field (used for context) |
| `ignore_user_permissions` | boolean | No | Whether to ignore user permissions when searching (default: False) |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Set Value

**Slug:** `ERPNEXT_SET_VALUE`

Tool to set a specific field value on a document in ERPNext. Use when you need to update a single field without retrieving or modifying the entire document.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | The document name/ID to update. |
| `value` | string | Yes | The value to set for the field. Can be string, number, or boolean. |
| `doctype` | string | Yes | The DocType name (e.g., 'ToDo', 'Task', 'User', 'Customer'). |
| `fieldname` | string | Yes | The field name to set (e.g., 'description', 'status'). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Submit Document

**Slug:** `ERPNEXT_SUBMIT_DOCUMENT`

Submit a draft document in ERPNext/Frappe to change its status from Draft to Submitted. Use for submittable DocTypes like Sales Invoice, Purchase Order, Journal Entry, etc. Document must exist in draft state (docstatus=0) before submission.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `doc` | string | Yes | JSON-stringified complete document object to submit. Must include: (1) 'doctype' field specifying the document type (e.g., 'Journal Entry', 'Sales Invoice'), (2) 'name' field with the document ID, (3) all required fields for the DocType, (4) all child table records if applicable (as arrays of objects), (5) timestamp fields ('modified', 'creation') matching current server state. The document must be in draft state (docstatus=0) and the DocType must be submittable. Fetch the complete document first using GET endpoint to ensure all fields and timestamps are current. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update ERPNext document

**Slug:** `ERPNEXT_UPDATE_DOCUMENT`

Tool to update a specific ERPNext document. Acts like a PATCH request - only send the fields you want to change, not the whole document. Use when you need to modify specific fields of an existing document.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | The name (ID) of the document you'd like to update. For example EMP001 (of type Employee), or 4klj4teijs (of type ToDo). |
| `fields` | object | Yes | Dictionary of field names and their new values. Only include the fields you want to update - acts like a PATCH request. Field names and types must match the DocType schema. |
| `doctype` | string | Yes | The DocType you'd like to update. For example Customer, Supplier, Employee, Account, Lead, Company, Sales Invoice, Purchase Invoice, Stock Entry, etc. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
