@mondaydotcomorg/agent-toolkit 4.1.4 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,6 +63,37 @@
63
63
  }
64
64
  }
65
65
  `,BI=zI`
66
+ query GetDocComments($boardId: ID!, $itemsLimit: Int, $updatesLimit: Int) {
67
+ boards(ids: [$boardId]) {
68
+ items_page(limit: $itemsLimit) {
69
+ items {
70
+ id
71
+ name
72
+ updates(limit: $updatesLimit) {
73
+ id
74
+ text_body
75
+ body
76
+ created_at
77
+ creator {
78
+ id
79
+ name
80
+ }
81
+ replies {
82
+ id
83
+ text_body
84
+ body
85
+ created_at
86
+ creator {
87
+ id
88
+ name
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ `,qI=zI`
66
97
  query GetDocVersionDiff($docId: ID!, $date: String!, $prevDate: String!) {
67
98
  doc_version_diff(doc_id: $docId, date: $date, prev_date: $prevDate) {
68
99
  doc_id
@@ -78,13 +109,13 @@
78
109
  }
79
110
  }
80
111
  }
81
- `,qI=zI`
112
+ `,MI=zI`
82
113
  mutation DeleteItem($id: ID!) {
83
114
  delete_item(item_id: $id) {
84
115
  id
85
116
  }
86
117
  }
87
- `,MI=zI`
118
+ `,HI=zI`
88
119
  mutation createItem($boardId: ID!, $itemName: String!, $groupId: String, $columnValues: JSON) {
89
120
  create_item(board_id: $boardId, item_name: $itemName, group_id: $groupId, column_values: $columnValues) {
90
121
  id
@@ -92,7 +123,7 @@
92
123
  url
93
124
  }
94
125
  }
95
- `,HI=zI`
126
+ `,GI=zI`
96
127
  query getBoardSchema($boardId: ID!) {
97
128
  boards(ids: [$boardId]) {
98
129
  groups {
@@ -106,7 +137,7 @@
106
137
  }
107
138
  }
108
139
  }
109
- `,GI=zI`
140
+ `,WI=zI`
110
141
  mutation changeItemColumnValues($boardId: ID!, $itemId: ID!, $columnValues: JSON!) {
111
142
  change_multiple_column_values(board_id: $boardId, item_id: $itemId, column_values: $columnValues) {
112
143
  id
@@ -114,13 +145,13 @@
114
145
  url
115
146
  }
116
147
  }
117
- `,WI=zI`
148
+ `,QI=zI`
118
149
  mutation moveItemToGroup($itemId: ID!, $groupId: String!) {
119
150
  move_item_to_group(item_id: $itemId, group_id: $groupId) {
120
151
  id
121
152
  }
122
153
  }
123
- `,QI=zI`
154
+ `,KI=zI`
124
155
  mutation createBoard($boardKind: BoardKind!, $boardName: String!, $boardDescription: String, $workspaceId: ID) {
125
156
  create_board(
126
157
  board_kind: $boardKind
@@ -134,7 +165,7 @@
134
165
  url
135
166
  }
136
167
  }
137
- `,KI=zI`
168
+ `,YI=zI`
138
169
  mutation createColumn(
139
170
  $boardId: ID!
140
171
  $columnType: ColumnType!
@@ -153,13 +184,13 @@
153
184
  title
154
185
  }
155
186
  }
156
- `,YI=zI`
187
+ `,JI=zI`
157
188
  mutation deleteColumn($boardId: ID!, $columnId: String!) {
158
189
  delete_column(board_id: $boardId, column_id: $columnId) {
159
190
  id
160
191
  }
161
192
  }
162
- `,JI=zI`
193
+ `,XI=zI`
163
194
  query getGraphQLSchema {
164
195
  __schema {
165
196
  queryType {
@@ -212,7 +243,7 @@
212
243
  }
213
244
  }
214
245
  }
215
- `,XI=zI`
246
+ `,ZI=zI`
216
247
  query IntrospectionQuery {
217
248
  __schema {
218
249
  queryType {
@@ -314,7 +345,7 @@
314
345
  }
315
346
  }
316
347
  }
317
- `,ZI=zI`
348
+ `,eS=zI`
318
349
  mutation createCustomActivity($color: CustomActivityColor!, $icon_id: CustomActivityIcon!, $name: String!) {
319
350
  create_custom_activity(color: $color, icon_id: $icon_id, name: $name) {
320
351
  color
@@ -322,7 +353,7 @@
322
353
  name
323
354
  }
324
355
  }
325
- `,eS=zI`
356
+ `,tS=zI`
326
357
  mutation createTimelineItem(
327
358
  $item_id: ID!
328
359
  $custom_activity_id: String!
@@ -355,7 +386,7 @@
355
386
  type
356
387
  }
357
388
  }
358
- `,tS=zI`
389
+ `,aS=zI`
359
390
  query fetchCustomActivity {
360
391
  custom_activity {
361
392
  color
@@ -365,7 +396,7 @@
365
396
  type
366
397
  }
367
398
  }
368
- `,aS=zI`
399
+ `,iS=zI`
369
400
  query exportMarkdownFromDoc($docId: ID!, $blockIds: [String!]) {
370
401
  export_markdown_from_doc(docId: $docId, blockIds: $blockIds) {
371
402
  success
@@ -373,7 +404,7 @@
373
404
  error
374
405
  }
375
406
  }
376
- `,iS=zI`
407
+ `,nS=zI`
377
408
  query getWorkspaceInfo($workspace_id: ID!) {
378
409
  workspaces(ids: [$workspace_id]) {
379
410
  id
@@ -404,7 +435,7 @@
404
435
  name
405
436
  }
406
437
  }
407
- `,nS={query:e.z.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:e.z.string().describe("JSON string containing the variables for the GraphQL operation")};class oS extends eb{constructor(e,t,a){super(e,t,a),this.name="all_monday_api",this.type=an.ALL_API,this.annotations=Zg({title:"Run Query or Mutation on any monday.com API",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Execute any monday.com API operation by generating GraphQL queries and mutations dynamically. Make sure you ask only for the fields you need and nothing more. When providing the query/mutation - use get_graphql_schema and get_type_details tools first to understand the schema before crafting your query."}getInputSchema(){return nS}async loadSchema(e){if(oS.schemaCache[e])return oS.schemaCache[e];try{const t=await this.mondayApi.rawRequest(XI),{data:a}=t,i=ix(a);return oS.schemaCache[e]=i,i}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}async validateOperation(e,t){var a;return ax(await this.loadSchema(t),new Yb(e,a).parseDocument()).map((e=>e.message))}async executeInternal(e){const{query:t,variables:a}=e;try{let e={};try{e=JSON.parse(a)}catch(e){return{content:`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`}}const i=await this.validateOperation(t,this.context?.apiVersion??Ag);if(i.length>0)return{content:i.join(", ")};return{content:await this.mondayApi.request(t,e)}}catch(e){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)return{content:t.response.errors.map((e=>e.message)).join(", ")}}return{content:t}}}}oS.schemaCache={};const rS={itemId:e.z.number().describe("The ID of the item to be updated"),columnValues:e.z.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"}, \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"')},sS={boardId:e.z.number().describe("The ID of the board that contains the item to be updated"),...rS};class pS extends eb{constructor(){super(...arguments),this.name="change_item_column_values",this.type=an.WRITE,this.annotations=Zg({title:"Change Item Column Values",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Change the column values of an item in a monday.com board"}getInputSchema(){return this.context?.boardId?rS:sS}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),itemId:e.itemId.toString(),columnValues:e.columnValues},a=await this.mondayApi.request(GI,t);return{content:{message:`Item ${a.change_multiple_column_values?.id} successfully updated`,item_id:a.change_multiple_column_values?.id,item_name:a.change_multiple_column_values?.name,item_url:a.change_multiple_column_values?.url}}}}const dS={boardName:e.z.string().describe("The name of the board to create"),boardKind:e.z.nativeEnum(Ex).default(Ex.Public).describe("The kind of board to create"),boardDescription:e.z.string().optional().describe("The description of the board to create"),workspaceId:e.z.string().optional().describe("The ID of the workspace to create the board in")};const lS=zI`
438
+ `,oS={query:e.z.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:e.z.string().describe("JSON string containing the variables for the GraphQL operation")};class rS extends eb{constructor(e,t,a){super(e,t,a),this.name="all_monday_api",this.type=an.ALL_API,this.annotations=Zg({title:"Run Query or Mutation on any monday.com API",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Execute any monday.com API operation by generating GraphQL queries and mutations dynamically. Make sure you ask only for the fields you need and nothing more. When providing the query/mutation - use get_graphql_schema and get_type_details tools first to understand the schema before crafting your query."}getInputSchema(){return oS}async loadSchema(e){if(rS.schemaCache[e])return rS.schemaCache[e];try{const t=await this.mondayApi.rawRequest(ZI),{data:a}=t,i=ix(a);return rS.schemaCache[e]=i,i}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}async validateOperation(e,t){var a;return ax(await this.loadSchema(t),new Yb(e,a).parseDocument()).map((e=>e.message))}async executeInternal(e){const{query:t,variables:a}=e;try{let e={};try{e=JSON.parse(a)}catch(e){return{content:`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`}}const i=await this.validateOperation(t,this.context?.apiVersion??Ag);if(i.length>0)return{content:i.join(", ")};return{content:await this.mondayApi.request(t,e)}}catch(e){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)return{content:t.response.errors.map((e=>e.message)).join(", ")}}return{content:t}}}}rS.schemaCache={};const sS={itemId:e.z.number().describe("The ID of the item to be updated"),columnValues:e.z.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"}, \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"')},pS={boardId:e.z.number().describe("The ID of the board that contains the item to be updated"),...sS};class dS extends eb{constructor(){super(...arguments),this.name="change_item_column_values",this.type=an.WRITE,this.annotations=Zg({title:"Change Item Column Values",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Change the column values of an item in a monday.com board"}getInputSchema(){return this.context?.boardId?sS:pS}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),itemId:e.itemId.toString(),columnValues:e.columnValues},a=await this.mondayApi.request(WI,t);return{content:{message:`Item ${a.change_multiple_column_values?.id} successfully updated`,item_id:a.change_multiple_column_values?.id,item_name:a.change_multiple_column_values?.name,item_url:a.change_multiple_column_values?.url}}}}const lS={boardName:e.z.string().describe("The name of the board to create"),boardKind:e.z.nativeEnum(Ex).default(Ex.Public).describe("The kind of board to create"),boardDescription:e.z.string().optional().describe("The description of the board to create"),workspaceId:e.z.string().optional().describe("The ID of the workspace to create the board in")};const cS=zI`
408
439
  mutation createView(
409
440
  $boardId: ID!
410
441
  $type: ViewKind!
@@ -418,7 +449,7 @@
418
449
  type
419
450
  }
420
451
  }
421
- `,cS={boardId:e.z.string().describe("The board ID to create the view on"),type:e.z.nativeEnum(mT).default(mT.Table).describe("The type of board view to create. Use TABLE for standard board views."),name:e.z.string().optional().describe('The name of the view (e.g. "High Priority Items", "My Tasks")'),filter:e.z.object({rules:e.z.array(e.z.object({column_id:e.z.string().describe("The column ID to filter by"),compare_value:e.z.any().default([]).describe("The value(s) to compare against"),operator:e.z.nativeEnum(wE).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:e.z.nativeEnum(_E).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration for the view"),sort:e.z.array(e.z.object({column_id:e.z.string().describe("The column ID to sort by"),direction:e.z.nativeEnum(yE).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view")};const mS=zI`
452
+ `,mS={boardId:e.z.string().describe("The board ID to create the view on"),type:e.z.nativeEnum(mT).default(mT.Table).describe("The type of board view to create. Use TABLE for standard board views."),name:e.z.string().optional().describe('The name of the view (e.g. "High Priority Items", "My Tasks")'),filter:e.z.object({rules:e.z.array(e.z.object({column_id:e.z.string().describe("The column ID to filter by"),compare_value:e.z.any().default([]).describe("The value(s) to compare against"),operator:e.z.nativeEnum(wE).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:e.z.nativeEnum(_E).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration for the view"),sort:e.z.array(e.z.object({column_id:e.z.string().describe("The column ID to sort by"),direction:e.z.nativeEnum(yE).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view")};const uS=zI`
422
453
  fragment QuestionBasic on FormQuestion {
423
454
  id
424
455
  type
@@ -427,13 +458,13 @@
427
458
  visible
428
459
  required
429
460
  }
430
- `,uS=zI`
461
+ `,hS=zI`
431
462
  fragment QuestionOptions on FormQuestion {
432
463
  options {
433
464
  label
434
465
  }
435
466
  }
436
- `,hS=zI`
467
+ `,fS=zI`
437
468
  fragment QuestionSettings on FormQuestion {
438
469
  settings {
439
470
  prefill {
@@ -456,17 +487,17 @@
456
487
  skipValidation
457
488
  }
458
489
  }
459
- `,fS=zI`
490
+ `,vS=zI`
460
491
  fragment QuestionComplete on FormQuestion {
461
492
  ...QuestionBasic
462
493
  ...QuestionOptions
463
494
  ...QuestionSettings
464
495
  showIfRules
465
496
  }
466
- ${mS}
467
497
  ${uS}
468
498
  ${hS}
469
- `,vS=zI`
499
+ ${fS}
500
+ `,gS=zI`
470
501
  fragment FormFeatures on FormFeatures {
471
502
  isInternal
472
503
  reCaptchaChallenge
@@ -519,7 +550,7 @@
519
550
  syncQuestionAndColumnsTitles
520
551
  }
521
552
  }
522
- `,gS=zI`
553
+ `,bS=zI`
523
554
  fragment FormAppearance on FormAppearance {
524
555
  hideBranding
525
556
  showProgressBar
@@ -547,19 +578,19 @@
547
578
  text
548
579
  }
549
580
  }
550
- `,bS=zI`
581
+ `,yS=zI`
551
582
  fragment FormAccessibility on FormAccessibility {
552
583
  language
553
584
  logoAltText
554
585
  }
555
- `,yS=zI`
586
+ `,_S=zI`
556
587
  fragment FormTag on FormTag {
557
588
  id
558
589
  name
559
590
  value
560
591
  columnId
561
592
  }
562
- `,_S=zI`
593
+ `,wS=zI`
563
594
  mutation createForm(
564
595
  $destination_workspace_id: ID!
565
596
  $destination_folder_id: ID
@@ -586,7 +617,7 @@
586
617
  token
587
618
  }
588
619
  }
589
- `,wS=zI`
620
+ `,xS=zI`
590
621
  query getForm($formToken: String!) {
591
622
  form(formToken: $formToken) {
592
623
  id
@@ -615,16 +646,16 @@
615
646
  }
616
647
  }
617
648
  }
618
- ${fS}
619
649
  ${vS}
620
650
  ${gS}
621
651
  ${bS}
622
652
  ${yS}
623
- `,xS=zI`
653
+ ${_S}
654
+ `,ES=zI`
624
655
  mutation deleteFormQuestion($formToken: String!, $questionId: String!) {
625
656
  delete_question(formToken: $formToken, questionId: $questionId)
626
657
  }
627
- `,ES=zI`
658
+ `,TS=zI`
628
659
  mutation createFormQuestion($formToken: String!, $question: CreateQuestionInput!) {
629
660
  create_form_question(formToken: $formToken, question: $question) {
630
661
  ...QuestionBasic
@@ -632,10 +663,10 @@
632
663
  ...QuestionSettings
633
664
  }
634
665
  }
635
- ${mS}
636
666
  ${uS}
637
667
  ${hS}
638
- `,TS=zI`
668
+ ${fS}
669
+ `,IS=zI`
639
670
  mutation updateFormQuestion($formToken: String!, $questionId: String!, $question: UpdateQuestionInput!) {
640
671
  update_form_question(formToken: $formToken, questionId: $questionId, question: $question) {
641
672
  ...QuestionBasic
@@ -643,9 +674,9 @@
643
674
  ...QuestionSettings
644
675
  }
645
676
  }
646
- ${mS}
647
677
  ${uS}
648
678
  ${hS}
679
+ ${fS}
649
680
  `;zI`
650
681
  mutation updateForm($formToken: String!, $input: UpdateFormInput!) {
651
682
  update_form(formToken: $formToken, input: $input) {
@@ -670,46 +701,46 @@
670
701
  }
671
702
  }
672
703
  }
673
- ${vS}
674
704
  ${gS}
675
705
  ${bS}
676
- `;const IS=zI`
706
+ ${yS}
707
+ `;const SS=zI`
677
708
  mutation setFormPassword($formToken: String!, $input: SetFormPasswordInput!) {
678
709
  set_form_password(formToken: $formToken, input: $input) {
679
710
  id
680
711
  }
681
712
  }
682
- `,SS=zI`
713
+ `,NS=zI`
683
714
  mutation shortenFormUrl($formToken: String!) {
684
715
  shorten_form_url(formToken: $formToken) {
685
716
  enabled
686
717
  url
687
718
  }
688
719
  }
689
- `,NS=zI`
720
+ `,AS=zI`
690
721
  mutation deactivateForm($formToken: String!) {
691
722
  deactivate_form(formToken: $formToken)
692
723
  }
693
- `,AS=zI`
724
+ `,DS=zI`
694
725
  mutation activateForm($formToken: String!) {
695
726
  activate_form(formToken: $formToken)
696
727
  }
697
- `,DS=zI`
728
+ `,kS=zI`
698
729
  mutation deleteFormTag($formToken: String!, $tagId: String!) {
699
730
  delete_form_tag(formToken: $formToken, tagId: $tagId)
700
731
  }
701
- `,kS=zI`
732
+ `,OS=zI`
702
733
  mutation createFormTag($formToken: String!, $tag: CreateFormTagInput!) {
703
734
  create_form_tag(formToken: $formToken, tag: $tag) {
704
735
  ...FormTag
705
736
  }
706
737
  }
707
- ${yS}
708
- `,OS=zI`
738
+ ${_S}
739
+ `,RS=zI`
709
740
  mutation updateFormTag($formToken: String!, $tagId: String!, $tag: UpdateFormTagInput!) {
710
741
  update_form_tag(formToken: $formToken, tagId: $tagId, tag: $tag)
711
742
  }
712
- `,RS=zI`
743
+ `,PS=zI`
713
744
  mutation updateFormAppearance($formToken: String!, $appearance: FormAppearanceInput!) {
714
745
  update_form_settings(formToken: $formToken, settings: { appearance: $appearance }) {
715
746
  appearance {
@@ -717,8 +748,8 @@
717
748
  }
718
749
  }
719
750
  }
720
- ${gS}
721
- `,PS=zI`
751
+ ${bS}
752
+ `,$S=zI`
722
753
  mutation updateFormAccessibility($formToken: String!, $accessibility: FormAccessibilityInput!) {
723
754
  update_form_settings(formToken: $formToken, settings: { accessibility: $accessibility }) {
724
755
  accessibility {
@@ -726,8 +757,8 @@
726
757
  }
727
758
  }
728
759
  }
729
- ${bS}
730
- `,$S=zI`
760
+ ${yS}
761
+ `,CS=zI`
731
762
  mutation updateFormFeatures($formToken: String!, $features: FormFeaturesInput!) {
732
763
  update_form_settings(formToken: $formToken, settings: { features: $features }) {
733
764
  features {
@@ -735,8 +766,8 @@
735
766
  }
736
767
  }
737
768
  }
738
- ${vS}
739
- `,CS=zI`
769
+ ${gS}
770
+ `,FS=zI`
740
771
  mutation updateFormQuestionOrder($formToken: String!, $questions: [QuestionOrderInput!]!) {
741
772
  update_form(formToken: $formToken, input: { questions: $questions }) {
742
773
  questions {
@@ -744,20 +775,20 @@
744
775
  }
745
776
  }
746
777
  }
747
- `,FS=zI`
778
+ `,jS=zI`
748
779
  mutation updateFormHeader($formToken: String!, $title: String, $description: String) {
749
780
  update_form(formToken: $formToken, input: { title: $title, description: $description }) {
750
781
  title
751
782
  description
752
783
  }
753
784
  }
