Skip to main content

SAP

Connects to SAP systems (SAP S/4HANA, ERP, Business One) via the OData REST API. An agent can query, create, update and delete OData entities, list available services, and call custom function imports.

Add to an agent node's tools array with _node_type: "tool-sap". See Connector Reference — How connectors are used.

Authentication

FieldRequiredDescription
base_urlYesBase URL of the SAP system, e.g. https://mycompany.s4hana.ondemand.com.
usernameYesSAP username, used for HTTP Basic auth.
passwordYesSAP password, used for HTTP Basic auth.
sap_clientNoSAP client number, e.g. 100 (default: 100).
api_pathNoBase OData API path (default: /sap/opu/odata/sap/).
{
"name": "sap",
"_node_type": "tool-sap",
"base_url": "https://mycompany.s4hana.ondemand.com",
"username": "{{ secret.SAP_USERNAME }}",
"password": "{{ secret.SAP_PASSWORD }}",
"sap_client": "100"
}

Tools

sap_query

Query SAP OData entities (business partners, sales orders, materials, etc.).

Parameters

ParameterTypeRequiredDescription
servicestringYesOData service name, e.g. API_BUSINESS_PARTNER
entity_setstringYesEntitySet name, e.g. A_BusinessPartner
filterstringNoOData filter expression, e.g. BusinessPartner eq '1000000'
selectstringNoComma-separated fields to return
topnumberNoMax records (default 20)
order_bystringNoSort field and direction, e.g. BusinessPartner desc

Returns: A summary line with the number of records found, followed by the matching records as indented JSON, or "No records found.".

sap_create

Create a new SAP entity (e.g. create a sales order, customer, material).

Parameters

ParameterTypeRequiredDescription
servicestringYesOData service name
entity_setstringYesEntitySet name
dataobjectYesEntity fields as key-value pairs

Returns: "Created:" followed by the created entity as indented JSON.

sap_update

Update an existing SAP entity using MERGE/PATCH (partial update).

Parameters

ParameterTypeRequiredDescription
servicestringYesOData service name
entity_setstringYesEntitySet name
keystringYesEntity key, e.g. BusinessPartner='1000000'
dataobjectYesFields to update

Returns: A success message (e.g. "Entity <entity_set>(<key>) updated successfully."), or the raw response body if non-empty.

sap_delete

Delete an SAP entity by its key.

Parameters

ParameterTypeRequiredDescription
servicestringYesOData service name
entity_setstringYesEntitySet name
keystringYesEntity key, e.g. MaterialDocument='5000000001'

Returns: A success message (e.g. "Entity <entity_set>(<key>) deleted."), or the raw response body if non-empty.

sap_list_services

List available OData services on the SAP system.

No parameters.

Returns: A newline-separated list of <ServiceCollection> <Title> lines, or "No services found — check base_url and credentials.".

sap_function_import

Call a SAP OData function import (custom operations like posting goods movements, approvals, etc.).

Parameters

ParameterTypeRequiredDescription
servicestringYesOData service name
functionstringYesFunction import name
paramsobjectNoFunction parameters
methodstringNoHTTP method GET or POST (default GET)

Returns: The function import's response body as indented JSON.

Next