Skip to main content
Glama
parmarnaresh86

SAP Business One Order-to-Cash MCP Server

query_hana_direct

Execute read-only SQL SELECT directly against SAP Business One HANA database, bypassing Service Layer when unavailable or when complex joins and aggregations are needed.

Instructions

Run a read-only SQL SELECT directly against a SAP B1 HANA database, bypassing Service Layer entirely. Use this when Service Layer is unavailable/misconfigured, or when a question needs a join/aggregation across tables that's awkward via OData. Requires HANA_HOST, HANA_PORT, HANA_USER, HANA_PASSWORD (and HANA_TENANT for a multi-tenant/MDC system) to be set in this connector's environment — if not configured, this tool will error saying so. This is a single tenant-DB connection that can see every company's schema — table names MUST be fully qualified as "SCHEMA_NAME"."TABLE_NAME" (HANA identifiers are double-quoted and case-sensitive), e.g. SELECT * FROM "JKL_LIVEDB"."OCRD". If you don't already know the exact schema name for a company, call list_hana_schemas first rather than guessing. Only SELECT statements are allowed; anything else is rejected.

SAP Business One key tables (T-SQL / MSSQL):

SALES & QUOTATIONS: OQUT(DocEntry,DocNum,CardCode,CardName,SlpCode,DocDate,DocDueDate,DocTotal,GrossProfit,DocStatus,Comments) QUT1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode,GrssProfit) ORDR(DocEntry,DocNum,CardCode,CardName,SlpCode,DocDate,DocDueDate,DocTotal,GrossProfit,DocStatus,Comments) RDR1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode,GrssProfit)

AR INVOICES & DELIVERY: OINV(DocEntry,DocNum,CardCode,CardName,SlpCode,DocDate,DocDueDate,DocTotal,GrossProfit,PaidToDate,DocStatus) INV1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode,GrssProfit) ODLN(DocEntry,DocNum,CardCode,CardName,DocDate,DocTotal,DocStatus) DLN1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode) ORIN(DocEntry,DocNum,CardCode,CardName,DocDate,DocTotal,DocStatus) RIN1(DocEntry,LineNum,ItemCode,Dscription,Quantity,LineTotal,WhsCode)

PURCHASING: OPQT(DocEntry,DocNum,CardCode,CardName,DocDate,DocTotal,DocStatus) PQT1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode) OPOR(DocEntry,DocNum,CardCode,CardName,DocDate,DocDueDate,DocTotal,DocStatus) POR1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode) OPDN(DocEntry,DocNum,CardCode,CardName,DocDate,DocTotal,DocStatus) PDN1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode) OPCH(DocEntry,DocNum,CardCode,CardName,DocDate,DocDueDate,DocTotal,DocStatus) PCH1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode)

INVENTORY: OITM(ItemCode,ItemName,ItmsGrpCod,InvntItem,SellItem,PrchseItem,OnHand,IsCommited,OnOrder,LastPurPrc,AvgPrice) OITW(ItemCode,WhsCode,OnHand,IsCommited,OnOrder) OWHS(WhsCode,WhsName,Street,City) OITB(ItmsGrpCod,ItmsGrpNam)

BUSINESS PARTNERS: OCRD(CardCode,CardName,CardType,GroupCode,Phone1,E_Mail,CntctPrsn,Balance,SlpCode,Territory) OSLP(SlpCode,SlpName,Memo,Commission,Phone,Email) OCRG(GroupCode,GroupName,GroupType)

FINANCE: OJDT(TransId,TransType,RefDate,Memo,Ref1,Ref2,Ref3,CreatedBy) JDT1(TransId,Line_ID,Account,Debit,Credit,SYSDebit,SYSCredit,FCDebit,FCCredit,RefDate,LineMemo,ContraAct) OACT(AcctCode,AcctName,GroupMask,ActType,Blocked,CurrTotal,LocTotal)

STATUS CODES: DocStatus = 'O' (Open) | 'C' (Closed) | 'W' (Cancelled) CardType: 'C' (Customer) | 'S' (Supplier) | 'L' (Lead)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesA single SQL SELECT statement with fully schema-qualified table names, e.g. SELECT TOP 5 "CardCode","CardName" FROM "JKL_LIVEDB"."OCRD"
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: read-only SELECT-only enforcement, required HANA_* environment variables, the error if they are missing, the single-tenant multi-company visibility, and double-quoted case-sensitive schema qualification. It also discloses that non-SELECT statements are rejected, which is important behavioral context.

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?

The definition is well front-loaded with purpose, usage, requirements, and constraints before the table reference. It is long, but the table earns its place for a SQL query tool; the main structural flaw is the slightly mismatched T-SQL / MSSQL heading on a HANA tool and some redundancy in the table block.

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

Completeness4/5

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

It covers prerequisites, error behavior, schema discovery, and key table metadata, so an agent can invoke it correctly. It stops short of saying what the tool returns or whether result sets are limited, and with no output schema those details would round out the otherwise strong context.

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

Parameters5/5

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

The schema only provides a short example for query, but the description adds substantial meaning: mandatory fully qualified schema.table names, HANA double-quoting and case sensitivity, the SELECT-only constraint, and a large curated reference of SAP B1 table names and key columns. This is far more than the input schema alone provides.

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

Purpose4/5

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

The description opens with a specific action and resource: running a read-only SQL SELECT directly against an SAP B1 HANA database and bypassing Service Layer. It is clear about the target and mode, but it never explicitly contrasts this tool with sibling query_sql_direct, so an agent may need to infer the HANA-vs-SQL-database boundary.

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

Usage Guidelines4/5

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

It gives explicit triggers: use when Service Layer is unavailable or misconfigured, or when an OData join/aggregation is awkward, and it tells the agent to call list_hana_schemas first if the schema is unknown. However, it does not state when not to use direct SQL or mention query_sql_direct as an alternative, leaving the choice between the two direct-query siblings implicit.

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

Install Server

Other Tools

Latest Blog Posts

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/parmarnaresh86/AgentSphere-MCP'

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