754
- `,jS={formToken:"The unique identifier token for the form. Required for all form-specific operations.",questionId:"The unique identifier for the question. Used to target specific questions within a form."},LS={operations:{createForm:"Create a new form with specified configuration. Returns the created form with its unique token.",updateForm:{action:"The type of update action to perform on the form. Can be one of the following: activate, deactivate, shortenFormUrl, setFormPassword, createTag, deleteTag, updateTag, updateForm, updateAppearance, updateAccessibility, updateFeatures, updateQuestionOrder, updateFormHeader."},activateForm:"Activate a form to make it visible to users and accept new submissions.",deactivateForm:"Deactivate a form to hide it from users and stop accepting submissions. Form data is preserved."},properties:{id:"The unique identifier for the form. Auto-generated upon creation.",token:"The unique token used to access and identify the form. Used in public URLs and API calls.",boardId:"The board ID connected to the form. Used to store form responses as items.",title:"The display title shown to users at the top of the form.",description:"Optional detailed description explaining the form purpose, displayed below the title.",active:"Boolean indicating if the form is currently accepting responses and visible to users.",ownerId:"The ID of the user who created and owns this form. Determines permissions.",createWithAI:"Boolean indicating if this form was initially created using AI assistance.",builtWithAI:"Boolean indicating if this form was built or modified using AI functionality.",questions:"Array of question objects that make up the form content, in display order.",isSuspicious:"Boolean flag indicating if the form has been flagged for review due to suspicious content or activity.",isAnonymous:"Boolean indicating if responses are collected without identifying the submitter.",type:"The category or classification of the form for organizational purposes.",features:"Object containing feature toggles and settings like password protection, response limits, etc.",appearance:"Object containing visual styling settings including colors, fonts, layout, and branding.",accessibility:"Object containing accessibility settings such as language, alt text, and reading direction.",tags:{description:"Array of tracking tags for categorization and analytics (e.g., UTM parameters for marketing tracking).",id:"The unique identifier for the tag. This will get auto generated when creating a tag and can’t be updated. This is required when updating or deleting a tag.",name:"The name of the tag. This can only be created, not updated. This is required when creating a tag.",value:"The value of the tag. This value is required when creating or updating a tag.",columnId:"The ID of the column this tag is associated with. This will get auto generated when creating a tag and can’t be updated."}},inputs:{title:"The title text for the form. Must be at least 1 character long. Can only be updated if the update action is updateFormHeader.",description:"Optional description text providing context about the form purpose. Can only be updated if the update action is updateFormHeader.",input:"Complete form configuration object containing properties to create or update.",questions:"Ordered array of dehydrated questions, object only including each question ID, for reordering. Must include all existing question IDs. Required if the update action is updateQuestionOrder.",questionId:"The unique identifier for the question. Used to target specific questions within a form. Required when deleting or updating a question.",tag:"The tag data to create, update or delete. If deleting a tag, only provide the id of the tag to delete. If creating a tag, provide the name and value, the id and columnId are auto generated. If updating a tag, provide the id and new value, name and columnId are not changeable.",form:{describe:"The form data to update. Required if updating the appearance, accessibility, features, question order, or form header.",appearance:"The appearance data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateAppearance.",accessibility:"The accessibility data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateAccessibility.",features:"The features data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateFeatures.",questionOrder:"The question order data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateQuestionOrder.",formHeader:"The form header data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateFormHeader."}},args:{formToken:"The unique form token identifying which form to operate on.",destinationWorkspaceId:"The workspace in which the form will be created in.",destinationFolderId:"The folder in which the form will be created under.",destinationFolderName:"The name of the folder in which the form will be created in.",boardKind:"The board kind to create for the board in which the form will create items in.",destinationName:"The name of the board that will be created to store the form responses in.",boardOwnerIds:"Array of user IDs who will have owner permissions on the board in which the form will create items in.",boardOwnerTeamIds:"Array of team IDs whose members will have owner permissions on the board in which the form will create items in.",boardSubscriberIds:"Array of user IDs who will receive notifications about board activity for the board in which the form will create items in.",boardSubscriberTeamsIds:"Array of team IDs whose members will receive notifications about board activity for the board in which the form will create items in."}},zS={operations:{updateFormSettings:"Update form configuration including features, appearance, and accessibility options.",setFormPassword:'Set a password on a form to restrict access. This will enable password protection for the form. Required for the action "setFormPassword" in the update form tool.',shortenUrl:"Shorten a URL for a form and store it in the form settings. Returns the shortened link object."},properties:{features:"Object containing form features including but not limited to password protection, response limits, login requirements, etc. Required when updating the features of the form.",appearance:"Object containing visual styling including colors, layout, fonts, and branding elements. Required when updating the appearance of the form.",accessibility:"Object containing accessibility options such as language, alt text, etc. Required when updating the accessibility of the form.",isInternal:"Boolean indicating if the form is restricted to internal users only.",reCaptchaChallenge:"Boolean enabling reCAPTCHA verification to prevent spam submissions.",password:"Object containing password protection configuration for the form.",passwordEnabled:"Boolean disabling password protection. Can only be updated to false. In order to enable password protection use the setFormPassword action instead.",requireLogin:"Object containing login requirement settings for form access.",requireLoginEnabled:"Boolean requiring users to be logged in before submitting responses.",redirectToLogin:"Boolean automatically redirecting unauthenticated users to the login page.",shortenedLink:"Object containing shortened URL configuration for easy form sharing.",shortenedLinkEnabled:"Boolean enabling generation of shortened URLs for the form.",shortenedLinkUrl:"The generated shortened URL for form access. Only available when shortened links are enabled.",draftSubmission:"Object containing draft saving configuration allowing users to save progress.",draftSubmissionEnabled:"Boolean allowing users to save incomplete responses as drafts.",aiTranslate:"Object containing AI translation configuration for the form.",aiTranslateEnabled:"Boolean enabling AI translation for the form.",responseLimit:"Object containing response limitation settings to control submission volume.",responseLimitEnabled:"Boolean enabling response count limits for the form.",responseLimitValue:"Integer specifying the maximum number of responses allowed.",closeDate:"Object containing automatic form closure configuration.",closeDateEnabled:"Boolean enabling automatic form closure at a specified date and time.",closeDateValue:"ISO timestamp when the form will automatically stop accepting responses.",allowResubmit:"Boolean allowing users to submit multiple responses to the same form.",allowEditSubmission:"Boolean allowing users to modify their submitted responses after submission.",allowViewSubmission:"Boolean allowing users to view their submitted responses.",preSubmissionView:"Object containing welcome screen configuration displayed before the form.",preSubmissionEnabled:"Boolean showing a welcome/introduction screen before the form begins.",preSubmissionTitle:"Text displayed as the title on the welcome screen.",preSubmissionDescription:"Text providing context or instructions on the welcome screen.",startButton:"Object containing start button configuration for the welcome screen.",startButtonText:"Custom text for the button that begins the form experience.",afterSubmissionView:"Object containing settings for the post-submission user experience.",postSubmissionTitle:"Text displayed as the title after successful form submission.",postSubmissionDescription:"Text shown to users after they complete the form.",showSuccessImage:"Boolean displaying a success image after form completion.",redirectAfterSubmission:"Object containing redirect configuration after form submission.",redirectAfterSubmissionEnabled:"Boolean enabling automatic redirect after form completion to a specified URL.",redirectUrl:"The URL where users will be redirected after successfully submitting the form.",monday:"Object containing board settings for response handling.",itemGroupId:"The board group ID where new items from form responses will be created.",includeNameQuestion:"Boolean adding a name question to the form. This is a special question type that represents the name column from the associated monday board",includeUpdateQuestion:"Boolean adding an update/comment field to the form. This is a special question type that represents the updates from the associated item of the submission on the monday board. ",syncQuestionAndColumnsTitles:"Boolean synchronizing form question titles with board column names. When true, the form question titles will be synchronized with the board column names.",hideBranding:"Boolean hiding monday branding from the form display.",showProgressBar:"Boolean displaying a progress indicator showing form completion progress bar.",primaryColor:"Hex color code for the primary theme color used throughout the form.",layout:"Object containing form structure and presentation settings.",format:"String specifying the form display format. Can be a step by step form or a classic one page form.",alignment:"String controlling text and content alignment.",direction:"String setting reading direction.",background:"Object containing background appearance configuration for the form.",backgroundType:"String specifying background style.",backgroundValue:"String containing the background value. The value will depend on the background type. If the background type is color, the value will be a hex color code. If the background type is image, the value will be an image URL.",text:"Object containing typography and text styling configuration.",font:"String specifying the font family used throughout the form.",textColor:"Hex color code for the text color in the form.",fontSize:"String or number specifying the base font size for form text.",logo:"Object containing logo display configuration for form branding.",logoPosition:'String specifying logo placement ("top", "bottom", "header").',logoUrl:"URL pointing to the logo image file for display on the form.",logoSize:'String specifying logo size ("small", "medium", "large") for the logo that appears on the header of the form.',logoAltText:"Alternative text description for the logo image for accessibility.",submitButton:"Object containing submit button styling and text configuration.",submitButtonText:"Custom text displayed on the form submission button.",language:'Language code for form localization and interface text (e.g., "en", "es", "fr").'},inputs:{settings:"Complete form settings object containing all configuration options.",features:"Form features configuration including security, limits, and access controls.",appearance:"Visual styling configuration including colors, layout, and branding.",accessibility:"Accessibility configuration including language and reading direction.",password:"Password configuration for the form. Only setting enabled to false is supported. To enable a form to be password protected, please use the set_form_password mutation instead.",passwordValue:"The password to set for the form. Must be at least 1 character long."}},US={actions:{type:"The type of operation to perform on the question. Can delete, update, or create. When updating or deleting a question, the questionId is required. When creating or updating a question, the question object is required. When updating, the question is a patch object, meaning that only the fields that are provided will be updated.",question:"The question object containing all properties for creation or update. When creating a question, the title is required."},properties:{title:"The question text displayed to respondents. Must be at least 1 character long and clearly indicate the expected response.",type:'The question type determining input behavior and validation (e.g., "text", "email", "single_select", "multi_select").',visible:"Boolean controlling question visibility to respondents. Hidden questions remain in form structure but are not displayed.",required:"Boolean indicating if the question must be answered before form submission.",position:"Integer specifying the display order of the question within the form (zero-based).",description:"Optional explanatory text providing additional context, instructions, or examples for the question.",placeholder:"Optional placeholder text shown in input fields to guide user input.",createdAt:"ISO timestamp when the question was created.",updatedAt:"ISO timestamp when the question was last modified.",selectOptions:"Array of option objects for choice-based questions (single_select, multi_select). Required when creating select type questions. Can only be provided when creating a question, not yet supported for updating a question.",selectOptionsLabel:"The display text for individual option choices in select-type questions."},inputs:{question:"Complete question object containing all properties for creation or update.",questionData:"Question configuration including type, title, and type-specific settings.",position:"Integer position where the question should be placed in the form sequence."}},VS={properties:{validation:"Validation rules applied to the question response",prefill:"Configuration for automatically populating question values from various data sources such as user account information or URL query parameters.",prefillEnabled:"Whether prefill functionality is enabled for this question. When true, the question will attempt to auto-populate values from the specified source.",prefillSource:"The data source to use for prefilling the question value. Check the PrefillSources for available options.",prefillLookup:'The specific field or parameter name to lookup from the prefill source. For account sources, this would be a user property like "name" or "email". For query parameters, this would be the parameter name that would be set in the URL.',prefixAutofilled:"Phone questions only: Automatically detect and fill the phone country prefix based on the user's geographic location or browser settings.",prefixPredefined:"Phone questions only: Configuration for setting a specific predefined phone country prefix that will be pre-selected for users.",prefixPredefinedEnabled:"Whether a predefined phone prefix is enabled for phone number questions. When true, the specified prefix will be pre-selected.",prefixPredefinedPrefix:'The predefined phone country prefix to use as country code in capital letters (e.g., "US", "UK", "IL"). Only used when enabled is true.',checkedByDefault:"Boolean/checkbox questions only: Whether the checkbox should be checked by default when the form loads.",defaultCurrentDate:"Date based questions only: Automatically set the current date as the default value when the form loads.",includeTime:"Date questions only: Whether to include time selection (hours and minutes) in addition to the date picker. When false, only date selection is available.",display:"Single/Multi Select questions only: Controls how the selection options are visually presented to users.",optionsOrder:"Single/Multi Select questions only: Determines the ordering of selection options.",locationAutofilled:"Location questions only: Automatically detect and fill the user's current location using browser geolocation services, requiring user permission.",limit:"Rating questions only: Maximum rating value that users can select.",skipValidation:"Link/URL questions only: Whether to skip URL format validation, allowing any text input."},inputs:{settings:"Question-specific configuration object that varies by question type.",validationRules:"Validation constraints and rules",choiceOptions:"List of available choices for selection questions",fileSettings:"File upload constraints and settings"}},BS={destination_workspace_id:e.z.string().describe(LS.args.destinationWorkspaceId),destination_folder_id:e.z.string().optional().describe(LS.args.destinationFolderId),destination_folder_name:e.z.string().optional().describe(LS.args.destinationFolderName),board_kind:e.z.nativeEnum(Ex).optional().describe(LS.args.boardKind),destination_name:e.z.string().optional().describe(LS.args.destinationName),board_owner_ids:e.z.array(e.z.string()).optional().describe(LS.args.boardOwnerIds),board_owner_team_ids:e.z.array(e.z.string()).optional().describe(LS.args.boardOwnerTeamIds),board_subscriber_ids:e.z.array(e.z.string()).optional().describe(LS.args.boardSubscriberIds),board_subscriber_teams_ids:e.z.array(e.z.string()).optional().describe(LS.args.boardSubscriberTeamsIds)};var qS,MS,HS,GS,WS,QS,KS,YS,JS,XS,ZS,eN,tN,aN,iN,nN;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(qS||(qS={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(MS||(MS={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(HS||(HS={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(GS||(GS={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(WS||(WS={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(QS||(QS={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(KS||(KS={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(YS||(YS={})),function(e){e.Boolean="Boolean",e.ConnectedBoards="ConnectedBoards",e.Country="Country",e.Date="Date",e.DateRange="DateRange",e.Email="Email",e.File="File",e.Link="Link",e.Location="Location",e.LongText="LongText",e.MultiSelect="MultiSelect",e.Name="Name",e.Number="Number",e.People="People",e.Phone="Phone",e.Rating="Rating",e.ShortText="ShortText",e.Signature="Signature",e.SingleSelect="SingleSelect",e.Subitems="Subitems",e.Updates="Updates"}(JS||(JS={})),function(e){e.Account="account",e.QueryParam="queryParam"}(XS||(XS={})),function(e){e.Email="email",e.Name="name",e.Title="title",e.Phone="phone",e.FirstName="first_name",e.LastName="last_name",e.Location="location",e.Timezone="time_zone",e.ManagerName="manager_display_name"}(ZS||(ZS={})),function(e){e.And="AND",e.Or="OR"}(eN||(eN={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(tN||(tN={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(aN||(aN={})),function(e){e.MultiSelect="multi-select",e.SingleSelect="single-select",e.People="people",e.Location="location",e.CountryCode="country-code",e.Country="country",e.ConnectedBoards="connected_boards"}(iN||(iN={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(nN||(nN={}));const oN=e.z.object({type:e.z.nativeEnum(fE).describe(US.properties.type),title:e.z.string().describe(US.properties.title).optional(),description:e.z.string().describe(US.properties.description).optional(),visible:e.z.boolean().describe(US.properties.visible).optional(),required:e.z.boolean().describe(US.properties.required).optional(),options:e.z.array(e.z.object({label:e.z.string().describe(US.properties.selectOptionsLabel)})).describe(US.properties.selectOptions).optional(),settings:e.z.object({checkedByDefault:e.z.boolean().describe(VS.properties.checkedByDefault).optional(),defaultCurrentDate:e.z.boolean().describe(VS.properties.defaultCurrentDate).optional(),display:e.z.nativeEnum(uE).describe(VS.properties.display).optional(),includeTime:e.z.boolean().describe(VS.properties.includeTime).optional(),locationAutofilled:e.z.boolean().describe(VS.properties.locationAutofilled).optional(),optionsOrder:e.z.nativeEnum(hE).describe(VS.properties.optionsOrder).optional(),prefixAutofilled:e.z.boolean().describe(VS.properties.prefixAutofilled).optional(),prefixPredefined:e.z.object({enabled:e.z.boolean().describe(VS.properties.prefixPredefinedEnabled),prefix:e.z.string().describe(VS.properties.prefixPredefinedPrefix).optional()}).describe(VS.properties.prefixPredefined).optional(),skipValidation:e.z.boolean().describe(VS.properties.skipValidation).optional(),prefill:e.z.object({enabled:e.z.boolean().describe(VS.properties.prefillEnabled),lookup:e.z.string().describe(VS.properties.prefillLookup).optional(),source:e.z.nativeEnum(mE).describe(VS.properties.prefillSource).optional()}).describe(VS.properties.prefill).optional()}).optional()}),rN={action:e.z.nativeEnum(nN).describe(US.actions.type),formToken:e.z.string().describe(jS.formToken),questionId:e.z.string().describe(jS.questionId).optional(),question:oN.describe(US.actions.question).optional()};class sN{constructor(e){this.mondayApi=e}async deleteQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when deleting a question."};const a={formToken:e.formToken,questionId:t};return await this.mondayApi.request(xS,a),{content:{message:"Question deleted",question_id:t,action_name:"delete"}}}async updateQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when updating a question."};const a=e.question;if(!a)return{content:"Must provide updated patch props for the question when updating."};const i={formToken:e.formToken,questionId:t,question:a};return await this.mondayApi.request(TS,i),{content:{message:"Question updated",question_id:t,action_name:"update"}}}async createQuestion(e){const t=e.question;if(!t)return{content:"Must provide a full question payload when creating a question."};if(!t.title)return{content:"Must provide a title for the question when creating a question."};const a={formToken:e.formToken,question:{...t,title:t.title}},i=await this.mondayApi.request(ES,a);return{content:{message:"Question created",question_id:i.create_form_question?.id,action_name:"create"}}}}var pN;!function(e){e.activate="activate",e.deactivate="deactivate",e.shortenFormUrl="shortenFormUrl",e.setFormPassword="setFormPassword",e.createTag="createTag",e.deleteTag="deleteTag",e.updateTag="updateTag",e.updateAppearance="updateAppearance",e.updateAccessibility="updateAccessibility",e.updateFeatures="updateFeatures",e.updateQuestionOrder="updateQuestionOrder",e.updateFormHeader="updateFormHeader"}(pN||(pN={}));const dN=e.z.object({id:e.z.string().describe(LS.properties.tags.id).optional(),name:e.z.string().describe(LS.properties.tags.name).optional(),value:e.z.string().describe(LS.properties.tags.value).optional(),columnId:e.z.string().describe(LS.properties.tags.columnId).optional()}),lN=e.z.object({type:e.z.nativeEnum(GS).describe(zS.properties.backgroundType).optional(),value:e.z.string().describe(zS.properties.backgroundValue).optional()}),cN=e.z.object({format:e.z.nativeEnum(QS).describe(zS.properties.format).optional(),alignment:e.z.nativeEnum(KS).describe(zS.properties.alignment).optional(),direction:e.z.nativeEnum(WS).describe(zS.properties.direction).optional()}),mN=e.z.object({position:e.z.nativeEnum(HS).describe(zS.properties.logoPosition).optional(),size:e.z.nativeEnum(MS).describe(zS.properties.logoSize).optional()}),uN=e.z.object({text:e.z.string().describe(zS.properties.submitButtonText).optional()}),hN=e.z.object({font:e.z.string().describe(zS.properties.font).optional(),color:e.z.string().describe(zS.properties.textColor).optional(),size:e.z.nativeEnum(YS).describe(zS.properties.fontSize).optional()}),fN=e.z.object({enabled:e.z.boolean().describe(zS.properties.redirectAfterSubmissionEnabled).optional(),redirectUrl:e.z.string().describe(zS.properties.redirectUrl).optional()}),vN=e.z.object({allowEditSubmission:e.z.boolean().describe(zS.properties.allowEditSubmission).optional(),allowResubmit:e.z.boolean().describe(zS.properties.allowResubmit).optional(),allowViewSubmission:e.z.boolean().describe(zS.properties.allowViewSubmission).optional(),description:e.z.string().describe(zS.properties.postSubmissionDescription).optional(),redirectAfterSubmission:fN.describe(zS.properties.redirectAfterSubmission).optional(),showSuccessImage:e.z.boolean().describe(zS.properties.showSuccessImage).optional(),title:e.z.string().describe(zS.properties.postSubmissionTitle).optional()}),gN=e.z.object({enabled:e.z.boolean().describe(zS.properties.closeDateEnabled).optional(),date:e.z.string().describe(zS.properties.closeDateValue).optional()}),bN=e.z.object({enabled:e.z.boolean().describe(zS.properties.draftSubmissionEnabled).optional()}),yN=e.z.object({itemGroupId:e.z.string().describe(zS.properties.itemGroupId).optional(),includeNameQuestion:e.z.boolean().describe(zS.properties.includeNameQuestion).optional(),includeUpdateQuestion:e.z.boolean().describe(zS.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:e.z.boolean().describe(zS.properties.syncQuestionAndColumnsTitles).optional()}),_N=e.z.object({enabled:e.z.boolean().describe(zS.properties.passwordEnabled).optional()}),wN=e.z.object({text:e.z.string().describe(zS.properties.startButtonText).optional()}),xN=e.z.object({enabled:e.z.boolean().describe(zS.properties.preSubmissionEnabled).optional(),title:e.z.string().describe(zS.properties.preSubmissionTitle).optional(),description:e.z.string().describe(zS.properties.preSubmissionDescription).optional(),startButton:wN.describe(zS.properties.startButton).optional()}),EN=e.z.object({enabled:e.z.boolean().describe(zS.properties.requireLoginEnabled).optional(),redirectToLogin:e.z.boolean().describe(zS.properties.redirectToLogin).optional()}),TN=e.z.object({enabled:e.z.boolean().describe(zS.properties.responseLimitEnabled).optional(),limit:e.z.number().describe(zS.properties.responseLimitValue).optional()}),IN=e.z.object({background:lN.describe(zS.properties.background).optional(),hideBranding:e.z.boolean().describe(zS.properties.hideBranding).optional(),layout:cN.describe(zS.properties.layout).optional(),logo:mN.describe(zS.properties.logo).optional(),primaryColor:e.z.string().describe(zS.properties.primaryColor).optional(),showProgressBar:e.z.boolean().describe(zS.properties.showProgressBar).optional(),submitButton:uN.describe(zS.properties.submitButton).optional(),text:hN.describe(zS.properties.text).optional()}),SN=e.z.object({language:e.z.string().describe(zS.properties.language).optional(),logoAltText:e.z.string().describe(zS.properties.logoAltText).optional()}),NN=e.z.object({afterSubmissionView:vN.describe(zS.properties.afterSubmissionView).optional(),closeDate:gN.describe(zS.properties.closeDate).optional(),draftSubmission:bN.describe(zS.properties.draftSubmission).optional(),monday:yN.describe(zS.properties.monday).optional(),password:_N.describe(zS.properties.password).optional(),preSubmissionView:xN.describe(zS.properties.preSubmissionView).optional(),reCaptchaChallenge:e.z.boolean().describe(zS.properties.reCaptchaChallenge).optional(),requireLogin:EN.describe(zS.properties.requireLogin).optional(),responseLimit:TN.describe(zS.properties.responseLimit).optional()}),AN=e.z.object({id:e.z.string().describe(LS.inputs.questionId)}),DN=e.z.object({appearance:IN.describe(LS.inputs.form.appearance).optional(),accessibility:SN.describe(LS.inputs.form.accessibility).optional(),features:NN.describe(LS.inputs.form.features).optional(),title:e.z.string().describe(LS.inputs.title).optional(),description:e.z.string().describe(LS.inputs.description).optional(),questions:e.z.array(AN).describe(LS.inputs.questions).optional()}),kN={formToken:e.z.string().describe(jS.formToken),action:e.z.nativeEnum(pN).describe(LS.operations.updateForm.action),formPassword:e.z.string().describe(zS.operations.setFormPassword).optional(),tag:dN.describe(LS.inputs.tag).optional(),form:DN.describe(LS.inputs.form.describe).optional()};class ON{constructor(e){this.mondayApi=e}async setFormPassword(e){if(!e.formPassword)return{content:'formPassword is required for the action "setFormPassword" in the update form tool.'};const t={formToken:e.formToken,input:{password:e.formPassword}};return await this.mondayApi.request(IS,t),{content:{message:"Form password successfully set",form_token:e.formToken,action_name:"setFormPassword"}}}async shortenFormUrl(e){const t={formToken:e.formToken};return await this.mondayApi.request(SS,t),{content:{message:"Form URL successfully shortened",form_token:e.formToken,action_name:"shortenFormUrl"}}}async deactivateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(NS,t),{content:{message:"Form successfully deactivated",form_token:e.formToken,action_name:"deactivateForm"}}}async activateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(AS,t),{content:{message:"Form successfully activated",form_token:e.formToken,action_name:"activateForm"}}}async createTag(e){if(!e.tag)return{content:'Tag is required for the action "createTag" in the update form tool.'};if(!e.tag.name)return{content:'Tag name is required for the action "createTag" in the update form tool.'};const t={formToken:e.formToken,tag:{name:e.tag.name,value:e.tag.value}},a=await this.mondayApi.request(kS,t);return{content:{message:"Tag successfully added",form_token:e.formToken,action_name:"createTag",data:a.create_form_tag}}}async deleteTag(e){if(!e.tag)return{content:'Tag is required for the action "deleteTag" in the update form tool.'};if(!e.tag.id)return{content:'Tag id is required for the action "deleteTag" in the update form tool.'};const t={formToken:e.formToken,tagId:e.tag.id};return await this.mondayApi.request(DS,t),{content:{message:"Tag deleted",form_token:e.formToken,tag_id:e.tag.id,action_name:"deleteTag"}}}async updateTag(e){if(!e.tag)return{content:'Tag is required for the action "updateTag" in the update form tool.'};if(!e.tag.id||!e.tag.value)return{content:'Tag id and value are required for the action "updateTag" in the update form tool.'};const t={formToken:e.formToken,tagId:e.tag.id,tag:{value:e.tag.value}};return(await this.mondayApi.request(OS,t)).update_form_tag?{content:{message:"Tag updated",form_token:e.formToken,tag_id:e.tag.id,action_name:"updateTag"}}:{content:`Unable to update tag with id: ${e.tag.id}.`}}async updateAppearance(e){if(!e.form?.appearance)return{content:'Appearance is required for the action "updateAppearance" in the update form tool.'};const t={formToken:e.formToken,appearance:e.form.appearance},a=await this.mondayApi.request(RS,t);return{content:{message:"Appearance successfully updated",form_token:e.formToken,action_name:"updateAppearance",data:a.update_form_settings?.appearance}}}async updateAccessibility(e){if(!e.form?.accessibility)return{content:'Accessibility is required for the action "updateAccessibility" in the update form tool.'};const t={formToken:e.formToken,accessibility:e.form.accessibility},a=await this.mondayApi.request(PS,t);return{content:{message:"Accessibility successfully updated",form_token:e.formToken,action_name:"updateAccessibility",data:a.update_form_settings?.accessibility}}}async updateFeatures(e){if(!e.form?.features)return{content:'Features is required for the action "updateFeatures" in the update form tool.'};const t={formToken:e.formToken,features:e.form.features},a=await this.mondayApi.request($S,t);return{content:{message:"Features successfully updated",form_token:e.formToken,action_name:"updateFeatures",data:a.update_form_settings?.features}}}async updateQuestionOrder(e){if(!e.form?.questions)return{content:'List of dehydrated questions is required for the action "updateQuestionOrder" in the update form tool.'};const t={formToken:e.formToken,questions:e.form.questions},a=await this.mondayApi.request(CS,t);return{content:{message:"Question order successfully updated",form_token:e.formToken,action_name:"updateQuestionOrder",data:a.update_form?.questions}}}async updateFormHeader(e){if(!e.form?.title&&!e.form?.description)return{content:'Title or description is required for the action "updateFormHeader" in the update form tool.'};const t={formToken:e.formToken,title:e.form.title,description:e.form.description},a=await this.mondayApi.request(FS,t);return{content:{message:"Form header updated",form_token:e.formToken,action_name:"updateFormHeader",data:a.update_form}}}}const RN={formToken:e.z.string().describe(jS.formToken)};const PN=Object.fromEntries(Object.entries(jx).filter((([e])=>"Person"!==e))),$N={columnType:e.z.nativeEnum(PN).describe("The type of the column to be created"),columnTitle:e.z.string().describe("The title of the column to be created"),columnDescription:e.z.string().optional().describe("The description of the column to be created"),columnSettings:e.z.string().optional().describe("Column-specific configuration settings as a JSON string. Use the get_column_type_info tool to fetch the JSON schema for the given column type.")},CN={boardId:e.z.number().describe("The id of the board to which the new column will be added"),...$N};const FN={color:e.z.nativeEnum(Lx).describe("The color of the custom activity"),icon_id:e.z.nativeEnum(zx).describe("The icon ID of the custom activity"),name:e.z.string().describe("The name of the custom activity")};const jN=zI`
785
+ `,LS={formToken:"The unique identifier token for the form. Required for all form-specific operations.",questionId:"The unique identifier for the question. Used to target specific questions within a form."},zS={operations:{createForm:"Create a new form with specified configuration. Returns the created form with its unique token.",updateForm:{action:"The type of update action to perform on the form. Can be one of the following: activate, deactivate, shortenFormUrl, setFormPassword, createTag, deleteTag, updateTag, updateForm, updateAppearance, updateAccessibility, updateFeatures, updateQuestionOrder, updateFormHeader."},activateForm:"Activate a form to make it visible to users and accept new submissions.",deactivateForm:"Deactivate a form to hide it from users and stop accepting submissions. Form data is preserved."},properties:{id:"The unique identifier for the form. Auto-generated upon creation.",token:"The unique token used to access and identify the form. Used in public URLs and API calls.",boardId:"The board ID connected to the form. Used to store form responses as items.",title:"The display title shown to users at the top of the form.",description:"Optional detailed description explaining the form purpose, displayed below the title.",active:"Boolean indicating if the form is currently accepting responses and visible to users.",ownerId:"The ID of the user who created and owns this form. Determines permissions.",createWithAI:"Boolean indicating if this form was initially created using AI assistance.",builtWithAI:"Boolean indicating if this form was built or modified using AI functionality.",questions:"Array of question objects that make up the form content, in display order.",isSuspicious:"Boolean flag indicating if the form has been flagged for review due to suspicious content or activity.",isAnonymous:"Boolean indicating if responses are collected without identifying the submitter.",type:"The category or classification of the form for organizational purposes.",features:"Object containing feature toggles and settings like password protection, response limits, etc.",appearance:"Object containing visual styling settings including colors, fonts, layout, and branding.",accessibility:"Object containing accessibility settings such as language, alt text, and reading direction.",tags:{description:"Array of tracking tags for categorization and analytics (e.g., UTM parameters for marketing tracking).",id:"The unique identifier for the tag. This will get auto generated when creating a tag and can’t be updated. This is required when updating or deleting a tag.",name:"The name of the tag. This can only be created, not updated. This is required when creating a tag.",value:"The value of the tag. This value is required when creating or updating a tag.",columnId:"The ID of the column this tag is associated with. This will get auto generated when creating a tag and can’t be updated."}},inputs:{title:"The title text for the form. Must be at least 1 character long. Can only be updated if the update action is updateFormHeader.",description:"Optional description text providing context about the form purpose. Can only be updated if the update action is updateFormHeader.",input:"Complete form configuration object containing properties to create or update.",questions:"Ordered array of dehydrated questions, object only including each question ID, for reordering. Must include all existing question IDs. Required if the update action is updateQuestionOrder.",questionId:"The unique identifier for the question. Used to target specific questions within a form. Required when deleting or updating a question.",tag:"The tag data to create, update or delete. If deleting a tag, only provide the id of the tag to delete. If creating a tag, provide the name and value, the id and columnId are auto generated. If updating a tag, provide the id and new value, name and columnId are not changeable.",form:{describe:"The form data to update. Required if updating the appearance, accessibility, features, question order, or form header.",appearance:"The appearance data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateAppearance.",accessibility:"The accessibility data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateAccessibility.",features:"The features data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateFeatures.",questionOrder:"The question order data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateQuestionOrder.",formHeader:"The form header data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateFormHeader."}},args:{formToken:"The unique form token identifying which form to operate on.",destinationWorkspaceId:"The workspace in which the form will be created in.",destinationFolderId:"The folder in which the form will be created under.",destinationFolderName:"The name of the folder in which the form will be created in.",boardKind:"The board kind to create for the board in which the form will create items in.",destinationName:"The name of the board that will be created to store the form responses in.",boardOwnerIds:"Array of user IDs who will have owner permissions on the board in which the form will create items in.",boardOwnerTeamIds:"Array of team IDs whose members will have owner permissions on the board in which the form will create items in.",boardSubscriberIds:"Array of user IDs who will receive notifications about board activity for the board in which the form will create items in.",boardSubscriberTeamsIds:"Array of team IDs whose members will receive notifications about board activity for the board in which the form will create items in."}},US={operations:{updateFormSettings:"Update form configuration including features, appearance, and accessibility options.",setFormPassword:'Set a password on a form to restrict access. This will enable password protection for the form. Required for the action "setFormPassword" in the update form tool.',shortenUrl:"Shorten a URL for a form and store it in the form settings. Returns the shortened link object."},properties:{features:"Object containing form features including but not limited to password protection, response limits, login requirements, etc. Required when updating the features of the form.",appearance:"Object containing visual styling including colors, layout, fonts, and branding elements. Required when updating the appearance of the form.",accessibility:"Object containing accessibility options such as language, alt text, etc. Required when updating the accessibility of the form.",isInternal:"Boolean indicating if the form is restricted to internal users only.",reCaptchaChallenge:"Boolean enabling reCAPTCHA verification to prevent spam submissions.",password:"Object containing password protection configuration for the form.",passwordEnabled:"Boolean disabling password protection. Can only be updated to false. In order to enable password protection use the setFormPassword action instead.",requireLogin:"Object containing login requirement settings for form access.",requireLoginEnabled:"Boolean requiring users to be logged in before submitting responses.",redirectToLogin:"Boolean automatically redirecting unauthenticated users to the login page.",shortenedLink:"Object containing shortened URL configuration for easy form sharing.",shortenedLinkEnabled:"Boolean enabling generation of shortened URLs for the form.",shortenedLinkUrl:"The generated shortened URL for form access. Only available when shortened links are enabled.",draftSubmission:"Object containing draft saving configuration allowing users to save progress.",draftSubmissionEnabled:"Boolean allowing users to save incomplete responses as drafts.",aiTranslate:"Object containing AI translation configuration for the form.",aiTranslateEnabled:"Boolean enabling AI translation for the form.",responseLimit:"Object containing response limitation settings to control submission volume.",responseLimitEnabled:"Boolean enabling response count limits for the form.",responseLimitValue:"Integer specifying the maximum number of responses allowed.",closeDate:"Object containing automatic form closure configuration.",closeDateEnabled:"Boolean enabling automatic form closure at a specified date and time.",closeDateValue:"ISO timestamp when the form will automatically stop accepting responses.",allowResubmit:"Boolean allowing users to submit multiple responses to the same form.",allowEditSubmission:"Boolean allowing users to modify their submitted responses after submission.",allowViewSubmission:"Boolean allowing users to view their submitted responses.",preSubmissionView:"Object containing welcome screen configuration displayed before the form.",preSubmissionEnabled:"Boolean showing a welcome/introduction screen before the form begins.",preSubmissionTitle:"Text displayed as the title on the welcome screen.",preSubmissionDescription:"Text providing context or instructions on the welcome screen.",startButton:"Object containing start button configuration for the welcome screen.",startButtonText:"Custom text for the button that begins the form experience.",afterSubmissionView:"Object containing settings for the post-submission user experience.",postSubmissionTitle:"Text displayed as the title after successful form submission.",postSubmissionDescription:"Text shown to users after they complete the form.",showSuccessImage:"Boolean displaying a success image after form completion.",redirectAfterSubmission:"Object containing redirect configuration after form submission.",redirectAfterSubmissionEnabled:"Boolean enabling automatic redirect after form completion to a specified URL.",redirectUrl:"The URL where users will be redirected after successfully submitting the form.",monday:"Object containing board settings for response handling.",itemGroupId:"The board group ID where new items from form responses will be created.",includeNameQuestion:"Boolean adding a name question to the form. This is a special question type that represents the name column from the associated monday board",includeUpdateQuestion:"Boolean adding an update/comment field to the form. This is a special question type that represents the updates from the associated item of the submission on the monday board. ",syncQuestionAndColumnsTitles:"Boolean synchronizing form question titles with board column names. When true, the form question titles will be synchronized with the board column names.",hideBranding:"Boolean hiding monday branding from the form display.",showProgressBar:"Boolean displaying a progress indicator showing form completion progress bar.",primaryColor:"Hex color code for the primary theme color used throughout the form.",layout:"Object containing form structure and presentation settings.",format:"String specifying the form display format. Can be a step by step form or a classic one page form.",alignment:"String controlling text and content alignment.",direction:"String setting reading direction.",background:"Object containing background appearance configuration for the form.",backgroundType:"String specifying background style.",backgroundValue:"String containing the background value. The value will depend on the background type. If the background type is color, the value will be a hex color code. If the background type is image, the value will be an image URL.",text:"Object containing typography and text styling configuration.",font:"String specifying the font family used throughout the form.",textColor:"Hex color code for the text color in the form.",fontSize:"String or number specifying the base font size for form text.",logo:"Object containing logo display configuration for form branding.",logoPosition:'String specifying logo placement ("top", "bottom", "header").',logoUrl:"URL pointing to the logo image file for display on the form.",logoSize:'String specifying logo size ("small", "medium", "large") for the logo that appears on the header of the form.',logoAltText:"Alternative text description for the logo image for accessibility.",submitButton:"Object containing submit button styling and text configuration.",submitButtonText:"Custom text displayed on the form submission button.",language:'Language code for form localization and interface text (e.g., "en", "es", "fr").'},inputs:{settings:"Complete form settings object containing all configuration options.",features:"Form features configuration including security, limits, and access controls.",appearance:"Visual styling configuration including colors, layout, and branding.",accessibility:"Accessibility configuration including language and reading direction.",password:"Password configuration for the form. Only setting enabled to false is supported. To enable a form to be password protected, please use the set_form_password mutation instead.",passwordValue:"The password to set for the form. Must be at least 1 character long."}},VS={actions:{type:"The type of operation to perform on the question. Can delete, update, or create. When updating or deleting a question, the questionId is required. When creating or updating a question, the question object is required. When updating, the question is a patch object, meaning that only the fields that are provided will be updated.",question:"The question object containing all properties for creation or update. When creating a question, the title is required."},properties:{title:"The question text displayed to respondents. Must be at least 1 character long and clearly indicate the expected response.",type:'The question type determining input behavior and validation (e.g., "text", "email", "single_select", "multi_select").',visible:"Boolean controlling question visibility to respondents. Hidden questions remain in form structure but are not displayed.",required:"Boolean indicating if the question must be answered before form submission.",position:"Integer specifying the display order of the question within the form (zero-based).",description:"Optional explanatory text providing additional context, instructions, or examples for the question.",placeholder:"Optional placeholder text shown in input fields to guide user input.",createdAt:"ISO timestamp when the question was created.",updatedAt:"ISO timestamp when the question was last modified.",selectOptions:"Array of option objects for choice-based questions (single_select, multi_select). Required when creating select type questions. Can only be provided when creating a question, not yet supported for updating a question.",selectOptionsLabel:"The display text for individual option choices in select-type questions."},inputs:{question:"Complete question object containing all properties for creation or update.",questionData:"Question configuration including type, title, and type-specific settings.",position:"Integer position where the question should be placed in the form sequence."}},BS={properties:{validation:"Validation rules applied to the question response",prefill:"Configuration for automatically populating question values from various data sources such as user account information or URL query parameters.",prefillEnabled:"Whether prefill functionality is enabled for this question. When true, the question will attempt to auto-populate values from the specified source.",prefillSource:"The data source to use for prefilling the question value. Check the PrefillSources for available options.",prefillLookup:'The specific field or parameter name to lookup from the prefill source. For account sources, this would be a user property like "name" or "email". For query parameters, this would be the parameter name that would be set in the URL.',prefixAutofilled:"Phone questions only: Automatically detect and fill the phone country prefix based on the user's geographic location or browser settings.",prefixPredefined:"Phone questions only: Configuration for setting a specific predefined phone country prefix that will be pre-selected for users.",prefixPredefinedEnabled:"Whether a predefined phone prefix is enabled for phone number questions. When true, the specified prefix will be pre-selected.",prefixPredefinedPrefix:'The predefined phone country prefix to use as country code in capital letters (e.g., "US", "UK", "IL"). Only used when enabled is true.',checkedByDefault:"Boolean/checkbox questions only: Whether the checkbox should be checked by default when the form loads.",defaultCurrentDate:"Date based questions only: Automatically set the current date as the default value when the form loads.",includeTime:"Date questions only: Whether to include time selection (hours and minutes) in addition to the date picker. When false, only date selection is available.",display:"Single/Multi Select questions only: Controls how the selection options are visually presented to users.",optionsOrder:"Single/Multi Select questions only: Determines the ordering of selection options.",locationAutofilled:"Location questions only: Automatically detect and fill the user's current location using browser geolocation services, requiring user permission.",limit:"Rating questions only: Maximum rating value that users can select.",skipValidation:"Link/URL questions only: Whether to skip URL format validation, allowing any text input."},inputs:{settings:"Question-specific configuration object that varies by question type.",validationRules:"Validation constraints and rules",choiceOptions:"List of available choices for selection questions",fileSettings:"File upload constraints and settings"}},qS={destination_workspace_id:e.z.string().describe(zS.args.destinationWorkspaceId),destination_folder_id:e.z.string().optional().describe(zS.args.destinationFolderId),destination_folder_name:e.z.string().optional().describe(zS.args.destinationFolderName),board_kind:e.z.nativeEnum(Ex).optional().describe(zS.args.boardKind),destination_name:e.z.string().optional().describe(zS.args.destinationName),board_owner_ids:e.z.array(e.z.string()).optional().describe(zS.args.boardOwnerIds),board_owner_team_ids:e.z.array(e.z.string()).optional().describe(zS.args.boardOwnerTeamIds),board_subscriber_ids:e.z.array(e.z.string()).optional().describe(zS.args.boardSubscriberIds),board_subscriber_teams_ids:e.z.array(e.z.string()).optional().describe(zS.args.boardSubscriberTeamsIds)};var MS,HS,GS,WS,QS,KS,YS,JS,XS,ZS,eN,tN,aN,iN,nN,oN;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(MS||(MS={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(HS||(HS={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(GS||(GS={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(WS||(WS={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(QS||(QS={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(KS||(KS={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(YS||(YS={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(JS||(JS={})),function(e){e.Boolean="Boolean",e.ConnectedBoards="ConnectedBoards",e.Country="Country",e.Date="Date",e.DateRange="DateRange",e.Email="Email",e.File="File",e.Link="Link",e.Location="Location",e.LongText="LongText",e.MultiSelect="MultiSelect",e.Name="Name",e.Number="Number",e.People="People",e.Phone="Phone",e.Rating="Rating",e.ShortText="ShortText",e.Signature="Signature",e.SingleSelect="SingleSelect",e.Subitems="Subitems",e.Updates="Updates"}(XS||(XS={})),function(e){e.Account="account",e.QueryParam="queryParam"}(ZS||(ZS={})),function(e){e.Email="email",e.Name="name",e.Title="title",e.Phone="phone",e.FirstName="first_name",e.LastName="last_name",e.Location="location",e.Timezone="time_zone",e.ManagerName="manager_display_name"}(eN||(eN={})),function(e){e.And="AND",e.Or="OR"}(tN||(tN={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(aN||(aN={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(iN||(iN={})),function(e){e.MultiSelect="multi-select",e.SingleSelect="single-select",e.People="people",e.Location="location",e.CountryCode="country-code",e.Country="country",e.ConnectedBoards="connected_boards"}(nN||(nN={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(oN||(oN={}));const rN=e.z.object({type:e.z.nativeEnum(fE).describe(VS.properties.type),title:e.z.string().describe(VS.properties.title).optional(),description:e.z.string().describe(VS.properties.description).optional(),visible:e.z.boolean().describe(VS.properties.visible).optional(),required:e.z.boolean().describe(VS.properties.required).optional(),options:e.z.array(e.z.object({label:e.z.string().describe(VS.properties.selectOptionsLabel)})).describe(VS.properties.selectOptions).optional(),settings:e.z.object({checkedByDefault:e.z.boolean().describe(BS.properties.checkedByDefault).optional(),defaultCurrentDate:e.z.boolean().describe(BS.properties.defaultCurrentDate).optional(),display:e.z.nativeEnum(uE).describe(BS.properties.display).optional(),includeTime:e.z.boolean().describe(BS.properties.includeTime).optional(),locationAutofilled:e.z.boolean().describe(BS.properties.locationAutofilled).optional(),optionsOrder:e.z.nativeEnum(hE).describe(BS.properties.optionsOrder).optional(),prefixAutofilled:e.z.boolean().describe(BS.properties.prefixAutofilled).optional(),prefixPredefined:e.z.object({enabled:e.z.boolean().describe(BS.properties.prefixPredefinedEnabled),prefix:e.z.string().describe(BS.properties.prefixPredefinedPrefix).optional()}).describe(BS.properties.prefixPredefined).optional(),skipValidation:e.z.boolean().describe(BS.properties.skipValidation).optional(),prefill:e.z.object({enabled:e.z.boolean().describe(BS.properties.prefillEnabled),lookup:e.z.string().describe(BS.properties.prefillLookup).optional(),source:e.z.nativeEnum(mE).describe(BS.properties.prefillSource).optional()}).describe(BS.properties.prefill).optional()}).optional()}),sN={action:e.z.nativeEnum(oN).describe(VS.actions.type),formToken:e.z.string().describe(LS.formToken),questionId:e.z.string().describe(LS.questionId).optional(),question:rN.describe(VS.actions.question).optional()};class pN{constructor(e){this.mondayApi=e}async deleteQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when deleting a question."};const a={formToken:e.formToken,questionId:t};return await this.mondayApi.request(ES,a),{content:{message:"Question deleted",question_id:t,action_name:"delete"}}}async updateQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when updating a question."};const a=e.question;if(!a)return{content:"Must provide updated patch props for the question when updating."};const i={formToken:e.formToken,questionId:t,question:a};return await this.mondayApi.request(IS,i),{content:{message:"Question updated",question_id:t,action_name:"update"}}}async createQuestion(e){const t=e.question;if(!t)return{content:"Must provide a full question payload when creating a question."};if(!t.title)return{content:"Must provide a title for the question when creating a question."};const a={formToken:e.formToken,question:{...t,title:t.title}},i=await this.mondayApi.request(TS,a);return{content:{message:"Question created",question_id:i.create_form_question?.id,action_name:"create"}}}}var dN;!function(e){e.activate="activate",e.deactivate="deactivate",e.shortenFormUrl="shortenFormUrl",e.setFormPassword="setFormPassword",e.createTag="createTag",e.deleteTag="deleteTag",e.updateTag="updateTag",e.updateAppearance="updateAppearance",e.updateAccessibility="updateAccessibility",e.updateFeatures="updateFeatures",e.updateQuestionOrder="updateQuestionOrder",e.updateFormHeader="updateFormHeader"}(dN||(dN={}));const lN=e.z.object({id:e.z.string().describe(zS.properties.tags.id).optional(),name:e.z.string().describe(zS.properties.tags.name).optional(),value:e.z.string().describe(zS.properties.tags.value).optional(),columnId:e.z.string().describe(zS.properties.tags.columnId).optional()}),cN=e.z.object({type:e.z.nativeEnum(WS).describe(US.properties.backgroundType).optional(),value:e.z.string().describe(US.properties.backgroundValue).optional()}),mN=e.z.object({format:e.z.nativeEnum(KS).describe(US.properties.format).optional(),alignment:e.z.nativeEnum(YS).describe(US.properties.alignment).optional(),direction:e.z.nativeEnum(QS).describe(US.properties.direction).optional()}),uN=e.z.object({position:e.z.nativeEnum(GS).describe(US.properties.logoPosition).optional(),size:e.z.nativeEnum(HS).describe(US.properties.logoSize).optional()}),hN=e.z.object({text:e.z.string().describe(US.properties.submitButtonText).optional()}),fN=e.z.object({font:e.z.string().describe(US.properties.font).optional(),color:e.z.string().describe(US.properties.textColor).optional(),size:e.z.nativeEnum(JS).describe(US.properties.fontSize).optional()}),vN=e.z.object({enabled:e.z.boolean().describe(US.properties.redirectAfterSubmissionEnabled).optional(),redirectUrl:e.z.string().describe(US.properties.redirectUrl).optional()}),gN=e.z.object({allowEditSubmission:e.z.boolean().describe(US.properties.allowEditSubmission).optional(),allowResubmit:e.z.boolean().describe(US.properties.allowResubmit).optional(),allowViewSubmission:e.z.boolean().describe(US.properties.allowViewSubmission).optional(),description:e.z.string().describe(US.properties.postSubmissionDescription).optional(),redirectAfterSubmission:vN.describe(US.properties.redirectAfterSubmission).optional(),showSuccessImage:e.z.boolean().describe(US.properties.showSuccessImage).optional(),title:e.z.string().describe(US.properties.postSubmissionTitle).optional()}),bN=e.z.object({enabled:e.z.boolean().describe(US.properties.closeDateEnabled).optional(),date:e.z.string().describe(US.properties.closeDateValue).optional()}),yN=e.z.object({enabled:e.z.boolean().describe(US.properties.draftSubmissionEnabled).optional()}),_N=e.z.object({itemGroupId:e.z.string().describe(US.properties.itemGroupId).optional(),includeNameQuestion:e.z.boolean().describe(US.properties.includeNameQuestion).optional(),includeUpdateQuestion:e.z.boolean().describe(US.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:e.z.boolean().describe(US.properties.syncQuestionAndColumnsTitles).optional()}),wN=e.z.object({enabled:e.z.boolean().describe(US.properties.passwordEnabled).optional()}),xN=e.z.object({text:e.z.string().describe(US.properties.startButtonText).optional()}),EN=e.z.object({enabled:e.z.boolean().describe(US.properties.preSubmissionEnabled).optional(),title:e.z.string().describe(US.properties.preSubmissionTitle).optional(),description:e.z.string().describe(US.properties.preSubmissionDescription).optional(),startButton:xN.describe(US.properties.startButton).optional()}),TN=e.z.object({enabled:e.z.boolean().describe(US.properties.requireLoginEnabled).optional(),redirectToLogin:e.z.boolean().describe(US.properties.redirectToLogin).optional()}),IN=e.z.object({enabled:e.z.boolean().describe(US.properties.responseLimitEnabled).optional(),limit:e.z.number().describe(US.properties.responseLimitValue).optional()}),SN=e.z.object({background:cN.describe(US.properties.background).optional(),hideBranding:e.z.boolean().describe(US.properties.hideBranding).optional(),layout:mN.describe(US.properties.layout).optional(),logo:uN.describe(US.properties.logo).optional(),primaryColor:e.z.string().describe(US.properties.primaryColor).optional(),showProgressBar:e.z.boolean().describe(US.properties.showProgressBar).optional(),submitButton:hN.describe(US.properties.submitButton).optional(),text:fN.describe(US.properties.text).optional()}),NN=e.z.object({language:e.z.string().describe(US.properties.language).optional(),logoAltText:e.z.string().describe(US.properties.logoAltText).optional()}),AN=e.z.object({afterSubmissionView:gN.describe(US.properties.afterSubmissionView).optional(),closeDate:bN.describe(US.properties.closeDate).optional(),draftSubmission:yN.describe(US.properties.draftSubmission).optional(),monday:_N.describe(US.properties.monday).optional(),password:wN.describe(US.properties.password).optional(),preSubmissionView:EN.describe(US.properties.preSubmissionView).optional(),reCaptchaChallenge:e.z.boolean().describe(US.properties.reCaptchaChallenge).optional(),requireLogin:TN.describe(US.properties.requireLogin).optional(),responseLimit:IN.describe(US.properties.responseLimit).optional()}),DN=e.z.object({id:e.z.string().describe(zS.inputs.questionId)}),kN=e.z.object({appearance:SN.describe(zS.inputs.form.appearance).optional(),accessibility:NN.describe(zS.inputs.form.accessibility).optional(),features:AN.describe(zS.inputs.form.features).optional(),title:e.z.string().describe(zS.inputs.title).optional(),description:e.z.string().describe(zS.inputs.description).optional(),questions:e.z.array(DN).describe(zS.inputs.questions).optional()}),ON={formToken:e.z.string().describe(LS.formToken),action:e.z.nativeEnum(dN).describe(zS.operations.updateForm.action),formPassword:e.z.string().describe(US.operations.setFormPassword).optional(),tag:lN.describe(zS.inputs.tag).optional(),form:kN.describe(zS.inputs.form.describe).optional()};class RN{constructor(e){this.mondayApi=e}async setFormPassword(e){if(!e.formPassword)return{content:'formPassword is required for the action "setFormPassword" in the update form tool.'};const t={formToken:e.formToken,input:{password:e.formPassword}};return await this.mondayApi.request(SS,t),{content:{message:"Form password successfully set",form_token:e.formToken,action_name:"setFormPassword"}}}async shortenFormUrl(e){const t={formToken:e.formToken};return await this.mondayApi.request(NS,t),{content:{message:"Form URL successfully shortened",form_token:e.formToken,action_name:"shortenFormUrl"}}}async deactivateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(AS,t),{content:{message:"Form successfully deactivated",form_token:e.formToken,action_name:"deactivateForm"}}}async activateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(DS,t),{content:{message:"Form successfully activated",form_token:e.formToken,action_name:"activateForm"}}}async createTag(e){if(!e.tag)return{content:'Tag is required for the action "createTag" in the update form tool.'};if(!e.tag.name)return{content:'Tag name is required for the action "createTag" in the update form tool.'};const t={formToken:e.formToken,tag:{name:e.tag.name,value:e.tag.value}},a=await this.mondayApi.request(OS,t);return{content:{message:"Tag successfully added",form_token:e.formToken,action_name:"createTag",data:a.create_form_tag}}}async deleteTag(e){if(!e.tag)return{content:'Tag is required for the action "deleteTag" in the update form tool.'};if(!e.tag.id)return{content:'Tag id is required for the action "deleteTag" in the update form tool.'};const t={formToken:e.formToken,tagId:e.tag.id};return await this.mondayApi.request(kS,t),{content:{message:"Tag deleted",form_token:e.formToken,tag_id:e.tag.id,action_name:"deleteTag"}}}async updateTag(e){if(!e.tag)return{content:'Tag is required for the action "updateTag" in the update form tool.'};if(!e.tag.id||!e.tag.value)return{content:'Tag id and value are required for the action "updateTag" in the update form tool.'};const t={formToken:e.formToken,tagId:e.tag.id,tag:{value:e.tag.value}};return(await this.mondayApi.request(RS,t)).update_form_tag?{content:{message:"Tag updated",form_token:e.formToken,tag_id:e.tag.id,action_name:"updateTag"}}:{content:`Unable to update tag with id: ${e.tag.id}.`}}async updateAppearance(e){if(!e.form?.appearance)return{content:'Appearance is required for the action "updateAppearance" in the update form tool.'};const t={formToken:e.formToken,appearance:e.form.appearance},a=await this.mondayApi.request(PS,t);return{content:{message:"Appearance successfully updated",form_token:e.formToken,action_name:"updateAppearance",data:a.update_form_settings?.appearance}}}async updateAccessibility(e){if(!e.form?.accessibility)return{content:'Accessibility is required for the action "updateAccessibility" in the update form tool.'};const t={formToken:e.formToken,accessibility:e.form.accessibility},a=await this.mondayApi.request($S,t);return{content:{message:"Accessibility successfully updated",form_token:e.formToken,action_name:"updateAccessibility",data:a.update_form_settings?.accessibility}}}async updateFeatures(e){if(!e.form?.features)return{content:'Features is required for the action "updateFeatures" in the update form tool.'};const t={formToken:e.formToken,features:e.form.features},a=await this.mondayApi.request(CS,t);return{content:{message:"Features successfully updated",form_token:e.formToken,action_name:"updateFeatures",data:a.update_form_settings?.features}}}async updateQuestionOrder(e){if(!e.form?.questions)return{content:'List of dehydrated questions is required for the action "updateQuestionOrder" in the update form tool.'};const t={formToken:e.formToken,questions:e.form.questions},a=await this.mondayApi.request(FS,t);return{content:{message:"Question order successfully updated",form_token:e.formToken,action_name:"updateQuestionOrder",data:a.update_form?.questions}}}async updateFormHeader(e){if(!e.form?.title&&!e.form?.description)return{content:'Title or description is required for the action "updateFormHeader" in the update form tool.'};const t={formToken:e.formToken,title:e.form.title,description:e.form.description},a=await this.mondayApi.request(jS,t);return{content:{message:"Form header updated",form_token:e.formToken,action_name:"updateFormHeader",data:a.update_form}}}}const PN={formToken:e.z.string().describe(LS.formToken)};const $N=Object.fromEntries(Object.entries(jx).filter((([e])=>"Person"!==e))),CN={columnType:e.z.nativeEnum($N).describe("The type of the column to be created"),columnTitle:e.z.string().describe("The title of the column to be created"),columnDescription:e.z.string().optional().describe("The description of the column to be created"),columnSettings:e.z.string().optional().describe("Column-specific configuration settings as a JSON string. Use the get_column_type_info tool to fetch the JSON schema for the given column type.")},FN={boardId:e.z.number().describe("The id of the board to which the new column will be added"),...CN};const jN={color:e.z.nativeEnum(Lx).describe("The color of the custom activity"),icon_id:e.z.nativeEnum(zx).describe("The icon ID of the custom activity"),name:e.z.string().describe("The name of the custom activity")};const LN=zI`
755
786
  mutation createNotification($user_id: ID!, $target_id: ID!, $text: String!, $target_type: NotificationTargetType!) {
756
787
  create_notification(user_id: $user_id, target_id: $target_id, text: $text, target_type: $target_type) {
757
788
  text
758
789
  }
759
790
  }
