web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Dataverse MCP Server R...
Copilot Studio
Suggested Answer

Dataverse MCP Server Read Query 20 row limit

(1) ShareShare
ReportReport
Posted on by 69
Dataverse MCP Server read_query tool currently only returns max or 20 rows even when the query requests more.  This is a ridiculous limit for almost any use case!
Is there a way to increase this limit?
If not, is it on the roadmap? 
I have many use cases for using this MCP Server so it would a great benefit to be able to control this for use cases that require it.
  • Suggested answer
    Romain The Low-Code Bearded Bear Profile Picture
    2,898 Super User 2026 Season 2 on at
    the limit is a problem i agree, ATM without using external tool, you coul try with the prompt tool it has dataverse capacity and in the settings in the prompt windows you could change to thousand of element for the query. it's a workaround but it could work (but add a lot of complexity, you have to route all question wich need datataverse to you'r prompt tool)
  • Assisted by AI
    Ethan_009 Profile Picture
    4,840 Moderator on at
     

    The cap of 20 records is real and unfortunately as of today it isn't configurable. If you ask for more, you get a hard error rather than a partial result:

    SELECT TOP 25 name FROM account
    -- Requested TOP 25 exceeds the maximum of 20 records.

    Although, there's a potential solution that can help you.

    The thing that made it click for me: the cap is on the rows that come back, not on the rows the query looks at. The filtering and the maths still happen server side across the whole table. So if you shape your query so the answer is small, the cap never touches you.

    Example of how I made it work:

    Use-case: I wanna know how many active accounts we have, and how they split by status.

    Instead of pulling the records and counting them myself, I let Dataverse do the counting:

    SELECT COUNT(accountid) AS total FROM account WHERE statecode = 0
     

    That comes back as a single row with the correct number, even when the table has thousands of rows. Same for a breakdown:

    SELECT statecode, COUNT(accountid) AS c FROM account GROUP BY statecode
     

    Two rows out, both correct. The cap is irrelevant because the answer was only ever going to be small.

    One trap worth knowing about, because it caught me out. The 20 row cap applies to grouped rows too. I ran a GROUP BY on a date column and got back 20 groups that all happened to be the oldest ones in the table. No error, no warning. It just looked like a complete answer and wasn't. So GROUP BY is safe when the column has few distinct values (status, type, owner). It quietly lies when the column has many (dates, names, IDs). If you must group on something high cardinality, add an ORDER BY so at least you control which 20 you see.

    If you genuinely need the full list, not an answer, there's no OFFSET so you can't page through it. What worked for me was windowing:

    1. Run a COUNT first so you know the real total.

    2. Pull 20 with an ORDER BY on a date column.

    3. Note the oldest date you got back, then run again with that date as the upper bound.

    4. Repeat until the rows you've collected add up to the COUNT.

    The COUNT is the important bit. It's what tells you when you're actually finished, instead of guessing.

    Honestly though, for most agent scenarios I'd avoid step 2 onward entirely. If you're asking an agent a question, let SQL do the aggregation and return a small answer. The 20 row cap only really hurts when you're using the MCP server as a data extractor rather than a question answerer.

     

    Hope that helps. 👍🏻

    AI-Assisted: I have used AI to run Dataverse MCP against queries for retrieving records and validate the results. Also, simply formatted my message with AI.

  • Suggested answer
    Mohsin Ali Profile Picture
    1,075 on at
    Hello @donniekerr - Your observation is correct. The design behind the read_query tool is mainly to help the agent retrieve structured Dataverse data and reason over a specific scenario.

    For example:

    • How many active cases exist by priority?

    • Show me accounts that don't have a primary contact.

    For bulk data extraction, I would prefer using the Dataverse Web API, Custom APIs, or a similar integration approach. That gives you much better control over the query, pagination, volume, and how the returned data is processed.


  • Suggested answer
    M Bilal Khan Profile Picture
    384 on at

    I believe the 20-row behavior is a limitation of the current Dataverse MCP read_query implementation rather than the Dataverse table itself.

    If you need more than 20 records, one approach is to handle the query in pages instead of trying to return the entire result set in a single MCP call. For example, use an appropriate filter/order-by together with pagination so the agent retrieves the next set of records when required.

    For MCP scenarios, this is generally safer anyway because returning a very large result set can quickly consume the model's context window.

    That said, I agree that having a configurable page size or a documented way to control the maximum number of rows would be useful for scenarios such as reporting, aggregation, and data analysis.

    If the 20-row limit is enforced specifically by the current MCP read_query tool, rather than by the underlying Dataverse Web API, then increasing it would require_

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Copilot Studio

#1
Mohsin Ali Profile Picture

Mohsin Ali 356

#2
Valantis Profile Picture

Valantis 253 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 179 Super User 2026 Season 2

Last 30 days Overall leaderboard