Skip to content
  • There are no suggestions because the search field is empty.

Find data products and write SQL with Claude

Applies to
License: Enterprise · Data Marketplace · MCP Server

Ask Claude a business question, and it finds the matching data products in the Data Marketplace and writes SQL for their output ports. Use it when you need a query or a report over data products. Afterwards you have SQL, checked against the data contracts, that your own tool or agent runs on your database.

The MCP server never runs the query: it knows neither your database server nor your schema.

Prerequisites

Find a data product and get SQL

  1. Ask your question in business terms, for example how many customers live in each city. Claude calls search_data_products and selects the data products that match.
  2. Read the answer. Claude names the output port that fits, what it contains and what is missing for your question; it reads them with get_data_product.
  3. Ask for the SQL. Claude calls get_query_context and writes the SQL in the dialect of the output port's platform, with only the tables and columns of the newest active data contract.
  4. Read the notes that come with the SQL. Claude checks it with check_query and points out unknown tables or columns, columns with a data classification, and historized objects without a validity filter.
  5. Pass the hand-over block to the tool or agent that runs the query. The block holds the SQL, the platform, the data products and output ports with their data contract versions, the tables, and the classified columns.
  6. Have the placeholder {{schema}} replaced with the schema where the output port is deployed in your environment, then run the query. Ask the owner of the data product when you do not know the schema.

How Claude writes the SQL

  • Tables are written as {{schema}}.<table>, because biGENIUS-X does not know where the data product is deployed.
  • For a historized object, the current version is the row whose validity range contains the current time.
  • A fact joins a historized dimension over its surrogate key without a current-version filter, so the fact gets the version that was valid at its time.
  • Output ports on different platforms cannot be joined in one query. Claude writes a separate query per platform.
  • Data contracts do not name the targets of foreign keys. The server derives them from the column names, and Claude tells you when a join depends on such a derived key. Check those joins with the owner of the data product.

Example

Example: a data product Customer Accounts on Microsoft SQL Server, with the historized dimension DimCustomer and the validity columns BG_ValidFromTimestamp and BG_ValidToTimestamp. In a real data contract, table and column names come from its project.

How many customers live in each city today?
Write the SQL for the Customer Accounts data product.

Claude returns SQL of this shape, together with a hand-over block:

SELECT c.City, COUNT(*) AS CustomerCount
FROM {{schema}}.DimCustomer AS c
WHERE c.BG_ValidFromTimestamp <= CURRENT_TIMESTAMP
  AND c.BG_ValidToTimestamp > CURRENT_TIMESTAMP
GROUP BY c.City

The filter keeps the current version of each customer, so every customer is counted once, in the city where they live today. Without it, a customer who moved would be counted once per historized version.

Check the result

The SQL runs in your tool after you replace {{schema}}, and the notes of check_query name no unknown table or column.

Failure symptoms and recovery

Claude finds no matching data product

Cause: no data product of your organization matches the question, or a new data product is not visible yet. The server keeps the list of data products for up to 5 minutes and data contracts for up to 30 minutes.
Fix: rephrase the question with the business terms of the data products, or ask again after that time.

An output port cannot be queried

Message: Output port <output port> of <data product> has no active data contract and cannot be queried yet.
Cause: the output port has no data contract with status Active.
Fix: ask the owner of the data product to activate a data contract.

Sign-in and license errors are in MCP server troubleshooting.

Related articles