760
- `,LN={user_id:e.z.string().describe("The user ID to send the notification to"),target_id:e.z.string().describe("The target ID (update/reply ID for Post type, item/board ID for Project type)"),text:e.z.string().describe("The notification text"),target_type:e.z.nativeEnum(kE).describe("The target type (Post for update/reply, Project for item/board)")};const zN=zI`
791
+ `,zN={user_id:e.z.string().describe("The user ID to send the notification to"),target_id:e.z.string().describe("The target ID (update/reply ID for Post type, item/board ID for Project type)"),text:e.z.string().describe("The notification text"),target_type:e.z.nativeEnum(kE).describe("The target type (Post for update/reply, Project for item/board)")};const UN=zI`
761
792
  mutation createGroup(
762
793
  $boardId: ID!
763
794
  $groupName: String!
@@ -776,7 +807,7 @@
776
807
  title
777
808
  }
778
809
  }
779
- `,UN=["#037f4c","#00c875","#9cd326","#cab641","#ffcb00","#784bd1","#9d50dd","#007eb5","#579bfc","#66ccff","#bb3354","#df2f4a","#ff007f","#ff5ac4","#ff642e","#fdab3d","#7f5347","#c4c4c4","#757575"],VN={boardId:e.z.string().describe("The ID of the board to create the group in"),groupName:e.z.string().max(255).describe("The name of the new group (maximum 255 characters)"),groupColor:e.z.enum(UN).optional().describe(`The color for the group. Must be one of the predefined Monday.com group colors: ${UN.join(", ")}`),relativeTo:e.z.string().optional().describe("The ID of the group to position this new group relative to"),positionRelativeMethod:e.z.nativeEnum(FE).optional().describe("Whether to position the new group before or after the relativeTo group")};const BN=zI`
810
+ `,VN=["#037f4c","#00c875","#9cd326","#cab641","#ffcb00","#784bd1","#9d50dd","#007eb5","#579bfc","#66ccff","#bb3354","#df2f4a","#ff007f","#ff5ac4","#ff642e","#fdab3d","#7f5347","#c4c4c4","#757575"],BN={boardId:e.z.string().describe("The ID of the board to create the group in"),groupName:e.z.string().max(255).describe("The name of the new group (maximum 255 characters)"),groupColor:e.z.enum(VN).optional().describe(`The color for the group. Must be one of the predefined Monday.com group colors: ${VN.join(", ")}`),relativeTo:e.z.string().optional().describe("The ID of the group to position this new group relative to"),positionRelativeMethod:e.z.nativeEnum(FE).optional().describe("Whether to position the new group before or after the relativeTo group")};const qN=zI`
780
811
  mutation duplicateItem($boardId: ID!, $itemId: ID!, $withUpdates: Boolean) {
781
812
  duplicate_item(board_id: $boardId, item_id: $itemId, with_updates: $withUpdates) {
782
813
  id
@@ -784,7 +815,7 @@
784
815
  url
785
816
  }
786
817
  }
787
- `,qN=zI`
818
+ `,MN=zI`
788
819
  mutation createSubitem($parentItemId: ID!, $itemName: String!, $columnValues: JSON) {
789
820
  create_subitem(parent_item_id: $parentItemId, item_name: $itemName, column_values: $columnValues) {
790
821
  id
@@ -795,7 +826,7 @@
795
826
  }
796
827
  }
797
828
  }
798
- `,MN=1e3;var HN,GN;!function(e){e[e.YEAR=31536e3]="YEAR",e[e.MONTH31Days=2678400]="MONTH31Days",e[e.MONTH30Days=2592e3]="MONTH30Days",e[e.MONTH29Days=2505600]="MONTH29Days",e[e.MONTH28Days=2419200]="MONTH28Days",e[e.WEEK=604800]="WEEK",e[e.DAY=86400]="DAY",e[e.HOUR=3600]="HOUR",e[e.MINUTE=60]="MINUTE"}(HN||(HN={})),function(e){e[e.YEAR=31536e6]="YEAR",e[e.MONTH31Days=26784e5]="MONTH31Days",e[e.MONTH30Days=2592e6]="MONTH30Days",e[e.MONTH29Days=25056e5]="MONTH29Days",e[e.MONTH28Days=24192e5]="MONTH28Days",e[e.DAY=864e5]="DAY",e[e.HOUR=36e5]="HOUR",e[e.MINUTE=6e4]="MINUTE",e[e.SECOND=MN]="SECOND"}(GN||(GN={}));const WN=10*GN.SECOND;function QN(e,t){const a=e?.response?.errors?.map((e=>e.message))?.join(", ");if(a)throw new Error(`Failed to ${t}: ${a}`);const i=e instanceof Error?e.message:"Unknown error";throw new Error(`Failed to ${t}: ${i}`)}function KN(e){if(e instanceof Error&&"AbortError"===e.name)throw new Error("Search has timed out, try providing alternative search term")}const YN={name:e.z.string().describe("The name of the new item to be created, must be relevant to the user's request"),groupId:e.z.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:e.z.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"},\\"dropdown_id\\":\\"value\\", \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"'),parentItemId:e.z.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:e.z.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},JN={boardId:e.z.number().describe("The id of the board to which the new item will be added"),...YN};const XN={item_id:e.z.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:e.z.string().describe("The ID of the custom activity for the timeline item"),title:e.z.string().describe("The title of the new timeline item"),summary:e.z.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:e.z.string().optional().describe("The content of the new timeline item"),timestamp:e.z.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:e.z.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:e.z.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:e.z.string().optional().describe("The location to add to the new timeline item"),phone:e.z.string().optional().describe("The phone number to add to the new timeline item"),url:e.z.string().optional().describe("The URL to add to the new timeline item")};const ZN=zI`
829
+ `,HN=1e3;var GN,WN;!function(e){e[e.YEAR=31536e3]="YEAR",e[e.MONTH31Days=2678400]="MONTH31Days",e[e.MONTH30Days=2592e3]="MONTH30Days",e[e.MONTH29Days=2505600]="MONTH29Days",e[e.MONTH28Days=2419200]="MONTH28Days",e[e.WEEK=604800]="WEEK",e[e.DAY=86400]="DAY",e[e.HOUR=3600]="HOUR",e[e.MINUTE=60]="MINUTE"}(GN||(GN={})),function(e){e[e.YEAR=31536e6]="YEAR",e[e.MONTH31Days=26784e5]="MONTH31Days",e[e.MONTH30Days=2592e6]="MONTH30Days",e[e.MONTH29Days=25056e5]="MONTH29Days",e[e.MONTH28Days=24192e5]="MONTH28Days",e[e.DAY=864e5]="DAY",e[e.HOUR=36e5]="HOUR",e[e.MINUTE=6e4]="MINUTE",e[e.SECOND=HN]="SECOND"}(WN||(WN={}));const QN=10*WN.SECOND;function KN(e,t){const a=e?.response?.errors?.map((e=>e.message))?.join(", ");if(a)throw new Error(`Failed to ${t}: ${a}`);const i=e instanceof Error?e.message:"Unknown error";throw new Error(`Failed to ${t}: ${i}`)}function YN(e){if(e instanceof Error&&"AbortError"===e.name)throw new Error("Search has timed out, try providing alternative search term")}const JN={name:e.z.string().describe("The name of the new item to be created, must be relevant to the user's request"),groupId:e.z.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:e.z.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"},\\"dropdown_id\\":\\"value\\", \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"'),parentItemId:e.z.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:e.z.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},XN={boardId:e.z.number().describe("The id of the board to which the new item will be added"),...JN};const ZN={item_id:e.z.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:e.z.string().describe("The ID of the custom activity for the timeline item"),title:e.z.string().describe("The title of the new timeline item"),summary:e.z.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:e.z.string().optional().describe("The content of the new timeline item"),timestamp:e.z.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:e.z.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:e.z.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:e.z.string().optional().describe("The location to add to the new timeline item"),phone:e.z.string().optional().describe("The phone number to add to the new timeline item"),url:e.z.string().optional().describe("The URL to add to the new timeline item")};const eA=zI`
799
830
  mutation createUpdate($itemId: ID!, $body: String!, $mentionsList: [UpdateMention], $parentId: ID) {
800
831
  create_update(body: $body, item_id: $itemId, mentions_list: $mentionsList, parent_id: $parentId) {
801
832
  id
@@ -806,7 +837,7 @@
806
837
  }
807
838
  }
808
839
  }
809
- `,eA=e.z.object({id:e.z.string().describe("The ID of the entity to mention"),type:e.z.nativeEnum(AE).describe("The type of mention: User, Team, Board, or Project")}),tA=e.z.array(eA),aA={itemId:e.z.number().describe("The id of the item to which the update will be added"),body:e.z.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead. use html tags to format the text, dont use markdown."),mentionsList:e.z.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project'),parentId:e.z.number().optional().describe("The ID of the update to reply to. Use this parameter when you want to reply on an existing update leave it empty if you want to create a new update")};const iA=zI`
840
+ `,tA=e.z.object({id:e.z.string().describe("The ID of the entity to mention"),type:e.z.nativeEnum(AE).describe("The type of mention: User, Team, Board, or Project")}),aA=e.z.array(tA),iA={itemId:e.z.number().describe("The id of the item to which the update will be added"),body:e.z.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead. use html tags to format the text, dont use markdown."),mentionsList:e.z.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project'),parentId:e.z.number().optional().describe("The ID of the update to reply to. Use this parameter when you want to reply on an existing update leave it empty if you want to create a new update")};const nA=zI`
810
841
  query GetItemUpdates($itemId: ID!, $limit: Int, $page: Int, $includeReplies: Boolean!, $includeAssets: Boolean!) {
811
842
  items(ids: [$itemId]) {
812
843
  id
@@ -842,7 +873,7 @@
842
873
  }
843
874
  }
844
875
  }
845
- `,nA=zI`
876
+ `,oA=zI`
846
877
  query GetBoardUpdates($boardId: ID!, $limit: Int, $page: Int, $includeReplies: Boolean!, $includeAssets: Boolean!, $fromDate: ISO8601DateTime, $toDate: ISO8601DateTime, $boardUpdatesOnly: Boolean) {
847
878
  boards(ids: [$boardId]) {
848
879
  id
@@ -878,7 +909,7 @@
878
909
  }
879
910
  }
880
911
  }
881
- `;var oA;!function(e){e.Item="Item",e.Board="Board"}(oA||(oA={}));const rA={objectId:e.z.string().describe("The ID of the item or board to get updates from"),objectType:e.z.enum([oA.Item,oA.Board]).describe("Type of object for which objectId was provided"),limit:e.z.number().min(1).max(100).optional().default(25).describe("Number of updates per page (default: 25, max: 100)"),page:e.z.number().min(1).optional().default(1).describe("Page number for pagination (default: 1)"),includeReplies:e.z.boolean().optional().default(!1).describe("Include update replies in the response"),includeAssets:e.z.boolean().optional().default(!1).describe("Include file attachments in the response"),fromDate:e.z.string().optional().describe('Start of date range filter (e.g. "2025-01-01" or "2025-01-01T00:00:00Z"). Must be used together with toDate. Only supported for Board objectType.'),toDate:e.z.string().optional().describe('End of date range filter (e.g. "2025-06-01" or "2025-06-01T23:59:59Z"). Must be used together with fromDate. Only supported for Board objectType.'),includeItemUpdates:e.z.boolean().optional().default(!1).describe("When objectType is Board, also include updates on individual items. Defaults to false, returning only board discussion. Set to true to retrieve all updates on a board, including updates on individual items.")};function sA(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e}const pA={columnId:e.z.string().describe("The id of the column to be deleted")},dA={boardId:e.z.number().describe("The id of the board to which the new column will be added"),...pA};const lA={itemId:e.z.number()};const cA={};const mA=zI`
912
+ `;var rA;!function(e){e.Item="Item",e.Board="Board"}(rA||(rA={}));const sA={objectId:e.z.string().describe("The ID of the item or board to get updates from"),objectType:e.z.enum([rA.Item,rA.Board]).describe("Type of object for which objectId was provided"),limit:e.z.number().min(1).max(100).optional().default(25).describe("Number of updates per page (default: 25, max: 100)"),page:e.z.number().min(1).optional().default(1).describe("Page number for pagination (default: 1)"),includeReplies:e.z.boolean().optional().default(!1).describe("Include update replies in the response"),includeAssets:e.z.boolean().optional().default(!1).describe("Include file attachments in the response"),fromDate:e.z.string().optional().describe('Start of date range filter (e.g. "2025-01-01" or "2025-01-01T00:00:00Z"). Must be used together with toDate. Only supported for Board objectType.'),toDate:e.z.string().optional().describe('End of date range filter (e.g. "2025-06-01" or "2025-06-01T23:59:59Z"). Must be used together with fromDate. Only supported for Board objectType.'),includeItemUpdates:e.z.boolean().optional().default(!1).describe("When objectType is Board, also include updates on individual items. Defaults to false, returning only board discussion. Set to true to retrieve all updates on a board, including updates on individual items.")};function pA(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e}const dA={columnId:e.z.string().describe("The id of the column to be deleted")},lA={boardId:e.z.number().describe("The id of the board to which the new column will be added"),...dA};const cA={itemId:e.z.number()};const mA={};const uA=zI`
882
913
  query getBoardData($boardId: ID!, $itemsLimit: Int!, $queryParams: ItemsQuery) {
883
914
  boards(ids: [$boardId]) {
884
915
  id
@@ -921,7 +952,7 @@
921
952
  }
922
953
  }
923
954
  }
924
- `,uA=zI`
955
+ `,hA=zI`
925
956
  query getUsersByIds($userIds: [ID!]!) {
926
957
  users(ids: $userIds) {
927
958
  id
@@ -929,7 +960,7 @@
929
960
  photo_tiny
930
961
  }
931
962
  }
932
- `,hA=e.z.array(e.z.object({columnId:e.z.string().describe("The id of the column to filter by"),compareAttribute:e.z.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:e.z.union([e.z.string(),e.z.number(),e.z.boolean(),e.z.array(e.z.union([e.z.string(),e.z.number()]))]).describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:e.z.nativeEnum(wE).optional().default(wE.AnyOf).describe("The operator to use for the filter")})).optional().describe('The configuration of filters to apply on the items. Before sending the filters, use get_board_info tool to check "filteringGuidelines" key for filtering by the column.'),fA=e.z.nativeEnum(_E).optional().default(_E.And).describe("The operator to use for the filters"),vA={boardId:e.z.string().describe("The ID of the board to fetch complete data for"),filters:hA,filtersOperator:fA};const gA=zI`
963
+ `,fA=e.z.array(e.z.object({columnId:e.z.string().describe("The id of the column to filter by"),compareAttribute:e.z.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:e.z.union([e.z.string(),e.z.number(),e.z.boolean(),e.z.array(e.z.union([e.z.string(),e.z.number()]))]).describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:e.z.nativeEnum(wE).optional().default(wE.AnyOf).describe("The operator to use for the filter")})).optional().describe('The configuration of filters to apply on the items. Before sending the filters, use get_board_info tool to check "filteringGuidelines" key for filtering by the column.'),vA=e.z.nativeEnum(_E).optional().default(_E.And).describe("The operator to use for the filters"),gA={boardId:e.z.string().describe("The ID of the board to fetch complete data for"),filters:fA,filtersOperator:vA};const bA=zI`
933
964
  query GetBoardAllActivity(
934
965
  $boardId: ID!
935
966
  $fromDate: ISO8601DateTime!
@@ -950,7 +981,7 @@
950
981
  }
951
982
  }
952
983
  }
953
- `,bA={boardId:e.z.number().describe("The id of the board to get activity for"),fromDate:e.z.string().optional().describe("Start date for activity range (ISO8601DateTime format). Defaults to 30 days ago"),toDate:e.z.string().optional().describe("End date for activity range (ISO8601DateTime format). Defaults to now"),includeData:e.z.boolean().optional().default(!1).describe("Whether to include the raw data payload for each activity entry. The data field contains the full before/after state of changes and can be very large. Only set to true when you need the detailed change data.")};const yA=zI`
984
+ `,yA={boardId:e.z.number().describe("The id of the board to get activity for"),fromDate:e.z.string().optional().describe("Start date for activity range (ISO8601DateTime format). Defaults to 30 days ago"),toDate:e.z.string().optional().describe("End date for activity range (ISO8601DateTime format). Defaults to now"),includeData:e.z.boolean().optional().default(!1).describe("Whether to include the raw data payload for each activity entry. The data field contains the full before/after state of changes and can be very large. Only set to true when you need the detailed change data.")};const _A=zI`
954
985
  query GetBoardInfo($boardId: ID!) {
955
986
  boards(ids: [$boardId]) {
956
987
  # Basic Board Metadata
@@ -1037,7 +1068,7 @@
1037
1068
  }
1038
1069
  }
1039
1070
  }
1040
- `,_A=zI`
1071
+ `,wA=zI`
1041
1072
  query GetBoardInfoJustColumns($boardId: ID!) {
1042
1073
  boards(ids: [$boardId]) {
1043
1074
  columns {
@@ -1049,7 +1080,7 @@
1049
1080
  }
1050
1081
  }
1051
1082
  }
1052
- `,wA=(e,t)=>({board:{...e,subItemColumns:t?.columns??void 0},filteringGuidelines:IA(e.columns.filter(xA)),aggregationGuidelines:TA()});function xA(e){return!!e&&["id","type"].every((t=>t in e))}const EA={last_updated:'Supported operators: any_of, not_any_of. CompareValue should be either:\n - "TODAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "YESTERDAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\nEXAMPLES:\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // using TODAY with correct compareAttribute\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "UPDATED_AT"} // using THIS_WEEK with not_any_of\n ❌ Wrong: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of"} // missing required compareAttribute\n ❌ Wrong: {"columnId": "last_updated", "compareValue": "TODAY", "operator": "any_of", "compareAttribute": "UPDATED_AT"} // not using array for any_of operator',date:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue should be either:\n - Date in "YYYY-MM-DD" format must be passed along with "EXACT" string e.g. compareValue:["2025-01-01", "EXACT"]\n - "TODAY" - Item with today\'s date\n - "TOMORROW" - Item with tomorrow\'s date\n - "THIS_WEEK" - Item with this week\'s date\n - "ONE_WEEK_AGO" - Item with one week ago\'s date\nEXAMPLES:\n ✅ Correct: {"columnId": "date", "compareValue": ["2025-01-01", "EXACT"], "operator": "any_of"} // using exact date format with EXACT\n ✅ Correct: {"columnId": "date", "compareValue": "TODAY", "operator": "greater_than"} // using TODAY with greater_than\n ❌ Wrong: {"columnId": "date", "compareValue": "2025-01-01", "operator": "any_of"} // missing EXACT string for exact date\n ❌ Wrong: {"columnId": "date", "compareValue": ["TODAY"], "operator": "greater_than"} // using array with single value operator',email:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be:\n - empty string "" when searching for blank values\n - whole email address when searching for specific email\n - partial email when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "email", "compareValue": ["john@example.com"], "operator": "any_of"} // using array with any_of for specific email\n ✅ Correct: {"columnId": "email", "compareValue": "gmail", "operator": "contains_text"} // using partial email with contains_text\n ❌ Wrong: {"columnId": "email", "compareValue": "john@example.com", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "email", "compareValue": ["gmail"], "operator": "contains_text"} // using array with single value operator',long_text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "long_text", "compareValue": ["Complete project description"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "long_text", "compareValue": "urgent", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "long_text", "compareValue": "Complete project description", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "long_text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "text", "compareValue": ["Task Name"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "text", "compareValue": "bug", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "text", "compareValue": "Task Name", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',numbers:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue is a number or "$$$blank$$$" when searching for blank values\nEXAMPLES:\n ✅ Correct: {"columnId": "numbers", "compareValue": [100, 200], "operator": "any_of"} // using array with any_of for multiple numbers\n ✅ Correct: {"columnId": "numbers", "compareValue": 50, "operator": "greater_than"} // using single number with greater_than\n ❌ Wrong: {"columnId": "numbers", "compareValue": 100, "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "numbers", "compareValue": ["50"], "operator": "greater_than"} // using array with single value operator',name:'Supported operators: "contains_text", "not_contains_text". CompareValue can be full or partial text\nEXAMPLES:\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "contains_text"} // using string with contains_text\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "not_contains_text"} // using string with not_contains_text',status:'Supported operators: any_of, not_any_of, contains_terms. CompareValue should be either:\n - id of label from column settings - when used with any_of, not_any_of operators\n - label\'s text - when use with contains_terms\nEXAMPLES:\n ✅ Correct: {"columnId": "status", "compareValue": [0, 1], "operator": "any_of"} // Using id values\n ✅ Correct: {"columnId": "status", "compareValue": "Done", "operator": "contains_terms"} // Using label text\n ❌ Wrong: {"columnId": "status", "compareValue": "Done", "operator": "any_of"} // Using label text with wrong operator\n ❌ Wrong: {"columnId": "status", "compareValue": [0, 1], "operator": "contains_terms"} // Using id with wrong operator',checkbox:'Supported operators: is_empty, is_not_empty. Compare value must be an empty array\nEXAMPLES:\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": null, "operator": "is_empty"} // not using empty array with is_empty operator',people:'Supported operators: any_of, not_any_of, is_empty, is_not_empty. **CRITICAL**: CompareValue MUST be in one of following:\n - "assigned_to_me" - when searching for current user\n - "person-123" - when searching for specific person with id 123\n - "team-456" - when searching for specific team with id 456\n - empty array when using is_empty, is_not_empty operators\nEXAMPLES: \n ❌ Wrong: {"columnId": "column_id", "compareValue": ["person—123"], "operator": "any_of"} // Using long hyphen \'—\' instead of short hyphen \'-\'\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ✅ Correct: {"columnId": "column_id", "compareValue": ["person-80120403"], "operator": "any_of"} // using person prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["team-9000"], "operator": "any_of"} // using team prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["assigned_to_me"], "operator": "any_of"} // using assigned_to_me value\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "is_empty"} // using id with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "any_of"} // not using person or team prefix'},TA=()=>`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${sx.CountItems} function. Do not use ${sx.Count} function for that purpose.\n `,IA=e=>{const t=e.reduce(((e,t)=>EA[t.type]?(e[t.type]||(e[t.type]=[]),e[t.type].push(t.id),e):e),{});return 0===Object.keys(t).length?"":`\n[MEMORY] Remember the filtering guidelines for subsequent requests for the same board.\n# Filtering Guidelines\n\n## [IMPORTANT] Operator Guidelines\nSpecific operators expect specific compareValue types:\n- CompareValue MUST BE SENT AS AN ARRAY WHEN USED WITH any_of, not_any_of, between operators\n- CompareValue MUST BE SENT AS AN EMPTY ARRAY WHEN USED WITH is_empty, is_not_empty\n- CompareValue MUST BE SENT AS EITHER SINGLE STRING OR SINGLE NUMBER WHEN USED WITH greater_than, greater_than_or_equals, lower_than, lower_than_or_equal\n- CompareValue MUST BE SENT AS SINGLE STRING WHEN USED WITH contains_terms, not_contains_text, contains_text, starts_with, ends_with operators\n\n## [IMPORTANT] Column type Guidelines\n${Object.entries(t).map((([e,t])=>`- Column Type: ${e} (Column IDs: ${t.join(", ")}) - ${EA[e]}`)).join("\n\n")}\n\n## [IMPORTANT] Sub Items Columns MUST NOT BE USED FOR FILTERING.\n `},SA={boardId:e.z.number().describe("The id of the board to get information for")};const NA=zI`
1083
+ `,xA=(e,t)=>({board:{...e,subItemColumns:t?.columns??void 0},filteringGuidelines:SA(e.columns.filter(EA)),aggregationGuidelines:IA()});function EA(e){return!!e&&["id","type"].every((t=>t in e))}const TA={last_updated:'Supported operators: any_of, not_any_of. CompareValue should be either:\n - "TODAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "YESTERDAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\nEXAMPLES:\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // using TODAY with correct compareAttribute\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "UPDATED_AT"} // using THIS_WEEK with not_any_of\n ❌ Wrong: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of"} // missing required compareAttribute\n ❌ Wrong: {"columnId": "last_updated", "compareValue": "TODAY", "operator": "any_of", "compareAttribute": "UPDATED_AT"} // not using array for any_of operator',date:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue should be either:\n - Date in "YYYY-MM-DD" format must be passed along with "EXACT" string e.g. compareValue:["2025-01-01", "EXACT"]\n - "TODAY" - Item with today\'s date\n - "TOMORROW" - Item with tomorrow\'s date\n - "THIS_WEEK" - Item with this week\'s date\n - "ONE_WEEK_AGO" - Item with one week ago\'s date\nEXAMPLES:\n ✅ Correct: {"columnId": "date", "compareValue": ["2025-01-01", "EXACT"], "operator": "any_of"} // using exact date format with EXACT\n ✅ Correct: {"columnId": "date", "compareValue": "TODAY", "operator": "greater_than"} // using TODAY with greater_than\n ❌ Wrong: {"columnId": "date", "compareValue": "2025-01-01", "operator": "any_of"} // missing EXACT string for exact date\n ❌ Wrong: {"columnId": "date", "compareValue": ["TODAY"], "operator": "greater_than"} // using array with single value operator',email:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be:\n - empty string "" when searching for blank values\n - whole email address when searching for specific email\n - partial email when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "email", "compareValue": ["john@example.com"], "operator": "any_of"} // using array with any_of for specific email\n ✅ Correct: {"columnId": "email", "compareValue": "gmail", "operator": "contains_text"} // using partial email with contains_text\n ❌ Wrong: {"columnId": "email", "compareValue": "john@example.com", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "email", "compareValue": ["gmail"], "operator": "contains_text"} // using array with single value operator',long_text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "long_text", "compareValue": ["Complete project description"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "long_text", "compareValue": "urgent", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "long_text", "compareValue": "Complete project description", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "long_text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "text", "compareValue": ["Task Name"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "text", "compareValue": "bug", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "text", "compareValue": "Task Name", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',numbers:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue is a number or "$$$blank$$$" when searching for blank values\nEXAMPLES:\n ✅ Correct: {"columnId": "numbers", "compareValue": [100, 200], "operator": "any_of"} // using array with any_of for multiple numbers\n ✅ Correct: {"columnId": "numbers", "compareValue": 50, "operator": "greater_than"} // using single number with greater_than\n ❌ Wrong: {"columnId": "numbers", "compareValue": 100, "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "numbers", "compareValue": ["50"], "operator": "greater_than"} // using array with single value operator',name:'Supported operators: "contains_text", "not_contains_text". CompareValue can be full or partial text\nEXAMPLES:\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "contains_text"} // using string with contains_text\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "not_contains_text"} // using string with not_contains_text',status:'Supported operators: any_of, not_any_of, contains_terms. CompareValue should be either:\n - id of label from column settings - when used with any_of, not_any_of operators\n - label\'s text - when use with contains_terms\nEXAMPLES:\n ✅ Correct: {"columnId": "status", "compareValue": [0, 1], "operator": "any_of"} // Using id values\n ✅ Correct: {"columnId": "status", "compareValue": "Done", "operator": "contains_terms"} // Using label text\n ❌ Wrong: {"columnId": "status", "compareValue": "Done", "operator": "any_of"} // Using label text with wrong operator\n ❌ Wrong: {"columnId": "status", "compareValue": [0, 1], "operator": "contains_terms"} // Using id with wrong operator',checkbox:'Supported operators: is_empty, is_not_empty. Compare value must be an empty array\nEXAMPLES:\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": null, "operator": "is_empty"} // not using empty array with is_empty operator',people:'Supported operators: any_of, not_any_of, is_empty, is_not_empty. **CRITICAL**: CompareValue MUST be in one of following:\n - "assigned_to_me" - when searching for current user\n - "person-123" - when searching for specific person with id 123\n - "team-456" - when searching for specific team with id 456\n - empty array when using is_empty, is_not_empty operators\nEXAMPLES: \n ❌ Wrong: {"columnId": "column_id", "compareValue": ["person—123"], "operator": "any_of"} // Using long hyphen \'—\' instead of short hyphen \'-\'\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ✅ Correct: {"columnId": "column_id", "compareValue": ["person-80120403"], "operator": "any_of"} // using person prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["team-9000"], "operator": "any_of"} // using team prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["assigned_to_me"], "operator": "any_of"} // using assigned_to_me value\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "is_empty"} // using id with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "any_of"} // not using person or team prefix'},IA=()=>`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${sx.CountItems} function. Do not use ${sx.Count} function for that purpose.\n `,SA=e=>{const t=e.reduce(((e,t)=>TA[t.type]?(e[t.type]||(e[t.type]=[]),e[t.type].push(t.id),e):e),{});return 0===Object.keys(t).length?"":`\n[MEMORY] Remember the filtering guidelines for subsequent requests for the same board.\n# Filtering Guidelines\n\n## [IMPORTANT] Operator Guidelines\nSpecific operators expect specific compareValue types:\n- CompareValue MUST BE SENT AS AN ARRAY WHEN USED WITH any_of, not_any_of, between operators\n- CompareValue MUST BE SENT AS AN EMPTY ARRAY WHEN USED WITH is_empty, is_not_empty\n- CompareValue MUST BE SENT AS EITHER SINGLE STRING OR SINGLE NUMBER WHEN USED WITH greater_than, greater_than_or_equals, lower_than, lower_than_or_equal\n- CompareValue MUST BE SENT AS SINGLE STRING WHEN USED WITH contains_terms, not_contains_text, contains_text, starts_with, ends_with operators\n\n## [IMPORTANT] Column type Guidelines\n${Object.entries(t).map((([e,t])=>`- Column Type: ${e} (Column IDs: ${t.join(", ")}) - ${TA[e]}`)).join("\n\n")}\n\n## [IMPORTANT] Sub Items Columns MUST NOT BE USED FOR FILTERING.\n `},NA={boardId:e.z.number().describe("The id of the board to get information for")};const AA=zI`
1053
1084
  fragment ItemDataFragment on Item {
1054
1085
  id
1055
1086
  name
@@ -1112,7 +1143,7 @@
1112
1143
  }
1113
1144
  }
1114
1145
  }
1115
- `,AA=zI`
1146
+ `,DA=zI`
1116
1147
  query SearchItemsDev($query: String!, $limit: Int!, $filters: SearchFiltersInput!) {
1117
1148
  search(query: $query, limit: $limit, filters: $filters) {
1118
1149
  __typename
@@ -1123,11 +1154,11 @@
1123
1154
  }
1124
1155
  }
1125
1156
  }
1126
- `;var DA,kA;!function(e){e.BOARD="board-",e.DOCUMENT="doc-",e.FOLDER="folder-"}(DA||(DA={})),function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS"}(kA||(kA={}));const OA={boardId:e.z.number().describe("The id of the board to get items from"),itemIds:e.z.array(e.z.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:e.z.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:e.z.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:e.z.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:e.z.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeItemDescription:e.z.boolean().optional().default(!1).describe("Whether to include the item's description in the response. The item description is the rich-text body content that appears inside a monday.com item (similar to a task description or issue body). Set this to true when the user asks about an item's description, details, body, or notes. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the item description content."),includeSubItems:e.z.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:e.z.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filters:hA,filtersOperator:fA,columnIds:e.z.array(e.z.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderBy:e.z.array(e.z.object({columnId:e.z.string().describe("The id of the column to order by"),direction:e.z.nativeEnum(yE).optional().default(yE.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};const RA={boardId:e.z.number().describe("The id of the board to get the schema of")};const PA=zI`
1157
+ `;var kA,OA;!function(e){e.BOARD="board-",e.DOCUMENT="doc-",e.FOLDER="folder-"}(kA||(kA={})),function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS"}(OA||(OA={}));const RA={boardId:e.z.number().describe("The id of the board to get items from"),itemIds:e.z.array(e.z.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:e.z.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:e.z.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:e.z.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:e.z.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeItemDescription:e.z.boolean().optional().default(!1).describe("Whether to include the item's description in the response. The item description is the rich-text body content that appears inside a monday.com item (similar to a task description or issue body). Set this to true when the user asks about an item's description, details, body, or notes. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the item description content."),includeSubItems:e.z.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:e.z.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filters:fA,filtersOperator:vA,columnIds:e.z.array(e.z.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderBy:e.z.array(e.z.object({columnId:e.z.string().describe("The id of the column to order by"),direction:e.z.nativeEnum(yE).optional().default(yE.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};const PA={boardId:e.z.number().describe("The id of the board to get the schema of")};const $A=zI`
1127
1158
  query GetColumnTypeSchema($type: ColumnType!) {
1128
1159
  get_column_type_schema(type: $type)
1129
1160
  }
1130
- `,$A="https://developer.monday.com/api-reference",CA={columnType:e.z.nativeEnum(PN).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const FA={random_string:e.z.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:e.z.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const jA={typeName:e.z.string().describe("The name of the GraphQL type to get details for")};function LA(e){return e?"NON_NULL"===e.kind?`${LA(e.ofType)}!`:"LIST"===e.kind?`[${LA(e.ofType)}]`:e.name||"unknown":"unknown"}const zA=zI`
1161
+ `,CA="https://developer.monday.com/api-reference",FA={columnType:e.z.nativeEnum($N).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const jA={random_string:e.z.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:e.z.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const LA={typeName:e.z.string().describe("The name of the GraphQL type to get details for")};function zA(e){return e?"NON_NULL"===e.kind?`${zA(e.ofType)}!`:"LIST"===e.kind?`[${zA(e.ofType)}]`:e.name||"unknown":"unknown"}const UA=zI`
1131
1162
  fragment UserDetails on User {
1132
1163
  # Basic User Information
1133
1164
  id
@@ -1159,31 +1190,31 @@
1159
1190
  time_zone_identifier
1160
1191
  utc_hours_diff
1161
1192
  }
1162
- `,UA=zI`
1193
+ `,VA=zI`
1163
1194
  fragment UserTeamMembership on Team {
1164
1195
  id
1165
1196
  name
1166
1197
  is_guest
1167
1198
  picture_url
1168
1199
  }
1169
- `,VA=zI`
1200
+ `,BA=zI`
1170
1201
  fragment TeamBasicInfo on Team {
1171
1202
  id
1172
1203
  name
1173
1204
  }
1174
- `,BA=zI`
1205
+ `,qA=zI`
1175
1206
  fragment TeamExtendedInfo on Team {
1176
1207
  ...TeamBasicInfo
1177
1208
  is_guest
1178
1209
  picture_url
1179
1210
  }
1180
- `,qA=zI`
1211
+ `,MA=zI`
1181
1212
  fragment TeamOwner on User {
1182
1213
  id
1183
1214
  name
1184
1215
  email
1185
1216
  }
1186
- `,MA=zI`
1217
+ `,HA=zI`
1187
1218
  fragment TeamMember on User {
1188
1219
  id
1189
1220
  name
@@ -1203,7 +1234,7 @@
1203
1234
  time_zone_identifier
1204
1235
  utc_hours_diff
1205
1236
  }
1206
- `,HA=zI`
1237
+ `,GA=zI`
1207
1238
  fragment TeamMemberSimplified on User {
1208
1239
  id
1209
1240
  name
@@ -1212,15 +1243,15 @@
1212
1243
  is_admin
1213
1244
  is_guest
1214
1245
  }
1215
- `,GA=zI`
1246
+ `,WA=zI`
1216
1247
  fragment UserTeamMembershipSimplified on Team {
1217
1248
  id
1218
1249
  name
1219
1250
  is_guest
1220
1251
  }
1221
- `,WA=zI`
1222
- ${zA}
1252
+ `,QA=zI`
1223
1253
  ${UA}
1254
+ ${VA}
1224
1255
 
1225
1256
  query listUsersWithTeams($userIds: [ID!], $limit: Int = 1000) {
1226
1257
  users(ids: $userIds, limit: $limit) {
@@ -1232,21 +1263,21 @@
1232
1263
  }
1233
1264
  }
1234
1265
  }
1235
- `,QA=zI`
1236
- ${zA}
1266
+ `,KA=zI`
1267
+ ${UA}
1237
1268
 
1238
1269
  query listUsersOnly($userIds: [ID!], $limit: Int = 1000) {
1239
1270
  users(ids: $userIds, limit: $limit) {
1240
1271
  ...UserDetails
1241
1272
  }
1242
1273
  }
1243
- `,KA=zI`
1244
- ${zA}
1245
- ${GA}
1246
- ${BA}
1247
- ${VA}
1274
+ `,YA=zI`
1275
+ ${UA}
1276
+ ${WA}
1248
1277
  ${qA}
1249
- ${HA}
1278
+ ${BA}
1279
+ ${MA}
1280
+ ${GA}
1250
1281
 
1251
1282
  query listUsersAndTeams($userIds: [ID!], $teamIds: [ID!], $limit: Int = 1000) {
1252
1283
  users(ids: $userIds, limit: $limit) {
@@ -1272,19 +1303,19 @@
1272
1303
  }
1273
1304
  }
1274
1305
  }
1275
- `,YA=zI`
1276
- ${VA}
1306
+ `,JA=zI`
1307
+ ${BA}
1277
1308
 
1278
1309
  query listTeamsOnly($teamIds: [ID!]) {
1279
1310
  teams(ids: $teamIds) {
1280
1311
  ...TeamBasicInfo
1281
1312
  }
1282
1313
  }
1283
- `,JA=zI`
1284
- ${BA}
1285
- ${VA}
1314
+ `,XA=zI`
1286
1315
  ${qA}
1316
+ ${BA}
1287
1317
  ${MA}
1318
+ ${HA}
1288
1319
 
1289
1320
  query listTeamsWithMembers($teamIds: [ID!]) {
1290
1321
  teams(ids: $teamIds) {
@@ -1301,9 +1332,9 @@
1301
1332
  }
1302
1333
  }
1303
1334
  }
1304
- `,XA=zI`
1305
- ${zA}
1335
+ `,ZA=zI`
1306
1336
  ${UA}
1337
+ ${VA}
1307
1338
 
1308
1339
  query getUserByName($name: String) {
1309
1340
  users(name: $name) {
@@ -1315,7 +1346,7 @@
1315
1346
  }
1316
1347
  }
1317
1348
  }
1318
- `,ZA=zI`
1349
+ `,eD=zI`
1319
1350
  query getCurrentUser {
1320
1351
  me {
1321
1352
  id
@@ -1327,7 +1358,7 @@
1327
1358
  photo_thumb
1328
1359
  }
1329
1360
  }
