Skip to main content
Glama
bersimao

b1-mcp-server for SAP B1

execute_service_layer_write

Executes guarded OData PATCH, POST, or DELETE writes to the connected SAP Business One Service Layer database after profile and approval checks.

Instructions

Execute a guarded OData write (PATCH, POST or DELETE) against the currently connected SAP Business One Service Layer. These are real writes to the company database.

The verb must be in the connected profile's slAllowedMethods, and database must equal the connected Service Layer database exactly — connect_database prints both. A mismatch is denied.

Approval follows the profile's slWriteApproval, also printed by connect_database. "elicitation" (default): the server asks the user through an MCP approval form; clients without form elicitation cannot write. "client" or "none": the server executes after this client's own permission prompt, honoured only for Claude Code. On a "none" profile, prefer execute_service_layer_write_unattended, which does the same write without any approval; use this tool there only when the user asks to confirm the write. MCP_DRY_RUN previews but never executes a write, and MCP_SL_WRITES_ENABLED=false disables every write globally.

PATCH and DELETE accept one directly keyed entity endpoint only. POST accepts an entity set, a service operation, or one action on a keyed entity (Orders(12)/Close). Query options, navigation paths, absolute URLs, Login/Logout and $batch are denied.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesRelative OData endpoint without the configured /b1s/v1/ or /b1s/v2/ root
bodyNoJSON object: required and non-empty for PATCH, optional for POST, forbidden for DELETE
methodYesMust also be allowed by the connected profile's slAllowedMethods
databaseYesConnected company database exactly as connect_database prints it; shown to the approver and checked by the server

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.1

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full burden and does so: it warns these are real database writes, describes the exact denial condition for method/database mismatch, explains the three approval paths and which clients honour them, and enumerates denied endpoint shapes (query options, navigation, $batch, Login/Logout). This is far beyond what the schema conveys.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense paragraphs, front-loaded with the verb and the write warning, then gating rules, then endpoint restrictions. Almost every sentence carries a constraint, though the approval-mode enumeration is long enough that a bulleted form would scan faster.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a high-risk, four-parameter mutation tool with no annotations and no output schema, the description covers permissions, database matching, approval routing, dry-run and global kill switches, and accepted endpoint shapes. The only omission is error/response semantics, which is minor for a write operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real constraints the schema does not: method must be in the profile's slAllowedMethods, database must equal the connected Service Layer database exactly, and PATCH/DELETE accept only one keyed entity endpoint while POST accepts a set, operation, or single action. Body optionality is already covered by the schema, so it is not a full 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (execute) and resource (guarded OData write: PATCH/POST/DELETE against the SAP B1 Service Layer) and immediately scopes it as real company-database writes. It is clearly distinguishable from the read-oriented execute_service_layer sibling and from execute_service_layer_write_unattended, which it names directly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says when writes are permitted (verb in slAllowedMethods, database must match connect_database exactly), how approval behaves per slWriteApproval mode, and when to prefer execute_service_layer_write_unattended over this tool. It also names MCP_DRY_RUN and MCP_SL_WRITES_ENABLED=false as global gates, leaving nothing to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.