From a4ca07996f8329a52b8a22343e9247bfeea84cce Mon Sep 17 00:00:00 2001 From: noa reuven Date: Thu, 7 May 2026 16:54:08 +0300 Subject: [PATCH 01/14] feat(agent-toolkit): support docOwnerIds in create_doc tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../create-doc-tool.graphql.ts | 4 +- .../create-doc-tool/create-doc-tool.test.ts | 55 +++++++++++++++++++ .../create-doc-tool/create-doc-tool.ts | 10 +++- .../generated/graphql/graphql.ts | 1 + 4 files changed, 67 insertions(+), 3 deletions(-) diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts index 53010eea..c9e95e56 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts @@ -18,8 +18,8 @@ export const getItemBoard = gql` // Create a new monday doc (works for both workspace and board/item locations via CreateDocInput) export const createDoc = gql` - mutation createDoc($location: CreateDocInput!) { - create_doc(location: $location) { + mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) { + create_doc(location: $location, board_owner_ids: $docOwnerIds) { id object_id url diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts index 7c08e8c4..e73daac6 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts @@ -190,6 +190,61 @@ describe('CreateDocTool', () => { }); }); + describe('docOwnerIds', () => { + it('includes docOwnerIds in variables when provided', async () => { + const createDocResponse = { + create_doc: { id: 'doc_owners', object_id: 'obj_owners', url: 'https://monday.com/docs/obj_owners', name: 'Owners Doc' }, + }; + const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; + + mocks.getMockRequest().mockImplementation((query: string) => { + if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); + if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); + return Promise.resolve({}); + }); + + const args: inputType = { + location: 'workspace', + workspace_id: 12345, + doc_name: 'Owners Doc', + markdown: '# Test', + docOwnerIds: ['111', '222'], + }; + + await callToolByNameRawAsync('create_doc', args); + + const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); + expect(createDocCall).toBeDefined(); + expect(createDocCall[1]).toMatchObject({ docOwnerIds: ['111', '222'] }); + }); + + it('does not include docOwnerIds in variables when not provided', async () => { + const createDocResponse = { + create_doc: { id: 'doc_no_owners', object_id: 'obj_no_owners', url: 'https://monday.com/docs/obj_no_owners', name: 'No Owners Doc' }, + }; + const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; + + mocks.getMockRequest().mockImplementation((query: string) => { + if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); + if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); + return Promise.resolve({}); + }); + + const args: inputType = { + location: 'workspace', + workspace_id: 12345, + doc_name: 'No Owners Doc', + markdown: '# Test', + }; + + await callToolByNameRawAsync('create_doc', args); + + const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); + expect(createDocCall).toBeDefined(); + expect(createDocCall[1]).not.toHaveProperty('docOwnerIds'); + }); + }); + describe('Validation Errors', () => { it('should return error when workspace_id is missing', async () => { const args: Partial = { diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts index 1469c2d7..62f2f34f 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts @@ -54,6 +54,12 @@ export const createDocToolSchema = { location: z .enum(['workspace', 'item']) .describe('Location where the document should be created - either in a workspace or attached to an item'), + docOwnerIds: z + .array(z.string()) + .optional() + .describe( + 'Optional list of user IDs to set as document owners at creation time. Use this to add the agent owner as a co-owner so they retain access to the document. Ownership is set inside the creation mutation itself, bypassing the permission checks that would block a subsequent add_users_to_board call.', + ), workspace_id: z .number() @@ -104,7 +110,8 @@ LOCATION TYPES: USAGE EXAMPLES: - Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." } - Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." } -- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }`; +- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." } +- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, markdown: "...", docOwnerIds: [""] }`; } getInputSchema(): typeof createDocToolSchema { @@ -139,6 +146,7 @@ USAGE EXAMPLES: folder_id: parsedInput.folder_id?.toString(), }, }, + ...(input.docOwnerIds !== undefined ? { docOwnerIds: input.docOwnerIds } : {}), }; const res: CreateDocMutation = await this.mondayApi.request(createDocMutation, variables); diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts index df9ccb53..b34b447f 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts @@ -11540,6 +11540,7 @@ export type GetItemBoardQuery = { __typename?: 'Query', items?: Array<{ __typena export type CreateDocMutationVariables = Exact<{ location: CreateDocInput; + docOwnerIds?: InputMaybe | Scalars['ID']['input']>; }>; From 74807226e60871bd6cb8c956e99fa2891abfa2c9 Mon Sep 17 00:00:00 2001 From: noa reuven Date: Sun, 10 May 2026 11:07:04 +0300 Subject: [PATCH 02/14] =?UTF-8?q?fix(create-doc):=20remove=20board=5Fowner?= =?UTF-8?q?=5Fids=20=E2=80=94=20not=20yet=20in=20create=5Fdoc=20API=20sche?= =?UTF-8?q?ma?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../create-doc-tool.graphql.ts | 4 +- .../create-doc-tool/create-doc-tool.test.ts | 55 ------------------- .../create-doc-tool/create-doc-tool.ts | 11 +--- .../generated/graphql/graphql.ts | 1 - 4 files changed, 3 insertions(+), 68 deletions(-) diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts index c9e95e56..53010eea 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts @@ -18,8 +18,8 @@ export const getItemBoard = gql` // Create a new monday doc (works for both workspace and board/item locations via CreateDocInput) export const createDoc = gql` - mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) { - create_doc(location: $location, board_owner_ids: $docOwnerIds) { + mutation createDoc($location: CreateDocInput!) { + create_doc(location: $location) { id object_id url diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts index e73daac6..7c08e8c4 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts @@ -190,61 +190,6 @@ describe('CreateDocTool', () => { }); }); - describe('docOwnerIds', () => { - it('includes docOwnerIds in variables when provided', async () => { - const createDocResponse = { - create_doc: { id: 'doc_owners', object_id: 'obj_owners', url: 'https://monday.com/docs/obj_owners', name: 'Owners Doc' }, - }; - const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; - - mocks.getMockRequest().mockImplementation((query: string) => { - if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); - if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); - return Promise.resolve({}); - }); - - const args: inputType = { - location: 'workspace', - workspace_id: 12345, - doc_name: 'Owners Doc', - markdown: '# Test', - docOwnerIds: ['111', '222'], - }; - - await callToolByNameRawAsync('create_doc', args); - - const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); - expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).toMatchObject({ docOwnerIds: ['111', '222'] }); - }); - - it('does not include docOwnerIds in variables when not provided', async () => { - const createDocResponse = { - create_doc: { id: 'doc_no_owners', object_id: 'obj_no_owners', url: 'https://monday.com/docs/obj_no_owners', name: 'No Owners Doc' }, - }; - const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; - - mocks.getMockRequest().mockImplementation((query: string) => { - if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); - if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); - return Promise.resolve({}); - }); - - const args: inputType = { - location: 'workspace', - workspace_id: 12345, - doc_name: 'No Owners Doc', - markdown: '# Test', - }; - - await callToolByNameRawAsync('create_doc', args); - - const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); - expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).not.toHaveProperty('docOwnerIds'); - }); - }); - describe('Validation Errors', () => { it('should return error when workspace_id is missing', async () => { const args: Partial = { diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts index 62f2f34f..17e624b7 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts @@ -54,13 +54,6 @@ export const createDocToolSchema = { location: z .enum(['workspace', 'item']) .describe('Location where the document should be created - either in a workspace or attached to an item'), - docOwnerIds: z - .array(z.string()) - .optional() - .describe( - 'Optional list of user IDs to set as document owners at creation time. Use this to add the agent owner as a co-owner so they retain access to the document. Ownership is set inside the creation mutation itself, bypassing the permission checks that would block a subsequent add_users_to_board call.', - ), - workspace_id: z .number() .optional() @@ -110,8 +103,7 @@ LOCATION TYPES: USAGE EXAMPLES: - Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." } - Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." } -- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." } -- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, markdown: "...", docOwnerIds: [""] }`; +- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }`; } getInputSchema(): typeof createDocToolSchema { @@ -146,7 +138,6 @@ USAGE EXAMPLES: folder_id: parsedInput.folder_id?.toString(), }, }, - ...(input.docOwnerIds !== undefined ? { docOwnerIds: input.docOwnerIds } : {}), }; const res: CreateDocMutation = await this.mondayApi.request(createDocMutation, variables); diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts index b34b447f..df9ccb53 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts @@ -11540,7 +11540,6 @@ export type GetItemBoardQuery = { __typename?: 'Query', items?: Array<{ __typena export type CreateDocMutationVariables = Exact<{ location: CreateDocInput; - docOwnerIds?: InputMaybe | Scalars['ID']['input']>; }>; From b54e5ccc607060f9abf54dc0414cda6172e7168b Mon Sep 17 00:00:00 2001 From: noa reuven Date: Sun, 10 May 2026 11:49:06 +0300 Subject: [PATCH 03/14] feat(create-doc): add board_owner_ids / docOwnerIds support 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) --- .../create-doc-tool.graphql.ts | 4 +- .../create-doc-tool/create-doc-tool.test.ts | 55 +++++++++++++++++++ .../create-doc-tool/create-doc-tool.ts | 10 +++- .../generated/graphql.dev/graphql.ts | 1 + .../monday-graphql/generated/graphql/gql.ts | 6 +- .../generated/graphql/graphql.ts | 4 +- .../src/monday-graphql/schema.dev.graphql | 3 +- .../src/monday-graphql/schema.graphql | 4 +- 8 files changed, 78 insertions(+), 9 deletions(-) diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts index 53010eea..c9e95e56 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts @@ -18,8 +18,8 @@ export const getItemBoard = gql` // Create a new monday doc (works for both workspace and board/item locations via CreateDocInput) export const createDoc = gql` - mutation createDoc($location: CreateDocInput!) { - create_doc(location: $location) { + mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) { + create_doc(location: $location, board_owner_ids: $docOwnerIds) { id object_id url diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts index 7c08e8c4..e73daac6 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts @@ -190,6 +190,61 @@ describe('CreateDocTool', () => { }); }); + describe('docOwnerIds', () => { + it('includes docOwnerIds in variables when provided', async () => { + const createDocResponse = { + create_doc: { id: 'doc_owners', object_id: 'obj_owners', url: 'https://monday.com/docs/obj_owners', name: 'Owners Doc' }, + }; + const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; + + mocks.getMockRequest().mockImplementation((query: string) => { + if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); + if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); + return Promise.resolve({}); + }); + + const args: inputType = { + location: 'workspace', + workspace_id: 12345, + doc_name: 'Owners Doc', + markdown: '# Test', + docOwnerIds: ['111', '222'], + }; + + await callToolByNameRawAsync('create_doc', args); + + const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); + expect(createDocCall).toBeDefined(); + expect(createDocCall[1]).toMatchObject({ docOwnerIds: ['111', '222'] }); + }); + + it('does not include docOwnerIds in variables when not provided', async () => { + const createDocResponse = { + create_doc: { id: 'doc_no_owners', object_id: 'obj_no_owners', url: 'https://monday.com/docs/obj_no_owners', name: 'No Owners Doc' }, + }; + const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; + + mocks.getMockRequest().mockImplementation((query: string) => { + if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); + if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); + return Promise.resolve({}); + }); + + const args: inputType = { + location: 'workspace', + workspace_id: 12345, + doc_name: 'No Owners Doc', + markdown: '# Test', + }; + + await callToolByNameRawAsync('create_doc', args); + + const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); + expect(createDocCall).toBeDefined(); + expect(createDocCall[1]).not.toHaveProperty('docOwnerIds'); + }); + }); + describe('Validation Errors', () => { it('should return error when workspace_id is missing', async () => { const args: Partial = { diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts index 17e624b7..4e41a0b8 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts @@ -54,6 +54,12 @@ export const createDocToolSchema = { location: z .enum(['workspace', 'item']) .describe('Location where the document should be created - either in a workspace or attached to an item'), + docOwnerIds: z + .array(z.string()) + .optional() + .describe( + 'Optional list of user IDs to set as document owners at creation time. Use this to add the agent owner as a co-owner so they retain access to the document. Ownership is set inside the creation mutation itself, bypassing the permission checks that would block a subsequent add_users_to_board call.', + ), workspace_id: z .number() .optional() @@ -103,7 +109,8 @@ LOCATION TYPES: USAGE EXAMPLES: - Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." } - Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." } -- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }`; +- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." } +- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, markdown: "...", docOwnerIds: [""] }`; } getInputSchema(): typeof createDocToolSchema { @@ -138,6 +145,7 @@ USAGE EXAMPLES: folder_id: parsedInput.folder_id?.toString(), }, }, + ...(input.docOwnerIds !== undefined ? { docOwnerIds: input.docOwnerIds } : {}), }; const res: CreateDocMutation = await this.mondayApi.request(createDocMutation, variables); diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts index 56cb33f2..1d34eae6 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts @@ -9146,6 +9146,7 @@ export type MutationCreate_DepartmentArgs = { /** Root mutation type for the Dependencies service */ export type MutationCreate_DocArgs = { + board_owner_ids?: InputMaybe>; location: CreateDocInput; }; diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts index fd481db9..8e09b56d 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts @@ -22,7 +22,7 @@ type Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": typeof types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": typeof types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": typeof types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!) {\n create_doc(location: $location) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": typeof types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": typeof types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": typeof types.CreateGroupDocument, @@ -152,7 +152,7 @@ const documents: Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!) {\n create_doc(location: $location) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": types.CreateGroupDocument, @@ -323,7 +323,7 @@ export function graphql(source: "\n query getItemBoard($itemId: ID!) {\n ite /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n mutation createDoc($location: CreateDocInput!) {\n create_doc(location: $location) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!) {\n create_doc(location: $location) {\n id\n object_id\n url\n name\n }\n }\n"]; +export function graphql(source: "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts index df9ccb53..8681c54f 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts @@ -6176,6 +6176,7 @@ export type MutationCreate_DepartmentArgs = { /** Root mutation type for the Dependencies service */ export type MutationCreate_DocArgs = { + board_owner_ids?: InputMaybe>; location: CreateDocInput; }; @@ -11540,6 +11541,7 @@ export type GetItemBoardQuery = { __typename?: 'Query', items?: Array<{ __typena export type CreateDocMutationVariables = Exact<{ location: CreateDocInput; + docOwnerIds?: InputMaybe | Scalars['ID']['input']>; }>; @@ -12535,7 +12537,7 @@ export const GetDocByObjectIdDocument = {"kind":"Document","definitions":[{"kind export const GetDocByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getDocById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"docs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const AggregateBoardInsightsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"aggregateBoardInsights"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"query"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateQueryInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"boards"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"aggregate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"query"},"value":{"kind":"Variable","name":{"kind":"Name","value":"query"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alias"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateBasicAggregationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"result"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateGroupByResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const GetItemBoardDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getItemBoard"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"itemId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"itemId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"board"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"columns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"Argument","name":{"kind":"Name","value":"board_owner_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const UpdateDocNameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"updateDocName"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"update_doc_name"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"docId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}]}]}}]} as unknown as DocumentNode; export const CreateFolderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createFolder"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"color"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderColor"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderFontWeight"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderCustomIcon"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_folder"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspace_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"color"}}},{"kind":"Argument","name":{"kind":"Name","value":"font_weight"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}}},{"kind":"Argument","name":{"kind":"Name","value":"custom_icon"},"value":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}}},{"kind":"Argument","name":{"kind":"Name","value":"parent_folder_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const CreateGroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createGroup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositionRelative"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_group"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"board_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}}},{"kind":"Argument","name":{"kind":"Name","value":"relative_to"},"value":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}}},{"kind":"Argument","name":{"kind":"Name","value":"position_relative_method"},"value":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]} as unknown as DocumentNode; diff --git a/packages/agent-toolkit/src/monday-graphql/schema.dev.graphql b/packages/agent-toolkit/src/monday-graphql/schema.dev.graphql index 1dceb835..3d8006fb 100644 --- a/packages/agent-toolkit/src/monday-graphql/schema.dev.graphql +++ b/packages/agent-toolkit/src/monday-graphql/schema.dev.graphql @@ -1508,7 +1508,8 @@ template_id: ID, "Optional workspace id" workspace_id: ID): Board "Create a new doc." create_doc( "new monday doc location" -location: CreateDocInput!): Document +location: CreateDocInput!, "Optional list of user IDs to set as document owners at creation time" +board_owner_ids: [ID!]): Document "Create new document block" create_doc_block( "After which block to insert this one. If not provided, will be inserted first in the document" after_block_id: String, "The block's content." diff --git a/packages/agent-toolkit/src/monday-graphql/schema.graphql b/packages/agent-toolkit/src/monday-graphql/schema.graphql index 2b4f4834..7767ed8b 100644 --- a/packages/agent-toolkit/src/monday-graphql/schema.graphql +++ b/packages/agent-toolkit/src/monday-graphql/schema.graphql @@ -1769,7 +1769,9 @@ type Mutation { workspace_id: ID ): Board "Create a new doc." - create_doc("new monday doc location" location: CreateDocInput!): Document + create_doc( "new monday doc location" +location: CreateDocInput!, "Optional list of user IDs to set as document owners at creation time" +doc_owner_ids: [ID!]): Document "Create new document block" create_doc_block( "After which block to insert this one. If not provided, will be inserted first in the document" From 18d6ff65305e80ac8161a2e5e0c36ba50caaa9f6 Mon Sep 17 00:00:00 2001 From: noa reuven Date: Sun, 10 May 2026 12:03:20 +0300 Subject: [PATCH 04/14] =?UTF-8?q?refactor(create-doc):=20rename=20docOwner?= =?UTF-8?q?Ids=20=E2=86=92=20boardOwnerIds=20for=20consistency=20with=20cr?= =?UTF-8?q?eate=5Fboard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../create-doc-tool/create-doc-tool.graphql.ts | 4 ++-- .../create-doc-tool/create-doc-tool.test.ts | 12 ++++++------ .../create-doc-tool/create-doc-tool.ts | 6 +++--- .../src/monday-graphql/generated/graphql/gql.ts | 6 +++--- .../src/monday-graphql/generated/graphql/graphql.ts | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts index c9e95e56..882d672d 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts @@ -18,8 +18,8 @@ export const getItemBoard = gql` // Create a new monday doc (works for both workspace and board/item locations via CreateDocInput) export const createDoc = gql` - mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) { - create_doc(location: $location, board_owner_ids: $docOwnerIds) { + mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) { + create_doc(location: $location, board_owner_ids: $boardOwnerIds) { id object_id url diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts index e73daac6..c4c87f6c 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts @@ -190,8 +190,8 @@ describe('CreateDocTool', () => { }); }); - describe('docOwnerIds', () => { - it('includes docOwnerIds in variables when provided', async () => { + describe('boardOwnerIds', () => { + it('includes boardOwnerIds in variables when provided', async () => { const createDocResponse = { create_doc: { id: 'doc_owners', object_id: 'obj_owners', url: 'https://monday.com/docs/obj_owners', name: 'Owners Doc' }, }; @@ -208,17 +208,17 @@ describe('CreateDocTool', () => { workspace_id: 12345, doc_name: 'Owners Doc', markdown: '# Test', - docOwnerIds: ['111', '222'], + boardOwnerIds: ['111', '222'], }; await callToolByNameRawAsync('create_doc', args); const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).toMatchObject({ docOwnerIds: ['111', '222'] }); + expect(createDocCall[1]).toMatchObject({ boardOwnerIds: ['111', '222'] }); }); - it('does not include docOwnerIds in variables when not provided', async () => { + it('does not include boardOwnerIds in variables when not provided', async () => { const createDocResponse = { create_doc: { id: 'doc_no_owners', object_id: 'obj_no_owners', url: 'https://monday.com/docs/obj_no_owners', name: 'No Owners Doc' }, }; @@ -241,7 +241,7 @@ describe('CreateDocTool', () => { const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).not.toHaveProperty('docOwnerIds'); + expect(createDocCall[1]).not.toHaveProperty('boardOwnerIds'); }); }); diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts index 4e41a0b8..91d32f13 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts @@ -54,7 +54,7 @@ export const createDocToolSchema = { location: z .enum(['workspace', 'item']) .describe('Location where the document should be created - either in a workspace or attached to an item'), - docOwnerIds: z + boardOwnerIds: z .array(z.string()) .optional() .describe( @@ -110,7 +110,7 @@ USAGE EXAMPLES: - Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." } - Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." } - Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." } -- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, markdown: "...", docOwnerIds: [""] }`; +- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, markdown: "...", boardOwnerIds: [""] }`; } getInputSchema(): typeof createDocToolSchema { @@ -145,7 +145,7 @@ USAGE EXAMPLES: folder_id: parsedInput.folder_id?.toString(), }, }, - ...(input.docOwnerIds !== undefined ? { docOwnerIds: input.docOwnerIds } : {}), + ...(input.boardOwnerIds !== undefined ? { boardOwnerIds: input.boardOwnerIds } : {}), }; const res: CreateDocMutation = await this.mondayApi.request(createDocMutation, variables); diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts index 8e09b56d..baeca8b0 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts @@ -22,7 +22,7 @@ type Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": typeof types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": typeof types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": typeof types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": typeof types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": typeof types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": typeof types.CreateGroupDocument, @@ -152,7 +152,7 @@ const documents: Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": types.CreateGroupDocument, @@ -323,7 +323,7 @@ export function graphql(source: "\n query getItemBoard($itemId: ID!) {\n ite /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"]; +export function graphql(source: "\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts index 8681c54f..4cdb451f 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts @@ -11541,7 +11541,7 @@ export type GetItemBoardQuery = { __typename?: 'Query', items?: Array<{ __typena export type CreateDocMutationVariables = Exact<{ location: CreateDocInput; - docOwnerIds?: InputMaybe | Scalars['ID']['input']>; + boardOwnerIds?: InputMaybe | Scalars['ID']['input']>; }>; @@ -12537,7 +12537,7 @@ export const GetDocByObjectIdDocument = {"kind":"Document","definitions":[{"kind export const GetDocByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getDocById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"docs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const AggregateBoardInsightsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"aggregateBoardInsights"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"query"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateQueryInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"boards"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"aggregate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"query"},"value":{"kind":"Variable","name":{"kind":"Name","value":"query"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alias"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateBasicAggregationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"result"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateGroupByResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const GetItemBoardDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getItemBoard"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"itemId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"itemId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"board"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"columns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"Argument","name":{"kind":"Name","value":"board_owner_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardOwnerIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"Argument","name":{"kind":"Name","value":"board_owner_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"boardOwnerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const UpdateDocNameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"updateDocName"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"update_doc_name"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"docId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}]}]}}]} as unknown as DocumentNode; export const CreateFolderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createFolder"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"color"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderColor"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderFontWeight"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderCustomIcon"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_folder"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspace_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"color"}}},{"kind":"Argument","name":{"kind":"Name","value":"font_weight"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}}},{"kind":"Argument","name":{"kind":"Name","value":"custom_icon"},"value":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}}},{"kind":"Argument","name":{"kind":"Name","value":"parent_folder_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const CreateGroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createGroup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositionRelative"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_group"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"board_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}}},{"kind":"Argument","name":{"kind":"Name","value":"relative_to"},"value":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}}},{"kind":"Argument","name":{"kind":"Name","value":"position_relative_method"},"value":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]} as unknown as DocumentNode; From cb2e83b3b9db239c71a800a4972d776bee6f25f1 Mon Sep 17 00:00:00 2001 From: noa reuven Date: Sun, 10 May 2026 12:34:51 +0300 Subject: [PATCH 05/14] =?UTF-8?q?refactor(create-doc):=20rename=20boardOwn?= =?UTF-8?q?erIds=20=E2=86=92=20docOwnerIds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../create-doc-tool/create-doc-tool.graphql.ts | 4 ++-- .../create-doc-tool/create-doc-tool.test.ts | 12 ++++++------ .../create-doc-tool/create-doc-tool.ts | 6 +++--- .../src/monday-graphql/generated/graphql/gql.ts | 6 +++--- .../src/monday-graphql/generated/graphql/graphql.ts | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts index 882d672d..c9e95e56 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts @@ -18,8 +18,8 @@ export const getItemBoard = gql` // Create a new monday doc (works for both workspace and board/item locations via CreateDocInput) export const createDoc = gql` - mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) { - create_doc(location: $location, board_owner_ids: $boardOwnerIds) { + mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) { + create_doc(location: $location, board_owner_ids: $docOwnerIds) { id object_id url diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts index c4c87f6c..e73daac6 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts @@ -190,8 +190,8 @@ describe('CreateDocTool', () => { }); }); - describe('boardOwnerIds', () => { - it('includes boardOwnerIds in variables when provided', async () => { + describe('docOwnerIds', () => { + it('includes docOwnerIds in variables when provided', async () => { const createDocResponse = { create_doc: { id: 'doc_owners', object_id: 'obj_owners', url: 'https://monday.com/docs/obj_owners', name: 'Owners Doc' }, }; @@ -208,17 +208,17 @@ describe('CreateDocTool', () => { workspace_id: 12345, doc_name: 'Owners Doc', markdown: '# Test', - boardOwnerIds: ['111', '222'], + docOwnerIds: ['111', '222'], }; await callToolByNameRawAsync('create_doc', args); const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).toMatchObject({ boardOwnerIds: ['111', '222'] }); + expect(createDocCall[1]).toMatchObject({ docOwnerIds: ['111', '222'] }); }); - it('does not include boardOwnerIds in variables when not provided', async () => { + it('does not include docOwnerIds in variables when not provided', async () => { const createDocResponse = { create_doc: { id: 'doc_no_owners', object_id: 'obj_no_owners', url: 'https://monday.com/docs/obj_no_owners', name: 'No Owners Doc' }, }; @@ -241,7 +241,7 @@ describe('CreateDocTool', () => { const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).not.toHaveProperty('boardOwnerIds'); + expect(createDocCall[1]).not.toHaveProperty('docOwnerIds'); }); }); diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts index 91d32f13..4e41a0b8 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts @@ -54,7 +54,7 @@ export const createDocToolSchema = { location: z .enum(['workspace', 'item']) .describe('Location where the document should be created - either in a workspace or attached to an item'), - boardOwnerIds: z + docOwnerIds: z .array(z.string()) .optional() .describe( @@ -110,7 +110,7 @@ USAGE EXAMPLES: - Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." } - Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." } - Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." } -- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, markdown: "...", boardOwnerIds: [""] }`; +- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, markdown: "...", docOwnerIds: [""] }`; } getInputSchema(): typeof createDocToolSchema { @@ -145,7 +145,7 @@ USAGE EXAMPLES: folder_id: parsedInput.folder_id?.toString(), }, }, - ...(input.boardOwnerIds !== undefined ? { boardOwnerIds: input.boardOwnerIds } : {}), + ...(input.docOwnerIds !== undefined ? { docOwnerIds: input.docOwnerIds } : {}), }; const res: CreateDocMutation = await this.mondayApi.request(createDocMutation, variables); diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts index baeca8b0..8e09b56d 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts @@ -22,7 +22,7 @@ type Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": typeof types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": typeof types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": typeof types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": typeof types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": typeof types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": typeof types.CreateGroupDocument, @@ -152,7 +152,7 @@ const documents: Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": types.CreateGroupDocument, @@ -323,7 +323,7 @@ export function graphql(source: "\n query getItemBoard($itemId: ID!) {\n ite /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"]; +export function graphql(source: "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts index 4cdb451f..8681c54f 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts @@ -11541,7 +11541,7 @@ export type GetItemBoardQuery = { __typename?: 'Query', items?: Array<{ __typena export type CreateDocMutationVariables = Exact<{ location: CreateDocInput; - boardOwnerIds?: InputMaybe | Scalars['ID']['input']>; + docOwnerIds?: InputMaybe | Scalars['ID']['input']>; }>; @@ -12537,7 +12537,7 @@ export const GetDocByObjectIdDocument = {"kind":"Document","definitions":[{"kind export const GetDocByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getDocById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"docs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const AggregateBoardInsightsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"aggregateBoardInsights"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"query"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateQueryInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"boards"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"aggregate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"query"},"value":{"kind":"Variable","name":{"kind":"Name","value":"query"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alias"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateBasicAggregationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"result"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateGroupByResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const GetItemBoardDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getItemBoard"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"itemId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"itemId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"board"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"columns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardOwnerIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"Argument","name":{"kind":"Name","value":"board_owner_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"boardOwnerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"Argument","name":{"kind":"Name","value":"board_owner_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const UpdateDocNameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"updateDocName"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"update_doc_name"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"docId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}]}]}}]} as unknown as DocumentNode; export const CreateFolderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createFolder"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"color"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderColor"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderFontWeight"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderCustomIcon"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_folder"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspace_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"color"}}},{"kind":"Argument","name":{"kind":"Name","value":"font_weight"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}}},{"kind":"Argument","name":{"kind":"Name","value":"custom_icon"},"value":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}}},{"kind":"Argument","name":{"kind":"Name","value":"parent_folder_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const CreateGroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createGroup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositionRelative"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_group"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"board_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}}},{"kind":"Argument","name":{"kind":"Name","value":"relative_to"},"value":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}}},{"kind":"Argument","name":{"kind":"Name","value":"position_relative_method"},"value":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]} as unknown as DocumentNode; From 5b85988661d78a995e88216ad7138d1106d99b76 Mon Sep 17 00:00:00 2001 From: noa reuven Date: Mon, 11 May 2026 12:23:46 +0300 Subject: [PATCH 06/14] fix(create-doc): forward boardOwnerIds in item-attached doc path + fix stale test references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- .../create-doc-tool/create-doc-tool.test.ts | 45 ++++++++++++++++--- .../create-doc-tool/create-doc-tool.ts | 1 + 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts index e73daac6..95418690 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts @@ -190,8 +190,8 @@ describe('CreateDocTool', () => { }); }); - describe('docOwnerIds', () => { - it('includes docOwnerIds in variables when provided', async () => { + describe('boardOwnerIds', () => { + it('includes boardOwnerIds in variables when provided', async () => { const createDocResponse = { create_doc: { id: 'doc_owners', object_id: 'obj_owners', url: 'https://monday.com/docs/obj_owners', name: 'Owners Doc' }, }; @@ -208,17 +208,17 @@ describe('CreateDocTool', () => { workspace_id: 12345, doc_name: 'Owners Doc', markdown: '# Test', - docOwnerIds: ['111', '222'], + boardOwnerIds: ['111', '222'], }; await callToolByNameRawAsync('create_doc', args); const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).toMatchObject({ docOwnerIds: ['111', '222'] }); + expect(createDocCall[1]).toMatchObject({ boardOwnerIds: ['111', '222'] }); }); - it('does not include docOwnerIds in variables when not provided', async () => { + it('does not include boardOwnerIds in variables when not provided', async () => { const createDocResponse = { create_doc: { id: 'doc_no_owners', object_id: 'obj_no_owners', url: 'https://monday.com/docs/obj_no_owners', name: 'No Owners Doc' }, }; @@ -241,7 +241,7 @@ describe('CreateDocTool', () => { const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).not.toHaveProperty('docOwnerIds'); + expect(createDocCall[1]).not.toHaveProperty('boardOwnerIds'); }); }); @@ -638,6 +638,39 @@ describe('CreateDocTool', () => { }); }); + describe('boardOwnerIds', () => { + it('includes boardOwnerIds in item doc variables when provided', async () => { + const getItemBoardResponse = { + items: [{ id: 'item_99', board: { id: 'board_99', columns: [{ id: 'doc_col_99', type: NonDeprecatedColumnType.Doc }] } }], + }; + const createDocResponse = { create_doc: { id: 'doc_owners_item', object_id: 'obj_owners_item', url: 'https://monday.com/docs/obj_owners_item', name: null } }; + const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; + + jest.spyOn(mocks, 'mockRequest').mockImplementation((query: string) => { + if (query.includes('query getItemBoard')) return Promise.resolve(getItemBoardResponse); + if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); + if (query.includes('mutation updateDocName')) return Promise.resolve({ update_doc_name: true }); + if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); + return Promise.resolve({}); + }); + + const args: inputType = { + location: 'item', + item_id: 99, + column_id: 'doc_col_99', + doc_name: 'Owners Item Doc', + markdown: '# Test', + boardOwnerIds: ['555', '666'], + }; + + await callToolByNameRawAsync('create_doc', args); + + const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); + expect(createDocCall).toBeDefined(); + expect(createDocCall[1]).toMatchObject({ boardOwnerIds: ['555', '666'] }); + }); + }); + describe('Validation Errors', () => { it('should return error when item_id is missing', async () => { const args: Partial = { diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts index 4e41a0b8..8386799d 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts @@ -197,6 +197,7 @@ USAGE EXAMPLES: column_id: columnId, }, }, + ...(input.boardOwnerIds !== undefined ? { boardOwnerIds: input.boardOwnerIds } : {}), }; const res: CreateDocMutation = await this.mondayApi.request(createDocMutation, itemVariables); From e7df59a904d1df4aa09de27491a09662ada84861 Mon Sep 17 00:00:00 2001 From: noa reuven Date: Mon, 11 May 2026 12:36:13 +0300 Subject: [PATCH 07/14] =?UTF-8?q?refactor:=20standardize=20boardOwnerIds?= =?UTF-8?q?=20naming=20=E2=80=94=20remove=20docOwnerIds=20inconsistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-doc-tool/create-doc-tool.graphql.ts | 4 ++-- .../platform-api-tools/create-doc-tool/create-doc-tool.ts | 6 +++--- .../src/monday-graphql/generated/graphql/gql.ts | 6 +++--- .../src/monday-graphql/generated/graphql/graphql.ts | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts index c9e95e56..882d672d 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts @@ -18,8 +18,8 @@ export const getItemBoard = gql` // Create a new monday doc (works for both workspace and board/item locations via CreateDocInput) export const createDoc = gql` - mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) { - create_doc(location: $location, board_owner_ids: $docOwnerIds) { + mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) { + create_doc(location: $location, board_owner_ids: $boardOwnerIds) { id object_id url diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts index 8386799d..e07f4245 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts @@ -54,7 +54,7 @@ export const createDocToolSchema = { location: z .enum(['workspace', 'item']) .describe('Location where the document should be created - either in a workspace or attached to an item'), - docOwnerIds: z + boardOwnerIds: z .array(z.string()) .optional() .describe( @@ -110,7 +110,7 @@ USAGE EXAMPLES: - Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." } - Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." } - Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." } -- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, markdown: "...", docOwnerIds: [""] }`; +- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, markdown: "...", boardOwnerIds: [""] }`; } getInputSchema(): typeof createDocToolSchema { @@ -145,7 +145,7 @@ USAGE EXAMPLES: folder_id: parsedInput.folder_id?.toString(), }, }, - ...(input.docOwnerIds !== undefined ? { docOwnerIds: input.docOwnerIds } : {}), + ...(input.boardOwnerIds !== undefined ? { boardOwnerIds: input.boardOwnerIds } : {}), }; const res: CreateDocMutation = await this.mondayApi.request(createDocMutation, variables); diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts index 8e09b56d..baeca8b0 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts @@ -22,7 +22,7 @@ type Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": typeof types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": typeof types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": typeof types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": typeof types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": typeof types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": typeof types.CreateGroupDocument, @@ -152,7 +152,7 @@ const documents: Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": types.CreateGroupDocument, @@ -323,7 +323,7 @@ export function graphql(source: "\n query getItemBoard($itemId: ID!) {\n ite /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"]; +export function graphql(source: "\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts index 8681c54f..4cdb451f 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts @@ -11541,7 +11541,7 @@ export type GetItemBoardQuery = { __typename?: 'Query', items?: Array<{ __typena export type CreateDocMutationVariables = Exact<{ location: CreateDocInput; - docOwnerIds?: InputMaybe | Scalars['ID']['input']>; + boardOwnerIds?: InputMaybe | Scalars['ID']['input']>; }>; @@ -12537,7 +12537,7 @@ export const GetDocByObjectIdDocument = {"kind":"Document","definitions":[{"kind export const GetDocByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getDocById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"docs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const AggregateBoardInsightsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"aggregateBoardInsights"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"query"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateQueryInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"boards"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"aggregate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"query"},"value":{"kind":"Variable","name":{"kind":"Name","value":"query"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alias"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateBasicAggregationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"result"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateGroupByResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const GetItemBoardDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getItemBoard"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"itemId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"itemId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"board"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"columns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"Argument","name":{"kind":"Name","value":"board_owner_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardOwnerIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"Argument","name":{"kind":"Name","value":"board_owner_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"boardOwnerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const UpdateDocNameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"updateDocName"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"update_doc_name"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"docId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}]}]}}]} as unknown as DocumentNode; export const CreateFolderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createFolder"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"color"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderColor"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderFontWeight"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderCustomIcon"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_folder"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspace_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"color"}}},{"kind":"Argument","name":{"kind":"Name","value":"font_weight"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}}},{"kind":"Argument","name":{"kind":"Name","value":"custom_icon"},"value":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}}},{"kind":"Argument","name":{"kind":"Name","value":"parent_folder_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const CreateGroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createGroup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositionRelative"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_group"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"board_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}}},{"kind":"Argument","name":{"kind":"Name","value":"relative_to"},"value":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}}},{"kind":"Argument","name":{"kind":"Name","value":"position_relative_method"},"value":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]} as unknown as DocumentNode; From 9659de1b332340adcc69bfc093acf6d712fe679f Mon Sep 17 00:00:00 2001 From: noa reuven Date: Mon, 11 May 2026 12:40:27 +0300 Subject: [PATCH 08/14] =?UTF-8?q?refactor:=20rename=20boardOwnerIds=20?= =?UTF-8?q?=E2=86=92=20docOwnerIds=20(more=20semantic=20for=20create=5Fdoc?= =?UTF-8?q?=20tool)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-doc-tool.graphql.ts | 4 ++-- .../create-doc-tool/create-doc-tool.test.ts | 20 +++++++++---------- .../create-doc-tool/create-doc-tool.ts | 8 ++++---- .../monday-graphql/generated/graphql/gql.ts | 6 +++--- .../generated/graphql/graphql.ts | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts index 882d672d..c9e95e56 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts @@ -18,8 +18,8 @@ export const getItemBoard = gql` // Create a new monday doc (works for both workspace and board/item locations via CreateDocInput) export const createDoc = gql` - mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) { - create_doc(location: $location, board_owner_ids: $boardOwnerIds) { + mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) { + create_doc(location: $location, board_owner_ids: $docOwnerIds) { id object_id url diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts index 95418690..89fd436f 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts @@ -190,8 +190,8 @@ describe('CreateDocTool', () => { }); }); - describe('boardOwnerIds', () => { - it('includes boardOwnerIds in variables when provided', async () => { + describe('docOwnerIds', () => { + it('includes docOwnerIds in variables when provided', async () => { const createDocResponse = { create_doc: { id: 'doc_owners', object_id: 'obj_owners', url: 'https://monday.com/docs/obj_owners', name: 'Owners Doc' }, }; @@ -208,17 +208,17 @@ describe('CreateDocTool', () => { workspace_id: 12345, doc_name: 'Owners Doc', markdown: '# Test', - boardOwnerIds: ['111', '222'], + docOwnerIds: ['111', '222'], }; await callToolByNameRawAsync('create_doc', args); const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).toMatchObject({ boardOwnerIds: ['111', '222'] }); + expect(createDocCall[1]).toMatchObject({ docOwnerIds: ['111', '222'] }); }); - it('does not include boardOwnerIds in variables when not provided', async () => { + it('does not include docOwnerIds in variables when not provided', async () => { const createDocResponse = { create_doc: { id: 'doc_no_owners', object_id: 'obj_no_owners', url: 'https://monday.com/docs/obj_no_owners', name: 'No Owners Doc' }, }; @@ -241,7 +241,7 @@ describe('CreateDocTool', () => { const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).not.toHaveProperty('boardOwnerIds'); + expect(createDocCall[1]).not.toHaveProperty('docOwnerIds'); }); }); @@ -638,8 +638,8 @@ describe('CreateDocTool', () => { }); }); - describe('boardOwnerIds', () => { - it('includes boardOwnerIds in item doc variables when provided', async () => { + describe('docOwnerIds', () => { + it('includes docOwnerIds in item doc variables when provided', async () => { const getItemBoardResponse = { items: [{ id: 'item_99', board: { id: 'board_99', columns: [{ id: 'doc_col_99', type: NonDeprecatedColumnType.Doc }] } }], }; @@ -660,14 +660,14 @@ describe('CreateDocTool', () => { column_id: 'doc_col_99', doc_name: 'Owners Item Doc', markdown: '# Test', - boardOwnerIds: ['555', '666'], + docOwnerIds: ['555', '666'], }; await callToolByNameRawAsync('create_doc', args); const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).toMatchObject({ boardOwnerIds: ['555', '666'] }); + expect(createDocCall[1]).toMatchObject({ docOwnerIds: ['555', '666'] }); }); }); diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts index e07f4245..24c80d13 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts @@ -54,7 +54,7 @@ export const createDocToolSchema = { location: z .enum(['workspace', 'item']) .describe('Location where the document should be created - either in a workspace or attached to an item'), - boardOwnerIds: z + docOwnerIds: z .array(z.string()) .optional() .describe( @@ -110,7 +110,7 @@ USAGE EXAMPLES: - Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." } - Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." } - Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." } -- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, markdown: "...", boardOwnerIds: [""] }`; +- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, markdown: "...", docOwnerIds: [""] }`; } getInputSchema(): typeof createDocToolSchema { @@ -145,7 +145,7 @@ USAGE EXAMPLES: folder_id: parsedInput.folder_id?.toString(), }, }, - ...(input.boardOwnerIds !== undefined ? { boardOwnerIds: input.boardOwnerIds } : {}), + ...(input.docOwnerIds !== undefined ? { docOwnerIds: input.docOwnerIds } : {}), }; const res: CreateDocMutation = await this.mondayApi.request(createDocMutation, variables); @@ -197,7 +197,7 @@ USAGE EXAMPLES: column_id: columnId, }, }, - ...(input.boardOwnerIds !== undefined ? { boardOwnerIds: input.boardOwnerIds } : {}), + ...(input.docOwnerIds !== undefined ? { docOwnerIds: input.docOwnerIds } : {}), }; const res: CreateDocMutation = await this.mondayApi.request(createDocMutation, itemVariables); diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts index baeca8b0..8e09b56d 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts @@ -22,7 +22,7 @@ type Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": typeof types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": typeof types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": typeof types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": typeof types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": typeof types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": typeof types.CreateGroupDocument, @@ -152,7 +152,7 @@ const documents: Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": types.CreateGroupDocument, @@ -323,7 +323,7 @@ export function graphql(source: "\n query getItemBoard($itemId: ID!) {\n ite /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!, $boardOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $boardOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"]; +export function graphql(source: "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts index 4cdb451f..8681c54f 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts @@ -11541,7 +11541,7 @@ export type GetItemBoardQuery = { __typename?: 'Query', items?: Array<{ __typena export type CreateDocMutationVariables = Exact<{ location: CreateDocInput; - boardOwnerIds?: InputMaybe | Scalars['ID']['input']>; + docOwnerIds?: InputMaybe | Scalars['ID']['input']>; }>; @@ -12537,7 +12537,7 @@ export const GetDocByObjectIdDocument = {"kind":"Document","definitions":[{"kind export const GetDocByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getDocById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"docs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const AggregateBoardInsightsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"aggregateBoardInsights"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"query"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateQueryInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"boards"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"aggregate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"query"},"value":{"kind":"Variable","name":{"kind":"Name","value":"query"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alias"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateBasicAggregationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"result"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateGroupByResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const GetItemBoardDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getItemBoard"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"itemId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"itemId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"board"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"columns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardOwnerIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"Argument","name":{"kind":"Name","value":"board_owner_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"boardOwnerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"Argument","name":{"kind":"Name","value":"board_owner_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const UpdateDocNameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"updateDocName"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"update_doc_name"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"docId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}]}]}}]} as unknown as DocumentNode; export const CreateFolderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createFolder"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"color"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderColor"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderFontWeight"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderCustomIcon"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_folder"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspace_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"color"}}},{"kind":"Argument","name":{"kind":"Name","value":"font_weight"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}}},{"kind":"Argument","name":{"kind":"Name","value":"custom_icon"},"value":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}}},{"kind":"Argument","name":{"kind":"Name","value":"parent_folder_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const CreateGroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createGroup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositionRelative"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_group"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"board_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}}},{"kind":"Argument","name":{"kind":"Name","value":"relative_to"},"value":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}}},{"kind":"Argument","name":{"kind":"Name","value":"position_relative_method"},"value":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]} as unknown as DocumentNode; From d2a9a9b5cd1bdf218556456f640675db6a126384 Mon Sep 17 00:00:00 2001 From: noa reuven Date: Wed, 13 May 2026 15:34:18 +0300 Subject: [PATCH 09/14] =?UTF-8?q?refactor:=20rename=20board=5Fowner=5Fids?= =?UTF-8?q?=20=E2=86=92=20doc=5Fowner=5Fids=20in=20create=5Fdoc=20mutation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-doc-tool/create-doc-tool.graphql.ts | 2 +- .../src/monday-graphql/generated/graphql/gql.ts | 6 +++--- .../src/monday-graphql/generated/graphql/graphql.ts | 4 ++-- .../agent-toolkit/src/monday-graphql/schema.dev.graphql | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts index c9e95e56..2c7f4064 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts @@ -19,7 +19,7 @@ export const getItemBoard = gql` // Create a new monday doc (works for both workspace and board/item locations via CreateDocInput) export const createDoc = gql` mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) { - create_doc(location: $location, board_owner_ids: $docOwnerIds) { + create_doc(location: $location, doc_owner_ids: $docOwnerIds) { id object_id url diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts index 8e09b56d..9780f321 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts @@ -22,7 +22,7 @@ type Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": typeof types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": typeof types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": typeof types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, doc_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": typeof types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": typeof types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": typeof types.CreateGroupDocument, @@ -152,7 +152,7 @@ const documents: Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, doc_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": types.CreateGroupDocument, @@ -323,7 +323,7 @@ export function graphql(source: "\n query getItemBoard($itemId: ID!) {\n ite /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, board_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"]; +export function graphql(source: "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, doc_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, doc_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts index 8681c54f..714f8ac7 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts @@ -6176,7 +6176,7 @@ export type MutationCreate_DepartmentArgs = { /** Root mutation type for the Dependencies service */ export type MutationCreate_DocArgs = { - board_owner_ids?: InputMaybe>; + doc_owner_ids?: InputMaybe>; location: CreateDocInput; }; @@ -12537,7 +12537,7 @@ export const GetDocByObjectIdDocument = {"kind":"Document","definitions":[{"kind export const GetDocByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getDocById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"docs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const AggregateBoardInsightsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"aggregateBoardInsights"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"query"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateQueryInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"boards"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"aggregate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"query"},"value":{"kind":"Variable","name":{"kind":"Name","value":"query"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alias"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateBasicAggregationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"result"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateGroupByResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const GetItemBoardDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getItemBoard"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"itemId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"itemId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"board"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"columns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"Argument","name":{"kind":"Name","value":"board_owner_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"Argument","name":{"kind":"Name","value":"doc_owner_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const UpdateDocNameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"updateDocName"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"update_doc_name"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"docId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}]}]}}]} as unknown as DocumentNode; export const CreateFolderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createFolder"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"color"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderColor"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderFontWeight"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderCustomIcon"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_folder"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspace_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"color"}}},{"kind":"Argument","name":{"kind":"Name","value":"font_weight"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}}},{"kind":"Argument","name":{"kind":"Name","value":"custom_icon"},"value":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}}},{"kind":"Argument","name":{"kind":"Name","value":"parent_folder_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const CreateGroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createGroup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositionRelative"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_group"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"board_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}}},{"kind":"Argument","name":{"kind":"Name","value":"relative_to"},"value":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}}},{"kind":"Argument","name":{"kind":"Name","value":"position_relative_method"},"value":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]} as unknown as DocumentNode; diff --git a/packages/agent-toolkit/src/monday-graphql/schema.dev.graphql b/packages/agent-toolkit/src/monday-graphql/schema.dev.graphql index 3d8006fb..6023525c 100644 --- a/packages/agent-toolkit/src/monday-graphql/schema.dev.graphql +++ b/packages/agent-toolkit/src/monday-graphql/schema.dev.graphql @@ -1509,7 +1509,7 @@ workspace_id: ID): Board "Create a new doc." create_doc( "new monday doc location" location: CreateDocInput!, "Optional list of user IDs to set as document owners at creation time" -board_owner_ids: [ID!]): Document +doc_owner_ids: [ID!]): Document "Create new document block" create_doc_block( "After which block to insert this one. If not provided, will be inserted first in the document" after_block_id: String, "The block's content." From 13f65106b99de91784c708db82f95ab902c5749a Mon Sep 17 00:00:00 2001 From: noa reuven Date: Sun, 17 May 2026 10:23:44 +0300 Subject: [PATCH 10/14] fix: add .min(1) validation to docOwnerIds + add missing item-path 'not provided' test --- .../create-doc-tool/create-doc-tool.test.ts | 30 +++++++++++++++++++ .../create-doc-tool/create-doc-tool.ts | 1 + 2 files changed, 31 insertions(+) diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts index 89fd436f..c30dd769 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts @@ -669,6 +669,36 @@ describe('CreateDocTool', () => { expect(createDocCall).toBeDefined(); expect(createDocCall[1]).toMatchObject({ docOwnerIds: ['555', '666'] }); }); + + it('does not include docOwnerIds in item doc variables when not provided', async () => { + const getItemBoardResponse = { + items: [{ id: 'item_77', board: { id: 'board_77', columns: [{ id: 'doc_col_77', type: NonDeprecatedColumnType.Doc }] } }], + }; + const createDocResponse = { create_doc: { id: 'doc_no_owners_item', object_id: 'obj_no_owners_item', url: 'https://monday.com/docs/obj_no_owners_item', name: null } }; + const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; + + jest.spyOn(mocks, 'mockRequest').mockImplementation((query: string) => { + if (query.includes('query getItemBoard')) return Promise.resolve(getItemBoardResponse); + if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); + if (query.includes('mutation updateDocName')) return Promise.resolve({ update_doc_name: true }); + if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); + return Promise.resolve({}); + }); + + const args: inputType = { + location: 'item', + item_id: 77, + column_id: 'doc_col_77', + doc_name: 'No Owners Item Doc', + markdown: '# Test', + }; + + await callToolByNameRawAsync('create_doc', args); + + const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); + expect(createDocCall).toBeDefined(); + expect(createDocCall[1]).not.toHaveProperty('docOwnerIds'); + }); }); describe('Validation Errors', () => { diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts index 24c80d13..0c54ff74 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts @@ -56,6 +56,7 @@ export const createDocToolSchema = { .describe('Location where the document should be created - either in a workspace or attached to an item'), docOwnerIds: z .array(z.string()) + .min(1) .optional() .describe( 'Optional list of user IDs to set as document owners at creation time. Use this to add the agent owner as a co-owner so they retain access to the document. Ownership is set inside the creation mutation itself, bypassing the permission checks that would block a subsequent add_users_to_board call.', From f4b3a743b91bd00e01900a985209609b604b84c2 Mon Sep 17 00:00:00 2001 From: noa reuven Date: Mon, 18 May 2026 09:24:18 +0300 Subject: [PATCH 11/14] chore: bump agent-toolkit version to 5.10.3 --- packages/agent-toolkit/package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/agent-toolkit/package.json b/packages/agent-toolkit/package.json index c798cd95..1813398a 100644 --- a/packages/agent-toolkit/package.json +++ b/packages/agent-toolkit/package.json @@ -1,8 +1,6 @@ { "name": "@mondaydotcomorg/agent-toolkit", "version": "5.12.0", - - "description": "monday.com agent toolkit", "exports": { "./mcp": { From 02ac7dc3e0d3d97ec9ce43cc60ae2d1f3265e00f Mon Sep 17 00:00:00 2001 From: noa reuven Date: Sun, 24 May 2026 16:03:48 +0300 Subject: [PATCH 12/14] fix: use doc_owner_ids instead of board_owner_ids in MutationCreate_DocArgs --- .../src/monday-graphql/generated/graphql.dev/graphql.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts index 1d34eae6..29ebf084 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts @@ -9146,7 +9146,7 @@ export type MutationCreate_DepartmentArgs = { /** Root mutation type for the Dependencies service */ export type MutationCreate_DocArgs = { - board_owner_ids?: InputMaybe>; + doc_owner_ids?: InputMaybe>; location: CreateDocInput; }; From 5c4b4332399a1b9b446ecc31c86c5bf8055b6697 Mon Sep 17 00:00:00 2001 From: noa reuven Date: Sun, 24 May 2026 16:06:18 +0300 Subject: [PATCH 13/14] chore: bump agent-toolkit version to 5.12.1 --- packages/agent-toolkit/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/agent-toolkit/package.json b/packages/agent-toolkit/package.json index 1813398a..062d98d7 100644 --- a/packages/agent-toolkit/package.json +++ b/packages/agent-toolkit/package.json @@ -1,6 +1,6 @@ { "name": "@mondaydotcomorg/agent-toolkit", - "version": "5.12.0", + "version": "5.12.1", "description": "monday.com agent toolkit", "exports": { "./mcp": { From 4b9bac83d16a28dff4e7c50a50c595e7f768fbfa Mon Sep 17 00:00:00 2001 From: noa reuven Date: Sun, 24 May 2026 16:29:48 +0300 Subject: [PATCH 14/14] fix(create-doc): address review feedback on docOwnerIds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .../create-doc-tool/create-doc-tool.test.ts | 22 +++++++++++++++---- .../create-doc-tool/create-doc-tool.ts | 14 ++++++------ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts index c30dd769..0b088d09 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts @@ -197,7 +197,7 @@ describe('CreateDocTool', () => { }; const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; - mocks.getMockRequest().mockImplementation((query: string) => { + jest.spyOn(mocks, 'mockRequest').mockImplementation((query: string) => { if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); return Promise.resolve({}); @@ -215,7 +215,7 @@ describe('CreateDocTool', () => { const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).toMatchObject({ docOwnerIds: ['111', '222'] }); + expect(createDocCall[1]).toEqual(expect.objectContaining({ docOwnerIds: ['111', '222'] })); }); it('does not include docOwnerIds in variables when not provided', async () => { @@ -224,7 +224,7 @@ describe('CreateDocTool', () => { }; const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; - mocks.getMockRequest().mockImplementation((query: string) => { + jest.spyOn(mocks, 'mockRequest').mockImplementation((query: string) => { if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); return Promise.resolve({}); @@ -243,6 +243,20 @@ describe('CreateDocTool', () => { expect(createDocCall).toBeDefined(); expect(createDocCall[1]).not.toHaveProperty('docOwnerIds'); }); + + it('rejects docOwnerIds as empty array (min 1 required)', async () => { + const args = { + location: 'workspace', + workspace_id: 12345, + doc_name: 'Empty Owners Doc', + markdown: '# Test', + docOwnerIds: [], + }; + + const result = await callToolByNameRawAsync('create_doc', args); + expect(result.content[0].text).toContain('Invalid arguments'); + expect(mocks.getMockRequest()).not.toHaveBeenCalled(); + }); }); describe('Validation Errors', () => { @@ -667,7 +681,7 @@ describe('CreateDocTool', () => { const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); expect(createDocCall).toBeDefined(); - expect(createDocCall[1]).toMatchObject({ docOwnerIds: ['555', '666'] }); + expect(createDocCall[1]).toEqual(expect.objectContaining({ docOwnerIds: ['555', '666'] })); }); it('does not include docOwnerIds in item doc variables when not provided', async () => { diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts index 0c54ff74..51823738 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts @@ -59,7 +59,7 @@ export const createDocToolSchema = { .min(1) .optional() .describe( - 'Optional list of user IDs to set as document owners at creation time. Use this to add the agent owner as a co-owner so they retain access to the document. Ownership is set inside the creation mutation itself, bypassing the permission checks that would block a subsequent add_users_to_board call.', + 'Optional list of user IDs to set as document owners at creation time. Use this to add the agent owner so they retain access to the document. Ownership is set inside the creation mutation itself, bypassing the permission checks that would block a subsequent add_subscribers_to_object call.', ), workspace_id: z .number() @@ -104,14 +104,14 @@ export class CreateDocTool extends BaseMondayApiTool return `Create a new monday.com doc either inside a workspace or attached to an item (via a doc column). After creation, the provided markdown will be appended to the document. LOCATION TYPES: -- workspace: Creates a document in a workspace (requires workspace_id, optional doc_kind, optional folder_id) -- item: Creates a document attached to an item (requires item_id, optional column_id) +- workspace: Creates a document in a workspace (requires workspace_id, optional doc_kind, optional folder_id, optional docOwnerIds) +- item: Creates a document attached to an item (requires item_id, optional column_id, optional docOwnerIds) USAGE EXAMPLES: -- Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." } -- Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." } -- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." } -- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, markdown: "...", docOwnerIds: [""] }`; +- Workspace doc: { location: "workspace", workspace_id: 123, doc_name: "My Doc", doc_kind: "private" , markdown: "..." } +- Workspace doc in folder: { location: "workspace", workspace_id: 123, doc_name: "My Doc", folder_id: 17264196 , markdown: "..." } +- Item doc: { location: "item", item_id: 456, doc_name: "My Doc", column_id: "doc_col_1" , markdown: "..." } +- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, doc_name: "My Doc", markdown: "...", docOwnerIds: [""] }`; } getInputSchema(): typeof createDocToolSchema {