1330
- `;const eD=[["is_pending","Pending"],["is_verified","Verified"],["is_view_only","View Only"],["join_date","Join Date"],["last_activity","Last Activity"],["location","Location"],["mobile_phone","Mobile Phone"],["phone","Phone"],["photo_thumb","Photo Thumb"],["time_zone_identifier","Timezone"],["utc_hours_diff","UTC Hours Diff"]];function tD(e,t=""){return eD.filter((([t])=>{const a=e[t];return null!=a})).map((([a,i])=>`${t}${i}: ${e[a]}`))}const aD=e=>{const t=[];return"users"in e&&e.users&&e.users.length>0&&(t.push("Users:"),e.users.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),t.push(` Email: ${e.email}`),t.push(` Title: ${e.title||"N/A"}`),t.push(` Enabled: ${e.enabled}`),t.push(` Admin: ${e.is_admin||!1}`),t.push(` Guest: ${e.is_guest||!1}`),t.push(...tD(e," ")),e.teams&&e.teams.length>0&&(t.push(" Teams:"),e.teams.forEach((e=>{e&&t.push(` - ID: ${e.id}, Name: ${e.name}, Guest Team: ${e.is_guest||!1}, Picture URL: ${e.picture_url||"N/A"}`)}))),t.push(""))}))),"teams"in e&&e.teams&&e.teams.length>0&&(t.push("Teams:"),e.teams.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),function(e){return"owners"in e}(e)&&(t.push(` Guest Team: ${e.is_guest||!1}`),t.push(` Picture URL: ${e.picture_url||"N/A"}`),e.owners&&e.owners.length>0&&(t.push(" Owners:"),e.owners.forEach((e=>{t.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}`)}))),e.users&&e.users.length>0&&(t.push(" Members:"),e.users.forEach((e=>{if(e){const a=[`ID: ${e.id}`,`Name: ${e.name}`,`Email: ${e.email}`,`Title: ${e.title||"N/A"}`,`Admin: ${e.is_admin||!1}`,`Guest: ${e.is_guest||!1}`,...tD(e)];t.push(` - ${a.join(", ")}`)}})))),t.push(""))}))),0===t.length?"No users or teams found with the specified filters.":t.join("\n").trim()},iD=500,nD=500,oD=1e3,rD=zI`
1361
+ `;const tD=[["is_pending","Pending"],["is_verified","Verified"],["is_view_only","View Only"],["join_date","Join Date"],["last_activity","Last Activity"],["location","Location"],["mobile_phone","Mobile Phone"],["phone","Phone"],["photo_thumb","Photo Thumb"],["time_zone_identifier","Timezone"],["utc_hours_diff","UTC Hours Diff"]];function aD(e,t=""){return tD.filter((([t])=>{const a=e[t];return null!=a})).map((([a,i])=>`${t}${i}: ${e[a]}`))}const iD=e=>{const t=[];return"users"in e&&e.users&&e.users.length>0&&(t.push("Users:"),e.users.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),t.push(` Email: ${e.email}`),t.push(` Title: ${e.title||"N/A"}`),t.push(` Enabled: ${e.enabled}`),t.push(` Admin: ${e.is_admin||!1}`),t.push(` Guest: ${e.is_guest||!1}`),t.push(...aD(e," ")),e.teams&&e.teams.length>0&&(t.push(" Teams:"),e.teams.forEach((e=>{e&&t.push(` - ID: ${e.id}, Name: ${e.name}, Guest Team: ${e.is_guest||!1}, Picture URL: ${e.picture_url||"N/A"}`)}))),t.push(""))}))),"teams"in e&&e.teams&&e.teams.length>0&&(t.push("Teams:"),e.teams.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),function(e){return"owners"in e}(e)&&(t.push(` Guest Team: ${e.is_guest||!1}`),t.push(` Picture URL: ${e.picture_url||"N/A"}`),e.owners&&e.owners.length>0&&(t.push(" Owners:"),e.owners.forEach((e=>{t.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}`)}))),e.users&&e.users.length>0&&(t.push(" Members:"),e.users.forEach((e=>{if(e){const a=[`ID: ${e.id}`,`Name: ${e.name}`,`Email: ${e.email}`,`Title: ${e.title||"N/A"}`,`Admin: ${e.is_admin||!1}`,`Guest: ${e.is_guest||!1}`,...aD(e)];t.push(` - ${a.join(", ")}`)}})))),t.push(""))}))),0===t.length?"No users or teams found with the specified filters.":t.join("\n").trim()},nD=500,oD=500,rD=1e3,sD=zI`
1331
1362
  query getAccountSlug {
1332
1363
  me {
1333
1364
  account {
@@ -1335,7 +1366,7 @@
1335
1366
  }
1336
1367
  }
1337
1368
  }
1338
- `;async function sD(e){const t=await e.request(rD);return t.me?.account?.slug??null}function pD(e,t){return`https://${e}.monday.com/workspaces/${t}`}const dD={userIds:e.z.array(e.z.string()).max(iD).optional().describe("Specific user IDs to fetch.[IMPORTANT] ALWAYS use when you have user IDs in context. PREFER over general search. RETURNS: user profiles including team memberships"),teamIds:e.z.array(e.z.string()).max(nD).optional().describe("Specific team IDs to fetch.[IMPORTANT] ALWAYS use when you have team IDs in context, NEVER fetch all teams if specific IDs are available.\n RETURNS: Team details with owners and optional member data."),name:e.z.string().optional().describe("Name-based USER search ONLY. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n CRITICAL: This parameter searches for USERS ONLY, NOT teams. To search for teams, use teamIds parameter instead."),getMe:e.z.boolean().optional().describe('[TOP PRIORITY] Use ALWAYS when requesting current user information. Examples of when it should be used: ["get my user" or "get my teams"].\n This parameter CONFLICTS with all others. '),includeTeams:e.z.boolean().optional().describe("[AVOID] This fetches all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get their team memberships."),teamsOnly:e.z.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:e.z.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const lD={itemId:e.z.number().describe("The id of the item to which the update will be added"),groupId:e.z.string().describe("The id of the group to which the item will be moved")};const cD=e.z.enum(["ids","object_ids","workspace_ids"]),mD={mode:e.z.enum(["content","version_history"]).optional().default("content").describe('The operation mode. "content" (default) fetches documents with their markdown content. "version_history" fetches the edit history of a single document.'),type:cD.optional().describe('Query type for content mode: "ids", "object_ids", or "workspace_ids". Required when mode is "content".'),ids:e.z.array(e.z.string()).optional().describe('Array of ID values. In content mode: matches the query type (ids/object_ids/workspace_ids). In version_history mode: provide the single document object_id here (e.g., ids: ["5001466606"]).'),limit:e.z.number().optional().describe("Number of docs per page (default: 25). Only used in content mode."),order_by:e.z.nativeEnum(Kx).optional().describe("Order in which to retrieve docs. Only used in content mode."),page:e.z.number().optional().describe("Page number to return (starts at 1). Only used in content mode."),include_blocks:e.z.boolean().optional().default(!1).describe("If true, includes the blocks array (block IDs, types, positions, content) in the response. Required when you plan to call update_doc. Defaults to false to reduce response size. Only used in content mode."),version_history_limit:e.z.number().optional().describe('Maximum number of restoring points to return. Use this when the user asks for "last N changes". Only used in version_history mode.'),since:e.z.string().optional().describe('ISO 8601 date string to filter version history from (e.g., "2026-03-15T00:00:00Z"). If omitted, returns the full history. Only used in version_history mode.'),until:e.z.string().optional().describe('ISO 8601 date string to filter version history until (e.g., "2026-03-16T23:59:59Z"). Defaults to now. Only used in version_history mode.'),include_diff:e.z.boolean().optional().default(!1).describe("If true, fetches content diffs between consecutive restoring points. May be slower due to additional API calls. Only used in version_history mode.")};const uD={workspace_id:e.z.number().describe("The ID of the workspace to get information for")};const hD=zI`
1369
+ `;async function pD(e){const t=await e.request(sD);return t.me?.account?.slug??null}function dD(e,t){return`https://${e}.monday.com/workspaces/${t}`}const lD={userIds:e.z.array(e.z.string()).max(nD).optional().describe("Specific user IDs to fetch.[IMPORTANT] ALWAYS use when you have user IDs in context. PREFER over general search. RETURNS: user profiles including team memberships"),teamIds:e.z.array(e.z.string()).max(oD).optional().describe("Specific team IDs to fetch.[IMPORTANT] ALWAYS use when you have team IDs in context, NEVER fetch all teams if specific IDs are available.\n RETURNS: Team details with owners and optional member data."),name:e.z.string().optional().describe("Name-based USER search ONLY. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n CRITICAL: This parameter searches for USERS ONLY, NOT teams. To search for teams, use teamIds parameter instead."),getMe:e.z.boolean().optional().describe('[TOP PRIORITY] Use ALWAYS when requesting current user information. Examples of when it should be used: ["get my user" or "get my teams"].\n This parameter CONFLICTS with all others. '),includeTeams:e.z.boolean().optional().describe("[AVOID] This fetches all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get their team memberships."),teamsOnly:e.z.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:e.z.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const cD={itemId:e.z.number().describe("The id of the item to which the update will be added"),groupId:e.z.string().describe("The id of the group to which the item will be moved")};const mD=e.z.enum(["ids","object_ids","workspace_ids"]),uD={mode:e.z.enum(["content","version_history"]).optional().default("content").describe('The operation mode. "content" (default) fetches documents with their markdown content. "version_history" fetches the edit history of a single document.'),type:mD.optional().describe('Query type for content mode: "ids", "object_ids", or "workspace_ids". Required when mode is "content".'),ids:e.z.array(e.z.string()).optional().describe('Array of ID values. In content mode: matches the query type (ids/object_ids/workspace_ids). In version_history mode: provide the single document object_id here (e.g., ids: ["5001466606"]).'),limit:e.z.number().optional().describe("Number of docs per page (default: 25). Only used in content mode."),order_by:e.z.nativeEnum(Kx).optional().describe("Order in which to retrieve docs. Only used in content mode."),page:e.z.number().optional().describe("Page number to return (starts at 1). Only used in content mode."),include_blocks:e.z.boolean().optional().default(!1).describe("If true, includes the blocks array (block IDs, types, positions, content) in the response. Required when you plan to call update_doc. Defaults to false to reduce response size. Only used in content mode."),include_comments:e.z.boolean().optional().default(!1).describe("If true, fetches all comments and replies on the document. Comments are stored at the item level within the doc backing board. Defaults to false. Only used in content mode."),comments_limit:e.z.number().optional().default(50).describe("Maximum number of comments (updates) to fetch per item when include_comments is true. Defaults to 50. Only used in content mode."),version_history_limit:e.z.number().optional().describe('Maximum number of restoring points to return. Use this when the user asks for "last N changes". Only used in version_history mode.'),since:e.z.string().optional().describe('ISO 8601 date string to filter version history from (e.g., "2026-03-15T00:00:00Z"). If omitted, returns the full history. Only used in version_history mode.'),until:e.z.string().optional().describe('ISO 8601 date string to filter version history until (e.g., "2026-03-16T23:59:59Z"). Defaults to now. Only used in version_history mode.'),include_diff:e.z.boolean().optional().default(!1).describe("If true, fetches content diffs between consecutive restoring points. May be slower due to additional API calls. Only used in version_history mode.")};const hD={workspace_id:e.z.number().describe("The ID of the workspace to get information for")};const fD=zI`
1339
1370
  query listWorkspaces($limit: Int!, $page: Int!, $membershipKind: WorkspaceMembershipKind!) {
1340
1371
  workspaces(limit: $limit, page: $page, membership_kind: $membershipKind) {
1341
1372
  id
@@ -1343,7 +1374,7 @@
1343
1374
  description
1344
1375
  }
1345
1376
  }
1346
- `,fD=100,vD=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,"");function gD(e){const t=e.workspaces?.filter((e=>null!==e));return t||[]}function bD(e){return Array.isArray(e)&&e.length>0}const yD={searchTerm:e.z.string().optional().describe("Optional search term used to filter workspaces. [IMPORTANT] Only alphanumeric characters are supported."),limit:e.z.number().min(1).max(fD).default(fD).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:e.z.number().min(1).default(1).describe("Page number to return. Default is 1.")};const _D=zI`
1377
+ `,vD=100,gD=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,"");function bD(e){const t=e.workspaces?.filter((e=>null!==e));return t||[]}function yD(e){return Array.isArray(e)&&e.length>0}const _D={searchTerm:e.z.string().optional().describe("Optional search term used to filter workspaces. [IMPORTANT] Only alphanumeric characters are supported."),limit:e.z.number().min(1).max(vD).default(vD).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:e.z.number().min(1).default(1).describe("Page number to return. Default is 1.")};const wD=zI`
1347
1378
  query getItemBoard($itemId: ID!) {
1348
1379
  items(ids: [$itemId]) {
1349
1380
  id
@@ -1356,7 +1387,7 @@
1356
1387
  }
1357
1388
  }
1358
1389
  }
1359
- `,wD=zI`
1390
+ `,xD=zI`
1360
1391
  mutation createDoc($location: CreateDocInput!) {
1361
1392
  create_doc(location: $location) {
1362
1393
  id
@@ -1365,7 +1396,7 @@
1365
1396
  name
1366
1397
  }
1367
1398
  }
1368
- `,xD=zI`
1399
+ `,ED=zI`
1369
1400
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1370
1401
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1371
1402
  success
@@ -1373,11 +1404,11 @@
1373
1404
  error
1374
1405
  }
1375
1406
  }
1376
- `,ED=zI`
1407
+ `,TD=zI`
1377
1408
  mutation updateDocName($docId: ID!, $name: String!) {
1378
1409
  update_doc_name(docId: $docId, name: $name)
1379
1410
  }
1380
- `,TD=e.z.enum(["workspace","item"]),ID=e.z.discriminatedUnion("type",[e.z.object({type:e.z.literal(TD.enum.workspace).describe("Create document in workspace"),workspace_id:e.z.number().describe("Workspace ID under which to create the new document"),doc_kind:e.z.nativeEnum(Ex).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:e.z.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),e.z.object({type:e.z.literal(TD.enum.item).describe("Create document attached to item"),item_id:e.z.number().describe("Item ID to attach the new document to"),column_id:e.z.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]),SD={doc_name:e.z.string().describe("Name for the new document."),markdown:e.z.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:e.z.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:e.z.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:e.z.nativeEnum(Ex).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:e.z.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:e.z.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:e.z.string().optional().describe('[OPTIONAL - use only when location="item"] ID of an existing "doc" column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.')};const ND=zI`
1411
+ `,ID=e.z.enum(["workspace","item"]),SD=e.z.discriminatedUnion("type",[e.z.object({type:e.z.literal(ID.enum.workspace).describe("Create document in workspace"),workspace_id:e.z.number().describe("Workspace ID under which to create the new document"),doc_kind:e.z.nativeEnum(Ex).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:e.z.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),e.z.object({type:e.z.literal(ID.enum.item).describe("Create document attached to item"),item_id:e.z.number().describe("Item ID to attach the new document to"),column_id:e.z.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]),ND={doc_name:e.z.string().describe("Name for the new document."),markdown:e.z.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:e.z.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:e.z.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:e.z.nativeEnum(Ex).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:e.z.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:e.z.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:e.z.string().optional().describe('[OPTIONAL - use only when location="item"] ID of an existing "doc" column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.')};const AD=zI`
1381
1412
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1382
1413
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1383
1414
  success
@@ -1385,7 +1416,7 @@
1385
1416
  error
1386
1417
  }
1387
1418
  }
1388
- `,AD=zI`
1419
+ `,DD=zI`
1389
1420
  query getDocByObjectId($objectId: [ID!]) {
1390
1421
  docs(object_ids: $objectId) {
1391
1422
  id
@@ -1393,7 +1424,7 @@
1393
1424
  url
1394
1425
  }
1395
1426
  }
1396
- `,DD=zI`
1427
+ `,kD=zI`
1397
1428
  query getDocById($docId: [ID!]) {
1398
1429
  docs(ids: $docId) {
1399
1430
  id
@@ -1401,11 +1432,11 @@
1401
1432
  url
1402
1433
  }
1403
1434
  }
1404
- `,kD={doc_id:e.z.string().min(1).optional().describe("The document ID (the id field returned by read_docs). Provide this OR object_id. Takes priority if both are provided."),object_id:e.z.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id. Provide this OR doc_id."),markdown:e.z.string().describe("Markdown content to add to the document."),after_block_id:e.z.string().optional().describe("Block ID after which to insert the new content. If omitted, content is appended at the end. To insert at the beginning, pass the first block ID from read_docs. Block IDs can be obtained from read_docs or from a previous add_content_to_doc response.")};const OD=zI`
1435
+ `,OD={doc_id:e.z.string().min(1).optional().describe("The document ID (the id field returned by read_docs). Provide this OR object_id. Takes priority if both are provided."),object_id:e.z.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id. Provide this OR doc_id."),markdown:e.z.string().describe("Markdown content to add to the document."),after_block_id:e.z.string().optional().describe("Block ID after which to insert the new content. If omitted, content is appended at the end. To insert at the beginning, pass the first block ID from read_docs. Block IDs can be obtained from read_docs or from a previous add_content_to_doc response.")};const RD=zI`
1405
1436
  mutation updateDocName($docId: ID!, $name: String!) {
1406
1437
  update_doc_name(docId: $docId, name: $name)
1407
1438
  }
1408
- `,RD=zI`
1439
+ `,PD=zI`
1409
1440
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1410
1441
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1411
1442
  success
@@ -1413,13 +1444,13 @@
1413
1444
  error
1414
1445
  }
1415
1446
  }
1416
- `,PD=zI`
1447
+ `,$D=zI`
1417
1448
  query getDocByObjectId($objectId: [ID!]) {
1418
1449
  docs(object_ids: $objectId) {
1419
1450
  id
1420
1451
  }
1421
1452
  }
1422
- `,$D=zI`
1453
+ `,CD=zI`
1423
1454
  mutation updateDocBlock($blockId: String!, $content: JSON!) {
1424
1455
  update_doc_block(block_id: $blockId, content: $content) {
1425
1456
  id
@@ -1427,13 +1458,13 @@
1427
1458
  created_at
1428
1459
  }
1429
1460
  }
1430
- `,CD=zI`
1461
+ `,FD=zI`
1431
1462
  mutation deleteDocBlock($blockId: String!) {
1432
1463
  delete_doc_block(block_id: $blockId) {
1433
1464
  id
1434
1465
  }
1435
1466
  }
1436
- `,FD=zI`
1467
+ `,jD=zI`
1437
1468
  mutation createDocBlocks($docId: ID!, $afterBlockId: String, $blocksInput: [CreateBlockInput!]!) {
1438
1469
  create_doc_blocks(docId: $docId, afterBlockId: $afterBlockId, blocksInput: $blocksInput) {
1439
1470
  id
@@ -1501,7 +1532,7 @@
1501
1532
  }
1502
1533
  }
1503
1534
  }
1504
- `;function jD(e){if(e)return e}function LD(e){if(e)return e}function zD(e){if(e)return{bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,code:e.code,link:e.link,color:e.color,background:e.background}}function UD(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{blot:{mention:{id:String(t),type:e.insert.mention.type}}}}}return"column_value"in e.insert?{insert:{blot:{column_value:{item_id:String(e.insert.column_value.item_id),column_id:e.insert.column_value.column_id}}}}:{insert:{text:e.insert.text},attributes:zD(e.attributes)}}))}function VD(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{mention:{id:t,type:e.insert.mention.type}}}}return"column_value"in e.insert?{insert:{macro:{type:"COLUMN_VALUE",macroId:l.randomUUID(),macroData:{itemId:Number(e.insert.column_value.item_id),columnId:e.insert.column_value.column_id}}}}:{insert:e.insert.text,attributes:zD(e.attributes)}}))}const BD=e.z.object({bold:e.z.boolean().optional(),italic:e.z.boolean().optional(),underline:e.z.boolean().optional(),strike:e.z.boolean().optional(),code:e.z.boolean().optional(),link:e.z.string().optional(),color:e.z.string().optional(),background:e.z.string().optional()}).optional(),qD=e.z.object({mention:e.z.object({id:e.z.union([e.z.string(),e.z.number()]).describe("User, doc, or board ID. Get user IDs from list_users_and_teams."),type:e.z.enum(["USER","DOC","BOARD"]).default("USER").describe("Mention type. USER is most common.")}).describe("Mention blot — tags a user, doc, or board inline. Do not set attributes on mention ops.")}),MD=e.z.object({column_value:e.z.object({item_id:e.z.union([e.z.string(),e.z.number()]).describe("The board item ID."),column_id:e.z.string().describe('The column ID (e.g. "status", "date4"). Get column IDs from get_board_schema.')}).describe("Column value blot — embeds a live board column value inline in the doc.")}),HD=e.z.object({insert:e.z.union([e.z.object({text:e.z.string()}),qD,MD]).describe('Content to insert. Use {text: "..."} for plain text, {mention: {id, type}} to tag a user/doc/board, or {column_value: {item_id, column_id}} to embed a live column value. The last operation in the array must be {text: "\\n"}.'),attributes:BD.describe("Optional formatting: bold, italic, underline, strike, code, link, color, background. Not applicable to mention or column_value ops.")}),GD=e.z.object({block_content_type:e.z.literal("text"),delta_format:e.z.array(HD).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:e.z.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:e.z.enum(["LTR","RTL"]).optional()}),WD=e.z.object({block_content_type:e.z.literal("code"),delta_format:e.z.array(HD).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:e.z.string().optional().describe('Programming language (e.g. "javascript", "python").')}),QD=e.z.object({block_content_type:e.z.literal("list_item"),delta_format:e.z.array(HD).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),checked:e.z.boolean().optional().describe("Check state for CHECK_LIST items."),indentation:e.z.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),KD=e.z.discriminatedUnion("block_content_type",[GD,WD,QD]),YD=e.z.object({block_type:e.z.literal("text"),text_block_type:e.z.enum(["NORMAL_TEXT","LARGE_TITLE","MEDIUM_TITLE","SMALL_TITLE","QUOTE"]).optional().describe("Block subtype. LARGE_TITLE=H1, MEDIUM_TITLE=H2, SMALL_TITLE=H3."),delta_format:e.z.array(HD).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:e.z.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:e.z.enum(["LTR","RTL"]).optional()}),JD=e.z.object({block_type:e.z.literal("list_item"),list_block_type:e.z.enum(["BULLETED_LIST","NUMBERED_LIST","CHECK_LIST"]).optional().describe("List type. Defaults to BULLETED_LIST."),delta_format:e.z.array(HD).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),indentation:e.z.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),XD=e.z.object({block_type:e.z.literal("code"),delta_format:e.z.array(HD).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:e.z.string().optional().describe('Programming language (e.g. "javascript", "python").')}),ZD=e.z.object({block_type:e.z.literal("divider")}),ek=e.z.object({block_type:e.z.literal("page_break")}),tk=e.z.object({block_type:e.z.literal("image"),public_url:e.z.string().url().optional().describe("Publicly accessible image URL. Provide either public_url or asset_id."),asset_id:e.z.union([e.z.number().int(),e.z.string().regex(/^\d+$/).transform(Number)]).optional().describe("monday.com asset ID for the image. The image block will reference the asset directly. Provide either public_url or asset_id."),width:e.z.number().int().min(1).optional().describe("Width in pixels.")}),ak=e.z.object({block_type:e.z.literal("video"),raw_url:e.z.string().url().describe("Video URL (YouTube, Vimeo, or direct video URL)."),width:e.z.number().int().min(1).optional().describe("Width in pixels.")}),ik=e.z.object({block_type:e.z.literal("notice_box"),theme:e.z.enum(["INFO","TIPS","WARNING","GENERAL"]).describe("Visual style of the notice box.")}),nk=e.z.object({block_type:e.z.literal("table"),row_count:e.z.number().int().min(1).max(25).describe("Number of rows (1–25)."),column_count:e.z.number().int().min(1).max(10).describe("Number of columns (1–10)."),width:e.z.number().int().optional().describe("Table width in pixels."),column_style:e.z.array(e.z.object({width:e.z.number().int()})).optional().describe("Column widths. Array length must match column_count; widths must sum to 100.")}),ok=e.z.object({block_type:e.z.literal("layout"),column_count:e.z.number().int().min(2).max(6).describe("Number of columns (2–6)."),column_style:e.z.array(e.z.object({width:e.z.number().int()})).optional().describe("Column widths. Array length must match column_count; widths must sum to 100.")}),rk=e.z.discriminatedUnion("block_type",[YD,JD,XD,ZD,ek,tk,ak,ik,nk,ok]),sk=e.z.object({operation_type:e.z.literal("set_name"),name:e.z.string().min(1).describe("New document name.")}),pk=e.z.object({operation_type:e.z.literal("add_markdown_content"),markdown:e.z.string().describe("Markdown content to convert and append (or insert) as blocks."),after_block_id:e.z.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs.")}),dk=e.z.object({operation_type:e.z.literal("update_block"),block_id:e.z.string().describe("ID of the block to update. Get block IDs from read_docs."),content:KD.describe("New content for the block. Use block_content_type to select: text (updates text/heading/quote content), code (updates code content), list_item (updates bullets/numbered/todo content). Cannot change block subtype — use replace_block for that.")}),lk=e.z.object({operation_type:e.z.literal("create_block"),after_block_id:e.z.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs."),parent_block_id:e.z.string().optional().describe("Parent block ID for nested blocks. Only works for notice_box containers — use the notice_box block ID directly. Table/layout cell nesting is NOT supported by the API. IMPORTANT: A notice_box created in the same call cannot be referenced — use a separate call first to create it, then a second call to nest content inside it."),block:rk.describe("The block to create. Use block_type to select the block type.")}),ck=e.z.object({operation_type:e.z.literal("delete_block"),block_id:e.z.string().describe("ID of the block to permanently delete. Works for all block types including BOARD, WIDGET, DOC embed, GIPHY.")}),mk=e.z.object({operation_type:e.z.literal("replace_block"),block_id:e.z.string().describe("ID of the block to delete."),after_block_id:e.z.string().optional().describe("Insert replacement after this block ID. Provide the ID of the block that precedes the deleted block."),parent_block_id:e.z.string().optional().describe("Parent block ID for the replacement block."),block:rk.describe("The new block to create in place of the deleted one.")}),uk=e.z.discriminatedUnion("operation_type",[sk,pk,dk,lk,ck,mk]),hk={doc_id:e.z.string().min(1).optional().describe("The document ID (the id field from read_docs). Takes priority over object_id if both are provided."),object_id:e.z.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, visible in the document URL). Resolved to doc_id."),operations:e.z.array(uk).min(1).max(25).describe('Ordered list of operations to perform. Executed sequentially; stops at first failure.\n\nOperation types:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (simplest for text/lists/tables).\n- update_block: Change content of an existing text/code/list/divider block.\n- create_block: Create a new block at a specific position (supports text, list_item, code, divider, page_break, image, video, notice_box, table, layout).\n- delete_block: Permanently remove a block. Works for ALL block types including BOARD, WIDGET, DOC embed, GIPHY.\n- replace_block: Delete a block and create a new one in its place. Use for: changing image/video source, table restructure, notice_box theme change.\n\nWHEN TO USE WHICH:\n- Adding new text sections → add_markdown_content\n- Adding asset-based images → create_block with block_type "image" and asset_id (add_markdown_content does NOT support asset images)\n- Mixed content with asset images → alternate add_markdown_content (for text) and create_block (for each image) in sequence\n- Editing existing text block → update_block\n- Changing an image URL → replace_block (image URL is immutable after creation)\n- Changing video URL → replace_block\n- Restructuring a table → replace_block\n- BOARD/WIDGET/DOC/GIPHY blocks → delete_block only (no public API to create these)\n\nNESTING CONTENT IN CONTAINERS:\n- notice_box: Fully supported. Create the notice_box first, then in a separate call create child blocks with parent_block_id set to the notice_box ID. You cannot reference a block ID created in the same call.\n- table: Cell-level API nesting is NOT supported. To create a table with content, use add_markdown_content with a markdown table (e.g. "| H1 | H2 |\\n| --- | --- |\\n| A | B |"). This creates a pre-populated table in one shot. Empty tables created via create_block cannot have their cells populated through the API.\n- layout: Cell-level API nesting is NOT supported and there is no markdown equivalent. Layouts can only be created empty via create_block. No workaround exists to populate layout columns through the API.\nDeleting a container does NOT delete its children — delete children first for clean removal.\n\nBlock IDs are available in the blocks array returned by read_docs.')};const fk=zI`
1535
+ `;function LD(e){if(e)return e}function zD(e){if(e)return e}function UD(e){if(e)return{bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,code:e.code,link:e.link,color:e.color,background:e.background}}function VD(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{blot:{mention:{id:String(t),type:e.insert.mention.type}}}}}return"column_value"in e.insert?{insert:{blot:{column_value:{item_id:String(e.insert.column_value.item_id),column_id:e.insert.column_value.column_id}}}}:{insert:{text:e.insert.text},attributes:UD(e.attributes)}}))}function BD(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{mention:{id:t,type:e.insert.mention.type}}}}return"column_value"in e.insert?{insert:{macro:{type:"COLUMN_VALUE",macroId:l.randomUUID(),macroData:{itemId:Number(e.insert.column_value.item_id),columnId:e.insert.column_value.column_id}}}}:{insert:e.insert.text,attributes:UD(e.attributes)}}))}const qD=e.z.object({bold:e.z.boolean().optional(),italic:e.z.boolean().optional(),underline:e.z.boolean().optional(),strike:e.z.boolean().optional(),code:e.z.boolean().optional(),link:e.z.string().optional(),color:e.z.string().optional(),background:e.z.string().optional()}).optional(),MD=e.z.object({mention:e.z.object({id:e.z.union([e.z.string(),e.z.number()]).describe("User, doc, or board ID. Get user IDs from list_users_and_teams."),type:e.z.enum(["USER","DOC","BOARD"]).default("USER").describe("Mention type. USER is most common.")}).describe("Mention blot — tags a user, doc, or board inline. Do not set attributes on mention ops.")}),HD=e.z.object({column_value:e.z.object({item_id:e.z.union([e.z.string(),e.z.number()]).describe("The board item ID."),column_id:e.z.string().describe('The column ID (e.g. "status", "date4"). Get column IDs from get_board_schema.')}).describe("Column value blot — embeds a live board column value inline in the doc.")}),GD=e.z.object({insert:e.z.union([e.z.object({text:e.z.string()}),MD,HD]).describe('Content to insert. Use {text: "..."} for plain text, {mention: {id, type}} to tag a user/doc/board, or {column_value: {item_id, column_id}} to embed a live column value. The last operation in the array must be {text: "\\n"}.'),attributes:qD.describe("Optional formatting: bold, italic, underline, strike, code, link, color, background. Not applicable to mention or column_value ops.")}),WD=e.z.object({block_content_type:e.z.literal("text"),delta_format:e.z.array(GD).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:e.z.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:e.z.enum(["LTR","RTL"]).optional()}),QD=e.z.object({block_content_type:e.z.literal("code"),delta_format:e.z.array(GD).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:e.z.string().optional().describe('Programming language (e.g. "javascript", "python").')}),KD=e.z.object({block_content_type:e.z.literal("list_item"),delta_format:e.z.array(GD).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),checked:e.z.boolean().optional().describe("Check state for CHECK_LIST items."),indentation:e.z.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),YD=e.z.discriminatedUnion("block_content_type",[WD,QD,KD]),JD=e.z.object({block_type:e.z.literal("text"),text_block_type:e.z.enum(["NORMAL_TEXT","LARGE_TITLE","MEDIUM_TITLE","SMALL_TITLE","QUOTE"]).optional().describe("Block subtype. LARGE_TITLE=H1, MEDIUM_TITLE=H2, SMALL_TITLE=H3."),delta_format:e.z.array(GD).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:e.z.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:e.z.enum(["LTR","RTL"]).optional()}),XD=e.z.object({block_type:e.z.literal("list_item"),list_block_type:e.z.enum(["BULLETED_LIST","NUMBERED_LIST","CHECK_LIST"]).optional().describe("List type. Defaults to BULLETED_LIST."),delta_format:e.z.array(GD).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),indentation:e.z.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),ZD=e.z.object({block_type:e.z.literal("code"),delta_format:e.z.array(GD).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:e.z.string().optional().describe('Programming language (e.g. "javascript", "python").')}),ek=e.z.object({block_type:e.z.literal("divider")}),tk=e.z.object({block_type:e.z.literal("page_break")}),ak=e.z.object({block_type:e.z.literal("image"),public_url:e.z.string().url().optional().describe("Publicly accessible image URL. Provide either public_url or asset_id."),asset_id:e.z.union([e.z.number().int(),e.z.string().regex(/^\d+$/).transform(Number)]).optional().describe("monday.com asset ID for the image. The image block will reference the asset directly. Provide either public_url or asset_id."),width:e.z.number().int().min(1).optional().describe("Width in pixels.")}),ik=e.z.object({block_type:e.z.literal("video"),raw_url:e.z.string().url().describe("Video URL (YouTube, Vimeo, or direct video URL)."),width:e.z.number().int().min(1).optional().describe("Width in pixels.")}),nk=e.z.object({block_type:e.z.literal("notice_box"),theme:e.z.enum(["INFO","TIPS","WARNING","GENERAL"]).describe("Visual style of the notice box.")}),ok=e.z.object({block_type:e.z.literal("table"),row_count:e.z.number().int().min(1).max(25).describe("Number of rows (1–25)."),column_count:e.z.number().int().min(1).max(10).describe("Number of columns (1–10)."),width:e.z.number().int().optional().describe("Table width in pixels."),column_style:e.z.array(e.z.object({width:e.z.number().int()})).optional().describe("Column widths. Array length must match column_count; widths must sum to 100.")}),rk=e.z.object({block_type:e.z.literal("layout"),column_count:e.z.number().int().min(2).max(6).describe("Number of columns (2–6)."),column_style:e.z.array(e.z.object({width:e.z.number().int()})).optional().describe("Column widths. Array length must match column_count; widths must sum to 100.")}),sk=e.z.discriminatedUnion("block_type",[JD,XD,ZD,ek,tk,ak,ik,nk,ok,rk]),pk=e.z.object({operation_type:e.z.literal("set_name"),name:e.z.string().min(1).describe("New document name.")}),dk=e.z.object({operation_type:e.z.literal("add_markdown_content"),markdown:e.z.string().describe("Markdown content to convert and append (or insert) as blocks."),after_block_id:e.z.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs.")}),lk=e.z.object({operation_type:e.z.literal("update_block"),block_id:e.z.string().describe("ID of the block to update. Get block IDs from read_docs."),content:YD.describe("New content for the block. Use block_content_type to select: text (updates text/heading/quote content), code (updates code content), list_item (updates bullets/numbered/todo content). Cannot change block subtype — use replace_block for that.")}),ck=e.z.object({operation_type:e.z.literal("create_block"),after_block_id:e.z.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs."),parent_block_id:e.z.string().optional().describe("Parent block ID for nested blocks. Only works for notice_box containers — use the notice_box block ID directly. Table/layout cell nesting is NOT supported by the API. IMPORTANT: A notice_box created in the same call cannot be referenced — use a separate call first to create it, then a second call to nest content inside it."),block:sk.describe("The block to create. Use block_type to select the block type.")}),mk=e.z.object({operation_type:e.z.literal("delete_block"),block_id:e.z.string().describe("ID of the block to permanently delete. Works for all block types including BOARD, WIDGET, DOC embed, GIPHY.")}),uk=e.z.object({operation_type:e.z.literal("replace_block"),block_id:e.z.string().describe("ID of the block to delete."),after_block_id:e.z.string().optional().describe("Insert replacement after this block ID. Provide the ID of the block that precedes the deleted block."),parent_block_id:e.z.string().optional().describe("Parent block ID for the replacement block."),block:sk.describe("The new block to create in place of the deleted one.")}),hk=e.z.discriminatedUnion("operation_type",[pk,dk,lk,ck,mk,uk]),fk={doc_id:e.z.string().min(1).optional().describe("The document ID (the id field from read_docs). Takes priority over object_id if both are provided."),object_id:e.z.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, visible in the document URL). Resolved to doc_id."),operations:e.z.array(hk).min(1).max(25).describe('Ordered list of operations to perform. Executed sequentially; stops at first failure.\n\nOperation types:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (simplest for text/lists/tables).\n- update_block: Change content of an existing text/code/list/divider block.\n- create_block: Create a new block at a specific position (supports text, list_item, code, divider, page_break, image, video, notice_box, table, layout).\n- delete_block: Permanently remove a block. Works for ALL block types including BOARD, WIDGET, DOC embed, GIPHY.\n- replace_block: Delete a block and create a new one in its place. Use for: changing image/video source, table restructure, notice_box theme change.\n\nWHEN TO USE WHICH:\n- Adding new text sections → add_markdown_content\n- Adding asset-based images → create_block with block_type "image" and asset_id (add_markdown_content does NOT support asset images)\n- Mixed content with asset images → alternate add_markdown_content (for text) and create_block (for each image) in sequence\n- Editing existing text block → update_block\n- Changing an image URL → replace_block (image URL is immutable after creation)\n- Changing video URL → replace_block\n- Restructuring a table → replace_block\n- BOARD/WIDGET/DOC/GIPHY blocks → delete_block only (no public API to create these)\n\nNESTING CONTENT IN CONTAINERS:\n- notice_box: Fully supported. Create the notice_box first, then in a separate call create child blocks with parent_block_id set to the notice_box ID. You cannot reference a block ID created in the same call.\n- table: Cell-level API nesting is NOT supported. To create a table with content, use add_markdown_content with a markdown table (e.g. "| H1 | H2 |\\n| --- | --- |\\n| A | B |"). This creates a pre-populated table in one shot. Empty tables created via create_block cannot have their cells populated through the API.\n- layout: Cell-level API nesting is NOT supported and there is no markdown equivalent. Layouts can only be created empty via create_block. No workaround exists to populate layout columns through the API.\nDeleting a container does NOT delete its children — delete children first for clean removal.\n\nBlock IDs are available in the blocks array returned by read_docs.')};const vk=zI`
1505
1536
  mutation CreateDashboard(
1506
1537
  $name: String!
1507
1538
  $workspace_id: ID!
@@ -1523,14 +1554,14 @@
1523
1554
  board_folder_id
1524
1555
  }
1525
1556
  }
1526
- `,vk=zI`
1557
+ `,gk=zI`
1527
1558
  query GetAllWidgetsSchema {
1528
1559
  all_widgets_schema {
1529
1560
  widget_type
1530
1561
  schema
1531
1562
  }
1532
1563
  }
1533
- `,gk=zI`
1564
+ `,bk=zI`
1534
1565
  mutation CreateWidget($parent: WidgetParentInput!, $kind: ExternalWidget!, $name: String!, $settings: JSON!) {
1535
1566
  create_widget(parent: $parent, kind: $kind, name: $name, settings: $settings) {
1536
1567
  id
@@ -1542,14 +1573,14 @@
1542
1573
  }
1543
1574
  }
1544
1575
  }
1545
- `,bk={name:e.z.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:e.z.string().describe("ID of the workspace that will own the dashboard"),board_ids:e.z.array(e.z.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:e.z.nativeEnum(Vx).default(Vx.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:e.z.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const yk={parent_container_id:e.z.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:e.z.nativeEnum(fT).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:e.z.nativeEnum(Xx).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:e.z.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:e.z.record(e.z.unknown()).optional().describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const _k=zI`
1576
+ `,yk={name:e.z.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:e.z.string().describe("ID of the workspace that will own the dashboard"),board_ids:e.z.array(e.z.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:e.z.nativeEnum(Vx).default(Vx.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:e.z.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const _k={parent_container_id:e.z.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:e.z.nativeEnum(fT).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:e.z.nativeEnum(Xx).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:e.z.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:e.z.record(e.z.unknown()).optional().describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const wk=zI`
1546
1577
  mutation updateWorkspace($id: ID!, $attributes: UpdateWorkspaceAttributesInput!) {
1547
1578
  update_workspace(id: $id, attributes: $attributes) {
1548
1579
  id
1549
1580
  name
1550
1581
  }
1551
1582
  }
