businessobject-update
Create or update Business Objects in Simplifier platform with proper project assignments and dependency management for accessing connectors and other business objects.
Instructions
#Create or update a Business Object
Attention: When updating dependencies or tags, allways fetch the Business Object resource first to ensure operating on the latest version. Existing dependencies and tags have to be resent when doing an update - otherwise they would be cleared.
Dependencies are REQUIRED to be added when the BO functions access connectors or other BOs using Simplifier.Connector.* or Simplifier.BusinessObject.* APIs.
Project Assignment
Business Objects must be assigned to projects using the project assignment parameters:
For Creating New BOs:
Set
projectsBeforeto empty array[]Set
projectsAfterChangeto array of project names to assign the BO to
For Updating Existing BOs:
Set
projectsBeforeto current project assignments (from existing BO)Set
projectsAfterChangeto new project assignments
Example:
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| description | Yes | ||
| dependencies | Yes | Array of dependencies that this BO requires. CRITICAL: Add connectors and other BOs that will be accessed from BO functions using Simplifier.Connector.<Name> or Simplifier.BusinessObject.<Name> syntax. If not provided when updating, existing dependencies will be preserved. | |
| tags | Yes | Array of tags for categorizing and organizing this Business Object. If not provided when updating, existing tags will be preserved. | |
| projectsBefore | No | Project names before the change. Use empty array [] when creating new BOs, or provide current projects when updating. | |
| projectsAfterChange | No | Project names to assign the BO to. Required for tracking project assignments. |
Implementation Reference
- The handler function for the 'businessobject-update' tool. It checks if the Business Object exists, constructs the details object including project assignments, and calls either createServerBusinessObject or updateServerBusinessObject on the SimplifierClient.}, async ({ name, description, dependencies, tags, projectsBefore, projectsAfterChange }) => { return wrapToolResult(`create or update Business Object ${name}`, async () => { const trackingKey = trackingToolPrefix + toolNameBusinessObjectUpdate let oExisting: any; try { oExisting = await simplifier.getServerBusinessObjectDetails(name, trackingKey) } catch { } const data: SimplifierBusinessObjectDetails = { name: name, description: description, dependencies: dependencies, tags: tags, assignedProjects: { projectsBefore: projectsBefore || [], projectsAfterChange: projectsAfterChange || [] } } as SimplifierBusinessObjectDetails if (oExisting) { return simplifier.updateServerBusinessObject(data); } else { return simplifier.createServerBusinessObject(data) } }) });
- Zod input schema for the 'businessobject-update' tool parameters including name, description, dependencies, tags, and project assignments.{ name: z.string(), description: z.string(), // defaults have been removed for description, dependencies and tags, so that we can add the existing values, if the properties are // not given at all dependencies: z.array(z.object({ refType: z.enum(['connector', 'serverbusinessobject', 'plugin']).describe('Type of dependency: "connector" for data connectors, "serverbusinessobject" for other Business Objects, "plugin" for Plugins'), name: z.string().describe('name of the connector or server business object (bo) to depend on') })).describe('Array of dependencies that this BO requires. CRITICAL: Add connectors and other BOs that will be accessed from BO functions using Simplifier.Connector.<Name> or Simplifier.BusinessObject.<Name> syntax. If not provided when updating, existing dependencies will be preserved.'), tags: z.array(z.string()).describe('Array of tags for categorizing and organizing this Business Object. If not provided when updating, existing tags will be preserved.'), projectsBefore: z.array(z.string()).default([]).describe('Project names before the change. Use empty array [] when creating new BOs, or provide current projects when updating.'), projectsAfterChange: z.array(z.string()).default([]).describe('Project names to assign the BO to. Required for tracking project assignments.') },
- src/tools/server-businessobject-tools.ts:41-84 (registration)Registration of the 'businessobject-update' tool on the McpServer, defining name, description, input schema, metadata, and handler.const toolNameBusinessObjectUpdate = "businessobject-update" server.tool(toolNameBusinessObjectUpdate, businessObjectUpdateDescription, { name: z.string(), description: z.string(), // defaults have been removed for description, dependencies and tags, so that we can add the existing values, if the properties are // not given at all dependencies: z.array(z.object({ refType: z.enum(['connector', 'serverbusinessobject', 'plugin']).describe('Type of dependency: "connector" for data connectors, "serverbusinessobject" for other Business Objects, "plugin" for Plugins'), name: z.string().describe('name of the connector or server business object (bo) to depend on') })).describe('Array of dependencies that this BO requires. CRITICAL: Add connectors and other BOs that will be accessed from BO functions using Simplifier.Connector.<Name> or Simplifier.BusinessObject.<Name> syntax. If not provided when updating, existing dependencies will be preserved.'), tags: z.array(z.string()).describe('Array of tags for categorizing and organizing this Business Object. If not provided when updating, existing tags will be preserved.'), projectsBefore: z.array(z.string()).default([]).describe('Project names before the change. Use empty array [] when creating new BOs, or provide current projects when updating.'), projectsAfterChange: z.array(z.string()).default([]).describe('Project names to assign the BO to. Required for tracking project assignments.') }, { title: "Create or update a Business Object", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }, async ({ name, description, dependencies, tags, projectsBefore, projectsAfterChange }) => { return wrapToolResult(`create or update Business Object ${name}`, async () => { const trackingKey = trackingToolPrefix + toolNameBusinessObjectUpdate let oExisting: any; try { oExisting = await simplifier.getServerBusinessObjectDetails(name, trackingKey) } catch { } const data: SimplifierBusinessObjectDetails = { name: name, description: description, dependencies: dependencies, tags: tags, assignedProjects: { projectsBefore: projectsBefore || [], projectsAfterChange: projectsAfterChange || [] } } as SimplifierBusinessObjectDetails if (oExisting) { return simplifier.updateServerBusinessObject(data); } else { return simplifier.createServerBusinessObject(data) } }) });
- src/tools/index.ts:14-14 (registration)Top-level call to registerServerBusinessObjectTools within the main registerTools function, which includes the businessobject-update tool registration.registerServerBusinessObjectTools(server, simplifier)