IBM Cloud Docs
Querying data with the MCP tool

Querying data with the MCP tool

After configuration with AI agents, you can interact with your watsonx.data instance through natural language conversations with your agent.

Verifying connectivity

Verify that the MCP server can successfully connect to your watsonx.data instance.

Procedure:

  1. Open your configured agent (Claude Desktop or IBM Bob).

  2. Submit the following query:

    What is my watsonx.data instance status?
    

Expected result: The agent returns information about your instance, including version, status, and available engines.

Exploring available data

Discover the schemas and tables available in your watsonx.data instance.

Procedure:

  1. To list available schemas:

    What schemas are available in my watsonx.data instance?
    
  2. To explore a specific schema:

    What tables exist in the tpch catalog?
    

Expected result: The agent returns a list of available schemas or tables.

Examining table structures

View the structure and metadata of a specific table.

Procedure:

  1. Submit a query in the following format:

    
    Describe the [table_name] table in [schema_name]
    

    Example:

    Describe the customer table in tpch.tiny
    

Expected result: The agent returns column names, data types, and table properties.

Querying data

Execute SQL SELECT queries to retrieve data from your lakehouse.

Only SELECT queries are permitted. Attempts to execute INSERT, UPDATE, DELETE, or other data modification statements will be rejected.

Procedure:

Submit queries using either natural language or SQL syntax:

  • Natural language example:

    Show me the top 10 customers by account balance
    
  • SQL syntax example:

    SELECT * FROM tpch.tiny.customer LIMIT 10
    

Expected result: The agent executes the query and presents results in a formatted table.