cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Generative AI
Explore discussions on generative artificial intelligence techniques and applications within the Databricks Community. Share ideas, challenges, and breakthroughs in this cutting-edge field.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

DBSQL MCP output limit

Manas2000
New Contributor

Hi, Databricks Champions 

I am using SQL MCP server. I was able to connect to MCP and run my sql queries. However as my query out goes above 32,768 it gets truncated and I am not able to get the complete output. 

I can only pass warehouse_id in "_meta" parameters while making connection. There is no way for me to configure row_limit. 

poll โ†’ state='SUCCEEDED'

Final state: SUCCEEDED

โ”€โ”€ MANIFEST (excl. schema) โ”€โ”€
{
"format": "PROTOBUF_ARRAY",
"total_chunk_count": 1,
"chunks": [
{
"chunk_index": 0,
"row_offset": 0,
"row_count": 32768,
"byte_count": 1860920
}
],
"total_row_count": 32768,
"total_byte_count": 1860920,
"truncated": true
}

โ”€โ”€ RESULT keys โ”€โ”€
['chunk_index', 'row_offset', 'row_count', 'data_typed_array']

It's literally giving me a single chunk only (with truncated = True) and there is no way for me to get the further data because chunks are not given to me. 

Has anyone encountered this limitation with the SQL MCP Server? Is there a supported way to:

  1. Increase the result row limit?
  2. Configure pagination/chunking?
  3. Retrieve the rows beyond the 32,768-row cutoff?

Any guidance would be greatly appreciated.

Thanks

1 REPLY 1

frankieseabrook
New Contributor

HI @Manas2000 ,

This appears to be a Databricks SQL MCP limitation, not a Databricks SQL warehouse limitation.

A hacky workaround might be to manually paginate in SQL, e.g., with `ROW_NUMBER()` or `LIMIT/OFFSET`, and run separate MCP calls for each page.

But candidly for large result extraction, MCP is the wrong tool. You could use the Databricks Statement Execution API directly with chunking or `EXTERNAL_LINKS`.

Hope that helps.

AI/BI Consultant | Databricks, Power BI, Genie, Metric Views, Unity Catalog
Focused on governed, business-ready analytics and practical lakehouse adoption.