1552
- `,wk={id:e.z.string().describe("The ID of the workspace to update"),attributeAccountProductId:e.z.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:e.z.string().optional().describe("The description of the workspace to update"),attributeKind:e.z.nativeEnum(vT).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:e.z.string().optional().describe("The name of the workspace to update")};const xk=zI`
1583
+ `,xk={id:e.z.string().describe("The ID of the workspace to update"),attributeAccountProductId:e.z.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:e.z.string().optional().describe("The description of the workspace to update"),attributeKind:e.z.nativeEnum(vT).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:e.z.string().optional().describe("The name of the workspace to update")};const Ek=zI`
1553
1584
  mutation updateFolder(
1554
1585
  $folderId: ID!
1555
1586
  $name: String
@@ -1576,7 +1607,7 @@
1576
1607
  name
1577
1608
  }
1578
1609
  }
1579
- `,Ek={folderId:e.z.string().describe("The ID of the folder to update"),name:e.z.string().optional().describe("The new name of the folder"),color:e.z.nativeEnum(aE).optional().describe("The new color of the folder"),fontWeight:e.z.nativeEnum(nE).optional().describe("The new font weight of the folder"),customIcon:e.z.nativeEnum(iE).optional().describe("The new custom icon of the folder"),parentFolderId:e.z.string().optional().describe("The ID of the new parent folder"),workspaceId:e.z.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:e.z.string().optional().describe("The account product ID associated with the folder"),position_object_id:e.z.string().optional().describe("The ID of the object to position the folder relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:e.z.nativeEnum(PE).optional().describe("The type of object to position the folder relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:e.z.boolean().optional().describe("Whether to position the folder after the object")};const Tk=zI`
1610
+ `,Tk={folderId:e.z.string().describe("The ID of the folder to update"),name:e.z.string().optional().describe("The new name of the folder"),color:e.z.nativeEnum(aE).optional().describe("The new color of the folder"),fontWeight:e.z.nativeEnum(nE).optional().describe("The new font weight of the folder"),customIcon:e.z.nativeEnum(iE).optional().describe("The new custom icon of the folder"),parentFolderId:e.z.string().optional().describe("The ID of the new parent folder"),workspaceId:e.z.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:e.z.string().optional().describe("The account product ID associated with the folder"),position_object_id:e.z.string().optional().describe("The ID of the object to position the folder relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:e.z.nativeEnum(PE).optional().describe("The type of object to position the folder relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:e.z.boolean().optional().describe("Whether to position the folder after the object")};const Ik=zI`
1580
1611
  mutation createWorkspace(
1581
1612
  $name: String!
1582
1613
  $workspaceKind: WorkspaceKind!
@@ -1593,7 +1624,7 @@
1593
1624
  name
1594
1625
  }
1595
1626
  }
1596
- `,Ik={name:e.z.string().describe("The name of the new workspace to be created"),workspaceKind:e.z.nativeEnum(vT).describe("The kind of workspace to create"),description:e.z.string().optional().describe("The description of the new workspace"),accountProductId:e.z.string().optional().describe("The account product ID associated with the workspace")};const Sk=zI`
1627
+ `,Sk={name:e.z.string().describe("The name of the new workspace to be created"),workspaceKind:e.z.nativeEnum(vT).describe("The kind of workspace to create"),description:e.z.string().optional().describe("The description of the new workspace"),accountProductId:e.z.string().optional().describe("The account product ID associated with the workspace")};const Nk=zI`
1597
1628
  mutation createFolder(
1598
1629
  $workspaceId: ID!
1599
1630
  $name: String!
@@ -1614,7 +1645,7 @@
1614
1645
  name
1615
1646
  }
1616
1647
  }
1617
- `,Nk={workspaceId:e.z.string().describe("The ID of the workspace where the folder will be created"),name:e.z.string().describe("The name of the folder to be created"),color:e.z.nativeEnum(aE).optional().describe("The color of the folder"),fontWeight:e.z.nativeEnum(nE).optional().describe("The font weight of the folder"),customIcon:e.z.nativeEnum(iE).optional().describe("The custom icon of the folder"),parentFolderId:e.z.string().optional().describe("The ID of the parent folder")};const Ak=zI`
1648
+ `,Ak={workspaceId:e.z.string().describe("The ID of the workspace where the folder will be created"),name:e.z.string().describe("The name of the folder to be created"),color:e.z.nativeEnum(aE).optional().describe("The color of the folder"),fontWeight:e.z.nativeEnum(nE).optional().describe("The font weight of the folder"),customIcon:e.z.nativeEnum(iE).optional().describe("The custom icon of the folder"),parentFolderId:e.z.string().optional().describe("The ID of the parent folder")};const Dk=zI`
1618
1649
  mutation updateBoardHierarchy($boardId: ID!, $attributes: UpdateBoardHierarchyAttributesInput!) {
1619
1650
  update_board_hierarchy(board_id: $boardId, attributes: $attributes) {
1620
1651
  success
@@ -1624,7 +1655,7 @@
1624
1655
  }
1625
1656
  }
1626
1657
  }
1627
- `,Dk=zI`
1658
+ `,kk=zI`
1628
1659
  mutation updateOverviewHierarchy($overviewId: ID!, $attributes: UpdateOverviewHierarchyAttributesInput!) {
1629
1660
  update_overview_hierarchy(overview_id: $overviewId, attributes: $attributes) {
1630
1661
  success
@@ -1634,7 +1665,7 @@
1634
1665
  }
1635
1666
  }
1636
1667
  }
1637
- `,kk={objectType:e.z.nativeEnum(PE).describe("The type of object to move"),id:e.z.string().describe("The ID of the object to move"),position_object_id:e.z.string().optional().describe("The ID of the object to position the object relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:e.z.nativeEnum(PE).optional().describe("The type of object to position the object relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:e.z.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:e.z.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:e.z.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:e.z.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const Ok=zI`
1668
+ `,Ok={objectType:e.z.nativeEnum(PE).describe("The type of object to move"),id:e.z.string().describe("The ID of the object to move"),position_object_id:e.z.string().optional().describe("The ID of the object to position the object relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:e.z.nativeEnum(PE).optional().describe("The type of object to position the object relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:e.z.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:e.z.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:e.z.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:e.z.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const Rk=zI`
1638
1669
  query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {
1639
1670
  boards(ids: [$boardId]) {
1640
1671
  name
@@ -1656,7 +1687,7 @@
1656
1687
  }
1657
1688
  }
1658
1689
  }
1659
- `,Rk=new Set([sx.Case,sx.Between,sx.Left,sx.Raw,sx.None,sx.CountKeys]),Pk=Object.values(sx).filter((e=>!Rk.has(e))),$k=new Set([sx.Left,sx.Trim,sx.Upper,sx.Lower,sx.DateTruncDay,sx.DateTruncWeek,sx.DateTruncMonth,sx.DateTruncQuarter,sx.DateTruncYear,sx.Color,sx.Label,sx.EndDate,sx.StartDate,sx.Hour,sx.PhoneCountryShortName,sx.Person,sx.Upper,sx.Lower,sx.Order,sx.Length,sx.Flatten,sx.IsDone]);function Ck(e){return{column_id:e}}new Set([sx.Count,sx.CountDistinct,sx.CountSubitems,sx.CountItems,sx.First,sx.Sum,sx.Average,sx.Median,sx.Min,sx.Max,sx.MinMax]);const Fk={boardId:e.z.number().describe("The id of the board to get insights for"),aggregations:e.z.array(e.z.object({function:e.z.enum(Pk).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:e.z.string().describe("The id of the column to aggregate")})).describe('The aggregations to get. Before sending the aggregations, use get_board_info tool to check "aggregationGuidelines" key for information. Transformative functions and plain columns (no function) must be in group by.').optional(),groupBy:e.z.array(e.z.string()).describe("The columns to group by. All columns in the group by must be in the aggregations as well without a function.").optional(),limit:e.z.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:hA,filtersOperator:fA,orderBy:e.z.array(e.z.object({columnId:e.z.string().describe("The id of the column to order by"),direction:e.z.nativeEnum(yE).optional().default(yE.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};const jk=zI`
1690
+ `,Pk=new Set([sx.Case,sx.Between,sx.Left,sx.Raw,sx.None,sx.CountKeys]),$k=Object.values(sx).filter((e=>!Pk.has(e))),Ck=new Set([sx.Left,sx.Trim,sx.Upper,sx.Lower,sx.DateTruncDay,sx.DateTruncWeek,sx.DateTruncMonth,sx.DateTruncQuarter,sx.DateTruncYear,sx.Color,sx.Label,sx.EndDate,sx.StartDate,sx.Hour,sx.PhoneCountryShortName,sx.Person,sx.Upper,sx.Lower,sx.Order,sx.Length,sx.Flatten,sx.IsDone]);function Fk(e){return{column_id:e}}new Set([sx.Count,sx.CountDistinct,sx.CountSubitems,sx.CountItems,sx.First,sx.Sum,sx.Average,sx.Median,sx.Min,sx.Max,sx.MinMax]);const jk={boardId:e.z.number().describe("The id of the board to get insights for"),aggregations:e.z.array(e.z.object({function:e.z.enum($k).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:e.z.string().describe("The id of the column to aggregate")})).describe('The aggregations to get. Before sending the aggregations, use get_board_info tool to check "aggregationGuidelines" key for information. Transformative functions and plain columns (no function) must be in group by.').optional(),groupBy:e.z.array(e.z.string()).describe("The columns to group by. All columns in the group by must be in the aggregations as well without a function.").optional(),limit:e.z.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:fA,filtersOperator:vA,orderBy:e.z.array(e.z.object({columnId:e.z.string().describe("The id of the column to order by"),direction:e.z.nativeEnum(yE).optional().default(yE.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};const Lk=zI`
1660
1691
  query GetBoards($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1661
1692
  boards(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1662
1693
  id
@@ -1664,7 +1695,7 @@
1664
1695
  url
1665
1696
  }
1666
1697
  }
1667
- `,Lk=zI`
1698
+ `,zk=zI`
1668
1699
  query GetDocs($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1669
1700
  docs(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1670
1701
  id
@@ -1672,14 +1703,14 @@
1672
1703
  url
1673
1704
  }
1674
1705
  }
1675
- `,zk=zI`
1706
+ `,Uk=zI`
1676
1707
  query GetFolders($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1677
1708
  folders(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1678
1709
  id
1679
1710
  name
1680
1711
  }
1681
1712
  }
1682
- `,Uk=zI`
1713
+ `,Vk=zI`
1683
1714
  query SearchDev($query: String!, $limit: Int!, $filters: SearchFiltersInput!) {
1684
1715
  search(query: $query, limit: $limit, filters: $filters) {
1685
1716
  __typename
@@ -1700,14 +1731,14 @@
1700
1731
  }
1701
1732
  }
1702
1733
  }
1703
- `,Vk=100,Bk={searchTerm:e.z.string().optional().describe("The search term to use for the search."),searchType:e.z.nativeEnum(kA).describe("The type of search to perform."),limit:e.z.number().max(Vk).optional().default(Vk).describe("The number of items to get. The max and default value is 100."),page:e.z.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:e.z.array(e.z.number()).optional().describe("The ids of the workspaces to search in. [IMPORTANT] Only pass this param if user explicitly asked to search within specific workspaces.")};const qk=e.z.object({id:e.z.string().describe("The ID of the entity to mention"),type:e.z.nativeEnum(AE).describe("The type of mention: User, Team, Board, or Project")}),Mk=e.z.array(qk),Hk={itemId:e.z.number().describe("The id of the item to which the update will be added"),body:e.z.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:e.z.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project')};const Gk=zI`
1734
+ `,Bk=100,qk={searchTerm:e.z.string().optional().describe("The search term to use for the search."),searchType:e.z.nativeEnum(OA).describe("The type of search to perform."),limit:e.z.number().max(Bk).optional().default(Bk).describe("The number of items to get. The max and default value is 100."),page:e.z.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:e.z.array(e.z.number()).optional().describe("The ids of the workspaces to search in. [IMPORTANT] Only pass this param if user explicitly asked to search within specific workspaces.")};const Mk=e.z.object({id:e.z.string().describe("The ID of the entity to mention"),type:e.z.nativeEnum(AE).describe("The type of mention: User, Team, Board, or Project")}),Hk=e.z.array(Mk),Gk={itemId:e.z.number().describe("The id of the item to which the update will be added"),body:e.z.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:e.z.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project')};const Wk=zI`
1704
1735
  mutation updateAssetsOnItem($boardId: ID!, $itemId: ID!, $columnId: String!, $files: [FileInput!]!) {
1705
1736
  update_assets_on_item(board_id: $boardId, item_id: $itemId, column_id: $columnId, files: $files) {
1706
1737
  id
1707
1738
  name
1708
1739
  }
1709
1740
  }
1710
- `,Wk=e.z.object({fileType:e.z.enum(["google_drive","dropbox","box","onedrive","link","asset","doc"]).describe('The type of file: "asset" for uploaded files (requires assetId), "doc" for monday docs (requires objectId), "link" for generic links, "google_drive", "dropbox", "box", "onedrive" for cloud storage links (all link types require linkToFile)'),name:e.z.string().describe("File display name"),linkToFile:e.z.string().optional().describe("File link URL. Required for link, google_drive, dropbox, box, and onedrive file types"),assetId:e.z.number().optional().describe("The asset's ID. Required when fileType is 'asset'"),objectId:e.z.number().optional().describe("The doc's ID. Required when fileType is 'doc'")}),Qk={boardId:e.z.string().describe("The board's unique identifier"),itemId:e.z.string().describe("The item's unique identifier"),columnId:e.z.string().describe("The file or doc column's unique identifier"),files:e.z.array(Wk).describe("Array of file values to set on the column")};const Kk=zI`
1741
+ `,Qk=e.z.object({fileType:e.z.enum(["google_drive","dropbox","box","onedrive","link","asset","doc"]).describe('The type of file: "asset" for uploaded files (requires assetId), "doc" for monday docs (requires objectId), "link" for generic links, "google_drive", "dropbox", "box", "onedrive" for cloud storage links (all link types require linkToFile)'),name:e.z.string().describe("File display name"),linkToFile:e.z.string().optional().describe("File link URL. Required for link, google_drive, dropbox, box, and onedrive file types"),assetId:e.z.number().optional().describe("The asset's ID. Required when fileType is 'asset'"),objectId:e.z.number().optional().describe("The doc's ID. Required when fileType is 'doc'")}),Kk={boardId:e.z.string().describe("The board's unique identifier"),itemId:e.z.string().describe("The item's unique identifier"),columnId:e.z.string().describe("The file or doc column's unique identifier"),files:e.z.array(Qk).describe("Array of file values to set on the column")};const Yk=zI`
1711
1742
  query getUserContext {
1712
1743
  me {
1713
1744
  id
@@ -1735,7 +1766,7 @@
1735
1766
  }
1736
1767
  }
1737
1768
  }
1738
- `,Yk=zI`
1769
+ `,Jk=zI`
1739
1770
  query getFavoriteDetails(
1740
1771
  $boardIds: [ID!]
1741
1772
  $folderIds: [ID!]
@@ -1759,7 +1790,7 @@
1759
1790
  name
1760
1791
  }
1761
1792
  }
1762
- `,Jk={[vE.Board]:"boardIds",[vE.Folder]:"folderIds",[vE.Workspace]:"workspaceIds",[vE.Dashboard]:"dashboardIds"},Xk={[vE.Board]:"boards",[vE.Folder]:"folders",[vE.Workspace]:"workspaces",[vE.Dashboard]:"dashboards"};const Zk=zI`
1793
+ `,Xk={[vE.Board]:"boardIds",[vE.Folder]:"folderIds",[vE.Workspace]:"workspaceIds",[vE.Dashboard]:"dashboardIds"},Zk={[vE.Board]:"boards",[vE.Folder]:"folders",[vE.Workspace]:"workspaces",[vE.Dashboard]:"dashboards"};const eO=zI`
1763
1794
  query GetNotetakerMeetings(
1764
1795
  $limit: Int
1765
1796
  $cursor: String
@@ -1812,7 +1843,13 @@
1812
1843
  }
1813
1844
  }
1814
1845
  }
1815
- `,eO={ids:e.z.array(e.z.string()).optional().describe("Filter by specific meeting IDs. Use this to fetch one or more specific meetings in a single call."),access:e.z.enum(["OWN","SHARED_WITH_ME","SHARED_WITH_ACCOUNT","ALL"]).optional().default("OWN").describe("Filter meetings by access level. OWN: meetings the user participated in or invited the bot to. SHARED_WITH_ME: meetings shared with the user or their team. SHARED_WITH_ACCOUNT: meetings shared with the entire account. ALL: all meetings the user has access to."),limit:e.z.number().min(1).max(100).optional().default(25).describe("Maximum number of notetaker meetings to return per page (1-100)."),cursor:e.z.string().optional().describe("Cursor for pagination. Use cursor from the previous page_info to fetch the next page."),search:e.z.string().optional().describe("Search notetaker meetings by title, participant name, or email."),include_summary:e.z.boolean().optional().default(!1).describe("Whether to include the AI-generated summary for each meeting."),include_topics:e.z.boolean().optional().default(!1).describe("Whether to include discussion topics and talking points for each meeting."),include_action_items:e.z.boolean().optional().default(!1).describe("Whether to include action items for each meeting."),include_transcript:e.z.boolean().optional().default(!1).describe("Whether to include the full transcript for each meeting. Transcripts can be very large.")};const tO={action:e.z.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),toolName:e.z.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)")};class aO{constructor(){this.name="manage_tools",this.type=an.READ,this.enabledByDefault=!0,this.annotations={title:"Discover & Manage monday.com Tools",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}}setToolkitManager(e){this.toolkitManager=e}getDescription(){return"Discover and manage available monday.com tools. Use this tool first to see what tools are available, check which ones are active/inactive, and enable any tools you need for your tasks. When enabling a tool, you will be asked for confirmation first. Essential for understanding your monday.com toolkit capabilities."}getInputSchema(){return tO}async execute(e){if(!this.toolkitManager)throw new Error("Toolkit manager not initialized");if(!e)throw new Error("Input parameters are required");const{action:t,toolName:a}=e;switch(t){case"enable":if(!a)throw new Error("Tool name is required for enable action");if(this.toolkitManager.isToolEnabled(a))return{content:`Tool '${a}' is already enabled`};return{content:this.toolkitManager.enableTool(a)?`✅ Tool '${a}' has been enabled and is now available for use`:`❌ Failed to enable tool '${a}' (tool not found)`};case"disable":if(!a)throw new Error("Tool name is required for disable action");return{content:this.toolkitManager.disableTool(a)?`Tool '${a}' has been disabled`:`Failed to disable tool '${a}' (tool not found)`};case"status":if(a){return{content:`Tool '${a}' is ${this.toolkitManager.isToolEnabled(a)?"enabled":"disabled"}`}}{const e=this.toolkitManager.getToolsStatus();return{content:`All tools status:\n${Object.entries(e).map((([e,t])=>`${e}: ${t?"enabled":"disabled"}`)).join("\n")}`}}case"detailed":{const e=this.toolkitManager.getDetailedToolsStatus(),t=Object.entries(e).filter((([,e])=>e.enabled)),a=Object.entries(e).filter((([,e])=>!e.enabled));let i="monday.com Tools Discovery:\n\n";return t.length>0&&(i+="✅ ACTIVE TOOLS (ready to use):\n",i+=t.map((([e,t])=>` • ${e} (default: ${t.enabledByDefault?"enabled":"disabled"})`)).join("\n")),a.length>0&&(i+="\n\n⚠️ INACTIVE TOOLS (need activation):\n",i+=a.map((([e,t])=>` • ${e} (default: ${t.enabledByDefault?"enabled":"disabled"}) - use {"action": "enable", "toolName": "${e}"} to activate`)).join("\n")),{content:i}}case"reset":{if(!a)throw new Error("Tool name is required for reset action");const e=this.toolkitManager.resetToolToDefault(a),t=this.toolkitManager.isToolEnabledByDefault(a);return{content:e?`Tool '${a}' has been reset to its default state (${t?"enabled":"disabled"})`:`Failed to reset tool '${a}' (tool not found)`}}case"list":{const e=this.toolkitManager.getToolsStatus();return{content:`Available tools: ${Object.entries(e).map((([e,t])=>`${e} (${t?"enabled":"disabled"})`)).join(", ")}`}}default:throw new Error("Invalid action. Use: enable, disable, status, list, detailed, or reset")}}}const iO=zI`
1846
+ `,tO={ids:e.z.array(e.z.string()).optional().describe("Filter by specific meeting IDs. Use this to fetch one or more specific meetings in a single call."),access:e.z.enum(["OWN","SHARED_WITH_ME","SHARED_WITH_ACCOUNT","ALL"]).optional().default("OWN").describe("Filter meetings by access level. OWN: meetings the user participated in or invited the bot to. SHARED_WITH_ME: meetings shared with the user or their team. SHARED_WITH_ACCOUNT: meetings shared with the entire account. ALL: all meetings the user has access to."),limit:e.z.number().min(1).max(100).optional().default(25).describe("Maximum number of notetaker meetings to return per page (1-100)."),cursor:e.z.string().optional().describe("Cursor for pagination. Use cursor from the previous page_info to fetch the next page."),search:e.z.string().optional().describe("Search notetaker meetings by title, participant name, or email."),include_summary:e.z.boolean().optional().default(!1).describe("Whether to include the AI-generated summary for each meeting."),include_topics:e.z.boolean().optional().default(!1).describe("Whether to include discussion topics and talking points for each meeting."),include_action_items:e.z.boolean().optional().default(!1).describe("Whether to include action items for each meeting."),include_transcript:e.z.boolean().optional().default(!1).describe("Whether to include the full transcript for each meeting. Transcripts can be very large.")};const aO=zI`
1847
+ mutation BatchUndo($boardId: ID!, $undoRecordId: ID!) {
1848
+ batch_undo(board_id: $boardId, undo_record_id: $undoRecordId) {
1849
+ success
1850
+ }
1851
+ }
1852
+ `,iO={boardId:e.z.number().describe("The id of the board where the action was performed"),undoRecordId:e.z.string().describe("The undo record ID (action_record_uuid) from the activity log data field. Use get_board_activity with includeData=true to find this value.")};const nO={action:e.z.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),toolName:e.z.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)")};class oO{constructor(){this.name="manage_tools",this.type=an.READ,this.enabledByDefault=!0,this.annotations={title:"Discover & Manage monday.com Tools",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}}setToolkitManager(e){this.toolkitManager=e}getDescription(){return"Discover and manage available monday.com tools. Use this tool first to see what tools are available, check which ones are active/inactive, and enable any tools you need for your tasks. When enabling a tool, you will be asked for confirmation first. Essential for understanding your monday.com toolkit capabilities."}getInputSchema(){return nO}async execute(e){if(!this.toolkitManager)throw new Error("Toolkit manager not initialized");if(!e)throw new Error("Input parameters are required");const{action:t,toolName:a}=e;switch(t){case"enable":if(!a)throw new Error("Tool name is required for enable action");if(this.toolkitManager.isToolEnabled(a))return{content:`Tool '${a}' is already enabled`};return{content:this.toolkitManager.enableTool(a)?`✅ Tool '${a}' has been enabled and is now available for use`:`❌ Failed to enable tool '${a}' (tool not found)`};case"disable":if(!a)throw new Error("Tool name is required for disable action");return{content:this.toolkitManager.disableTool(a)?`Tool '${a}' has been disabled`:`Failed to disable tool '${a}' (tool not found)`};case"status":if(a){return{content:`Tool '${a}' is ${this.toolkitManager.isToolEnabled(a)?"enabled":"disabled"}`}}{const e=this.toolkitManager.getToolsStatus();return{content:`All tools status:\n${Object.entries(e).map((([e,t])=>`${e}: ${t?"enabled":"disabled"}`)).join("\n")}`}}case"detailed":{const e=this.toolkitManager.getDetailedToolsStatus(),t=Object.entries(e).filter((([,e])=>e.enabled)),a=Object.entries(e).filter((([,e])=>!e.enabled));let i="monday.com Tools Discovery:\n\n";return t.length>0&&(i+="✅ ACTIVE TOOLS (ready to use):\n",i+=t.map((([e,t])=>` • ${e} (default: ${t.enabledByDefault?"enabled":"disabled"})`)).join("\n")),a.length>0&&(i+="\n\n⚠️ INACTIVE TOOLS (need activation):\n",i+=a.map((([e,t])=>` • ${e} (default: ${t.enabledByDefault?"enabled":"disabled"}) - use {"action": "enable", "toolName": "${e}"} to activate`)).join("\n")),{content:i}}case"reset":{if(!a)throw new Error("Tool name is required for reset action");const e=this.toolkitManager.resetToolToDefault(a),t=this.toolkitManager.isToolEnabledByDefault(a);return{content:e?`Tool '${a}' has been reset to its default state (${t?"enabled":"disabled"})`:`Failed to reset tool '${a}' (tool not found)`}}case"list":{const e=this.toolkitManager.getToolsStatus();return{content:`Available tools: ${Object.entries(e).map((([e,t])=>`${e} (${t?"enabled":"disabled"})`)).join(", ")}`}}default:throw new Error("Invalid action. Use: enable, disable, status, list, detailed, or reset")}}}const rO=zI`
1816
1853
  query getSprintsByIds($ids: [ID!]) {
1817
1854
  items(ids: $ids) {
1818
1855
  id
@@ -1847,7 +1884,7 @@
1847
1884
  }
1848
1885
  }
1849
1886
  }
1850
- `,nO={SPRINT_TASKS:"sprint_tasks",SPRINT_TIMELINE:"sprint_timeline",SPRINT_COMPLETION:"sprint_completion",SPRINT_START_DATE:"sprint_start_date",SPRINT_END_DATE:"sprint_end_date",SPRINT_ACTIVATION:"sprint_activation"},oO={...nO,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},rO="BOARD_NOT_FOUND:",sO="SPRINT_NOT_FOUND:",pO="DOCUMENT_NOT_FOUND:",dO="DOCUMENT_INVALID:",lO="DOCUMENT_EMPTY:",cO="EXPORT_FAILED:",mO="INTERNAL_ERROR:",uO="VALIDATION_ERROR:",hO="task_sprint",fO={[oO.SPRINT_TASKS]:"Sprint Tasks",[oO.SPRINT_TIMELINE]:"Sprint Timeline",[oO.SPRINT_COMPLETION]:"Sprint Completion",[oO.SPRINT_START_DATE]:"Sprint Start Date",[oO.SPRINT_END_DATE]:"Sprint End Date",[oO.SPRINT_ACTIVATION]:"Sprint Activation",[oO.SPRINT_SUMMARY]:"Sprint Summary",[oO.SPRINT_CAPACITY]:"Sprint Capacity"},vO=WE,gO={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},bO=(e,t)=>e.column_values?.find((e=>e.id===t)),yO=(e,t)=>{const a=bO(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},_O=(e,t)=>{const a=bO(e,t);return"DateValue"===a?.__typename?a.date??null:null},wO=(e,t)=>{const a=bO(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},xO=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},EO=(e,t)=>{if(!e.columns)return!1;const a=new Set(e.columns.filter((e=>null!==e)).map((e=>e.id)));return t.every((e=>a.has(e)))},TO=e=>EO(e,Object.values(nO)),IO=e=>EO(e,Object.values(gO)),SO=e=>{if(!e?.settings)return null;const t=e.settings;return t.boardIds&&Array.isArray(t.boardIds)&&t.boardIds[0]?.toString()||t.boardId?.toString()||null},NO=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===PN.BoardRelation))||null,AO={sprintId:e.z.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const DO=zI`
1887
+ `,sO={SPRINT_TASKS:"sprint_tasks",SPRINT_TIMELINE:"sprint_timeline",SPRINT_COMPLETION:"sprint_completion",SPRINT_START_DATE:"sprint_start_date",SPRINT_END_DATE:"sprint_end_date",SPRINT_ACTIVATION:"sprint_activation"},pO={...sO,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},dO="BOARD_NOT_FOUND:",lO="SPRINT_NOT_FOUND:",cO="DOCUMENT_NOT_FOUND:",mO="DOCUMENT_INVALID:",uO="DOCUMENT_EMPTY:",hO="EXPORT_FAILED:",fO="INTERNAL_ERROR:",vO="VALIDATION_ERROR:",gO="task_sprint",bO={[pO.SPRINT_TASKS]:"Sprint Tasks",[pO.SPRINT_TIMELINE]:"Sprint Timeline",[pO.SPRINT_COMPLETION]:"Sprint Completion",[pO.SPRINT_START_DATE]:"Sprint Start Date",[pO.SPRINT_END_DATE]:"Sprint End Date",[pO.SPRINT_ACTIVATION]:"Sprint Activation",[pO.SPRINT_SUMMARY]:"Sprint Summary",[pO.SPRINT_CAPACITY]:"Sprint Capacity"},yO=WE,_O={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},wO=(e,t)=>e.column_values?.find((e=>e.id===t)),xO=(e,t)=>{const a=wO(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},EO=(e,t)=>{const a=wO(e,t);return"DateValue"===a?.__typename?a.date??null:null},TO=(e,t)=>{const a=wO(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},IO=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},SO=(e,t)=>{if(!e.columns)return!1;const a=new Set(e.columns.filter((e=>null!==e)).map((e=>e.id)));return t.every((e=>a.has(e)))},NO=e=>SO(e,Object.values(sO)),AO=e=>SO(e,Object.values(_O)),DO=e=>{if(!e?.settings)return null;const t=e.settings;return t.boardIds&&Array.isArray(t.boardIds)&&t.boardIds[0]?.toString()||t.boardId?.toString()||null},kO=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===$N.BoardRelation))||null,OO={sprintId:e.z.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const RO=zI`
1851
1888
  query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
1852
1889
  boards(ids: [$boardId]) {
1853
1890
  items_page(limit: $limit) {
@@ -1883,7 +1920,7 @@
1883
1920
  }
1884
1921
  }
1885
1922
  }
1886
- `,kO={sprintsBoardId:e.z.number().describe("The ID of the monday-dev board containing the sprints"),limit:e.z.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const OO=zI`
1923
+ `,PO={sprintsBoardId:e.z.number().describe("The ID of the monday-dev board containing the sprints"),limit:e.z.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const $O=zI`
1887
1924
  query GetRecentBoards($limit: Int) {
1888
1925
  boards(limit: $limit, order_by: used_at, state: active) {
1889
1926
  id
@@ -1899,7 +1936,7 @@
1899
1936
  }
1900
1937
  }
1901
1938
  }
1902
- `,RO={};const PO=[class extends eb{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=an.READ,this.annotations=Zg({title:"monday-dev: Get Sprints Boards",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Discover monday-dev sprints boards and their associated tasks boards in your account.\n\n## Purpose:\nIdentifies and returns monday-dev sprints board IDs and tasks board IDs that you need to use with other monday-dev tools. \nThis tool scans your recently used boards (up to 100) to find valid monday-dev sprint management boards.\n\n## What it Returns:\n- Pairs of sprints boards and their corresponding tasks boards\n- Board IDs, names, and workspace information for each pair\n- The bidirectional relationship between each sprints board and its tasks board\n\n## Note:\nSearches recently used boards (up to 100). If none found, ask user to provide board IDs manually."}getInputSchema(){return RO}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(OO,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${rO} No boards found in your account. Please verify you have access to monday.com boards.`};const a=this.extractBoardPairs(t);if(0===a.length)return{content:this.generateNotFoundMessage(t.length)};return{content:this.generateReport(a)}}catch(e){return{content:`${mO} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}generateMultiplePairsWarning(e){return`## ⚠️ Multiple SprintsBoard Detected\n**${e}** different board pairs found. Each pair is isolated and workspace-specific.\n**AI Agent - REQUIRED:** Before ANY operation, confirm with user which pair and workspace to use.\n---\n`}generatePairDetails(e,t){return`### Pair ${t+1}\n**Sprints Board:**\n- ID: \`${e.sprintsBoard.id}\`\n- Name: ${e.sprintsBoard.name}\n- Workspace: ${e.sprintsBoard.workspaceName} (ID: ${e.sprintsBoard.workspaceId})\n\n**Tasks Board:**\n- ID: \`${e.tasksBoard.id}\`\n- Name: ${e.tasksBoard.name}\n- Workspace: ${e.tasksBoard.workspaceName} (ID: ${e.tasksBoard.workspaceId})\n---\n\n`}generateTechnicalReference(){return"## 📋 Technical Reference\n\n**Sprint Operations** (all require correct board pair):\n• Add to Sprint: Update `task_sprint` column with sprint item ID\n• Remove from Sprint: Clear `task_sprint` column (set to null)\n• Search in Sprint: Filter where `task_sprint` equals sprint item ID\n• Move Between Sprints: Update `task_sprint` with new sprint item ID\n• Backlog Tasks: `task_sprint` is empty/null\n\n**Critical:** `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}generateReport(e){const t=e.length>1?this.generateMultiplePairsWarning(e.length):"",a=e.map(((e,t)=>this.generatePairDetails(e,t))).join(""),i=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${t}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${a}${i}`}generateNotFoundMessage(e){return`## No Monday-Dev Sprints Board Pairs Found\n\n**Boards Checked:** ${e} (recently used)\n\nNo board pairs with sprint relationships found in your recent boards.\n\n### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`}createBoardInfo(e,t,a){return{id:e,name:t?.name||a,workspaceId:t?.workspace?.id||"unknown",workspaceName:t?.workspace?.name||"Unknown"}}processSprintsBoard(e,t,a){const i=NO(e,nO.SPRINT_TASKS);if(!i)return;const n=SO(i);if(!n)return;const o=`${e.id}:${n}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,t,a){const i=NO(e,hO);if(!i)return;const n=SO(i);if(!n)return;const o=`${n}:${e.id}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(TO(i)&&this.processSprintsBoard(i,a,t),IO(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends eb{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=an.READ,this.annotations=Zg({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive sprint metadata from a monday-dev sprints board including:\n\n## Data Retrieved:\nA table of sprints with the following information:\n- Sprint ID\n- Sprint Name\n- Sprint timeline (planned from/to dates)\n- Sprint completion status (completed/in-progress/planned)\n- Sprint start date (actual)\n- Sprint end date (actual)\n- Sprint activation status\n- Sprint summary document object ID\n\n## Parameters:\n- **limit**: Number of sprints to retrieve (default: 25, max: 100)\n\nRequires the Main Sprints board ID of the monday-dev containing your sprints."}getInputSchema(){return kO}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(DO,a),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${mO} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const t={boardId:e.toString()},a=await this.mondayApi.request(HI,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${rO} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${uO} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${mO} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const t=new Set(e.filter((e=>null!==e)).map((e=>e.id))),a=Object.values(nO),i=xO(t,a);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((t=>{const a=(e=>fO[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let t="# Sprints Metadata Report\n\n";return t+=`**Total Sprints:** ${e.length}\n\n`,t+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",t+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const a=e.name||"Unknown",i=e.id,n=yO(e,oO.SPRINT_ACTIVATION),o=yO(e,oO.SPRINT_COMPLETION),r=_O(e,oO.SPRINT_START_DATE),s=_O(e,oO.SPRINT_END_DATE),p=((e,t)=>{const a=bO(e,t);if("TimelineValue"===a?.__typename&&a.from&&a.to)return{from:a.from.split("T")[0],to:a.to.split("T")[0]};return null})(e,oO.SPRINT_TIMELINE),d=wO(e,oO.SPRINT_SUMMARY);let l=vO.Planned;o?l=vO.Completed:(n||r)&&(l=vO.Active);const c=p?`${p.from} to ${p.to}`:"Not set";t+=`| ${a} | ${i} | ${l} | ${c} | ${r||"Not started"} | ${s||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),t+="\n## Status Definitions:\n",t+=`- **${vO.Planned}**: Sprint not yet started (no activation, no start date)\n`,t+=`- **${vO.Active}**: Sprint is active (activated but not completed)\n`,t+=`- **${vO.Completed}**: Sprint is finished\n\n`,t}},class extends eb{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=an.READ,this.annotations=Zg({title:"monday-dev: Get Sprint Summary",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the complete summary and analysis of a sprint.\n\n## Purpose:\nUnlock deep insights into completed sprint performance. \n\nThe sprint summary content including:\n- **Scope Management**: Analysis of planned vs. unplanned tasks, scope creep\n- **Velocity & Performance**: Individual velocity, task completion rates, workload distribution per team member\n- **Task Distribution**: Breakdown of completed tasks by type (Feature, Bug, Tech Debt, Infrastructure, etc.)\n- **AI Recommendations**: Action items, process improvements, retrospective focus areas\n\n## Requirements:\n- Sprint must be completed and must be created after 1/1/2025 \n\n## Important Note:\nWhen viewing the section "Completed by Assignee", you\'ll see user IDs in the format "@user-12345678". the 8 digits after the @is the user ID. To retrieve the actual owner names, use the list_users_and_teams tool with the user ID and set includeTeams=false for optimal performance.\n\n'}getInputSchema(){return AO}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${mO} Unknown error occurred while getting sprint metadata`};const a=await this.readSprintSummaryDocument(t.documentObjectId);return a.success?{content:a.content}:{content:a.error||`${mO} Unknown error occurred while reading document content`}}catch(e){return{content:`${mO} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const t={ids:[String(e)]},a=(await this.mondayApi.request(iO,t)).items||[];if(0===a.length)return{success:!1,error:`${sO} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${sO} Sprint with ID ${e} not found.`};const n=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(nO),...t];return xO(a,i)})(i,[oO.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${uO} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=wO(i,oO.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${pO} No sprint summary document found for sprint "${i.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${mO} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const t={object_ids:[e],limit:1},a=(await this.mondayApi.request(UI,t)).docs||[];if(0===a.length)return{success:!1,error:`${pO} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${dO} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(aS,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${cO} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const r=o.export_markdown_from_doc.markdown;return r?{success:!0,content:r}:{success:!1,error:`${lO} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${mO} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],$O=[class extends eb{constructor(){super(...arguments),this.name="delete_item",this.type=an.WRITE,this.annotations=Zg({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return lA}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(qI,t);return{content:`Item ${a.delete_item?.id} successfully deleted`}}},class extends eb{constructor(){super(...arguments),this.name="get_board_items_page",this.type=an.READ,this.annotations=Zg({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values and item descriptions. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true. To retrieve an item's description (the rich-text body/details of a monday.com item), set 'includeItemDescription' to true — the response will include the item description's document blocks with their content, type, and id. Use this whenever the user asks about an item's description, body, details, or notes. [REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available. VIEW-BASED FILTERING: If the user refers to a board view by name (e.g. \"show me items in the 'Overdue' view\"), first call get_board_info to get the board's views, find the matching view by name, then extract its filter field and pass it as the filters argument here."}getInputSchema(){return OA}async executeInternal(e){const t=!e.cursor;if(t&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch(t){KN(t),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeItemDescription};t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(NA,a);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:wE.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],i=a?.items_page,n=i?.items||[];return{board:{id:a?.id,name:a?.name},items:n.map((e=>this.mapItem(e,t))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,t){const a={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}if(t.includeItemDescription&&"description"in e&&e.description){const t=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));a.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case PN.BoardRelation:return e.linked_items;case PN.Formula:return e.display_value;case PN.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const t={query:e.searchTerm,limit:100,filters:{entities:[{items:{board_ids:[e.boardId.toString()]}}]}},a=await this.mondayApi.request(AA,t,{versionOverride:"dev",timeout:WN}),i=a.search?.filter((e=>"ItemSearchResult"===e.__typename))?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends eb{constructor(){super(...arguments),this.name="create_item",this.type=an.WRITE,this.annotations=Zg({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?YN:JN}async executeInternal(e){const t=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,t):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,t)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(BN,a);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},r=new pS(this.mondayApi,this.apiToken,{boardId:t});return await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)}),{content:{message:`Item ${i.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:i.duplicate_item.id,item_name:i.duplicate_item.name,item_url:i.duplicate_item.url,board_id:t}}}catch(e){QN(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const a=await this.mondayApi.request(qN,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:{message:`Subitem ${a.create_subitem.id} created under ${e.parentItemId}`,item_id:a.create_subitem.id,item_name:a.create_subitem.name,item_url:a.create_subitem.url}}}catch(e){QN(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(MI,a);return{content:{message:`Item ${i.create_item?.id} successfully created`,item_id:i.create_item?.id,item_name:i.create_item?.name,item_url:i.create_item?.url,board_id:t}}}catch(e){QN(e,"create item")}}},class extends eb{constructor(){super(...arguments),this.name="create_update",this.type=an.WRITE,this.annotations=Zg({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. You can also reply to an existing update by using the parentId parameter."}getInputSchema(){return aA}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=tA.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t,parentId:e.parentId?.toString()},i=await this.mondayApi.request(ZN,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,item_name:i.create_update.item?.name,item_url:i.create_update.item?.url}}}catch(e){QN(e,"create update")}}},class extends eb{constructor(){super(...arguments),this.name="get_updates",this.type=an.READ,this.annotations=Zg({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. For Board queries, you can filter by date range using fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion; set includeItemUpdates to true to also include updates on individual items. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return rA}async executeInternal(e){try{const t=void 0!==e.fromDate,a=void 0!==e.toDate;if(t!==a)throw new Error("Both fromDate and toDate must be provided together for date range filtering");if((t||a)&&e.objectType===oA.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const i={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let n;n=e.objectType===oA.Item?await this.mondayApi.request(iA,{...i,itemId:e.objectId}):await this.mondayApi.request(nA,{...i,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:sA(e.fromDate),toDate:sA(e.toDate)}:{}});const o=e.objectType===oA.Item?n.items?.[0]?.updates:n.boards?.[0]?.updates;if(!o||0===o.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const r=o.map((t=>{const a={id:t.id,text_body:t.text_body,created_at:t.created_at,updated_at:t.updated_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:t.item_id};return e.includeReplies&&t.replies&&(a.replies=t.replies.map((e=>({id:e.id,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&t.assets&&(a.assets=t.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),a})),s=e.objectType===oA.Item?n.items?.[0]?.url:n.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:r,pagination:{page:e.page??1,limit:e.limit??25,count:r.length}}}}catch(e){QN(e,"get updates")}}},class extends eb{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=an.WRITE,this.annotations=Zg({title:"Create Update in Monday, after calling this tool you should",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. After calling this tool you should call the full board data tool to get data, and immediately after that call the show table tool to show the data from that tool. IMPORTANT: You MUST use the COMPLETE data from the full board data tool - do NOT cut, truncate, or omit any data. Pass the entire dataset to the show table tool."}getInputSchema(){return Hk}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=Mk.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},i=await this.mondayApi.request(ZN,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${i.create_update.id} successfully created on item ${e.itemId}. Now we want to show the updated data, so call the full board data tool to get data, and then immediately after that call the show table tool to show the data from that tool. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received.`}}catch(e){QN(e,"create update")}}},class extends eb{constructor(){super(...arguments),this.name="get_board_schema",this.type=an.READ,this.annotations=Zg({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return RA}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(HI,a);return{content:`The current schema of the board ${t} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends eb{constructor(){super(...arguments),this.name="get_board_activity",this.type=an.READ,this.annotations=Zg({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days)"}getInputSchema(){return bA}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-GN.MONTH30Days),i=e?.fromDate||a.toISOString(),n=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},r=await this.mondayApi.request(gA,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=r.boards?.[0],d=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:p?.name,board_url:p?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...d&&e.data?{data:e.data}:{}})))}}}},class extends eb{constructor(){super(...arguments),this.name="get_board_info",this.type=an.READ,this.annotations=Zg({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. Also returns the board's views (e.g. table views, filter views) — each view includes its id, name, type, and a structured `filter` object. "}getInputSchema(){return SA}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(yA,t),i=a.boards?.[0];if(!i)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const n=await this.getSubItemsBoardAsync(i);return{content:wA(i,n)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===PN.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],i=await this.mondayApi.request(_A,{boardId:a});return i.boards?.[0]??null}},class extends eb{constructor(){super(...arguments),this.name="get_full_board_data",this.type=an.READ,this.annotations=Zg({title:"Get Full Board Data",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"INTERNAL USE ONLY - DO NOT CALL THIS TOOL DIRECTLY. This tool is exclusively triggered by UI components and should never be invoked directly by the agent."}getInputSchema(){return vA}async executeInternal(e){try{const t={boardId:e.boardId,itemsLimit:7};e.filters&&(t.queryParams={operator:e.filtersOperator,rules:e.filters.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute})))});const a=await this.mondayApi.request(mA,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=a.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&n.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));const o=Array.from(n).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(uA,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e])));return{content:{board:{id:i.id,name:i.name,columns:i.columns,items:i.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:r,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){QN(e,"get full board data")}}},class extends eb{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=an.READ,this.annotations=Zg({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Tool to fetch users and/or teams data. \n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs or names when available\n 2. If no ids available, use name search if possible (USERS ONLY)\n 3. Use 'getMe: true' to get current user information\n 4. AVOID broad queries (no parameters) - use only as last resort\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe - STANDALONE\n 2. userIds\n 3. name - STANDALONE (USERS ONLY, NOT for teams)\n 4. teamIds + teamsOnly\n 5. No parameters - LAST RESORT\n\n CRITICAL USAGE RULES:\n • userIds + teamIds requires explicit includeTeams: true flag\n • includeTeams: true fetches both users and teams, do not use this to fetch a specific user's teams rather fetch that user by id and you will get their team memberships.\n • name parameter is for USER search ONLY - it cannot be used to search for teams. Use teamIds to fetch specific teams."}getInputSchema(){return dD}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(ZA);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},p=aD(s),d=await sD(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}if(r){if(t||a||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(XA,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const p=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),d=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${p}`,l=await sD(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>iD)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(a&&e.teamIds&&e.teamIds.length>nD)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!t&&a&&!i)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(JA,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(YA,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:oD};s=await this.mondayApi.request(KA,t)}else if(t){const t={userIds:e.userIds,limit:oD};s=await this.mondayApi.request(WA,t)}else{const e={userIds:void 0,limit:oD};s=await this.mondayApi.request(QA,e)}const p=aD(s),d=await sD(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}},pS,class extends eb{constructor(){super(...arguments),this.name="move_item_to_group",this.type=an.WRITE,this.annotations=Zg({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return lD}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(WI,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends eb{constructor(){super(...arguments),this.name="create_board",this.type=an.WRITE,this.annotations=Zg({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return dS}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(QI,t);return{content:{message:`Board ${a.create_board?.id} successfully created`,board_id:a.create_board?.id,board_name:a.create_board?.name,board_url:a.create_board?.url}}}},class extends eb{constructor(){super(...arguments),this.name="create_form",this.type=an.WRITE,this.annotations=Zg({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. This will create a new form as well as a new board for which the form’s responses will be stored. The returned board_id is the ID of the board that was created while the returned formToken can be used for all future queries and mutations to continue editing the form."}getInputSchema(){return BS}async executeInternal(e){const t={destination_workspace_id:e.destination_workspace_id,destination_folder_id:e.destination_folder_id,destination_folder_name:e.destination_folder_name,board_kind:e.board_kind,destination_name:e.destination_name,board_owner_ids:e.board_owner_ids,board_owner_team_ids:e.board_owner_team_ids,board_subscriber_ids:e.board_subscriber_ids,board_subscriber_teams_ids:e.board_subscriber_teams_ids},a=await this.mondayApi.request(_S,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends eb{constructor(){super(...arguments),this.name="update_form",this.type=an.WRITE,this.annotations=Zg({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new ON(this.mondayApi),this.actionHandlers=new Map([[pN.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[pN.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[pN.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[pN.activate,this.helpers.activateForm.bind(this.helpers)],[pN.createTag,this.helpers.createTag.bind(this.helpers)],[pN.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[pN.updateTag,this.helpers.updateTag.bind(this.helpers)],[pN.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[pN.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[pN.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[pN.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[pN.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return'Update a monday.com form. Handles the following form update actions that can only be done one at a time using the correct "action" input: \n - update form\'s feature settings with the action "updateFeatures",\n - update form\'s appearance settings with the action "updateAppearance",\n - update form\'s accessibility settings with the action "updateAccessibility",\n - update form\'s title with the action "updateFormHeader",\n - update form\'s description with the action "updateFormHeader",\n - update form\'s question order with the action "updateQuestionOrder",\n - create a new form tag with the action "createTag",\n - delete a form tag with the action "deleteTag",\n - update a form tag with the action "updateTag",\n - set or update the form\'s password with the action "setFormPassword"\n - shorten form\'s url with the action "shortenFormUrl"\n - deactivate form with the action "deactivateForm"\n - reactivate form with the action "activateForm"'}getInputSchema(){return kN}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:"Received an invalid action for the update form tool."}}},class extends eb{constructor(){super(...arguments),this.name="get_form",this.type=an.READ,this.annotations=Zg({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token. Form tokens can be extracted from the form’s url. Given a form url, such as https://forms.monday.com/forms/abc123def456ghi789?r=use1, the token is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the token is abc123def456ghi789."}getInputSchema(){return RN}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(wS,t);return a.form?{content:{message:"Form retrieved",form_token:e.formToken,data:a.form}}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends eb{constructor(){super(...arguments),this.name="form_questions_editor",this.type=an.WRITE,this.annotations=Zg({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new sN(this.mondayApi),this.actionHandlers=new Map([[nN.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[nN.Update,this.helpers.updateQuestion.bind(this.helpers)],[nN.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return rN}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends eb{constructor(){super(...arguments),this.name="create_column",this.type=an.WRITE,this.annotations=Zg({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?$N:CN}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},i=await this.mondayApi.request(KI,a);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends eb{constructor(){super(...arguments),this.name="create_group",this.type=an.WRITE,this.annotations=Zg({title:"Create Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new group in a monday.com board. Groups are sections that organize related items. Use when users want to add structure, categorize items, or create workflow phases. Groups can be positioned relative to existing groups and assigned predefined colors. Items will always be created in the top group and so the top group should be the most relevant one for new item creation"}getInputSchema(){return VN}async executeInternal(e){const t={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},a=await this.mondayApi.request(zN,t);return{content:{message:"Group created successfully",group_id:a.create_group?.id,group_title:a.create_group?.title,board_id:e.boardId,group_name:e.groupName}}}},class extends eb{constructor(){super(...arguments),this.name="delete_column",this.type=an.WRITE,this.annotations=Zg({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?pA:dA}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(YI,t);return{content:`Column ${a.delete_column?.id} successfully deleted`}}},oS,class extends eb{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=an.ALL_API,this.annotations=Zg({title:"Get GraphQL Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch the monday.com GraphQL schema structure including query and mutation definitions. This tool returns available query fields, mutation fields, and a list of GraphQL types in the schema. You can filter results by operation type (read/write) to focus on either queries or mutations."}getInputSchema(){return FA}async executeInternal(e){try{const t=await this.mondayApi.request(JI),a=e?.operationType,i=t.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=t.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=t.__schema,r=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let s="## GraphQL Schema\n";return a&&"read"!==a||(s+=`- Query Type: ${t.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${i}\n\n`),a&&"write"!==a||(s+=`- Mutation Type: ${t.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${n}\n\n`),s+=`## Available Types\n${r}\n\n`,s+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:s}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends eb{constructor(){super(...arguments),this.name="get_column_type_info",this.type=an.READ,this.annotations=Zg({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieves comprehensive information about a specific column type, including JSON schema definition and other metadata. Use this before creating columns with the create_column tool to understand the structure, validation rules, and available properties for column settings."}getInputSchema(){return CA}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(PA,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:a.get_column_type_schema};return{content:{message:`Column type info for ${e.columnType}`,data:i,url:$A}}}},class extends eb{constructor(){super(...arguments),this.name="get_type_details",this.type=an.ALL_API,this.annotations=Zg({title:"Get Type Details",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get detailed information about a specific GraphQL type from the monday.com API schema"}getInputSchema(){return jA}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const a=(t=e.typeName,zI`
1939
+ `,CO={};const FO=[class extends eb{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=an.READ,this.annotations=Zg({title:"monday-dev: Get Sprints Boards",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Discover monday-dev sprints boards and their associated tasks boards in your account.\n\n## Purpose:\nIdentifies and returns monday-dev sprints board IDs and tasks board IDs that you need to use with other monday-dev tools. \nThis tool scans your recently used boards (up to 100) to find valid monday-dev sprint management boards.\n\n## What it Returns:\n- Pairs of sprints boards and their corresponding tasks boards\n- Board IDs, names, and workspace information for each pair\n- The bidirectional relationship between each sprints board and its tasks board\n\n## Note:\nSearches recently used boards (up to 100). If none found, ask user to provide board IDs manually."}getInputSchema(){return CO}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request($O,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${dO} No boards found in your account. Please verify you have access to monday.com boards.`};const a=this.extractBoardPairs(t);if(0===a.length)return{content:this.generateNotFoundMessage(t.length)};return{content:this.generateReport(a)}}catch(e){return{content:`${fO} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}generateMultiplePairsWarning(e){return`## ⚠️ Multiple SprintsBoard Detected\n**${e}** different board pairs found. Each pair is isolated and workspace-specific.\n**AI Agent - REQUIRED:** Before ANY operation, confirm with user which pair and workspace to use.\n---\n`}generatePairDetails(e,t){return`### Pair ${t+1}\n**Sprints Board:**\n- ID: \`${e.sprintsBoard.id}\`\n- Name: ${e.sprintsBoard.name}\n- Workspace: ${e.sprintsBoard.workspaceName} (ID: ${e.sprintsBoard.workspaceId})\n\n**Tasks Board:**\n- ID: \`${e.tasksBoard.id}\`\n- Name: ${e.tasksBoard.name}\n- Workspace: ${e.tasksBoard.workspaceName} (ID: ${e.tasksBoard.workspaceId})\n---\n\n`}generateTechnicalReference(){return"## 📋 Technical Reference\n\n**Sprint Operations** (all require correct board pair):\n• Add to Sprint: Update `task_sprint` column with sprint item ID\n• Remove from Sprint: Clear `task_sprint` column (set to null)\n• Search in Sprint: Filter where `task_sprint` equals sprint item ID\n• Move Between Sprints: Update `task_sprint` with new sprint item ID\n• Backlog Tasks: `task_sprint` is empty/null\n\n**Critical:** `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}generateReport(e){const t=e.length>1?this.generateMultiplePairsWarning(e.length):"",a=e.map(((e,t)=>this.generatePairDetails(e,t))).join(""),i=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${t}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${a}${i}`}generateNotFoundMessage(e){return`## No Monday-Dev Sprints Board Pairs Found\n\n**Boards Checked:** ${e} (recently used)\n\nNo board pairs with sprint relationships found in your recent boards.\n\n### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`}createBoardInfo(e,t,a){return{id:e,name:t?.name||a,workspaceId:t?.workspace?.id||"unknown",workspaceName:t?.workspace?.name||"Unknown"}}processSprintsBoard(e,t,a){const i=kO(e,sO.SPRINT_TASKS);if(!i)return;const n=DO(i);if(!n)return;const o=`${e.id}:${n}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,t,a){const i=kO(e,gO);if(!i)return;const n=DO(i);if(!n)return;const o=`${n}:${e.id}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(NO(i)&&this.processSprintsBoard(i,a,t),AO(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends eb{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=an.READ,this.annotations=Zg({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive sprint metadata from a monday-dev sprints board including:\n\n## Data Retrieved:\nA table of sprints with the following information:\n- Sprint ID\n- Sprint Name\n- Sprint timeline (planned from/to dates)\n- Sprint completion status (completed/in-progress/planned)\n- Sprint start date (actual)\n- Sprint end date (actual)\n- Sprint activation status\n- Sprint summary document object ID\n\n## Parameters:\n- **limit**: Number of sprints to retrieve (default: 25, max: 100)\n\nRequires the Main Sprints board ID of the monday-dev containing your sprints."}getInputSchema(){return PO}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(RO,a),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${fO} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const t={boardId:e.toString()},a=await this.mondayApi.request(GI,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${dO} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${vO} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${fO} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const t=new Set(e.filter((e=>null!==e)).map((e=>e.id))),a=Object.values(sO),i=IO(t,a);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((t=>{const a=(e=>bO[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let t="# Sprints Metadata Report\n\n";return t+=`**Total Sprints:** ${e.length}\n\n`,t+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",t+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const a=e.name||"Unknown",i=e.id,n=xO(e,pO.SPRINT_ACTIVATION),o=xO(e,pO.SPRINT_COMPLETION),r=EO(e,pO.SPRINT_START_DATE),s=EO(e,pO.SPRINT_END_DATE),p=((e,t)=>{const a=wO(e,t);if("TimelineValue"===a?.__typename&&a.from&&a.to)return{from:a.from.split("T")[0],to:a.to.split("T")[0]};return null})(e,pO.SPRINT_TIMELINE),d=TO(e,pO.SPRINT_SUMMARY);let l=yO.Planned;o?l=yO.Completed:(n||r)&&(l=yO.Active);const c=p?`${p.from} to ${p.to}`:"Not set";t+=`| ${a} | ${i} | ${l} | ${c} | ${r||"Not started"} | ${s||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),t+="\n## Status Definitions:\n",t+=`- **${yO.Planned}**: Sprint not yet started (no activation, no start date)\n`,t+=`- **${yO.Active}**: Sprint is active (activated but not completed)\n`,t+=`- **${yO.Completed}**: Sprint is finished\n\n`,t}},class extends eb{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=an.READ,this.annotations=Zg({title:"monday-dev: Get Sprint Summary",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the complete summary and analysis of a sprint.\n\n## Purpose:\nUnlock deep insights into completed sprint performance. \n\nThe sprint summary content including:\n- **Scope Management**: Analysis of planned vs. unplanned tasks, scope creep\n- **Velocity & Performance**: Individual velocity, task completion rates, workload distribution per team member\n- **Task Distribution**: Breakdown of completed tasks by type (Feature, Bug, Tech Debt, Infrastructure, etc.)\n- **AI Recommendations**: Action items, process improvements, retrospective focus areas\n\n## Requirements:\n- Sprint must be completed and must be created after 1/1/2025 \n\n## Important Note:\nWhen viewing the section "Completed by Assignee", you\'ll see user IDs in the format "@user-12345678". the 8 digits after the @is the user ID. To retrieve the actual owner names, use the list_users_and_teams tool with the user ID and set includeTeams=false for optimal performance.\n\n'}getInputSchema(){return OO}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${fO} Unknown error occurred while getting sprint metadata`};const a=await this.readSprintSummaryDocument(t.documentObjectId);return a.success?{content:a.content}:{content:a.error||`${fO} Unknown error occurred while reading document content`}}catch(e){return{content:`${fO} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const t={ids:[String(e)]},a=(await this.mondayApi.request(rO,t)).items||[];if(0===a.length)return{success:!1,error:`${lO} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${lO} Sprint with ID ${e} not found.`};const n=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(sO),...t];return IO(a,i)})(i,[pO.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${vO} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=TO(i,pO.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${cO} No sprint summary document found for sprint "${i.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${fO} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const t={object_ids:[e],limit:1},a=(await this.mondayApi.request(UI,t)).docs||[];if(0===a.length)return{success:!1,error:`${cO} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${mO} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(iS,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${hO} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const r=o.export_markdown_from_doc.markdown;return r?{success:!0,content:r}:{success:!1,error:`${uO} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${fO} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],jO=[class extends eb{constructor(){super(...arguments),this.name="delete_item",this.type=an.WRITE,this.annotations=Zg({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return cA}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(MI,t);return{content:`Item ${a.delete_item?.id} successfully deleted`}}},class extends eb{constructor(){super(...arguments),this.name="get_board_items_page",this.type=an.READ,this.annotations=Zg({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values and item descriptions. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true. To retrieve an item's description (the rich-text body/details of a monday.com item), set 'includeItemDescription' to true — the response will include the item description's document blocks with their content, type, and id. Use this whenever the user asks about an item's description, body, details, or notes. [REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available. VIEW-BASED FILTERING: If the user refers to a board view by name (e.g. \"show me items in the 'Overdue' view\"), first call get_board_info to get the board's views, find the matching view by name, then extract its filter field and pass it as the filters argument here."}getInputSchema(){return RA}async executeInternal(e){const t=!e.cursor;if(t&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch(t){YN(t),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeItemDescription};t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(AA,a);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:wE.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],i=a?.items_page,n=i?.items||[];return{board:{id:a?.id,name:a?.name},items:n.map((e=>this.mapItem(e,t))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,t){const a={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}if(t.includeItemDescription&&"description"in e&&e.description){const t=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));a.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case $N.BoardRelation:return e.linked_items;case $N.Formula:return e.display_value;case $N.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const t={query:e.searchTerm,limit:100,filters:{entities:[{items:{board_ids:[e.boardId.toString()]}}]}},a=await this.mondayApi.request(DA,t,{versionOverride:"dev",timeout:QN}),i=a.search?.filter((e=>"ItemSearchResult"===e.__typename))?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends eb{constructor(){super(...arguments),this.name="create_item",this.type=an.WRITE,this.annotations=Zg({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?JN:XN}async executeInternal(e){const t=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,t):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,t)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(qN,a);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},r=new dS(this.mondayApi,this.apiToken,{boardId:t});return await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)}),{content:{message:`Item ${i.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:i.duplicate_item.id,item_name:i.duplicate_item.name,item_url:i.duplicate_item.url,board_id:t}}}catch(e){KN(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const a=await this.mondayApi.request(MN,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:{message:`Subitem ${a.create_subitem.id} created under ${e.parentItemId}`,item_id:a.create_subitem.id,item_name:a.create_subitem.name,item_url:a.create_subitem.url}}}catch(e){KN(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(HI,a);return{content:{message:`Item ${i.create_item?.id} successfully created`,item_id:i.create_item?.id,item_name:i.create_item?.name,item_url:i.create_item?.url,board_id:t}}}catch(e){KN(e,"create item")}}},class extends eb{constructor(){super(...arguments),this.name="create_update",this.type=an.WRITE,this.annotations=Zg({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. You can also reply to an existing update by using the parentId parameter."}getInputSchema(){return iA}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=aA.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t,parentId:e.parentId?.toString()},i=await this.mondayApi.request(eA,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,item_name:i.create_update.item?.name,item_url:i.create_update.item?.url}}}catch(e){KN(e,"create update")}}},class extends eb{constructor(){super(...arguments),this.name="get_updates",this.type=an.READ,this.annotations=Zg({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. For Board queries, you can filter by date range using fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion; set includeItemUpdates to true to also include updates on individual items. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return sA}async executeInternal(e){try{const t=void 0!==e.fromDate,a=void 0!==e.toDate;if(t!==a)throw new Error("Both fromDate and toDate must be provided together for date range filtering");if((t||a)&&e.objectType===rA.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const i={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let n;n=e.objectType===rA.Item?await this.mondayApi.request(nA,{...i,itemId:e.objectId}):await this.mondayApi.request(oA,{...i,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:pA(e.fromDate),toDate:pA(e.toDate)}:{}});const o=e.objectType===rA.Item?n.items?.[0]?.updates:n.boards?.[0]?.updates;if(!o||0===o.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const r=o.map((t=>{const a={id:t.id,text_body:t.text_body,created_at:t.created_at,updated_at:t.updated_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:t.item_id};return e.includeReplies&&t.replies&&(a.replies=t.replies.map((e=>({id:e.id,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&t.assets&&(a.assets=t.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),a})),s=e.objectType===rA.Item?n.items?.[0]?.url:n.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:r,pagination:{page:e.page??1,limit:e.limit??25,count:r.length}}}}catch(e){KN(e,"get updates")}}},class extends eb{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=an.WRITE,this.annotations=Zg({title:"Create Update in Monday, after calling this tool you should",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. After calling this tool you should call the full board data tool to get data, and immediately after that call the show table tool to show the data from that tool. IMPORTANT: You MUST use the COMPLETE data from the full board data tool - do NOT cut, truncate, or omit any data. Pass the entire dataset to the show table tool."}getInputSchema(){return Gk}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=Hk.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},i=await this.mondayApi.request(eA,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${i.create_update.id} successfully created on item ${e.itemId}. Now we want to show the updated data, so call the full board data tool to get data, and then immediately after that call the show table tool to show the data from that tool. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received.`}}catch(e){KN(e,"create update")}}},class extends eb{constructor(){super(...arguments),this.name="get_board_schema",this.type=an.READ,this.annotations=Zg({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return PA}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(GI,a);return{content:`The current schema of the board ${t} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends eb{constructor(){super(...arguments),this.name="get_board_activity",this.type=an.READ,this.annotations=Zg({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days)"}getInputSchema(){return yA}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-WN.MONTH30Days),i=e?.fromDate||a.toISOString(),n=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},r=await this.mondayApi.request(bA,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=r.boards?.[0],d=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:p?.name,board_url:p?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...d&&e.data?{data:e.data}:{}})))}}}},class extends eb{constructor(){super(...arguments),this.name="get_board_info",this.type=an.READ,this.annotations=Zg({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. Also returns the board's views (e.g. table views, filter views) — each view includes its id, name, type, and a structured `filter` object. "}getInputSchema(){return NA}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(_A,t),i=a.boards?.[0];if(!i)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const n=await this.getSubItemsBoardAsync(i);return{content:xA(i,n)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===$N.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],i=await this.mondayApi.request(wA,{boardId:a});return i.boards?.[0]??null}},class extends eb{constructor(){super(...arguments),this.name="get_full_board_data",this.type=an.READ,this.annotations=Zg({title:"Get Full Board Data",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"INTERNAL USE ONLY - DO NOT CALL THIS TOOL DIRECTLY. This tool is exclusively triggered by UI components and should never be invoked directly by the agent."}getInputSchema(){return gA}async executeInternal(e){try{const t={boardId:e.boardId,itemsLimit:7};e.filters&&(t.queryParams={operator:e.filtersOperator,rules:e.filters.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute})))});const a=await this.mondayApi.request(uA,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=a.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&n.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));const o=Array.from(n).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(hA,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e])));return{content:{board:{id:i.id,name:i.name,columns:i.columns,items:i.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:r,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){KN(e,"get full board data")}}},class extends eb{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=an.READ,this.annotations=Zg({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Tool to fetch users and/or teams data. \n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs or names when available\n 2. If no ids available, use name search if possible (USERS ONLY)\n 3. Use 'getMe: true' to get current user information\n 4. AVOID broad queries (no parameters) - use only as last resort\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe - STANDALONE\n 2. userIds\n 3. name - STANDALONE (USERS ONLY, NOT for teams)\n 4. teamIds + teamsOnly\n 5. No parameters - LAST RESORT\n\n CRITICAL USAGE RULES:\n • userIds + teamIds requires explicit includeTeams: true flag\n • includeTeams: true fetches both users and teams, do not use this to fetch a specific user's teams rather fetch that user by id and you will get their team memberships.\n • name parameter is for USER search ONLY - it cannot be used to search for teams. Use teamIds to fetch specific teams."}getInputSchema(){return lD}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(eD);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},p=iD(s),d=await pD(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}if(r){if(t||a||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(ZA,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const p=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),d=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${p}`,l=await pD(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>nD)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(a&&e.teamIds&&e.teamIds.length>oD)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!t&&a&&!i)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(XA,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(JA,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:rD};s=await this.mondayApi.request(YA,t)}else if(t){const t={userIds:e.userIds,limit:rD};s=await this.mondayApi.request(QA,t)}else{const e={userIds:void 0,limit:rD};s=await this.mondayApi.request(KA,e)}const p=iD(s),d=await pD(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}},dS,class extends eb{constructor(){super(...arguments),this.name="move_item_to_group",this.type=an.WRITE,this.annotations=Zg({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return cD}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(QI,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends eb{constructor(){super(...arguments),this.name="create_board",this.type=an.WRITE,this.annotations=Zg({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return lS}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(KI,t);return{content:{message:`Board ${a.create_board?.id} successfully created`,board_id:a.create_board?.id,board_name:a.create_board?.name,board_url:a.create_board?.url}}}},class extends eb{constructor(){super(...arguments),this.name="create_form",this.type=an.WRITE,this.annotations=Zg({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. This will create a new form as well as a new board for which the form’s responses will be stored. The returned board_id is the ID of the board that was created while the returned formToken can be used for all future queries and mutations to continue editing the form."}getInputSchema(){return qS}async executeInternal(e){const t={destination_workspace_id:e.destination_workspace_id,destination_folder_id:e.destination_folder_id,destination_folder_name:e.destination_folder_name,board_kind:e.board_kind,destination_name:e.destination_name,board_owner_ids:e.board_owner_ids,board_owner_team_ids:e.board_owner_team_ids,board_subscriber_ids:e.board_subscriber_ids,board_subscriber_teams_ids:e.board_subscriber_teams_ids},a=await this.mondayApi.request(wS,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends eb{constructor(){super(...arguments),this.name="update_form",this.type=an.WRITE,this.annotations=Zg({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new RN(this.mondayApi),this.actionHandlers=new Map([[dN.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[dN.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[dN.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[dN.activate,this.helpers.activateForm.bind(this.helpers)],[dN.createTag,this.helpers.createTag.bind(this.helpers)],[dN.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[dN.updateTag,this.helpers.updateTag.bind(this.helpers)],[dN.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[dN.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[dN.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[dN.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[dN.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return'Update a monday.com form. Handles the following form update actions that can only be done one at a time using the correct "action" input: \n - update form\'s feature settings with the action "updateFeatures",\n - update form\'s appearance settings with the action "updateAppearance",\n - update form\'s accessibility settings with the action "updateAccessibility",\n - update form\'s title with the action "updateFormHeader",\n - update form\'s description with the action "updateFormHeader",\n - update form\'s question order with the action "updateQuestionOrder",\n - create a new form tag with the action "createTag",\n - delete a form tag with the action "deleteTag",\n - update a form tag with the action "updateTag",\n - set or update the form\'s password with the action "setFormPassword"\n - shorten form\'s url with the action "shortenFormUrl"\n - deactivate form with the action "deactivateForm"\n - reactivate form with the action "activateForm"'}getInputSchema(){return ON}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:"Received an invalid action for the update form tool."}}},class extends eb{constructor(){super(...arguments),this.name="get_form",this.type=an.READ,this.annotations=Zg({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token. Form tokens can be extracted from the form’s url. Given a form url, such as https://forms.monday.com/forms/abc123def456ghi789?r=use1, the token is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the token is abc123def456ghi789."}getInputSchema(){return PN}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(xS,t);return a.form?{content:{message:"Form retrieved",form_token:e.formToken,data:a.form}}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends eb{constructor(){super(...arguments),this.name="form_questions_editor",this.type=an.WRITE,this.annotations=Zg({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new pN(this.mondayApi),this.actionHandlers=new Map([[oN.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[oN.Update,this.helpers.updateQuestion.bind(this.helpers)],[oN.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return sN}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends eb{constructor(){super(...arguments),this.name="create_column",this.type=an.WRITE,this.annotations=Zg({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?CN:FN}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},i=await this.mondayApi.request(YI,a);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends eb{constructor(){super(...arguments),this.name="create_group",this.type=an.WRITE,this.annotations=Zg({title:"Create Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new group in a monday.com board. Groups are sections that organize related items. Use when users want to add structure, categorize items, or create workflow phases. Groups can be positioned relative to existing groups and assigned predefined colors. Items will always be created in the top group and so the top group should be the most relevant one for new item creation"}getInputSchema(){return BN}async executeInternal(e){const t={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},a=await this.mondayApi.request(UN,t);return{content:{message:"Group created successfully",group_id:a.create_group?.id,group_title:a.create_group?.title,board_id:e.boardId,group_name:e.groupName}}}},class extends eb{constructor(){super(...arguments),this.name="delete_column",this.type=an.WRITE,this.annotations=Zg({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?dA:lA}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(JI,t);return{content:`Column ${a.delete_column?.id} successfully deleted`}}},rS,class extends eb{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=an.ALL_API,this.annotations=Zg({title:"Get GraphQL Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch the monday.com GraphQL schema structure including query and mutation definitions. This tool returns available query fields, mutation fields, and a list of GraphQL types in the schema. You can filter results by operation type (read/write) to focus on either queries or mutations."}getInputSchema(){return jA}async executeInternal(e){try{const t=await this.mondayApi.request(XI),a=e?.operationType,i=t.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=t.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=t.__schema,r=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let s="## GraphQL Schema\n";return a&&"read"!==a||(s+=`- Query Type: ${t.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${i}\n\n`),a&&"write"!==a||(s+=`- Mutation Type: ${t.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${n}\n\n`),s+=`## Available Types\n${r}\n\n`,s+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:s}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends eb{constructor(){super(...arguments),this.name="get_column_type_info",this.type=an.READ,this.annotations=Zg({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieves comprehensive information about a specific column type, including JSON schema definition and other metadata. Use this before creating columns with the create_column tool to understand the structure, validation rules, and available properties for column settings."}getInputSchema(){return FA}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request($A,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:a.get_column_type_schema};return{content:{message:`Column type info for ${e.columnType}`,data:i,url:CA}}}},class extends eb{constructor(){super(...arguments),this.name="get_type_details",this.type=an.ALL_API,this.annotations=Zg({title:"Get Type Details",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get detailed information about a specific GraphQL type from the monday.com API schema"}getInputSchema(){return LA}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const a=(t=e.typeName,zI`
1903
1940
  query getTypeDetails {
1904
1941
  __type(name: "${t}") {
1905
1942
  name
@@ -1987,5 +2024,5 @@
1987
2024
  }
1988
2025
  }
1989
2026
  }
1990
- `),i=await this.mondayApi.request(a);if(!i.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let n=`## Type: ${i.__type.name||"Unnamed"} ${e.typeName===i.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${i.__type.kind}\n${i.__type.description?`Description: ${i.__type.description}`:""}\n\n`;return i.__type.fields&&i.__type.fields.length>0&&(n+="## Fields\n",i.__type.fields.forEach((e=>{const t=LA(e.type);n+=`- ${e.name}: ${t}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(n+=" Arguments:\n",e.args.forEach((e=>{const t=LA(e.type);n+=` - ${e.name}: ${t}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),n+="\n"),i.__type.inputFields&&i.__type.inputFields.length>0&&(n+="## Input Fields\n",i.__type.inputFields.forEach((e=>{const t=LA(e.type);n+=`- ${e.name}: ${t}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),n+="\n"),i.__type.interfaces&&i.__type.interfaces.length>0&&(n+="## Implements\n",i.__type.interfaces.forEach((e=>{n+=`- ${e.name}\n`})),n+="\n"),i.__type.enumValues&&i.__type.enumValues.length>0&&(n+="## Enum Values\n",i.__type.enumValues.forEach((e=>{n+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),n+="\n"),i.__type.possibleTypes&&i.__type.possibleTypes.length>0&&(n+="## Possible Types\n",i.__type.possibleTypes.forEach((e=>{n+=`- ${e.name}\n`}))),n+=`\n## Usage Examples\nIf this is a Query or Mutation field, you can use it in the all_monday_api tool.\n\nExample for query:\nall_monday_api(operation: "query", name: "getTypeData", variables: "{\\"typeName\\": \\"${i.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:n}}catch(e){const t=e instanceof Error?e.message:"Unknown error",a=t.includes("JSON");return{content:`Error fetching type details: ${t}${a?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var t}},class extends eb{constructor(){super(...arguments),this.name="create_custom_activity",this.type=an.WRITE,this.annotations=Zg({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return FN}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(ZI,t),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends eb{constructor(){super(...arguments),this.name="create_notification",this.type=an.WRITE,this.annotations=Zg({title:"Create Notification",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Send a notification to a user via the bell icon and optionally by email. Use target_type "Post" for updates/replies or "Project" for items/boards.'}getInputSchema(){return LN}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{await this.mondayApi.request(jN,t);return{content:{message:"Notification sent",user_id:e.user_id,text:e.text}}}catch(t){return{content:`Failed to send notification to user ${e.user_id}`}}}},class extends eb{constructor(){super(...arguments),this.name="create_timeline_item",this.type=an.WRITE,this.annotations=Zg({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return XN}async executeInternal(e){const t={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(t.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const a=await this.mondayApi.request(eS,t);return{content:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends eb{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=an.READ,this.annotations=Zg({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return cA}async executeInternal(e){const t=await this.mondayApi.request(tS);if(!t.custom_activity||0===t.custom_activity.length)return{content:"No custom activities found"};const a=t.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${a.length} custom activities: ${JSON.stringify(a,null,2)}`}}},class extends eb{constructor(){super(...arguments),this.name="read_docs",this.type=an.READ,this.annotations=Zg({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get information about monday.com documents. Supports two modes:\n\nMODE: "content" (default) — Fetch documents with their full markdown content.\n- Requires: type ("ids" | "object_ids" | "workspace_ids") and ids array\n- Supports pagination via page/limit. Check has_more_pages in response.\n- If type "ids" returns no results, automatically retries with object_ids.\n- Set include_blocks: true to include block IDs, types, and positions in the response — required before calling update_doc.\n\nMODE: "version_history" — Fetch the edit history of a single document.\n- Requires: ids with the document\'s object_id (use the object_id field from content mode results, NOT the id field).\n- The object_id is the numeric ID visible in the document URL.\n- Returns restoring points sorted newest-first. Use version_history_limit to cap results (e.g., "last 3 changes" → version_history_limit: 3).\n- Use since/until to filter by time range. If omitted, returns full history.\n- Set include_diff: true to see what content changed between versions (fetches up to 10 diffs, may be slower).\n- Examples:\n - { mode: "version_history", ids: ["5001466606"], version_history_limit: 3 }\n - { mode: "version_history", ids: ["5001466606"], since: "2026-03-11T00:00:00Z", include_diff: true }'}getInputSchema(){return mD}async executeInternal(e){return"version_history"===e.mode?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!e.type||!e.ids||0===e.ids.length)return{content:'Error: type and ids are required when mode is "content".'};let t,a,i;switch(e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":i=e.ids}const n=e.include_blocks??!1,o={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n};let r=await this.mondayApi.request(UI,o);if((!r.docs||0===r.docs.length)&&t){const a={ids:void 0,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n};r=await this.mondayApi.request(UI,a)}if(!r.docs||0===r.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}return this.enrichDocsWithMarkdown(r.docs,o,n)}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}async executeVersionHistory(e){const{include_diff:t,since:a,until:i,version_history_limit:n}=e,o=e.ids?.[0];if(!o)return{content:'Error: ids is required when mode is "version_history". Provide the document object_id.'};try{const e={docId:o,since:a,until:i},r=await this.mondayApi.request(VI,e);let s=r?.doc_version_history?.restoring_points;if(!s||0===s.length)return{content:`No version history found for document ${o}${a?` from ${a}`:""}.`};if(!t)return n&&(s=s.slice(0,n)),{content:JSON.stringify({doc_id:o,since:a,until:i,restoring_points:s},null,2)};const p=Math.min(n??10,10),d=s.slice(0,p+1),l=s.length>p,c=(await Promise.allSettled(d.map((async(e,t)=>{if(t===d.length-1||!e.date)return e;const a=d[t+1];if(!a?.date)return e;const i={docId:o,date:e.date,prevDate:a.date},n=await this.mondayApi.request(BI,i);return{...e,diff:n?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,t)=>"fulfilled"===e.status?e.value:d[t]))))).slice(0,p);return{content:JSON.stringify({doc_id:o,since:a,until:i,restoring_points:c,...l&&{truncated:!0,total_count:s.length}},null,2)}}catch(e){return{content:`Error fetching version history for document ${o}: ${e instanceof Error?e.message:"Unknown error"}`}}}async enrichDocsWithMarkdown(e,t,a){const i=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t="";try{const a={docId:e.id},i=await this.mondayApi.request(aS,a);t=i.export_markdown_from_doc.success&&i.export_markdown_from_doc.markdown?i.export_markdown_from_doc.markdown:`Error getting markdown: ${i.export_markdown_from_doc.error||"Unknown error"}`}catch(e){t=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return{id:e.id,object_id:e.object_id,name:e.name,doc_kind:e.doc_kind,created_at:e.created_at,created_by:e.created_by?.name||"Unknown",url:e.url,relative_url:e.relative_url,workspace:e.workspace?.name||"Unknown",workspace_id:e.workspace_id,doc_folder_id:e.doc_folder_id,settings:e.settings,...a&&{blocks:(e.blocks??[]).filter((e=>null!=e)).map((e=>({id:e.id,type:e.type,parent_block_id:e.parent_block_id,position:e.position,content:e.content})))},blocks_as_markdown:t}}))),n=t.page||1,o=t.limit||25,r=i.length,s=r===o;return{content:{message:`Documents retrieved (${i.length})`,pagination:{current_page:n,limit:o,count:r,has_more_pages:s},data:i}}}},class extends eb{constructor(){super(...arguments),this.name="workspace_info",this.type=an.READ,this.annotations=Zg({title:"Get Workspace Information",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool returns the boards, docs and folders in a workspace and which folder they are in. It returns up to 100 of each object type, if you receive 100 assume there are additional objects of that type in the workspace."}getInputSchema(){return uD}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(iS,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e,t){const{workspaces:a,boards:i,docs:n,folders:o}=e,r=a?.[0];if(!r)throw new Error("No workspace found");const s=new Map((o||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),p=[];(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(t):p.push(t)}));const d=[];return(n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.doc_folder_id&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(t):d.push(t)})),{workspace:{id:r.id,name:r.name,url:t?pD(t,r.id):void 0,description:r.description||"",kind:r.kind||"",created_at:r.created_at||"",state:r.state||"",is_default_workspace:r.is_default_workspace||!1,owners_subscribers:(r.owners_subscribers||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name&&null!=e.email)).map((e=>({id:e.id,name:e.name,email:e.email})))},folders:Array.from(s.values()),root_items:{boards:p,docs:d}}}(a,await sD(this.mondayApi));return{content:{message:"Workspace info retrieved",data:i}}}},class extends eb{constructor(){super(...arguments),this.name="list_workspaces",this.type=an.READ,this.annotations=Zg({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List all workspaces available to the user. Returns up to 500 workspaces with their ID, name, and description."}getInputSchema(){return yD}async executeInternal(e){const t=e.searchTerm?1e4:e.limit,a=e.searchTerm?1:e.page;let i=null;if(e.searchTerm&&(i=vD(e.searchTerm),0===i.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const n=e=>({limit:t,page:a,membershipKind:e}),o=gD(await this.mondayApi.request(hD,n(gT.Member))),r=!bD(o)||i&&!function(e,t){return t.some((t=>vD(t.name).includes(e)))}(i,o);let s=o;if(r){s=gD(await this.mondayApi.request(hD,n(gT.All)))}if(!bD(s))return{content:"No workspaces found."};const p=i&&s?.length<=fD,d=function(e,t,a,i){if(!e||t.length<=fD)return t;const n=(a-1)*i,o=n+i;return t.filter((t=>vD(t.name).includes(e))).slice(n,o)}(i,s,e.page,e.limit);if(!bD(d))return{content:"No workspaces found matching the search term. Try using the tool without a search term"};const l=d.length===e.limit,c=await sD(this.mondayApi),m=d.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:c&&e.id?pD(c,e.id):void 0})));return{content:{message:"Workspaces retrieved",...p?{disclaimer:"Search term not applied - returning all workspaces. Perform the filtering manually."}:{},...l?{next_page:e.page+1}:{},data:m}}}},class extends eb{constructor(){super(...arguments),this.name="create_doc",this.type=an.WRITE,this.annotations=Zg({title:"Create Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){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.\n\nLOCATION TYPES:\n- workspace: Creates a document in a workspace (requires workspace_id, optional doc_kind, optional folder_id)\n- item: Creates a document attached to an item (requires item_id, optional column_id)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }'}getInputSchema(){return SD}async executeInternal(e){const t=ID.safeParse({...e,type:e.location});if(!t.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const a=t.data;try{let t,i,n;if(a.type===TD.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||Ex.Public,folder_id:a.folder_id?.toString()}}},r=await this.mondayApi.request(wD,o);t=r?.create_doc?.id??void 0,i=r?.create_doc?.object_id??void 0,n=r?.create_doc?.url??void 0}else if(a.type===TD.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(_D,o),s=r.items?.[0];if(!s)return{content:`Error: Item with id ${a.item_id} not found.`};const p=s.board?.id,d=s.board?.columns?.find((e=>e&&e.type===PN.Doc));let l=a.column_id;if(!l)if(d)l=d.id;else{const e={boardId:p.toString(),columnType:PN.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(KI,e);if(l=t?.create_column?.id,!l)return{content:"Error: Failed to create doc column."}}const c={location:{board:{item_id:a.item_id.toString(),column_id:l}}},m=await this.mondayApi.request(wD,c);if(t=m.create_doc?.id??void 0,i=m.create_doc?.object_id??void 0,n=m.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(ED,a)}catch(e){console.warn("Failed to update doc name:",e)}}if(!t)return{content:"Error: Failed to create document."};const o={docId:t,markdown:e.markdown},r=await this.mondayApi.request(xD,o),s=r?.add_content_to_doc_from_markdown?.success,p=r?.add_content_to_doc_from_markdown?.error;return s?{content:{message:"Document successfully created",doc_id:t,object_id:i,doc_url:n,doc_name:e.doc_name}}:{content:`Document ${t} created, but failed to add markdown content: ${p||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends eb{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=an.WRITE,this.annotations=Zg({title:"Add Content to Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add markdown content to an existing monday.com document.\n\nIDENTIFICATION: Provide either doc_id or object_id to identify the document:\n- doc_id: The document ID (the id field returned by read_docs). Takes priority if both provided.\n- object_id: The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id.\n\nUSAGE EXAMPLES:\n- By doc_id: { doc_id: "123", markdown: "# New Section\\nContent here" }\n- By object_id: { object_id: "456", markdown: "# New Section\\nContent here" }\n- Insert after block: { doc_id: "123", markdown: "Inserted content", after_block_id: "block_789" }'}getInputSchema(){return kD}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};try{let t=null;if(e.doc_id){const a=await this.mondayApi.request(DD,{docId:[e.doc_id]});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(AD,{objectId:[e.object_id]});t=a.docs?.[0]??null}if(!t){return{content:`Error: No document found for ${e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`}.`}}const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},i=await this.mondayApi.request(ND,a);if(!i?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:n,block_ids:o,error:r}=i.add_content_to_doc_from_markdown;if(!n)return{content:`Error adding content to document: ${r||"Unknown error"}`};const s=o?.length??0;return{content:{message:`Successfully added content to document ${t.id}. ${s} block${1===s?"":"s"} created.`,doc_id:t.id,block_ids:o,doc_name:t.name,doc_url:t.url}}}catch(e){return{content:`Error adding content to document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends eb{constructor(){super(...arguments),this.name="update_doc",this.type=an.WRITE,this.annotations=Zg({title:"Update Document",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Update an existing monday.com document. Provide doc_id (preferred) or object_id, plus an ordered operations array (executed sequentially, stops on first failure).\n\nOPERATIONS:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (or insert after a block). Best for text, headings, lists, simple tables — no block IDs needed.\n- update_block: Update content of an existing text, code, or list_item block in-place.\n- create_block: Create a new block at a precise position. Use parent_block_id to nest inside notice_box, table cell, or layout cell.\n- delete_block: Remove any block. The ONLY option for BOARD, WIDGET, DOC embed, and GIPHY blocks.\n- replace_block: Delete a block and create a new one in its place (use when update_block is not supported).\n\nWHEN TO USE EACH OPERATION:\n- text / code / list_item → update_block; use replace_block to change subtype (e.g. NORMAL_TEXT→LARGE_TITLE)\n- divider / table / image / video / notice_box / layout → replace_block (properties immutable after creation)\n- BOARD / WIDGET / DOC / GIPHY → delete_block only\n\nGETTING BLOCK IDs: Call read_docs with include_blocks: true — returns id, type, position, and content per block.\n\nBLOCK CONTENT (delta_format): Array of insert ops. Last op MUST be {insert: {text: "\\n"}}.\n- Plain: [{insert: {text: "Hello"}}, {insert: {text: "\\n"}}]\n- Bold: [{insert: {text: "Hi"}, attributes: {bold: true}}, {insert: {text: "\\n"}}]\n- Mention user/doc/board: [{insert: {text: "Hey "}}, {insert: {mention: {id: 12345, type: "USER"}}}, {insert: {text: "\\n"}}] — type is USER, DOC, or BOARD; id is numeric (user IDs from list_users_and_teams)\n- Inline column value: [{insert: {column_value: {item_id: 111, column_id: "status"}}}, {insert: {text: "\\n"}}]\n- Supported attributes: bold, italic, underline, strike, code, link, color, background (not applicable to mention/column_value ops)\n\nIMAGE WITH ASSET: For asset-based images, use create_block with block_type "image" and asset_id (instead of public_url). add_markdown_content does NOT support asset images — for mixed content, alternate add_markdown_content (text) and create_block (image) operations in sequence.'}getInputSchema(){return hk}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};try{let t=e.doc_id;if(!t){const a=await this.mondayApi.request(PD,{objectId:[e.object_id]}),i=a.docs?.[0];if(!i)return{content:`Error: No document found for object_id ${e.object_id}.`};t=i.id}const a=[];let i=null;for(let n=0;n<e.operations.length;n++){const o=e.operations[n];try{const e=await this.executeOperation(t,o);a.push(`- [OK] ${o.operation_type}${e?`: ${e}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";a.push(`- [FAILED] ${o.operation_type}: ${t}`),i=n;break}}const n=null!==i?i:e.operations.length,o=e.operations.length;return{content:`${`Completed ${n}/${o} operation${1===o?"":"s"} on doc ${t}.`}\n\nResults:\n${a.join("\n")}\n\nDoc ID: ${t}`}}catch(e){return{content:`Error: ${e instanceof Error?e.message:String(e)}`}}}async executeOperation(e,t){switch(t.operation_type){case"set_name":return this.executeSetName(e,t.name);case"add_markdown_content":return this.executeAddMarkdown(e,t.markdown,t.after_block_id);case"update_block":return this.executeUpdateBlock(t.block_id,t.content);case"create_block":return this.executeCreateBlock(e,t.block,t.after_block_id,t.parent_block_id);case"delete_block":return this.executeDeleteBlock(t.block_id);case"replace_block":return this.executeReplaceBlock(e,t.block_id,t.block,t.after_block_id,t.parent_block_id);default:{const e=t.operation_type;throw new Error(`Unsupported operation type: "${e}"`)}}}async executeSetName(e,t){const a={docId:e,name:t},i=await this.mondayApi.request(OD,a);if(!i?.update_doc_name)throw new Error(`No confirmation from update_doc_name — rename to "${t}" may not have applied`);return`Renamed to "${t}"`}async executeAddMarkdown(e,t,a){if(!t.trim())throw new Error("markdown must not be empty");const i={docId:e,markdown:t,afterBlockId:a},n=await this.mondayApi.request(RD,i),o=n?.add_content_to_doc_from_markdown;if(!o?.success)throw new Error(o?.error||"Failed to add markdown content");const r=o.block_ids?.length??0;return`${r} block${1===r?"":"s"} added${o.block_ids?.length?`. Block IDs: ${o.block_ids.join(", ")}`:""}`}async executeUpdateBlock(e,t){const a=function(e){switch(e.block_content_type){case"text":return{deltaFormat:VD(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:VD(e.delta_format),language:e.language};case"list_item":return{deltaFormat:VD(e.delta_format),checked:e.checked,indentation:e.indentation};default:{const t=e.block_content_type;throw new Error(`Unsupported block_content_type: "${t}"`)}}}(t),i={blockId:e,content:JSON.stringify(a)},n=await this.mondayApi.request($D,i);if(!n?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,i){const n=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:UD(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:jD(e.alignment),direction:LD(e.direction)}};case"list_item":return{list_block:{delta_format:UD(e.delta_format),list_block_type:e.list_block_type?e.list_block_type:void 0,indentation:e.indentation}};case"code":return{text_block:{delta_format:UD(e.delta_format),text_block_type:iT.Code}};case"divider":return{divider_block:{}};case"page_break":return{page_break_block:{}};case"image":if(null==e.asset_id&&!e.public_url)throw new Error("image block requires either asset_id or public_url");return{image_block:null!=e.asset_id?{asset_id:String(e.asset_id),width:e.width}:{public_url:e.public_url,width:e.width}};case"video":return{video_block:{raw_url:e.raw_url,width:e.width}};case"notice_box":return{notice_box_block:{theme:e.theme}};case"table":return{table_block:{row_count:e.row_count,column_count:e.column_count,width:e.width,column_style:e.column_style?.map((e=>({width:e.width})))}};case"layout":return{layout_block:{column_count:e.column_count,column_style:e.column_style?.map((e=>({width:e.width})))}};default:{const t=e.block_type;throw new Error(`Unsupported block_type: "${t}"`)}}}(t);if(i){const e=Object.keys(n);if(1!==e.length)throw new Error(`Cannot inject parent_block_id: expected exactly 1 key in block input, got: ${e.join(", ")}`);const t=e[0],a=n[t];if(!a||"object"!=typeof a)throw new Error(`Cannot inject parent_block_id into block type "${t}" — block value is not an object`);a.parent_block_id=i}const o={docId:e,afterBlockId:a,blocksInput:[n]},r=await this.mondayApi.request(FD,o),s=r?.create_doc_blocks;if(!s||0===s.length)throw new Error("No blocks returned from create_doc_blocks");return`Block created (ID: ${s.map((e=>e.id)).join(", ")})`}async executeDeleteBlock(e){const t={blockId:e},a=await this.mondayApi.request(CD,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async executeReplaceBlock(e,t,a,i,n){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,i,n)}`}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Original block ${t} was deleted, but replacement creation failed: ${a}. The original block is gone.`)}}},class extends eb{constructor(){super(...arguments),this.name="update_workspace",this.type=an.WRITE,this.annotations=Zg({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return wk}async executeInternal(e){const t={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},a=await this.mondayApi.request(_k,t),i=await sD(this.mondayApi),n=i?pD(i,a.update_workspace?.id):void 0;return{content:{message:`Workspace ${a.update_workspace?.id} updated`,workspace_id:a.update_workspace?.id,workspace_name:a.update_workspace?.name,workspace_url:n}}}},class extends eb{constructor(){super(...arguments),this.name="update_folder",this.type=an.WRITE,this.annotations=Zg({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return Ek}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:i}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const n={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:t?{position_is_after:i,position_object_id:t,position_object_type:a}:void 0},o=await this.mondayApi.request(xk,n);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends eb{constructor(){super(...arguments),this.name="create_workspace",this.type=an.WRITE,this.annotations=Zg({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return Ik}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(Tk,t),i=await sD(this.mondayApi),n=i&&a.create_workspace?.id?pD(i,a.create_workspace.id):void 0;return{content:{message:`Workspace ${a.create_workspace?.id} successfully created`,workspace_id:a.create_workspace?.id,workspace_name:a.create_workspace?.name,workspace_url:n}}}},class extends eb{constructor(){super(...arguments),this.name="create_folder",this.type=an.WRITE,this.annotations=Zg({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return Nk}async executeInternal(e){const t={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},a=await this.mondayApi.request(Sk,t);return{content:{message:`Folder ${a.create_folder?.id} successfully created`,folder_id:a.create_folder?.id,folder_name:a.create_folder?.name}}}},class extends eb{constructor(){super(...arguments),this.name="move_object",this.type=an.WRITE,this.annotations=Zg({title:"Move Object",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move a folder, board, or overview in monday.com. Use `position` for relative placement based on another object, `parentFolderId` for folder changes, `workspaceId` for workspace moves, and `accountProductId` for account product changes."}getInputSchema(){return kk}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={folderId:t,position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},d=await this.mondayApi.request(xk,p);return{content:{message:"Object moved",object_id:d.update_folder?.id}}}async executeUpdateBoardHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={boardId:t,attributes:{position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(Ak,p);return d.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:d.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${d.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={overviewId:t,attributes:{position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(Dk,p);return d.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:d.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${d.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:t}=e;switch(t){case PE.Folder:return this.executeUpdateFolder(e);case PE.Board:return this.executeUpdateBoardHierarchy(e);case PE.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends eb{constructor(){super(...arguments),this.name="create_dashboard",this.type=an.WRITE,this.annotations=Zg({title:"Create Dashboard",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Use this tool to create a new monday.com dashboard that aggregates data from one or more boards. \n Dashboards provide visual representations of board data through widgets and charts.\n \n Use this tool when users want to:\n - Create a dashboard to visualize board data\n - Aggregate information from multiple boards\n - Set up a data visualization container for widgets"}getInputSchema(){return bk}async executeInternal(e){try{const t={name:e.name,workspace_id:e.workspace_id.toString(),board_ids:e.board_ids,kind:e.kind,board_folder_id:e.board_folder_id?.toString()},a=await this.mondayApi.request(fk,t);if(!a.create_dashboard)throw new Error("Failed to create dashboard");const i=a.create_dashboard;return{content:{message:`Dashboard ${i.id} successfully created`,dashboard_id:i.id,dashboard_name:i.name}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${t}`)}}},class extends eb{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=an.READ,this.annotations=Zg({title:"Get All Widget Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch complete JSON Schema 7 definitions for all available widget types in monday.com.\n \n This tool is essential before creating widgets as it provides:\n - Complete schema definitions for all supported widgets\n - Required and optional fields for each widget type\n - Data type specifications and validation rules\n - Detailed descriptions of widget capabilities\n \n Use this tool when you need to:\n - Understand widget configuration requirements before creating widgets\n - Validate widget settings against official schemas\n - Plan widget implementations with proper data structures\n \n The response includes JSON Schema 7 definitions that describe exactly what settings each widget type accepts."}getInputSchema(){return{}}async executeInternal(){try{const e={},t=await this.mondayApi.request(vk,e);if(!t.all_widgets_schema||0===t.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const a={};let i=0;for(const e of t.all_widgets_schema)if(e?.widget_type&&e?.schema){const t="string"==typeof e.schema?JSON.parse(e.schema):e.schema,n=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:n,schema:e.schema},i++}if(0===i)throw new Error("No valid widget schemas found in API response");Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:a,url:$A}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends eb{constructor(){super(...arguments),this.name="create_widget",this.type=an.WRITE,this.annotations=Zg({title:"Create Widget",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new widget in a dashboard or board view with specific configuration settings.\n \n This tool creates data visualization widgets that display information from monday.com boards:\n **Parent Containers:**\n - **DASHBOARD**: Place widget in a dashboard (most common use case)\n - **BOARD_VIEW**: Place widget in a specific board view\n \n **Critical Requirements:**\n 1. **Schema Compliance**: Widget settings MUST conform to the JSON schema for the specific widget type\n 2. **Use all_widgets_schema first**: Always fetch widget schemas before creating widgets\n 3. **Validate settings**: Ensure all required fields are provided and data types match\n \n **Workflow:**\n 1. Use 'all_widgets_schema' to get schema definitions\n 2. Prepare widget settings according to the schema\n 3. Use this tool to create the widget"}getInputSchema(){return yk}async executeInternal(e){if(!e.settings)throw new Error("You must pass the settings parameter");try{const t={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},a=await this.mondayApi.request(gk,t);if(!a.create_widget)throw new Error("Failed to create widget");const i=a.create_widget;i.parent?.kind===fT.Dashboard?i.parent.id:i.parent;return{content:{message:`Widget ${i.id} created`,widget_id:i.id,widget_name:i.name,dashboard_id:i.parent?.id}}}catch(t){const a=t instanceof Error?t.message:String(t);throw new Error(`Failed to create ${e.widget_kind} widget: ${a}`)}}},class extends eb{constructor(){super(...arguments),this.name="board_insights",this.type=an.READ,this.annotations=Zg({title:"Get Board Insights",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool allows you to calculate insights about board's data by filtering, grouping and aggregating columns. For example, you can get the total number of items in a board, the number of items in each status, the number of items in each column, etc. Use this tool when you need to get a summary of the board's data, for example, you want to know the total number of items in a board, the number of items in each status, the number of items in each column, etc.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available.[IMPORTANT]: For some columns, human-friendly label is returned inside 'LABEL_<column_id' field. E.g. for column with id 'status_123' the label is returned inside 'LABEL_status_123' field."}getInputSchema(){return Fk}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],i=new Set(e.aggregations.filter((e=>e.function===sx.Label)).map((e=>e.columnId))),n=e.groupBy?.filter((e=>!i.has(e))).map((e=>({function:sx.Label,columnId:e})))??[],o=e.aggregations.concat(n).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return $k.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:rx.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===sx.CountItems?[]:[{type:rx.Column,column:Ck(n),as:n}]}),as:s}}var i,n;const o={type:rx.Column,column:Ck(e.columnId),as:e.columnId};return a.some((t=>t.column_id===e.columnId))||a.push({column_id:e.columnId}),o}));return a.forEach((e=>{o.some((t=>t.as===e.column_id))||o.push({type:rx.Column,column:Ck(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),i=function(e){if(!e.filters&&!e.orderBy)return;const t={};return e.filters&&(t.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),t.operator=e.filtersOperator),e.orderBy&&(t.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),t}(e),n=function(e){return{id:e.boardId.toString(),type:ox.Table}}(e),o={query:{from:n,query:i,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(Ok,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const i=e.value;if(!i)return void(t[a]=null);const n=i.result??i.value??null;t[a]=n})),t}));return s.length?{content:{message:"Board insights retrieved",board_name:r.boards?.[0]?.name,board_url:r.boards?.[0]?.url,data:s}}:{content:"No board insights found for the given query."}}},class extends eb{constructor(){super(...arguments),this.name="search",this.type=an.READ,this.annotations=Zg({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Search within monday.com platform. Can search for boards, documents, forms, folders.\nFor users and teams, use list_users_and_teams tool.\nFor workspaces, use list_workspaces tool.\nFor items and groups, use get_board_items_page tool.\nFor groups, use get_board_info tool.\nIMPORTANT: ids returned by this tool are prefixed with the type of the object (e.g doc-123, board-456, folder-789). When passing the ids to other tools, you need to remove the prefix and just pass the number.\n "}getInputSchema(){return Bk}async executeInternal(e){if(e.searchType!==kA.FOLDERS&&e.searchTerm)try{return{content:{message:"Search results",data:(await this.searchWithDevEndpointAsync(e)).items}}}catch(e){KN(e)}const t={[kA.BOARD]:this.searchBoardsAsync.bind(this),[kA.DOCUMENTS]:this.searchDocsAsync.bind(this),[kA.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!t)throw new Error(`Unsupported search type: ${e.searchType}`);const a=await t(e);return{content:{message:"Search results",disclaimer:a.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",data:a.items}}}async searchWithDevEndpointAsync(e){const t={[kA.BOARD]:{entities:[{boards:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[kA.DOCUMENTS]:{entities:[{docs:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[kA.FOLDERS]:void 0}[e.searchType];if(!t)throw new Error(`Unsupported search type for dev endpoint: ${e.searchType}`);if(e.page>1)throw new Error("Pagination is not supported for search, increase the limit parameter instead");const a={query:e.searchTerm,limit:e.limit,filters:t},i=(await this.mondayApi.request(Uk,a,{versionOverride:"dev",timeout:WN})).search||[],n=[];for(const e of i)"BoardSearchResult"===e.__typename?n.push({id:DA.BOARD+e.data.id,title:e.data.name,url:e.data.url}):"DocSearchResult"===e.__typename&&n.push({id:DA.DOCUMENT+e.data.id,title:e.data.name});return{items:n,wasFiltered:!0}}async searchFoldersAsync(e){const t={...this.getPagingParamsForSearch(e,100),workspace_ids:e.workspaceIds?.map((e=>e.toString()))};t.workspace_ids??=[],0===t.workspace_ids.length&&QN(new Error("Searching for folders require specifying workspace ids"),"search folders");const a=await this.mondayApi.request(zk,t),i=this.searchAndVirtuallyPaginate(e,a.folders||[],(e=>e.name));return{items:i.items.map((e=>({id:DA.FOLDER+e.id,title:e.name}))),wasFiltered:i.wasFiltered}}async searchDocsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(Lk,t),i=this.searchAndVirtuallyPaginate(e,a.docs||[],(e=>e.name));return{items:i.items.map((e=>({id:DA.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:i.wasFiltered}}async searchBoardsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(jk,t),i=this.searchAndVirtuallyPaginate(e,a.boards||[],(e=>e.name));return{items:i.items.map((e=>({id:DA.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:i.wasFiltered}}getPagingParamsForSearch(e,t=1e3){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?Math.min(1e3,t):e.limit}}searchAndVirtuallyPaginate(e,t,a){if(t.length<=Vk)return{items:t,wasFiltered:!1};const i=vD(e.searchTerm??""),n=(e.page-1)*e.limit,o=n+e.limit;return{items:t.filter((e=>vD(a(e)).includes(i))).slice(n,o),wasFiltered:!0}}},class extends eb{constructor(){super(...arguments),this.name="get_user_context",this.type=an.READ,this.annotations=Zg({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information and their relevant items (boards, folders, workspaces, dashboards).\n \n Use this tool at the beginning of conversations to:\n - Get context about who the current user is (id, name, title)\n - Discover user's favorite boards, folders, workspaces, and dashboards\n - Get user's most relevant boards based on visit frequency and recency\n - Get user's most relevant people based on interaction frequency and recency\n - Reduce the need for search requests by knowing user's commonly accessed items\n "}getInputSchema(){}async executeInternal(){const{me:e,favorites:t,intelligence:a}=await this.mondayApi.request(Kk,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};return{content:{message:"User context",...{user:e,favorites:await this.fetchFavorites(t||[]),relevantBoards:this.extractRelevantBoards(a),relevantPeople:this.extractRelevantPeople(a)}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const i={};for(const e of a)i[Jk[e]]=t[e];const n=await this.mondayApi.request(Yk,i),o=[];for(const e of a){const t=Xk[e];for(const a of n[t]??[])a?.id&&o.push({id:a.id,name:a.name,type:e})}return o}extractRelevantBoards(e){if(!e?.relevant_boards)return[];const t=[];for(const a of e.relevant_boards)a?.id&&a?.board?.name&&t.push({id:a.id,name:a.board.name});return t}extractRelevantPeople(e){if(!e?.relevant_people)return[];const t=[];for(const a of e.relevant_people)a?.id&&a?.user?.name&&t.push({id:a.id,name:a.user.name});return t}groupByType(e){const t={};for(const a of e){const e=a?.object;e?.id&&e?.type&&(t[e.type]??=[]).push(e.id)}return t}},class extends eb{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=an.WRITE,this.annotations=Zg({title:"Update Assets On Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update a file or doc column value on an item using existing assets, docs, or links. Sets the column to the provided list of files, adding new ones and removing any not in the list."}getInputSchema(){return Qk}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(Gk,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends eb{constructor(){super(...arguments),this.name="get_notetaker_meetings",this.type=an.READ,this.annotations=Zg({title:"Get Notetaker Meetings",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve notetaker meetings with optional detailed fields. Use include_summary, include_topics, include_action_items, and include_transcript flags to control which details are returned. Use access to filter by meeting access level (OWN, SHARED_WITH_ME, SHARED_WITH_ACCOUNT, ALL). Defaults to OWN. Supports filtering by ids, search term, and cursor-based pagination."}getInputSchema(){return eO}async executeInternal(e){const t={access:e.access};e.ids&&e.ids.length>0&&(t.ids=e.ids),e.search&&(t.search=e.search);const a={limit:e.limit,cursor:e.cursor||void 0,filters:t,includeSummary:e.include_summary,includeTopics:e.include_topics,includeActionItems:e.include_action_items,includeTranscript:e.include_transcript},i=await this.mondayApi.request(Zk,a,{versionOverride:"2026-04"}),n=i.notetaker?.meetings;if(!n?.meetings||0===n.meetings.length)return{content:"No notetaker meetings found matching the specified criteria."};return{content:{message:"Meetings retrieved",data:{meetings:n.meetings,pagination:{has_next_page:n.page_info?.has_next_page??!1,cursor:n.page_info?.cursor??null,count:n.meetings.length}}}}}},class extends eb{constructor(){super(...arguments),this.name="create_view",this.type=an.WRITE,this.annotations=Zg({title:"Create View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a new board view (tab) with optional filters and sorting. This creates a saved view on a monday.com board that users can switch to.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }'}getInputSchema(){return cS}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort},a=await this.mondayApi.request(lS,t);return a.create_view?{content:`View "${a.create_view.name}" (ID: ${a.create_view.id}, type: ${a.create_view.type}) successfully created`}:{content:"Failed to create view - no response from API"}}}];var CO;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(CO||(CO={}));const FO=(e,t)=>{let a=[];t?.mode===CO.APPS?a=[...Xg]:t?.mode!==CO.API&&t?.mode||(a=[...$O,...PO]);const i=a.map((t=>((e,t)=>e.prototype instanceof eb?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof kg?new e(t.apiToken):new e)(t,e)));return i.filter((e=>{if(!t)return e.type!==an.ALL_API;if(t.mode===CO.API&&"only"===t.enableDynamicApiTools)return e.type===an.ALL_API;let a=!1;return t.mode===CO.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===an.ALL_API),t.readOnlyMode&&(a=a||e.type!==an.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))};class jO{constructor(){this.dynamicTools=new Map}registerTool(e,t){const a=e.enabledByDefault??!0,i=a;this.dynamicTools.set(e.name,{instance:e,mcpTool:t,enabled:i,enabledByDefault:a}),a||t.disable()}enableTool(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabled||(t.mcpTool.enable(),t.enabled=!0),!0)}disableTool(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabled&&(t.mcpTool.disable(),t.enabled=!1),!0)}isToolEnabled(e){const t=this.dynamicTools.get(e);return!!t&&t.enabled}isToolEnabledByDefault(e){const t=this.dynamicTools.get(e);return!t||t.enabledByDefault}getToolsStatus(){const e={};return this.dynamicTools.forEach(((t,a)=>{e[a]=t.enabled})),e}getDynamicToolNames(){return Array.from(this.dynamicTools.keys())}getDetailedToolsStatus(){const e={};return this.dynamicTools.forEach(((t,a)=>{e[a]={enabled:t.enabled,enabledByDefault:t.enabledByDefault}})),e}resetToolToDefault(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabledByDefault&&!t.enabled?(t.mcpTool.enable(),t.enabled=!0,!0):!(!t.enabledByDefault&&t.enabled)||(t.mcpTool.disable(),t.enabled=!1,!0))}getAllDynamicTools(){return this.dynamicTools}clear(){this.dynamicTools.clear()}}const LO=e=>"object"==typeof e?JSON.stringify(e):e;exports.DynamicToolManager=jO,exports.MondayAgentToolkit=class extends Yi{constructor(e){super({name:"monday.com",version:"1.0.0"},{capabilities:{tools:{listChanged:!0}}}),this.dynamicToolManager=new jO,this.toolInstances=[],this.managementTool=null,this.mondayApiClient=this.createApiClient(e),this.mondayApiToken=e.mondayApiToken,this.context={...e.context,apiVersion:e.mondayApiVersion??Ag},this.registerTools(e)}createApiClient(e){return new a.ApiClient({token:e.mondayApiToken,apiVersion:e.mondayApiVersion??Ag,endpoint:e.mondayApiEndpoint,requestConfig:{...e.mondayApiRequestConfig,headers:{...e.mondayApiRequestConfig?.headers||{},"user-agent":"monday-api-mcp"}}})}registerTools(e){try{this.toolInstances=this.initializeTools(e),this.toolInstances.forEach((e=>this.registerSingleTool(e))),!0===e.toolsConfiguration?.enableToolManager&&this.registerManagementTool()}catch(e){throw new Error(`Failed to initialize Monday Agent Toolkit: ${e instanceof Error?e.message:String(e)}`)}}registerManagementTool(){const e=new aO;e.setToolkitManager(this.dynamicToolManager),this.managementTool=e,this.registerSingleTool(this.managementTool)}initializeTools(e){const t={apiClient:this.mondayApiClient,apiToken:this.mondayApiToken,context:this.context};return FO(t,e.toolsConfiguration)}registerSingleTool(t){const a=t.getInputSchema(),i=this.registerTool(t.name,{...t,title:t.annotations?.title,description:t.getDescription(),inputSchema:a,annotations:t.annotations},(async(i,n)=>{try{let n;if(a){const o=e.z.object(a).safeParse(i);if(!o.success)throw new Error(`Invalid arguments: ${o.error.message}`);n=await t.execute(o.data)}else n=await t.execute();return this.formatToolResult(n.content)}catch(e){return this.handleToolError(e,t.name)}}));this.dynamicToolManager.registerTool(t,i)}enableTool(e){return this.dynamicToolManager.enableTool(e)}disableTool(e){return this.dynamicToolManager.disableTool(e)}isToolEnabled(e){return this.dynamicToolManager.isToolEnabled(e)}getToolsStatus(){return this.dynamicToolManager.getToolsStatus()}getDynamicToolNames(){return this.dynamicToolManager.getDynamicToolNames()}getServer(){return this}getTools(e){const t=[...this.toolInstances];return this.managementTool&&t.push(this.managementTool),t.map((t=>({name:t.name,description:t.getDescription(),schema:this.getSchemaForTool(t,e),annotations:t.annotations,handler:this.createToolHandler(t)})))}getToolsForMcp(e){const t=[...this.toolInstances];return this.managementTool&&t.push(this.managementTool),t.map((t=>({name:t.name,description:t.getDescription(),schema:this.getSchemaForTool(t,e),annotations:t.annotations,handler:this.createMcpToolHandler(t)})))}createToolHandler(t){return async a=>{const i=t.getInputSchema();if(i){const n=e.z.object(i).safeParse(a);if(!n.success)throw new Error(`Invalid arguments: ${n.error.message}`);return(await t.execute(n.data)).content}return(await t.execute()).content}}createMcpToolHandler(t){return async(a,i)=>{try{const i=t.getInputSchema();if(i){const n=e.z.object(i).safeParse(a);if(!n.success)throw new Error(`Invalid arguments: ${n.error.message}`);const o=await t.execute(n.data);return{content:[{type:"text",text:LO(o.content)}]}}{const e=await t.execute();return{content:[{type:"text",text:LO(e.content)}]}}}catch(e){return{content:[{type:"text",text:`Error: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}}}getSchemaForTool(a,i){const n=a.getInputSchema();if(n)return"json"===i?.schemaFormat?t.zodToJsonSchema(e.z.object(n)):n}formatToolResult(e){return{content:[{type:"text",text:LO(e)}]}}handleToolError(e,t){return{content:[{type:"text",text:`Failed to execute tool ${t}: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}};
2027
+ `),i=await this.mondayApi.request(a);if(!i.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let n=`## Type: ${i.__type.name||"Unnamed"} ${e.typeName===i.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${i.__type.kind}\n${i.__type.description?`Description: ${i.__type.description}`:""}\n\n`;return i.__type.fields&&i.__type.fields.length>0&&(n+="## Fields\n",i.__type.fields.forEach((e=>{const t=zA(e.type);n+=`- ${e.name}: ${t}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(n+=" Arguments:\n",e.args.forEach((e=>{const t=zA(e.type);n+=` - ${e.name}: ${t}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),n+="\n"),i.__type.inputFields&&i.__type.inputFields.length>0&&(n+="## Input Fields\n",i.__type.inputFields.forEach((e=>{const t=zA(e.type);n+=`- ${e.name}: ${t}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),n+="\n"),i.__type.interfaces&&i.__type.interfaces.length>0&&(n+="## Implements\n",i.__type.interfaces.forEach((e=>{n+=`- ${e.name}\n`})),n+="\n"),i.__type.enumValues&&i.__type.enumValues.length>0&&(n+="## Enum Values\n",i.__type.enumValues.forEach((e=>{n+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),n+="\n"),i.__type.possibleTypes&&i.__type.possibleTypes.length>0&&(n+="## Possible Types\n",i.__type.possibleTypes.forEach((e=>{n+=`- ${e.name}\n`}))),n+=`\n## Usage Examples\nIf this is a Query or Mutation field, you can use it in the all_monday_api tool.\n\nExample for query:\nall_monday_api(operation: "query", name: "getTypeData", variables: "{\\"typeName\\": \\"${i.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:n}}catch(e){const t=e instanceof Error?e.message:"Unknown error",a=t.includes("JSON");return{content:`Error fetching type details: ${t}${a?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var t}},class extends eb{constructor(){super(...arguments),this.name="create_custom_activity",this.type=an.WRITE,this.annotations=Zg({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return jN}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(eS,t),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends eb{constructor(){super(...arguments),this.name="create_notification",this.type=an.WRITE,this.annotations=Zg({title:"Create Notification",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Send a notification to a user via the bell icon and optionally by email. Use target_type "Post" for updates/replies or "Project" for items/boards.'}getInputSchema(){return zN}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{await this.mondayApi.request(LN,t);return{content:{message:"Notification sent",user_id:e.user_id,text:e.text}}}catch(t){return{content:`Failed to send notification to user ${e.user_id}`}}}},class extends eb{constructor(){super(...arguments),this.name="create_timeline_item",this.type=an.WRITE,this.annotations=Zg({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return ZN}async executeInternal(e){const t={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(t.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const a=await this.mondayApi.request(tS,t);return{content:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends eb{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=an.READ,this.annotations=Zg({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return mA}async executeInternal(e){const t=await this.mondayApi.request(aS);if(!t.custom_activity||0===t.custom_activity.length)return{content:"No custom activities found"};const a=t.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${a.length} custom activities: ${JSON.stringify(a,null,2)}`}}},class extends eb{constructor(){super(...arguments),this.name="read_docs",this.type=an.READ,this.annotations=Zg({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get information about monday.com documents. Supports two modes:\n\nMODE: "content" (default) — Fetch documents with their full markdown content.\n- Requires: type ("ids" | "object_ids" | "workspace_ids") and ids array\n- Supports pagination via page/limit. Check has_more_pages in response.\n- If type "ids" returns no results, automatically retries with object_ids.\n- Set include_blocks: true to include block IDs, types, and positions in the response — required before calling update_doc.\n- Set include_comments: true to fetch all comments and replies on the document. Use comments_limit to control how many comments per item (default 50).\n\nMODE: "version_history" — Fetch the edit history of a single document.\n- Requires: ids with the document\'s object_id (use the object_id field from content mode results, NOT the id field).\n- The object_id is the numeric ID visible in the document URL.\n- Returns restoring points sorted newest-first. Use version_history_limit to cap results (e.g., "last 3 changes" → version_history_limit: 3).\n- Use since/until to filter by time range. If omitted, returns full history.\n- Set include_diff: true to see what content changed between versions (fetches up to 10 diffs, may be slower).\n- Examples:\n - { mode: "version_history", ids: ["5001466606"], version_history_limit: 3 }\n - { mode: "version_history", ids: ["5001466606"], since: "2026-03-11T00:00:00Z", include_diff: true }'}getInputSchema(){return uD}async executeInternal(e){return"version_history"===e.mode?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!e.type||!e.ids||0===e.ids.length)return{content:'Error: type and ids are required when mode is "content".'};let t,a,i;switch(e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":i=e.ids}const n=e.include_blocks??!1,o={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n};let r=await this.mondayApi.request(UI,o);if((!r.docs||0===r.docs.length)&&t){const a={ids:void 0,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n};r=await this.mondayApi.request(UI,a)}if(!r.docs||0===r.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const s=e.include_comments??!1,p=e.comments_limit??50;return this.enrichDocsWithMarkdown(r.docs,o,n,s,p)}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}async executeVersionHistory(e){const{include_diff:t,since:a,until:i,version_history_limit:n}=e,o=e.ids?.[0];if(!o)return{content:'Error: ids is required when mode is "version_history". Provide the document object_id.'};try{const e={docId:o,since:a,until:i},r=await this.mondayApi.request(VI,e);let s=r?.doc_version_history?.restoring_points;if(!s||0===s.length)return{content:`No version history found for document ${o}${a?` from ${a}`:""}.`};if(!t)return n&&(s=s.slice(0,n)),{content:JSON.stringify({doc_id:o,since:a,until:i,restoring_points:s},null,2)};const p=Math.min(n??10,10),d=s.slice(0,p+1),l=s.length>p,c=(await Promise.allSettled(d.map((async(e,t)=>{if(t===d.length-1||!e.date)return e;const a=d[t+1];if(!a?.date)return e;const i={docId:o,date:e.date,prevDate:a.date},n=await this.mondayApi.request(qI,i);return{...e,diff:n?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,t)=>"fulfilled"===e.status?e.value:d[t]))))).slice(0,p);return{content:JSON.stringify({doc_id:o,since:a,until:i,restoring_points:c,...l&&{truncated:!0,total_count:s.length}},null,2)}}catch(e){return{content:`Error fetching version history for document ${o}: ${e instanceof Error?e.message:"Unknown error"}`}}}async fetchDocComments(e,t){try{const a={boardId:e,itemsLimit:100,updatesLimit:t},i=await this.mondayApi.request(BI,a),n=i.boards?.[0]?.items_page?.items;if(!n)return[];const o=[];for(const e of n)if(e.updates&&0!==e.updates.length)for(const t of e.updates)o.push({id:t.id,text_body:t.text_body,body:t.body,created_at:t.created_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:e.id,item_name:e.name,replies:(t.replies??[]).map((e=>({id:e.id,text_body:e.text_body,body:e.body,created_at:e.created_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))});return o}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,i=!1,n=50){const o=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t,o="";try{const t={docId:e.id},a=await this.mondayApi.request(iS,t);o=a.export_markdown_from_doc.success&&a.export_markdown_from_doc.markdown?a.export_markdown_from_doc.markdown:`Error getting markdown: ${a.export_markdown_from_doc.error||"Unknown error"}`}catch(e){o=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return i&&e.object_id&&(t=await this.fetchDocComments(e.object_id,n)),{id:e.id,object_id:e.object_id,name:e.name,doc_kind:e.doc_kind,created_at:e.created_at,created_by:e.created_by?.name||"Unknown",url:e.url,relative_url:e.relative_url,workspace:e.workspace?.name||"Unknown",workspace_id:e.workspace_id,doc_folder_id:e.doc_folder_id,settings:e.settings,...a&&{blocks:(e.blocks??[]).filter((e=>null!=e)).map((e=>({id:e.id,type:e.type,parent_block_id:e.parent_block_id,position:e.position,content:e.content})))},blocks_as_markdown:o,...i&&{comments:t}}}))),r=t.page||1,s=t.limit||25,p=o.length,d=p===s;return{content:{message:`Documents retrieved (${o.length})`,pagination:{current_page:r,limit:s,count:p,has_more_pages:d},data:o}}}},class extends eb{constructor(){super(...arguments),this.name="workspace_info",this.type=an.READ,this.annotations=Zg({title:"Get Workspace Information",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool returns the boards, docs and folders in a workspace and which folder they are in. It returns up to 100 of each object type, if you receive 100 assume there are additional objects of that type in the workspace."}getInputSchema(){return hD}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(nS,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e,t){const{workspaces:a,boards:i,docs:n,folders:o}=e,r=a?.[0];if(!r)throw new Error("No workspace found");const s=new Map((o||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),p=[];(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(t):p.push(t)}));const d=[];return(n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.doc_folder_id&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(t):d.push(t)})),{workspace:{id:r.id,name:r.name,url:t?dD(t,r.id):void 0,description:r.description||"",kind:r.kind||"",created_at:r.created_at||"",state:r.state||"",is_default_workspace:r.is_default_workspace||!1,owners_subscribers:(r.owners_subscribers||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name&&null!=e.email)).map((e=>({id:e.id,name:e.name,email:e.email})))},folders:Array.from(s.values()),root_items:{boards:p,docs:d}}}(a,await pD(this.mondayApi));return{content:{message:"Workspace info retrieved",data:i}}}},class extends eb{constructor(){super(...arguments),this.name="list_workspaces",this.type=an.READ,this.annotations=Zg({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List all workspaces available to the user. Returns up to 500 workspaces with their ID, name, and description."}getInputSchema(){return _D}async executeInternal(e){const t=e.searchTerm?1e4:e.limit,a=e.searchTerm?1:e.page;let i=null;if(e.searchTerm&&(i=gD(e.searchTerm),0===i.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const n=e=>({limit:t,page:a,membershipKind:e}),o=bD(await this.mondayApi.request(fD,n(gT.Member))),r=!yD(o)||i&&!function(e,t){return t.some((t=>gD(t.name).includes(e)))}(i,o);let s=o;if(r){s=bD(await this.mondayApi.request(fD,n(gT.All)))}if(!yD(s))return{content:"No workspaces found."};const p=i&&s?.length<=vD,d=function(e,t,a,i){if(!e||t.length<=vD)return t;const n=(a-1)*i,o=n+i;return t.filter((t=>gD(t.name).includes(e))).slice(n,o)}(i,s,e.page,e.limit);if(!yD(d))return{content:"No workspaces found matching the search term. Try using the tool without a search term"};const l=d.length===e.limit,c=await pD(this.mondayApi),m=d.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:c&&e.id?dD(c,e.id):void 0})));return{content:{message:"Workspaces retrieved",...p?{disclaimer:"Search term not applied - returning all workspaces. Perform the filtering manually."}:{},...l?{next_page:e.page+1}:{},data:m}}}},class extends eb{constructor(){super(...arguments),this.name="create_doc",this.type=an.WRITE,this.annotations=Zg({title:"Create Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){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.\n\nLOCATION TYPES:\n- workspace: Creates a document in a workspace (requires workspace_id, optional doc_kind, optional folder_id)\n- item: Creates a document attached to an item (requires item_id, optional column_id)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }'}getInputSchema(){return ND}async executeInternal(e){const t=SD.safeParse({...e,type:e.location});if(!t.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const a=t.data;try{let t,i,n;if(a.type===ID.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||Ex.Public,folder_id:a.folder_id?.toString()}}},r=await this.mondayApi.request(xD,o);t=r?.create_doc?.id??void 0,i=r?.create_doc?.object_id??void 0,n=r?.create_doc?.url??void 0}else if(a.type===ID.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(wD,o),s=r.items?.[0];if(!s)return{content:`Error: Item with id ${a.item_id} not found.`};const p=s.board?.id,d=s.board?.columns?.find((e=>e&&e.type===$N.Doc));let l=a.column_id;if(!l)if(d)l=d.id;else{const e={boardId:p.toString(),columnType:$N.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(YI,e);if(l=t?.create_column?.id,!l)return{content:"Error: Failed to create doc column."}}const c={location:{board:{item_id:a.item_id.toString(),column_id:l}}},m=await this.mondayApi.request(xD,c);if(t=m.create_doc?.id??void 0,i=m.create_doc?.object_id??void 0,n=m.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(TD,a)}catch(e){console.warn("Failed to update doc name:",e)}}if(!t)return{content:"Error: Failed to create document."};const o={docId:t,markdown:e.markdown},r=await this.mondayApi.request(ED,o),s=r?.add_content_to_doc_from_markdown?.success,p=r?.add_content_to_doc_from_markdown?.error;return s?{content:{message:"Document successfully created",doc_id:t,object_id:i,doc_url:n,doc_name:e.doc_name}}:{content:`Document ${t} created, but failed to add markdown content: ${p||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends eb{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=an.WRITE,this.annotations=Zg({title:"Add Content to Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add markdown content to an existing monday.com document.\n\nIDENTIFICATION: Provide either doc_id or object_id to identify the document:\n- doc_id: The document ID (the id field returned by read_docs). Takes priority if both provided.\n- object_id: The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id.\n\nUSAGE EXAMPLES:\n- By doc_id: { doc_id: "123", markdown: "# New Section\\nContent here" }\n- By object_id: { object_id: "456", markdown: "# New Section\\nContent here" }\n- Insert after block: { doc_id: "123", markdown: "Inserted content", after_block_id: "block_789" }'}getInputSchema(){return OD}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};try{let t=null;if(e.doc_id){const a=await this.mondayApi.request(kD,{docId:[e.doc_id]});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(DD,{objectId:[e.object_id]});t=a.docs?.[0]??null}if(!t){return{content:`Error: No document found for ${e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`}.`}}const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},i=await this.mondayApi.request(AD,a);if(!i?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:n,block_ids:o,error:r}=i.add_content_to_doc_from_markdown;if(!n)return{content:`Error adding content to document: ${r||"Unknown error"}`};const s=o?.length??0;return{content:{message:`Successfully added content to document ${t.id}. ${s} block${1===s?"":"s"} created.`,doc_id:t.id,block_ids:o,doc_name:t.name,doc_url:t.url}}}catch(e){return{content:`Error adding content to document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends eb{constructor(){super(...arguments),this.name="update_doc",this.type=an.WRITE,this.annotations=Zg({title:"Update Document",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Update an existing monday.com document. Provide doc_id (preferred) or object_id, plus an ordered operations array (executed sequentially, stops on first failure).\n\nOPERATIONS:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (or insert after a block). Best for text, headings, lists, simple tables — no block IDs needed.\n- update_block: Update content of an existing text, code, or list_item block in-place.\n- create_block: Create a new block at a precise position. Use parent_block_id to nest inside notice_box, table cell, or layout cell.\n- delete_block: Remove any block. The ONLY option for BOARD, WIDGET, DOC embed, and GIPHY blocks.\n- replace_block: Delete a block and create a new one in its place (use when update_block is not supported).\n\nWHEN TO USE EACH OPERATION:\n- text / code / list_item → update_block; use replace_block to change subtype (e.g. NORMAL_TEXT→LARGE_TITLE)\n- divider / table / image / video / notice_box / layout → replace_block (properties immutable after creation)\n- BOARD / WIDGET / DOC / GIPHY → delete_block only\n\nGETTING BLOCK IDs: Call read_docs with include_blocks: true — returns id, type, position, and content per block.\n\nBLOCK CONTENT (delta_format): Array of insert ops. Last op MUST be {insert: {text: "\\n"}}.\n- Plain: [{insert: {text: "Hello"}}, {insert: {text: "\\n"}}]\n- Bold: [{insert: {text: "Hi"}, attributes: {bold: true}}, {insert: {text: "\\n"}}]\n- Mention user/doc/board: [{insert: {text: "Hey "}}, {insert: {mention: {id: 12345, type: "USER"}}}, {insert: {text: "\\n"}}] — type is USER, DOC, or BOARD; id is numeric (user IDs from list_users_and_teams)\n- Inline column value: [{insert: {column_value: {item_id: 111, column_id: "status"}}}, {insert: {text: "\\n"}}]\n- Supported attributes: bold, italic, underline, strike, code, link, color, background (not applicable to mention/column_value ops)\n\nIMAGE WITH ASSET: For asset-based images, use create_block with block_type "image" and asset_id (instead of public_url). add_markdown_content does NOT support asset images — for mixed content, alternate add_markdown_content (text) and create_block (image) operations in sequence.'}getInputSchema(){return fk}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};try{let t=e.doc_id;if(!t){const a=await this.mondayApi.request($D,{objectId:[e.object_id]}),i=a.docs?.[0];if(!i)return{content:`Error: No document found for object_id ${e.object_id}.`};t=i.id}const a=[];let i=null;for(let n=0;n<e.operations.length;n++){const o=e.operations[n];try{const e=await this.executeOperation(t,o);a.push(`- [OK] ${o.operation_type}${e?`: ${e}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";a.push(`- [FAILED] ${o.operation_type}: ${t}`),i=n;break}}const n=null!==i?i:e.operations.length,o=e.operations.length;return{content:`${`Completed ${n}/${o} operation${1===o?"":"s"} on doc ${t}.`}\n\nResults:\n${a.join("\n")}\n\nDoc ID: ${t}`}}catch(e){return{content:`Error: ${e instanceof Error?e.message:String(e)}`}}}async executeOperation(e,t){switch(t.operation_type){case"set_name":return this.executeSetName(e,t.name);case"add_markdown_content":return this.executeAddMarkdown(e,t.markdown,t.after_block_id);case"update_block":return this.executeUpdateBlock(t.block_id,t.content);case"create_block":return this.executeCreateBlock(e,t.block,t.after_block_id,t.parent_block_id);case"delete_block":return this.executeDeleteBlock(t.block_id);case"replace_block":return this.executeReplaceBlock(e,t.block_id,t.block,t.after_block_id,t.parent_block_id);default:{const e=t.operation_type;throw new Error(`Unsupported operation type: "${e}"`)}}}async executeSetName(e,t){const a={docId:e,name:t},i=await this.mondayApi.request(RD,a);if(!i?.update_doc_name)throw new Error(`No confirmation from update_doc_name — rename to "${t}" may not have applied`);return`Renamed to "${t}"`}async executeAddMarkdown(e,t,a){if(!t.trim())throw new Error("markdown must not be empty");const i={docId:e,markdown:t,afterBlockId:a},n=await this.mondayApi.request(PD,i),o=n?.add_content_to_doc_from_markdown;if(!o?.success)throw new Error(o?.error||"Failed to add markdown content");const r=o.block_ids?.length??0;return`${r} block${1===r?"":"s"} added${o.block_ids?.length?`. Block IDs: ${o.block_ids.join(", ")}`:""}`}async executeUpdateBlock(e,t){const a=function(e){switch(e.block_content_type){case"text":return{deltaFormat:BD(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:BD(e.delta_format),language:e.language};case"list_item":return{deltaFormat:BD(e.delta_format),checked:e.checked,indentation:e.indentation};default:{const t=e.block_content_type;throw new Error(`Unsupported block_content_type: "${t}"`)}}}(t),i={blockId:e,content:JSON.stringify(a)},n=await this.mondayApi.request(CD,i);if(!n?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,i){const n=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:VD(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:LD(e.alignment),direction:zD(e.direction)}};case"list_item":return{list_block:{delta_format:VD(e.delta_format),list_block_type:e.list_block_type?e.list_block_type:void 0,indentation:e.indentation}};case"code":return{text_block:{delta_format:VD(e.delta_format),text_block_type:iT.Code}};case"divider":return{divider_block:{}};case"page_break":return{page_break_block:{}};case"image":if(null==e.asset_id&&!e.public_url)throw new Error("image block requires either asset_id or public_url");return{image_block:null!=e.asset_id?{asset_id:String(e.asset_id),width:e.width}:{public_url:e.public_url,width:e.width}};case"video":return{video_block:{raw_url:e.raw_url,width:e.width}};case"notice_box":return{notice_box_block:{theme:e.theme}};case"table":return{table_block:{row_count:e.row_count,column_count:e.column_count,width:e.width,column_style:e.column_style?.map((e=>({width:e.width})))}};case"layout":return{layout_block:{column_count:e.column_count,column_style:e.column_style?.map((e=>({width:e.width})))}};default:{const t=e.block_type;throw new Error(`Unsupported block_type: "${t}"`)}}}(t);if(i){const e=Object.keys(n);if(1!==e.length)throw new Error(`Cannot inject parent_block_id: expected exactly 1 key in block input, got: ${e.join(", ")}`);const t=e[0],a=n[t];if(!a||"object"!=typeof a)throw new Error(`Cannot inject parent_block_id into block type "${t}" — block value is not an object`);a.parent_block_id=i}const o={docId:e,afterBlockId:a,blocksInput:[n]},r=await this.mondayApi.request(jD,o),s=r?.create_doc_blocks;if(!s||0===s.length)throw new Error("No blocks returned from create_doc_blocks");return`Block created (ID: ${s.map((e=>e.id)).join(", ")})`}async executeDeleteBlock(e){const t={blockId:e},a=await this.mondayApi.request(FD,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async executeReplaceBlock(e,t,a,i,n){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,i,n)}`}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Original block ${t} was deleted, but replacement creation failed: ${a}. The original block is gone.`)}}},class extends eb{constructor(){super(...arguments),this.name="update_workspace",this.type=an.WRITE,this.annotations=Zg({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return xk}async executeInternal(e){const t={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},a=await this.mondayApi.request(wk,t),i=await pD(this.mondayApi),n=i?dD(i,a.update_workspace?.id):void 0;return{content:{message:`Workspace ${a.update_workspace?.id} updated`,workspace_id:a.update_workspace?.id,workspace_name:a.update_workspace?.name,workspace_url:n}}}},class extends eb{constructor(){super(...arguments),this.name="update_folder",this.type=an.WRITE,this.annotations=Zg({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return Tk}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:i}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const n={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:t?{position_is_after:i,position_object_id:t,position_object_type:a}:void 0},o=await this.mondayApi.request(Ek,n);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends eb{constructor(){super(...arguments),this.name="create_workspace",this.type=an.WRITE,this.annotations=Zg({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return Sk}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(Ik,t),i=await pD(this.mondayApi),n=i&&a.create_workspace?.id?dD(i,a.create_workspace.id):void 0;return{content:{message:`Workspace ${a.create_workspace?.id} successfully created`,workspace_id:a.create_workspace?.id,workspace_name:a.create_workspace?.name,workspace_url:n}}}},class extends eb{constructor(){super(...arguments),this.name="create_folder",this.type=an.WRITE,this.annotations=Zg({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return Ak}async executeInternal(e){const t={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},a=await this.mondayApi.request(Nk,t);return{content:{message:`Folder ${a.create_folder?.id} successfully created`,folder_id:a.create_folder?.id,folder_name:a.create_folder?.name}}}},class extends eb{constructor(){super(...arguments),this.name="move_object",this.type=an.WRITE,this.annotations=Zg({title:"Move Object",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move a folder, board, or overview in monday.com. Use `position` for relative placement based on another object, `parentFolderId` for folder changes, `workspaceId` for workspace moves, and `accountProductId` for account product changes."}getInputSchema(){return Ok}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={folderId:t,position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},d=await this.mondayApi.request(Ek,p);return{content:{message:"Object moved",object_id:d.update_folder?.id}}}async executeUpdateBoardHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={boardId:t,attributes:{position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(Dk,p);return d.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:d.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${d.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={overviewId:t,attributes:{position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(kk,p);return d.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:d.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${d.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:t}=e;switch(t){case PE.Folder:return this.executeUpdateFolder(e);case PE.Board:return this.executeUpdateBoardHierarchy(e);case PE.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends eb{constructor(){super(...arguments),this.name="create_dashboard",this.type=an.WRITE,this.annotations=Zg({title:"Create Dashboard",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Use this tool to create a new monday.com dashboard that aggregates data from one or more boards. \n Dashboards provide visual representations of board data through widgets and charts.\n \n Use this tool when users want to:\n - Create a dashboard to visualize board data\n - Aggregate information from multiple boards\n - Set up a data visualization container for widgets"}getInputSchema(){return yk}async executeInternal(e){try{const t={name:e.name,workspace_id:e.workspace_id.toString(),board_ids:e.board_ids,kind:e.kind,board_folder_id:e.board_folder_id?.toString()},a=await this.mondayApi.request(vk,t);if(!a.create_dashboard)throw new Error("Failed to create dashboard");const i=a.create_dashboard;return{content:{message:`Dashboard ${i.id} successfully created`,dashboard_id:i.id,dashboard_name:i.name}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${t}`)}}},class extends eb{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=an.READ,this.annotations=Zg({title:"Get All Widget Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch complete JSON Schema 7 definitions for all available widget types in monday.com.\n \n This tool is essential before creating widgets as it provides:\n - Complete schema definitions for all supported widgets\n - Required and optional fields for each widget type\n - Data type specifications and validation rules\n - Detailed descriptions of widget capabilities\n \n Use this tool when you need to:\n - Understand widget configuration requirements before creating widgets\n - Validate widget settings against official schemas\n - Plan widget implementations with proper data structures\n \n The response includes JSON Schema 7 definitions that describe exactly what settings each widget type accepts."}getInputSchema(){return{}}async executeInternal(){try{const e={},t=await this.mondayApi.request(gk,e);if(!t.all_widgets_schema||0===t.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const a={};let i=0;for(const e of t.all_widgets_schema)if(e?.widget_type&&e?.schema){const t="string"==typeof e.schema?JSON.parse(e.schema):e.schema,n=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:n,schema:e.schema},i++}if(0===i)throw new Error("No valid widget schemas found in API response");Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:a,url:CA}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends eb{constructor(){super(...arguments),this.name="create_widget",this.type=an.WRITE,this.annotations=Zg({title:"Create Widget",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new widget in a dashboard or board view with specific configuration settings.\n \n This tool creates data visualization widgets that display information from monday.com boards:\n **Parent Containers:**\n - **DASHBOARD**: Place widget in a dashboard (most common use case)\n - **BOARD_VIEW**: Place widget in a specific board view\n \n **Critical Requirements:**\n 1. **Schema Compliance**: Widget settings MUST conform to the JSON schema for the specific widget type\n 2. **Use all_widgets_schema first**: Always fetch widget schemas before creating widgets\n 3. **Validate settings**: Ensure all required fields are provided and data types match\n \n **Workflow:**\n 1. Use 'all_widgets_schema' to get schema definitions\n 2. Prepare widget settings according to the schema\n 3. Use this tool to create the widget"}getInputSchema(){return _k}async executeInternal(e){if(!e.settings)throw new Error("You must pass the settings parameter");try{const t={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},a=await this.mondayApi.request(bk,t);if(!a.create_widget)throw new Error("Failed to create widget");const i=a.create_widget;i.parent?.kind===fT.Dashboard?i.parent.id:i.parent;return{content:{message:`Widget ${i.id} created`,widget_id:i.id,widget_name:i.name,dashboard_id:i.parent?.id}}}catch(t){const a=t instanceof Error?t.message:String(t);throw new Error(`Failed to create ${e.widget_kind} widget: ${a}`)}}},class extends eb{constructor(){super(...arguments),this.name="board_insights",this.type=an.READ,this.annotations=Zg({title:"Get Board Insights",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool allows you to calculate insights about board's data by filtering, grouping and aggregating columns. For example, you can get the total number of items in a board, the number of items in each status, the number of items in each column, etc. Use this tool when you need to get a summary of the board's data, for example, you want to know the total number of items in a board, the number of items in each status, the number of items in each column, etc.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available.[IMPORTANT]: For some columns, human-friendly label is returned inside 'LABEL_<column_id' field. E.g. for column with id 'status_123' the label is returned inside 'LABEL_status_123' field."}getInputSchema(){return jk}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],i=new Set(e.aggregations.filter((e=>e.function===sx.Label)).map((e=>e.columnId))),n=e.groupBy?.filter((e=>!i.has(e))).map((e=>({function:sx.Label,columnId:e})))??[],o=e.aggregations.concat(n).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return Ck.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:rx.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===sx.CountItems?[]:[{type:rx.Column,column:Fk(n),as:n}]}),as:s}}var i,n;const o={type:rx.Column,column:Fk(e.columnId),as:e.columnId};return a.some((t=>t.column_id===e.columnId))||a.push({column_id:e.columnId}),o}));return a.forEach((e=>{o.some((t=>t.as===e.column_id))||o.push({type:rx.Column,column:Fk(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),i=function(e){if(!e.filters&&!e.orderBy)return;const t={};return e.filters&&(t.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),t.operator=e.filtersOperator),e.orderBy&&(t.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),t}(e),n=function(e){return{id:e.boardId.toString(),type:ox.Table}}(e),o={query:{from:n,query:i,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(Rk,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const i=e.value;if(!i)return void(t[a]=null);const n=i.result??i.value??null;t[a]=n})),t}));return s.length?{content:{message:"Board insights retrieved",board_name:r.boards?.[0]?.name,board_url:r.boards?.[0]?.url,data:s}}:{content:"No board insights found for the given query."}}},class extends eb{constructor(){super(...arguments),this.name="search",this.type=an.READ,this.annotations=Zg({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Search within monday.com platform. Can search for boards, documents, forms, folders.\nFor users and teams, use list_users_and_teams tool.\nFor workspaces, use list_workspaces tool.\nFor items and groups, use get_board_items_page tool.\nFor groups, use get_board_info tool.\nIMPORTANT: ids returned by this tool are prefixed with the type of the object (e.g doc-123, board-456, folder-789). When passing the ids to other tools, you need to remove the prefix and just pass the number.\n "}getInputSchema(){return qk}async executeInternal(e){if(e.searchType!==OA.FOLDERS&&e.searchTerm)try{return{content:{message:"Search results",data:(await this.searchWithDevEndpointAsync(e)).items}}}catch(e){YN(e)}const t={[OA.BOARD]:this.searchBoardsAsync.bind(this),[OA.DOCUMENTS]:this.searchDocsAsync.bind(this),[OA.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!t)throw new Error(`Unsupported search type: ${e.searchType}`);const a=await t(e);return{content:{message:"Search results",disclaimer:a.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",data:a.items}}}async searchWithDevEndpointAsync(e){const t={[OA.BOARD]:{entities:[{boards:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[OA.DOCUMENTS]:{entities:[{docs:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[OA.FOLDERS]:void 0}[e.searchType];if(!t)throw new Error(`Unsupported search type for dev endpoint: ${e.searchType}`);if(e.page>1)throw new Error("Pagination is not supported for search, increase the limit parameter instead");const a={query:e.searchTerm,limit:e.limit,filters:t},i=(await this.mondayApi.request(Vk,a,{versionOverride:"dev",timeout:QN})).search||[],n=[];for(const e of i)"BoardSearchResult"===e.__typename?n.push({id:kA.BOARD+e.data.id,title:e.data.name,url:e.data.url}):"DocSearchResult"===e.__typename&&n.push({id:kA.DOCUMENT+e.data.id,title:e.data.name});return{items:n,wasFiltered:!0}}async searchFoldersAsync(e){const t={...this.getPagingParamsForSearch(e,100),workspace_ids:e.workspaceIds?.map((e=>e.toString()))};t.workspace_ids??=[],0===t.workspace_ids.length&&KN(new Error("Searching for folders require specifying workspace ids"),"search folders");const a=await this.mondayApi.request(Uk,t),i=this.searchAndVirtuallyPaginate(e,a.folders||[],(e=>e.name));return{items:i.items.map((e=>({id:kA.FOLDER+e.id,title:e.name}))),wasFiltered:i.wasFiltered}}async searchDocsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(zk,t),i=this.searchAndVirtuallyPaginate(e,a.docs||[],(e=>e.name));return{items:i.items.map((e=>({id:kA.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:i.wasFiltered}}async searchBoardsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(Lk,t),i=this.searchAndVirtuallyPaginate(e,a.boards||[],(e=>e.name));return{items:i.items.map((e=>({id:kA.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:i.wasFiltered}}getPagingParamsForSearch(e,t=1e3){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?Math.min(1e3,t):e.limit}}searchAndVirtuallyPaginate(e,t,a){if(t.length<=Bk)return{items:t,wasFiltered:!1};const i=gD(e.searchTerm??""),n=(e.page-1)*e.limit,o=n+e.limit;return{items:t.filter((e=>gD(a(e)).includes(i))).slice(n,o),wasFiltered:!0}}},class extends eb{constructor(){super(...arguments),this.name="get_user_context",this.type=an.READ,this.annotations=Zg({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information and their relevant items (boards, folders, workspaces, dashboards).\n \n Use this tool at the beginning of conversations to:\n - Get context about who the current user is (id, name, title)\n - Discover user's favorite boards, folders, workspaces, and dashboards\n - Get user's most relevant boards based on visit frequency and recency\n - Get user's most relevant people based on interaction frequency and recency\n - Reduce the need for search requests by knowing user's commonly accessed items\n "}getInputSchema(){}async executeInternal(){const{me:e,favorites:t,intelligence:a}=await this.mondayApi.request(Yk,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};return{content:{message:"User context",...{user:e,favorites:await this.fetchFavorites(t||[]),relevantBoards:this.extractRelevantBoards(a),relevantPeople:this.extractRelevantPeople(a)}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const i={};for(const e of a)i[Xk[e]]=t[e];const n=await this.mondayApi.request(Jk,i),o=[];for(const e of a){const t=Zk[e];for(const a of n[t]??[])a?.id&&o.push({id:a.id,name:a.name,type:e})}return o}extractRelevantBoards(e){if(!e?.relevant_boards)return[];const t=[];for(const a of e.relevant_boards)a?.id&&a?.board?.name&&t.push({id:a.id,name:a.board.name});return t}extractRelevantPeople(e){if(!e?.relevant_people)return[];const t=[];for(const a of e.relevant_people)a?.id&&a?.user?.name&&t.push({id:a.id,name:a.user.name});return t}groupByType(e){const t={};for(const a of e){const e=a?.object;e?.id&&e?.type&&(t[e.type]??=[]).push(e.id)}return t}},class extends eb{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=an.WRITE,this.annotations=Zg({title:"Update Assets On Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update a file or doc column value on an item using existing assets, docs, or links. Sets the column to the provided list of files, adding new ones and removing any not in the list."}getInputSchema(){return Kk}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(Wk,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends eb{constructor(){super(...arguments),this.name="get_notetaker_meetings",this.type=an.READ,this.annotations=Zg({title:"Get Notetaker Meetings",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve notetaker meetings with optional detailed fields. Use include_summary, include_topics, include_action_items, and include_transcript flags to control which details are returned. Use access to filter by meeting access level (OWN, SHARED_WITH_ME, SHARED_WITH_ACCOUNT, ALL). Defaults to OWN. Supports filtering by ids, search term, and cursor-based pagination."}getInputSchema(){return tO}async executeInternal(e){const t={access:e.access};e.ids&&e.ids.length>0&&(t.ids=e.ids),e.search&&(t.search=e.search);const a={limit:e.limit,cursor:e.cursor||void 0,filters:t,includeSummary:e.include_summary,includeTopics:e.include_topics,includeActionItems:e.include_action_items,includeTranscript:e.include_transcript},i=await this.mondayApi.request(eO,a,{versionOverride:"2026-04"}),n=i.notetaker?.meetings;if(!n?.meetings||0===n.meetings.length)return{content:"No notetaker meetings found matching the specified criteria."};return{content:{message:"Meetings retrieved",data:{meetings:n.meetings,pagination:{has_next_page:n.page_info?.has_next_page??!1,cursor:n.page_info?.cursor??null,count:n.meetings.length}}}}}},class extends eb{constructor(){super(...arguments),this.name="create_view",this.type=an.WRITE,this.annotations=Zg({title:"Create View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a new board view (tab) with optional filters and sorting. This creates a saved view on a monday.com board that users can switch to.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }'}getInputSchema(){return mS}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort},a=await this.mondayApi.request(cS,t);return a.create_view?{content:`View "${a.create_view.name}" (ID: ${a.create_view.id}, type: ${a.create_view.type}) successfully created`}:{content:"Failed to create view - no response from API"}}},class extends eb{constructor(){super(...arguments),this.name="undo_action",this.type=an.WRITE,this.annotations=Zg({title:"Undo Action",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Undo a previous action on a board using its action_record_uuid. Supports undoing column changes, deletes, archives, moves, duplicates, and more. Use get_board_activity with includeData=true to find the action_record_uuid."}getInputSchema(){return iO}async executeInternal(e){return await this.mondayApi.request(aO,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}}];var LO;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(LO||(LO={}));const zO=(e,t)=>{let a=[];t?.mode===LO.APPS?a=[...Xg]:t?.mode!==LO.API&&t?.mode||(a=[...jO,...FO]);const i=a.map((t=>((e,t)=>e.prototype instanceof eb?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof kg?new e(t.apiToken):new e)(t,e)));return i.filter((e=>{if(!t)return e.type!==an.ALL_API;if(t.mode===LO.API&&"only"===t.enableDynamicApiTools)return e.type===an.ALL_API;let a=!1;return t.mode===LO.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===an.ALL_API),t.readOnlyMode&&(a=a||e.type!==an.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))};class UO{constructor(){this.dynamicTools=new Map}registerTool(e,t){const a=e.enabledByDefault??!0,i=a;this.dynamicTools.set(e.name,{instance:e,mcpTool:t,enabled:i,enabledByDefault:a}),a||t.disable()}enableTool(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabled||(t.mcpTool.enable(),t.enabled=!0),!0)}disableTool(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabled&&(t.mcpTool.disable(),t.enabled=!1),!0)}isToolEnabled(e){const t=this.dynamicTools.get(e);return!!t&&t.enabled}isToolEnabledByDefault(e){const t=this.dynamicTools.get(e);return!t||t.enabledByDefault}getToolsStatus(){const e={};return this.dynamicTools.forEach(((t,a)=>{e[a]=t.enabled})),e}getDynamicToolNames(){return Array.from(this.dynamicTools.keys())}getDetailedToolsStatus(){const e={};return this.dynamicTools.forEach(((t,a)=>{e[a]={enabled:t.enabled,enabledByDefault:t.enabledByDefault}})),e}resetToolToDefault(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabledByDefault&&!t.enabled?(t.mcpTool.enable(),t.enabled=!0,!0):!(!t.enabledByDefault&&t.enabled)||(t.mcpTool.disable(),t.enabled=!1,!0))}getAllDynamicTools(){return this.dynamicTools}clear(){this.dynamicTools.clear()}}const VO=e=>"object"==typeof e?JSON.stringify(e):e;exports.DynamicToolManager=UO,exports.MondayAgentToolkit=class extends Yi{constructor(e){super({name:"monday.com",version:"1.0.0"},{capabilities:{tools:{listChanged:!0}}}),this.dynamicToolManager=new UO,this.toolInstances=[],this.managementTool=null,this.mondayApiClient=this.createApiClient(e),this.mondayApiToken=e.mondayApiToken,this.context={...e.context,apiVersion:e.mondayApiVersion??Ag},this.registerTools(e)}createApiClient(e){return new a.ApiClient({token:e.mondayApiToken,apiVersion:e.mondayApiVersion??Ag,endpoint:e.mondayApiEndpoint,requestConfig:{...e.mondayApiRequestConfig,headers:{...e.mondayApiRequestConfig?.headers||{},"user-agent":"monday-api-mcp"}}})}registerTools(e){try{this.toolInstances=this.initializeTools(e),this.toolInstances.forEach((e=>this.registerSingleTool(e))),!0===e.toolsConfiguration?.enableToolManager&&this.registerManagementTool()}catch(e){throw new Error(`Failed to initialize Monday Agent Toolkit: ${e instanceof Error?e.message:String(e)}`)}}registerManagementTool(){const e=new oO;e.setToolkitManager(this.dynamicToolManager),this.managementTool=e,this.registerSingleTool(this.managementTool)}initializeTools(e){const t={apiClient:this.mondayApiClient,apiToken:this.mondayApiToken,context:this.context};return zO(t,e.toolsConfiguration)}registerSingleTool(t){const a=t.getInputSchema(),i=this.registerTool(t.name,{...t,title:t.annotations?.title,description:t.getDescription(),inputSchema:a,annotations:t.annotations},(async(i,n)=>{try{let n;if(a){const o=e.z.object(a).safeParse(i);if(!o.success)throw new Error(`Invalid arguments: ${o.error.message}`);n=await t.execute(o.data)}else n=await t.execute();return this.formatToolResult(n.content)}catch(e){return this.handleToolError(e,t.name)}}));this.dynamicToolManager.registerTool(t,i)}enableTool(e){return this.dynamicToolManager.enableTool(e)}disableTool(e){return this.dynamicToolManager.disableTool(e)}isToolEnabled(e){return this.dynamicToolManager.isToolEnabled(e)}getToolsStatus(){return this.dynamicToolManager.getToolsStatus()}getDynamicToolNames(){return this.dynamicToolManager.getDynamicToolNames()}getServer(){return this}getTools(e){const t=[...this.toolInstances];return this.managementTool&&t.push(this.managementTool),t.map((t=>({name:t.name,description:t.getDescription(),schema:this.getSchemaForTool(t,e),annotations:t.annotations,handler:this.createToolHandler(t)})))}getToolsForMcp(e){const t=[...this.toolInstances];return this.managementTool&&t.push(this.managementTool),t.map((t=>({name:t.name,description:t.getDescription(),schema:this.getSchemaForTool(t,e),annotations:t.annotations,handler:this.createMcpToolHandler(t)})))}createToolHandler(t){return async a=>{const i=t.getInputSchema();if(i){const n=e.z.object(i).safeParse(a);if(!n.success)throw new Error(`Invalid arguments: ${n.error.message}`);return(await t.execute(n.data)).content}return(await t.execute()).content}}createMcpToolHandler(t){return async(a,i)=>{try{const i=t.getInputSchema();if(i){const n=e.z.object(i).safeParse(a);if(!n.success)throw new Error(`Invalid arguments: ${n.error.message}`);const o=await t.execute(n.data);return{content:[{type:"text",text:VO(o.content)}]}}{const e=await t.execute();return{content:[{type:"text",text:VO(e.content)}]}}}catch(e){return{content:[{type:"text",text:`Error: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}}}getSchemaForTool(a,i){const n=a.getInputSchema();if(n)return"json"===i?.schemaFormat?t.zodToJsonSchema(e.z.object(n)):n}formatToolResult(e){return{content:[{type:"text",text:VO(e)}]}}handleToolError(e,t){return{content:[{type:"text",text:`Failed to execute tool ${t}: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}};
1991
2028
  //# sourceMappingURL=index.js.map