Skip to main content
Glama
DimiDR

SAP Datasphere MCP Server

by DimiDR

create_table

Create a local table in a SAP Datasphere space with defined columns, primary keys, and deployment options. Supports provisioning for data ingestion, staging, or modelling.

Instructions

Create a new local table in a SAP Datasphere space.

IMPORTANT: This is a HIGH-RISK, WRITE operation. It creates a design-time object and (optionally) deploys it, which changes the state of the tenant. Requires user consent.

Use this tool when:

  • User asks: "Lege eine Tabelle X in Space Y an" / "Create a table for orders in DIMITRITEST"

  • Provisioning new local tables for data ingestion, staging, or modelling

  • Bootstrapping schemas from a specification (name + columns)

What it does:

  1. Builds a Datasphere object definition (CSN-style JSON) from your column list

  2. Writes it to a temporary file

  3. Calls the Datasphere CLI: datasphere objects local-tables create --space <id> --file-path <def.json> (the table name comes from the definitions key in the JSON, not from a flag)

  4. The CLI deploys the object by default so it becomes queryable; deploy=false adds --no-deploy

  5. Returns the created table metadata

Required parameters:

  • space_id: Target space (must exist, uppercase, e.g., 'DIMITRITEST')

  • table_name: Technical name (uppercase, alphanumeric + underscore, e.g., 'BESTELLUNGEN')

  • columns: Array of column definitions

Column definition format:

{
  "name": "BESTELL_ID",          // required, uppercase
  "type": "NVARCHAR",            // required: NVARCHAR|VARCHAR|INTEGER|BIGINT|DECIMAL|DOUBLE|DATE|TIMESTAMP|BOOLEAN|NCLOB
  "length": 20,                  // for NVARCHAR/VARCHAR
  "precision": 15,               // for DECIMAL
  "scale": 2,                    // for DECIMAL
  "nullable": false,             // default true
  "description": "Order ID"      // optional
}

Optional parameters:

  • primary_keys: Array of column names that form the primary key (e.g., ["BESTELL_ID"])

  • label: Business-friendly display name (e.g., "Bestellungen")

  • description: Description of the table's business purpose

  • deploy: If true (default), deploy the table immediately after creation so it can be queried

Example call (Bestellungen):

{
  "space_id": "DIMITRITEST",
  "table_name": "BESTELLUNGEN",
  "label": "Bestellungen",
  "description": "Kundenbestellungen mit Positionen",
  "primary_keys": ["BESTELL_ID"],
  "columns": [
    {"name": "BESTELL_ID",   "type": "NVARCHAR", "length": 20, "nullable": false},
    {"name": "KUNDEN_ID",    "type": "NVARCHAR", "length": 20, "nullable": false},
    {"name": "BESTELLDATUM", "type": "DATE"},
    {"name": "PRODUKT_ID",   "type": "NVARCHAR", "length": 20},
    {"name": "MENGE",        "type": "INTEGER"},
    {"name": "EINZELPREIS",  "type": "DECIMAL", "precision": 15, "scale": 2},
    {"name": "GESAMTBETRAG", "type": "DECIMAL", "precision": 15, "scale": 2},
    {"name": "WAEHRUNG",     "type": "NVARCHAR", "length": 3},
    {"name": "STATUS",       "type": "NVARCHAR", "length": 20}
  ],
  "deploy": true
}

Prerequisites (real mode):

  • Datasphere CLI installed and available on PATH (datasphere --version)

  • User logged in to the CLI (datasphere login)

  • User has DW Space Administrator or Modeler role in the target space

Mock mode (USE_MOCK_DATA=true):

  • No CLI call is made

  • Returns a simulated success response with the generated object definition

  • Perfect for testing prompts before running against a real tenant

Security & Safety:

  • Table name is validated to prevent injection (must match ^[A-Z][A-Z0-9_]*$)

  • Column names are validated identically

  • Data types are checked against a whitelist

  • HIGH-RISK: requires consent, all actions are audit-logged

  • Idempotency: fails if the table already exists (use datasphere objects local-tables update / delete first)

Note: Corresponds to CLI: datasphere objects local-tables create --space <id> --file-path <def.json> [--no-deploy]

Only local tables. This is the one object type the server creates, because the payload is derived from data it has already read. Views, analytic models, flows, task chains, spaces, users and roles are CLI territory — see docs/MCP_VS_CLI.md. Do not try to reshape this tool's CSN into another type.

Canonical CSN shape: the generated definition follows examples/local-table-orders.json and Appendix E of the datasphere-cli skill (DataphereCLI repo). That example is not just a reference — tests/test_csn_shape.py derives this tool's arguments from it and compares the result back, so the two cannot drift apart. If the CLI ever rejects the payload, compare against the example rather than guessing.

Column names must be UPPERCASE (^[A-Z][A-Z0-9_]*$). The minimal SAP Help example uses a mixed-case Name, which this tool rejects on purpose: uppercase matches the Open SQL schema convention and needs no quoting in later queries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelNoBusiness-friendly display label (e.g., 'Bestellungen').
deployNoIf true (default), deploy the table immediately after creation so it can be queried.
columnsYesColumn definitions. Each entry: {name, type, [length], [precision], [scale], [nullable], [description]}.
space_idYesTarget space ID in UPPERCASE (e.g., 'DIMITRITEST', 'SALES_ANALYTICS').
table_nameYesTechnical table name (uppercase, alphanumeric + underscore). Must match ^[A-Z][A-Z0-9_]*$.
descriptionNoBusiness description of the table's purpose.
primary_keysNoList of column names forming the primary key (e.g., ['BESTELL_ID']).
Behavior5/5

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

With no annotations provided, the description carries the full burden and delivers richly: it labels the operation high-risk and write, requires consent, mentions audit logging, deploy behavior by default, mock mode, validation rules, injection prevention, and idempotency (fails if table exists).

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 description is long but well-structured with headers, bullet points, and code blocks. Each section (parameters, example, prerequisites, mock mode, security) earns its place, though some redundancy (e.g., repeated CLI command) could be trimmed.

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?

The description covers prerequisites, mock mode, security, and examples robustly. The only gap is that it merely states 'Returns the created table metadata' without detailing the response structure, and since there is no output schema, slightly more specificity would be helpful.

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?

Although schema coverage is 100%, the description adds substantial meaning beyond the schema: a full column JSON format with allowed types, defaults, regex validation, optional parameters explained, and a complete worked example. This goes well beyond the baseline for high coverage.

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?

The description clearly states it creates a new local table in a SAP Datasphere space, with a specific verb and resource. It also distinguishes this tool from siblings by noting that views, analytic models, and other object types are CLI territory, not this tool's scope.

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?

Provides explicit when-to-use guidance, including concrete user queries ('Lege eine Tabelle X in Space Y an'), provisioning use cases, and prerequisites for real mode. It also warns against using this tool for other object types and directs to docs for those cases.

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/DimiDR/SAP-Datasphere-MCP'

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