Skip to content

MCP - complexity limits - make estimations more accurate - #493

Merged
damian-rakus merged 3 commits into
masterfrom
feature/damianra/optimize-estimated-complexity-for-queries
Sep 22, 2026
Merged

damian-rakus merged 3 commits into
masterfrom
feature/damianra/optimize-estimated-complexity-for-queries

Conversation

@damian-rakus

Copy link
Copy Markdown
Collaborator

Summary

Adds default limit values to GraphQL queries used by agent-toolkit MCP tools. Without an explicit limit, monday.com's estimated query complexity assumes worst-case pagination, inflating complexity estimates far beyond what the query actually costs — e.g. get_board_items_page was estimated at roughly 25x its real complexity. Passing explicit limits gives the complexity estimator accurate bounds and lets more requests succeed within the account's complexity budget.

Changes

  • Added explicit limit arguments to affected GraphQL query definitions (queries.graphql.ts and per-tool .graphql.ts files: get-board-info, get-board-items-page, get-board-activity, get-updates, create-doc, read-docs, update-doc, add-content-to-doc, fetch-file-content, full-board-data, board-insights, get-sprints-metadata)
  • Regenerated GraphQL types (gql.ts, graphql.ts)
  • Bumped agent-toolkit and monday-api-mcp package versions

Monday.com Item

https://monday.monday.com/boards/8222767873/pulses/13093993518

export const getDocByObjectId = gql`
query getDocByObjectId($objectId: [ID!]) {
docs(object_ids: $objectId) {
docs(object_ids: $objectId, limit: 1) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and below is passed as single item array in code always

export const getItemAssets = gql`
query GetItemAssets($itemId: [ID!]!, $columnId: [String!]!) {
items(ids: $itemId) {
items(ids: $itemId, limit: 1) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$itemId is populated as single item array in code

export const getDocByObjectId = gql`
query getDocIdByObjectId($objectId: [ID!]) {
docs(object_ids: $objectId) {
docs(object_ids: $objectId, limit: 1) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and below always pass single item in array

@damian-rakus
damian-rakus merged commit 8fdc0b4 into master Sep 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants