Skip to content

fix(agent-toolkit): read_docs resolves object_ids before ids - #484

Open
RoniLandau wants to merge 1 commit into
masterfrom
fix/read-docs-object-id-first
Open

fix(agent-toolkit): read_docs resolves object_ids before ids#484
RoniLandau wants to merge 1 commit into
masterfrom
fix/read-docs-object-id-first

Conversation

@RoniLandau

@RoniLandau RoniLandau commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

What

A doc is addressable by two identifiers, id and object_id, and the number exposed in the doc URL (https://<account>.monday.com/docs/5097882226) is the object_id. Callers therefore routinely pass an object_id while declaring type: "ids".

read_docs previously tried ids first and only retried as object_ids after an empty result, so the common case paid for two round trips. This flips the order so the common case resolves on the first request.

Changes

  • For type: "ids", object_ids is attempted first and ids is the fallback.
  • The local ids is renamed to doc_ids and now feeds only the fallback request; the first request sends ids: undefined. The rename is not cosmetic: the retry condition tests this variable, so while it also decided what to send first, flipping the order alone would have silently disabled the fallback. Splitting the two roles keeps "what to send first" and "is a retry eligible" independent.
  • type: "object_ids" and type: "workspace_ids" are unchanged — single request, no retry.
  • getDescription() and the type field description now state that the number in a doc URL is the object_id rather than the id, and that results carry both so callers can pass the matching one.

Compatibility

No input schema changes. No behaviour change for correctly labelled calls, beyond one extra lookup on the ids path.

Tests

tsc --noEmit is clean and all 43 tests in the suite pass. Added coverage for the lookup order, the fallback direction, and for type: "object_ids" / type: "workspace_ids" — neither of the latter two was previously exercised.

A doc is addressable by two identifiers, id and object_id, and the number
exposed in the doc URL is the object_id, so callers routinely pass an
object_id while declaring type: "ids".

For type "ids", object_ids is now attempted first with ids as the fallback,
so a mislabeled object_id resolves on the first request. The retry is keyed
on a dedicated doc_ids variable so that what to send first and whether a
retry is eligible stay independent. types "object_ids" and "workspace_ids"
are unchanged.

Descriptions now state that the number in a doc URL is the object_id, and
that results carry both identifiers.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant