Skip to main content
Glama
sap-ewm-io-agent

sap-ewm-io-agent

by toshif1234

sap-ewm-io-agent

MCP server exposing SAP EWM inventory-optimization tools to Claude: live read-only queries against confirmed EWM CDS views, plus standalone inventory-math calculators (ABC/XYZ classification, safety stock, reorder point, slow-moving detection, demand forecasting).

See ARCHITECTURE.md for the confirmed service map, known data gaps, and what's currently blocked.

Status at a glance

Tool

Status

get_stock_overview

✅ Live

get_bin_utilization

✅ Live

get_storage_type_capacity

✅ Live

get_goods_movement_history

🚫 Blocked (see ARCHITECTURE.md)

abc_xyz_classify

✅ Works standalone (needs caller-supplied value/demand data)

calc_safety_stock

✅ Works standalone

calc_reorder_point

✅ Works standalone

detect_slow_moving_stock

✅ Live on-hand qty + caller-supplied movement age

forecast_demand

✅ Works standalone

Related MCP server: SAP MCP Command Center

Setup

npm install
cp .env.example .env
# fill in SAP_USERNAME / SAP_PASSWORD in .env

Run

npm start

Test

npm test

Runs the calc/ unit test suite (29 tests, no SAP connectivity required).

Configuration

All SAP service names, entity sets, and field definitions are confirmed from live $metadata and stored in src/config/serviceMap.json — this is the single source of truth. Tool code never hardcodes a SAP field name independently of this file; src/lib/s4hClient.js validates requested fields against it and throws a clear error if a field doesn't exist, rather than silently guessing.

Available Tools

9 tools
abc_xyz_classifyA

Classifies materials by ABC (value/Pareto) and XYZ (demand variability) and returns the combined 9-cell matrix label (e.g. 'AX'). DEPENDS ON: caller-supplied { id, value } items for ABC and { id, demandSeries } items for XYZ — demand series cannot currently be sourced automatically from get_goods_movement_history, which is blocked pending CDS-view confirmation (see goodsMovementHistory.js).

Inputs: valueItems (required), demandItems (required).

calc_reorder_pointA

Calculates reorder point = (avgDemandPerPeriod * avgLeadTimePeriods) + safetyStock. DEPENDS ON: calc_safety_stock's output (or an equivalent safetyStock value) and the same demand/lead-time inputs — ultimately sourced from get_goods_movement_history, which is currently blocked (see that tool's file).

Inputs: safetyStock (required), avgDemandPerPeriod (required), avgLeadTimePeriods (required).

calc_safety_stockC

Calculates safety stock via the Z-score method (service-level driven). DEPENDS ON: demand/lead-time statistics which would normally come from get_goods_movement_history (currently blocked) — for now, pass these values directly.

Inputs: demandStdDev (required), avgDemandPerPeriod (required), avgLeadTimePeriods (required), z, +2 more.

detect_slow_moving_stockA

Flags slow-moving/dead stock by on-hand quantity vs. days-since-last-movement. Pulls on-hand quantities live from get_stock_overview for the given warehouse. DEPENDS ON: caller-supplied daysSinceLastMovement per material — this CANNOT currently be derived from get_goods_movement_history (blocked, no date field on that CDS view). Pass a movementAgeByMaterial map keyed by MaterialId.

Inputs: warehouse (required), movementAgeByMaterial (required), minOnHandQty, staleDaysThreshold.

forecast_demandA

Forecasts next-period demand via simple moving average (sma) or single exponential smoothing (ses). DEPENDS ON: a historical demand series which would normally come from get_goods_movement_history (currently blocked) — pass demandSeries directly for now.

Inputs: demandSeries (required), alpha, method, windowSize.

get_bin_utilizationA

Returns EWM bin-level utilization (block flags, distinct material count, empty flag) from the confirmed ZC_EWM_BIN_UTILIZATION_CDS view. NOTE: the raw field IsBlockedForOutbound actually blocks PUTAWAYS (inbound) per its own SAP quickinfo, and IsBlockedForInbound actually blocks STOCK REMOVALS (outbound). This tool returns both the raw fields and semantically-named aliases (isPutawayBlocked / isStockRemovalBlocked) to avoid that ambiguity.

Inputs: warehouse (required), top, storage_type.

get_goods_movement_historyA

BLOCKED. ZC_EWM_GOODS_MOVEMENT_HIST_CDS has no date field to support date_from/date_to filtering, and it is unconfirmed whether the view reads ORDIM_C (confirmed history) or ORDIM_O (open/in-progress tasks). Calling this tool currently raises an error explaining the gap rather than returning data.

Inputs: date_to (required), material (required), date_from (required), warehouse (required).

get_stock_overviewA

Returns EWM stock overview records (warehouse/storage type/bin/quantity/batch/owner) from the confirmed ZC_EWM_STOCK_OVERVIEW_CDS view. Does NOT support filtering by ERP plant or storage_location (those fields don't exist on this EWM-level view) and does NOT return any age/last-movement timestamp (none exists on this entity).

Inputs: top, plant, material, warehouse, +1 more.

get_storage_type_capacityA

Returns per-storage-type capacity utilization (bins, max/free capacity, volume, weight) for a warehouse, from the confirmed ZC_EWM_STORAGE_CAPACITY_CDS view.

Inputs: warehouse (required), top.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a distinct inventory analysis function: ABC/XYZ classification, reorder point calculation, safety stock, slow-moving detection, demand forecasting, bin utilization, stock overview, storage capacity, and goods movement history. No two tools overlap in purpose, and descriptions clearly differentiate them.

    Naming Consistency3/5

    Tool names use snake_case and are generally descriptive, but conventions vary: retrieval tools start with 'get_', calculations with 'calc_', but 'abc_xyz_classify', 'detect_slow_moving_stock', and 'forecast_demand' break this pattern. The mix is still readable but lacks a uniform verb prefix.

    Tool Count5/5

    9 tools is a well-scoped set for inventory analytics in SAP EWM. It covers core data retrieval (stock, bins, capacity) and key calculations (ABC/XYZ, safety stock, reorder point, slow-moving, forecast) without being overwhelming or too sparse.

    Completeness2/5

    The server has a critical gap: get_goods_movement_history is blocked, yet it is a dependency for demand forecasting, safety stock, reorder point, and slow-moving detection. This undermines the server's ability to function autonomously, as agents must provide external data for these tools. No write operations exist, which is acceptable for a read-only analytics agent, but the missing data source is a serious limitation.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Connects to Odoo ERP to provide comprehensive inventory analysis, including demand forecasting, ABC/XYZ classification, and stock level monitoring. It enables users to identify slow-moving items and generate turnover or aging reports through natural language queries.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables querying three synthetic SAP systems (ERP, S/4HANA, BW) for master data, transactions, and analytics via natural language or MCP tools, with a live dashboard.
      1
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Enables read-only analytics queries on Acumatica ERP data, including sales orders, inventory, shipments, invoices, purchase orders, customers, and OData generic inquiries.
      16
      -
    • F
      license
      A
      quality
      D
      maintenance
      Enables demand forecasting and replenishment recommendations using statistical models (Syntetos-Boylan classification, AutoETS, TSB) and provides tools for forecasting, evaluation, and order quantity calculation.
      6
      -