Skip to main content
Glama

simplifier-mcp

by SimplifierIO

businessobject-function-update

Create or update JavaScript functions in server-side Business Objects to implement custom business logic and integrate with connectors or other business objects.

Instructions

#Create or update a Business Object Function

Creates or updates a JavaScript function within a server-side Business Object. Functions contain business logic code and can call connectors or other business objects.

Common Base Data Type IDs:

  • String: "22ED1F787B6B0926AB0577860AF7543705341C053EB1B4A74E7CC199A0645E52"

  • Integer: "B9B1191E0B70BA0845CF4F6A4F4C017594F8BA84FD2F1849966081D53A8C836D"

  • Boolean: "2788FB5AA776C62635F156C820190D0FD3D558765201881A77382093F7248B39"

  • Date: "06A9841478D7BE17C423F11C38CD6829E372093DBEC144F2A85FC7165BE8CD80"

  • Float: "C09139C72F5A8A7E0036BA66CE301748BD617F463683EE03F92EDAAAA4AF8BC7"

  • Any: "D31053204B4A612390A2D6ECDF623E979C14ADC070A7CB9B08B2099C3011BCAB"

Parameter Structure: Each parameter needs name, dataTypeId, and isOptional. Description and alias are optional.

Code: Standard JavaScript code.

Parameter access in the code: Input parameters can be accessed with let myVar = input.parameter_name; Output parameters can be assigned with output.parameter_name = someOfMyResults; Attention: In case an alias is defined for a parameter, you have use "alias" instead of "parameter_name". Example: output.alias = someOfMyResults; You can do an early return of output, but you don't need to end with a return. The function code will be postfixed with a "return output" anyway. If you do a return instead of return output, then in the first case you will return undefined output parameters - this is most probably not what you want to do.

Business Objects Development Guide

Overview

This guide provides comprehensive information for implementing Business Object functions in Simplifier, including Object API usage, connector access patterns, and Business Object to Business Object communication.

Server-Side Business Object API

The Simplifier object provides access to various server-side methods and components:

Available Components

  • Logging: Server-side logging capabilities e.g. Simplifier.Log.info("my log") - see details: simplifier://documentation/server-businessobjects/api/Logging

  • Utilities/Tools: Helper functions and tools - see details: simplifier://documentation/server-businessobjects/api/Utils

  • Connectors: Access to data connectors - TODO add information later

  • Business Objects: Access to other Business Objects - see this description

  • Users: User management - see details: simplifier://documentation/server-businessobjects/api/User

Simplifier.Log.info(...) is logging to a Simplifier Log inside the database. The logged entries can be seen by the user but cannot be accessed by this MCP so far. console.log(...) is logging to the Simplifier logfile. The logged entries can be accessed by Simplifier Administrators only. The MCP cannot access these logs.

Accessing Other Business Objects

Basic Syntax

// Access other Business Objects Simplifier.BusinessObject.<BOName>.<MethodName>(payload?) // Access current Business Object methods Simplifier.CurrentBusinessObject.<MethodName>(payload?) // Access connector calls (find the available connector calls via resources) Simplifier.Connector.<ConnectorName>.<ConnectorCallName>(payload?)

Examples

// Call another Business Object function var userInfo = Simplifier.BusinessObject.UserManager.getUserById({ userId: "12345" }); // Call a function in the current Business Object var result = Simplifier.CurrentBusinessObject.validateInput({ data: input.userData });

Configuration Requirements

Adding Dependencies

When accessing other Business Objects or connectors from a Business Object function, these components MUST be added as dependencies. (see schema for tool about getting, updating and creating Business Objects)

Dependency Types

  • Business Objects: Other BOs that will be called

  • Connectors: Data connectors that will be accessed

Dynamic Access Methods

Variables Approach

// Using variables for dynamic calls var boName = "UserManager"; var methodName = "getUser"; var result = Simplifier.BusinessObject[boName][methodName](payload);

Dynamic Call Function

// Using dynamic call patterns var result = Simplifier.BusinessObject.call(boName, methodName, payload);

Parameter Validation

// Always validate input parameters if (!input.userId || input.userId.length === 0) { output.error = "UserId is required"; return output; } var userResult = Simplifier.BusinessObject.UserService.getUser({ userId: input.userId });

Security Considerations

  • Always validate input parameters

  • Validate data types and ranges for all inputs

Performance Tips

  • Cache frequently accessed data when appropriate

  • Avoid unnecessary nested Business Object calls

Debugging Tips

  • To track down an issue (e.g. the connector issue) put the failing part into a very small bo function and return the result with JSON.stringify as a string, then you can check, whether the expected result is delivered. Indicate in the name of the function, that it can be deleted after debugging.


This documentation provides the essential patterns and best practices for implementing robust Business Object functions in Simplifier. Remember to always add dependencies and follow security best practices when accessing external components. Dependencies for yourself do not need to be added, but you can access own functions like Simplifier.CurrentBusinessObject.(payload?).

Input Schema

NameRequiredDescriptionDefault
businessObjectNameYes
functionNameYes
descriptionNo
codeNoJavaScript function codereturn {};
validateInNoIf true, validates that all mandatory input parameters are present before execution. Catches missing parameters early with clear validation errors (HTTP 422). If false, allows incomplete requests through, resulting in backend errors (HTTP 500).
validateOutNoIf true, validates and filters the output response against the defined datatype structure, returning only defined fields. If false, returns the complete raw API response without filtering or validation.
inputParametersNo
outputParametersNo

Input Schema (JSON Schema)

{ "properties": { "businessObjectName": { "type": "string" }, "code": { "default": "return {};", "description": "JavaScript function code", "type": "string" }, "description": { "default": "", "type": "string" }, "functionName": { "type": "string" }, "inputParameters": { "default": [], "items": { "additionalProperties": false, "properties": { "alias": { "default": "", "type": "string" }, "dataTypeId": { "default": "D31053204B4A612390A2D6ECDF623E979C14ADC070A7CB9B08B2099C3011BCAB", "type": "string" }, "description": { "default": "", "type": "string" }, "isOptional": { "default": false, "type": "boolean" }, "name": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "type": "array" }, "outputParameters": { "default": [], "items": { "additionalProperties": false, "properties": { "alias": { "default": "", "type": "string" }, "dataTypeId": { "default": "D31053204B4A612390A2D6ECDF623E979C14ADC070A7CB9B08B2099C3011BCAB", "description": "Initially it could make sense, to give the Any type as output data type, and only later create a fitting datatype, when the output schema is fix.", "type": "string" }, "description": { "default": "", "type": "string" }, "isOptional": { "default": false, "type": "boolean" }, "name": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "type": "array" }, "validateIn": { "default": false, "description": "If true, validates that all mandatory input parameters are present before execution. Catches missing parameters early with clear validation errors (HTTP 422). If false, allows incomplete requests through, resulting in backend errors (HTTP 500).", "type": "boolean" }, "validateOut": { "default": false, "description": "If true, validates and filters the output response against the defined datatype structure, returning only defined fields. If false, returns the complete raw API response without filtering or validation.", "type": "boolean" } }, "required": [ "businessObjectName", "functionName" ], "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SimplifierIO/simplifier-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server