feat(agent-toolkit): support docOwnerIds in create_doc tool#338
Merged
Conversation
5f0b819 to
a0b5d9c
Compare
|
Several of the changed files ( |
SergeyRoyt
approved these changes
May 17, 2026
a5209fc to
11762aa
Compare
6b48aef to
559b9c0
Compare
Same fix as create_board (PR #335): when an agent creates a doc, the agent owner has no access due to permission constraints (agent permissions always intersect with owner permissions). Exposing board_owner_ids at creation time bypasses these checks, allowing the agent owner to be added as a co-owner. Changes: - create-doc-tool.ts: add optional docOwnerIds field to schema - create-doc-tool.graphql.ts: pass $docOwnerIds → board_owner_ids in mutation - graphql.ts: add docOwnerIds to CreateDocMutationVariables type - create-doc-tool.test.ts: add tests for with/without docOwnerIds
…chema board_owner_ids is not exposed on create_doc in the monday.com GraphQL API (confirmed via codegen validation against live schema). Removing docOwnerIds from the tool and mutation until the platform team adds the field to the schema. The create_board pattern (PR #335) works because board_owner_ids IS on create_board. Next step: coordinate with docs/platform team to add board_owner_ids to create_doc. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Exposes board_owner_ids on create_doc mutation following the same pattern as create_board (PR #335). Agents can now pass docOwnerIds to add the agent owner as co-owner at creation time, bypassing the permission intersection constraint that blocks subsequent add_users_to_board calls. - Add board_owner_ids to create_doc in both default and dev schemas - Update createDoc mutation to include $docOwnerIds variable - Regenerate types (CreateDocMutationVariables now has docOwnerIds) - Add docOwnerIds to createDocToolSchema with description - Spread docOwnerIds into workspace doc creation variables Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ncy with create_board Matches the naming pattern from PR #335 (create_board): the GraphQL variable and TypeScript parameter both use boardOwnerIds, which maps to board_owner_ids on the platform API. Docs are boards internally — naming it boardOwnerIds makes the connection explicit and consistent. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
More semantic for a doc creation tool — the user is creating a doc, not a board. board_owner_ids at the GraphQL API level stays unchanged (docs are boards internally — that's not something we can rename). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…x stale test references - Item-attached doc path now forwards boardOwnerIds to board_owner_ids, matching the workspace path. Without this, agents creating item docs still hit the permission intersection bug (owner has no access → agent can't operate on it). - Fix stale docOwnerIds → boardOwnerIds in tests - Add test covering boardOwnerIds forwarding for item location Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ot provided' test
0213c76 to
02ac7dc
Compare
- Fix describe() referencing add_users_to_board → add_subscribers_to_object - Add doc_name to all getDescription() usage examples - Document docOwnerIds as optional in LOCATION TYPES for both workspace and item - Fix workspace docOwnerIds tests to use jest.spyOn pattern - Add validation test for empty docOwnerIds array (min 1) - Update assertions to toEqual(expect.objectContaining(...)) Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://monday.monday.com/boards/3713040192/pulses/11854345358
Summary
Add optional
docOwnerIdsinput to thecreate_doctool schema — same pattern as PR #335 did forcreate_board.Problem
When a personal agent creates a doc, it becomes the doc owner — but it cannot subsequently add the agent owner as a subscriber/member. The reason: the platform performs a dual permission check (
agent_permission ∩ agent_owner_permission). Since the agent owner has no access to the newly created doc, this intersection is empty and the invite is blocked.Fix
The
create_doc(board) creation mutation supports passingboard_owner_idsas input. Ownership subscription happens inside the mutation itself, bypassing the permission checks that would block a subsequent call. By exposing this parameter in the MCP tool, agents can add the agent owner as a co-owner at creation time.Changes
create-doc-tool.ts— add optionaldocOwnerIds: string[]field to the tool schemacreate-doc-tool.graphql.ts— pass$docOwnerIds→board_owner_idsin thecreateDocmutationgraphql.ts— adddocOwnerIdstoCreateDocMutationVariablestype (mirrors how PR feat(agent-toolkit): support owners in create_board tool #335 updatedCreateBoardMutationVariables)create-doc-tool.test.ts— tests for with/withoutdocOwnerIdsUsage
{ "location": "workspace", "workspace_id": 123, "doc_name": "My Doc", "markdown": "# Hello", "docOwnerIds": ["<agent_owner_user_id>"] }Note
npm run codegenshould be run to regenerate types from the live schema and verify thatboard_owner_idsis accepted by thecreate_docmutation. Thegraphql.tschange was made manually following the same pattern as PR #335.References
🤖 Generated with Claude Code