@mondaydotcomorg/agent-toolkit 2.25.0 → 2.26.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.
@@ -738,6 +738,51 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
738
738
  }
739
739
  }
740
740
  `,b_=e.object({id:e.string().describe("The ID of the entity to mention"),type:e.nativeEnum(ob).describe("The type of mention: User, Team, Board, or Project")}),y_=e.array(b_),w_={itemId:e.number().describe("The id of the item to which the update will be added"),body:e.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:e.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 x_={columnId:e.string().describe("The id of the column to be deleted")},__={boardId:e.number().describe("The id of the board to which the new column will be added"),...x_};const T_={itemId:e.number()};const E_={};const I_=dw`
741
+ query getBoardData($boardId: ID!, $itemsLimit: Int!) {
742
+ boards(ids: [$boardId]) {
743
+ id
744
+ name
745
+ items_page(limit: $itemsLimit) {
746
+ items {
747
+ id
748
+ name
749
+ column_values {
750
+ id
751
+ text
752
+ type
753
+ value
754
+ ... on PeopleValue {
755
+ persons_and_teams {
756
+ id
757
+ kind
758
+ }
759
+ }
760
+ }
761
+ updates {
762
+ id
763
+ creator_id
764
+ text_body
765
+ created_at
766
+ }
767
+ }
768
+ }
769
+ columns {
770
+ id
771
+ title
772
+ type
773
+ settings
774
+ }
775
+ }
776
+ }
777
+ `,N_=dw`
778
+ query getUsersByIds($userIds: [ID!]!) {
779
+ users(ids: $userIds) {
780
+ id
781
+ name
782
+ photo_tiny
783
+ }
784
+ }
785
+ `,S_={boardId:e.number().describe("The ID of the board to fetch complete data for")};const A_=dw`
741
786
  query GetBoardAllActivity(
742
787
  $boardId: ID!
743
788
  $fromDate: ISO8601DateTime!
@@ -755,7 +800,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
755
800
  }
756
801
  }
757
802
  }
758
- `,N_={boardId:e.number().describe("The id of the board to get activity for"),fromDate:e.string().optional().describe("Start date for activity range (ISO8601DateTime format). Defaults to 30 days ago"),toDate:e.string().optional().describe("End date for activity range (ISO8601DateTime format). Defaults to now")};const S_=dw`
803
+ `,D_={boardId:e.number().describe("The id of the board to get activity for"),fromDate:e.string().optional().describe("Start date for activity range (ISO8601DateTime format). Defaults to 30 days ago"),toDate:e.string().optional().describe("End date for activity range (ISO8601DateTime format). Defaults to now")};const O_=dw`
759
804
  query GetBoardInfo($boardId: ID!) {
760
805
  boards(ids: [$boardId]) {
761
806
  # Basic Board Metadata
@@ -832,7 +877,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
832
877
  }
833
878
  }
834
879
  }
835
- `,A_=dw`
880
+ `,k_=dw`
836
881
  query GetBoardInfoJustColumns($boardId: ID!) {
837
882
  boards(ids: [$boardId]) {
838
883
  columns {
@@ -845,7 +890,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
845
890
 
846
891
  }
847
892
  }
848
- `,D_=(e,a)=>({board:{...e,subItemColumns:a?.columns??void 0},filteringGuidelines:R_(e.columns.filter(O_))});function O_(e){return!!e&&["id","type"].every((a=>a in e))}const k_={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'},R_=e=>{const a=e.reduce(((e,a)=>k_[a.type]?(e[a.type]||(e[a.type]=[]),e[a.type].push(a.id),e):e),{});return 0===Object.keys(a).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(a).map((([e,a])=>`- Column Type: ${e} (Column IDs: ${a.join(", ")}) - ${k_[e]}`)).join("\n\n")}\n\n## [IMPORTANT] Sub Items Columns MUST NOT BE USED FOR FILTERING.\n `},C_={boardId:e.number().describe("The id of the board to get information for")};const $_=dw`
893
+ `,R_=(e,a)=>({board:{...e,subItemColumns:a?.columns??void 0},filteringGuidelines:L_(e.columns.filter(C_))});function C_(e){return!!e&&["id","type"].every((a=>a in e))}const $_={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'},L_=e=>{const a=e.reduce(((e,a)=>$_[a.type]?(e[a.type]||(e[a.type]=[]),e[a.type].push(a.id),e):e),{});return 0===Object.keys(a).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(a).map((([e,a])=>`- Column Type: ${e} (Column IDs: ${a.join(", ")}) - ${$_[e]}`)).join("\n\n")}\n\n## [IMPORTANT] Sub Items Columns MUST NOT BE USED FOR FILTERING.\n `},F_={boardId:e.number().describe("The id of the board to get information for")};const j_=dw`
849
894
  fragment ItemDataFragment on Item {
850
895
  id
851
896
  name
@@ -874,7 +919,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
874
919
  }
875
920
  }
876
921
  }
877
- `,L_=dw`
922
+ `,P_=dw`
878
923
  query SmartSearchBoardItemIds($searchTerm: String!, $board_ids: [ID!]) {
879
924
  search_items(board_ids: $board_ids, query: $searchTerm, size: 100) {
880
925
  results {
@@ -884,11 +929,11 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
884
929
  }
885
930
  }
886
931
  }
887
- `,F_={boardId:e.number().describe("The id of the board to get items from"),itemIds:e.array(e.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:e.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.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:e.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.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."),includeSubItems:e.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.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."),filtersStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The filters to apply on the items. Send this as a stringified JSON array of "filters" field. Read "filters" field description for details how to use it.'),filters:e.array(e.object({columnId:e.string().describe("The id of the column to filter by"),compareAttribute:e.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:e.union([e.string(),e.number(),e.boolean(),e.array(e.union([e.string(),e.number()]))]).describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:e.nativeEnum(eb).optional().default(eb.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.'),filtersOperator:e.nativeEnum(Zg).optional().default(Zg.And).describe("The operator to use for the filters"),columnIds:e.array(e.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"),orderByStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The order by to apply on the items. Send this as a stringified JSON array of "orderBy" field. Read "orderBy" field description for details how to use it.'),orderBy:e.array(e.object({columnId:e.string().describe("The id of the column to order by"),direction:e.nativeEnum(Xg).optional().default(Xg.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 j_={boardId:e.number().describe("The id of the board to get the schema of")};const P_=dw`
932
+ `,V_={boardId:e.number().describe("The id of the board to get items from"),itemIds:e.array(e.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:e.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.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:e.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.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."),includeSubItems:e.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.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."),filtersStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The filters to apply on the items. Send this as a stringified JSON array of "filters" field. Read "filters" field description for details how to use it.'),filters:e.array(e.object({columnId:e.string().describe("The id of the column to filter by"),compareAttribute:e.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:e.union([e.string(),e.number(),e.boolean(),e.array(e.union([e.string(),e.number()]))]).describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:e.nativeEnum(eb).optional().default(eb.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.'),filtersOperator:e.nativeEnum(Zg).optional().default(Zg.And).describe("The operator to use for the filters"),columnIds:e.array(e.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"),orderByStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The order by to apply on the items. Send this as a stringified JSON array of "orderBy" field. Read "orderBy" field description for details how to use it.'),orderBy:e.array(e.object({columnId:e.string().describe("The id of the column to order by"),direction:e.nativeEnum(Xg).optional().default(Xg.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 U_={boardId:e.number().describe("The id of the board to get the schema of")};const B_=dw`
888
933
  query GetColumnTypeSchema($type: ColumnType!) {
889
934
  get_column_type_schema(type: $type)
890
935
  }
891
- `,V_={columnType:e.nativeEnum(e_).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const U_={random_string:e.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:e.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const B_={typeName:e.string().describe("The name of the GraphQL type to get details for")};function M_(e){return e?"NON_NULL"===e.kind?`${M_(e.ofType)}!`:"LIST"===e.kind?`[${M_(e.ofType)}]`:e.name||"unknown":"unknown"}const q_=dw`
936
+ `,M_={columnType:e.nativeEnum(e_).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const q_={random_string:e.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:e.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const H_={typeName:e.string().describe("The name of the GraphQL type to get details for")};function G_(e){return e?"NON_NULL"===e.kind?`${G_(e.ofType)}!`:"LIST"===e.kind?`[${G_(e.ofType)}]`:e.name||"unknown":"unknown"}const z_=dw`
892
937
  fragment UserDetails on User {
893
938
  # Basic User Information
894
939
  id
@@ -916,31 +961,31 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
916
961
  time_zone_identifier
917
962
  utc_hours_diff
918
963
  }
919
- `,H_=dw`
964
+ `,W_=dw`
920
965
  fragment UserTeamMembership on Team {
921
966
  id
922
967
  name
923
968
  is_guest
924
969
  picture_url
925
970
  }
926
- `,G_=dw`
971
+ `,Y_=dw`
927
972
  fragment TeamBasicInfo on Team {
928
973
  id
929
974
  name
930
975
  }
931
- `,z_=dw`
976
+ `,K_=dw`
932
977
  fragment TeamExtendedInfo on Team {
933
978
  ...TeamBasicInfo
934
979
  is_guest
935
980
  picture_url
936
981
  }
937
- `,W_=dw`
982
+ `,J_=dw`
938
983
  fragment TeamOwner on User {
939
984
  id
940
985
  name
941
986
  email
942
987
  }
943
- `,Y_=dw`
988
+ `,Q_=dw`
944
989
  fragment TeamMember on User {
945
990
  id
946
991
  name
@@ -960,7 +1005,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
960
1005
  time_zone_identifier
961
1006
  utc_hours_diff
962
1007
  }
963
- `,K_=dw`
1008
+ `,X_=dw`
964
1009
  fragment TeamMemberSimplified on User {
965
1010
  id
966
1011
  name
@@ -969,15 +1014,15 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
969
1014
  is_admin
970
1015
  is_guest
971
1016
  }
972
- `,J_=dw`
1017
+ `,Z_=dw`
973
1018
  fragment UserTeamMembershipSimplified on Team {
974
1019
  id
975
1020
  name
976
1021
  is_guest
977
1022
  }
978
- `,Q_=dw`
979
- ${q_}
980
- ${H_}
1023
+ `,eT=dw`
1024
+ ${z_}
1025
+ ${W_}
981
1026
 
982
1027
  query listUsersWithTeams($userIds: [ID!], $limit: Int = 1000) {
983
1028
  users(ids: $userIds, limit: $limit) {
@@ -989,9 +1034,9 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
989
1034
  }
990
1035
  }
991
1036
  }
992
- `,X_=dw`
993
- ${q_}
994
- ${H_}
1037
+ `,aT=dw`
1038
+ ${z_}
1039
+ ${W_}
995
1040
 
996
1041
  query listUsersOnly($userIds: [ID!], $limit: Int = 1000) {
997
1042
  users(ids: $userIds, limit: $limit) {
@@ -1003,13 +1048,13 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1003
1048
  }
1004
1049
  }
1005
1050
  }
1006
- `,Z_=dw`
1007
- ${q_}
1008
- ${J_}
1051
+ `,tT=dw`
1009
1052
  ${z_}
1010
- ${G_}
1011
- ${W_}
1053
+ ${Z_}
1012
1054
  ${K_}
1055
+ ${Y_}
1056
+ ${J_}
1057
+ ${X_}
1013
1058
 
1014
1059
  query listUsersAndTeams($userIds: [ID!], $teamIds: [ID!], $limit: Int = 1000) {
1015
1060
  users(ids: $userIds, limit: $limit) {
@@ -1035,19 +1080,19 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1035
1080
  }
1036
1081
  }
1037
1082
  }
1038
- `,eT=dw`
1039
- ${G_}
1083
+ `,iT=dw`
1084
+ ${Y_}
1040
1085
 
1041
1086
  query listTeamsOnly($teamIds: [ID!]) {
1042
1087
  teams(ids: $teamIds) {
1043
1088
  ...TeamBasicInfo
1044
1089
  }
1045
1090
  }
1046
- `,aT=dw`
1047
- ${z_}
1048
- ${G_}
1049
- ${W_}
1091
+ `,nT=dw`
1092
+ ${K_}
1050
1093
  ${Y_}
1094
+ ${J_}
1095
+ ${Q_}
1051
1096
 
1052
1097
  query listTeamsWithMembers($teamIds: [ID!]) {
1053
1098
  teams(ids: $teamIds) {
@@ -1064,9 +1109,9 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1064
1109
  }
1065
1110
  }
1066
1111
  }
1067
- `,tT=dw`
1068
- ${q_}
1069
- ${H_}
1112
+ `,oT=dw`
1113
+ ${z_}
1114
+ ${W_}
1070
1115
 
1071
1116
  query getUserByName($name: String) {
1072
1117
  users(name: $name) {
@@ -1078,7 +1123,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1078
1123
  }
1079
1124
  }
1080
1125
  }
1081
- `,iT=dw`
1126
+ `,sT=dw`
1082
1127
  query getCurrentUser {
1083
1128
  me {
1084
1129
  id
@@ -1089,7 +1134,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1089
1134
  is_guest
1090
1135
  }
1091
1136
  }
1092
- `;const nT=e=>{const a=[];return"users"in e&&e.users&&e.users.length>0&&(a.push("Users:"),e.users.forEach((e=>{e&&(a.push(` ID: ${e.id}`),a.push(` Name: ${e.name}`),a.push(` Email: ${e.email}`),a.push(` Title: ${e.title||"N/A"}`),a.push(` Enabled: ${e.enabled}`),a.push(` Admin: ${e.is_admin||!1}`),a.push(` Guest: ${e.is_guest||!1}`),a.push(` Pending: ${e.is_pending||!1}`),a.push(` Verified: ${e.is_verified||!1}`),a.push(` View Only: ${e.is_view_only||!1}`),a.push(` Join Date: ${e.join_date||"N/A"}`),a.push(` Last Activity: ${e.last_activity||"N/A"}`),a.push(` Location: ${e.location||"N/A"}`),a.push(` Mobile Phone: ${e.mobile_phone||"N/A"}`),a.push(` Phone: ${e.phone||"N/A"}`),a.push(` Timezone: ${e.time_zone_identifier||"N/A"}`),a.push(` UTC Hours Diff: ${e.utc_hours_diff||"N/A"}`),e.teams&&e.teams.length>0&&(a.push(" Teams:"),e.teams.forEach((e=>{e&&a.push(` - ID: ${e.id}, Name: ${e.name}, Guest Team: ${e.is_guest||!1}`)}))),a.push(""))}))),"teams"in e&&e.teams&&e.teams.length>0&&(a.push("Teams:"),e.teams.forEach((e=>{e&&(a.push(` ID: ${e.id}`),a.push(` Name: ${e.name}`),function(e){return"owners"in e}(e)&&(a.push(` Guest Team: ${e.is_guest||!1}`),a.push(` Picture URL: ${e.picture_url||"N/A"}`),e.owners&&e.owners.length>0&&(a.push(" Owners:"),e.owners.forEach((e=>{a.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}`)}))),e.users&&e.users.length>0&&(a.push(" Members:"),e.users.forEach((e=>{e&&a.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}, Title: ${e.title||"N/A"}, Admin: ${e.is_admin||!1}, Guest: ${e.is_guest||!1}`)})))),a.push(""))}))),0===a.length?"No users or teams found with the specified filters.":a.join("\n").trim()},oT=500,sT=500,rT=1e3,pT={userIds:e.array(e.string()).max(oT).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.array(e.string()).max(sT).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.string().optional().describe("Name-based user search. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n This parameter CONFLICTS with all others."),getMe:e.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.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.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:e.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const dT={itemId:e.number().describe("The id of the item to which the update will be added"),groupId:e.string().describe("The id of the group to which the item will be moved")};const lT={type:e.enum(["ids","object_ids","workspace_ids"]).describe("Query type of ids parameter that is used query by: ids, object_ids, or workspace_ids"),ids:e.array(e.string()).min(1).describe("Array of ID values for this query type (at least 1 required)"),limit:e.number().optional().describe("Number of docs per page (default: 25). Affects pagination - if you get exactly this many results, there may be more pages."),order_by:e.nativeEnum(Ag).optional().describe("The order in which to retrieve your docs. The default shows created_at with the newest docs listed first. This argument will not be applied if you query docs by specific ids."),page:e.number().optional().describe("The page number to return (starts at 1). Use this to paginate through large result sets. Check response for has_more_pages indicator.")};const cT={workspace_id:e.number().describe("The ID of the workspace to get information for")};const mT=dw`
1137
+ `;const rT=e=>{const a=[];return"users"in e&&e.users&&e.users.length>0&&(a.push("Users:"),e.users.forEach((e=>{e&&(a.push(` ID: ${e.id}`),a.push(` Name: ${e.name}`),a.push(` Email: ${e.email}`),a.push(` Title: ${e.title||"N/A"}`),a.push(` Enabled: ${e.enabled}`),a.push(` Admin: ${e.is_admin||!1}`),a.push(` Guest: ${e.is_guest||!1}`),a.push(` Pending: ${e.is_pending||!1}`),a.push(` Verified: ${e.is_verified||!1}`),a.push(` View Only: ${e.is_view_only||!1}`),a.push(` Join Date: ${e.join_date||"N/A"}`),a.push(` Last Activity: ${e.last_activity||"N/A"}`),a.push(` Location: ${e.location||"N/A"}`),a.push(` Mobile Phone: ${e.mobile_phone||"N/A"}`),a.push(` Phone: ${e.phone||"N/A"}`),a.push(` Timezone: ${e.time_zone_identifier||"N/A"}`),a.push(` UTC Hours Diff: ${e.utc_hours_diff||"N/A"}`),e.teams&&e.teams.length>0&&(a.push(" Teams:"),e.teams.forEach((e=>{e&&a.push(` - ID: ${e.id}, Name: ${e.name}, Guest Team: ${e.is_guest||!1}`)}))),a.push(""))}))),"teams"in e&&e.teams&&e.teams.length>0&&(a.push("Teams:"),e.teams.forEach((e=>{e&&(a.push(` ID: ${e.id}`),a.push(` Name: ${e.name}`),function(e){return"owners"in e}(e)&&(a.push(` Guest Team: ${e.is_guest||!1}`),a.push(` Picture URL: ${e.picture_url||"N/A"}`),e.owners&&e.owners.length>0&&(a.push(" Owners:"),e.owners.forEach((e=>{a.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}`)}))),e.users&&e.users.length>0&&(a.push(" Members:"),e.users.forEach((e=>{e&&a.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}, Title: ${e.title||"N/A"}, Admin: ${e.is_admin||!1}, Guest: ${e.is_guest||!1}`)})))),a.push(""))}))),0===a.length?"No users or teams found with the specified filters.":a.join("\n").trim()},pT=500,dT=500,lT=1e3,cT={userIds:e.array(e.string()).max(pT).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.array(e.string()).max(dT).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.string().optional().describe("Name-based user search. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n This parameter CONFLICTS with all others."),getMe:e.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.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.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:e.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const mT={itemId:e.number().describe("The id of the item to which the update will be added"),groupId:e.string().describe("The id of the group to which the item will be moved")};const uT={type:e.enum(["ids","object_ids","workspace_ids"]).describe("Query type of ids parameter that is used query by: ids, object_ids, or workspace_ids"),ids:e.array(e.string()).min(1).describe("Array of ID values for this query type (at least 1 required)"),limit:e.number().optional().describe("Number of docs per page (default: 25). Affects pagination - if you get exactly this many results, there may be more pages."),order_by:e.nativeEnum(Ag).optional().describe("The order in which to retrieve your docs. The default shows created_at with the newest docs listed first. This argument will not be applied if you query docs by specific ids."),page:e.number().optional().describe("The page number to return (starts at 1). Use this to paginate through large result sets. Check response for has_more_pages indicator.")};const fT={workspace_id:e.number().describe("The ID of the workspace to get information for")};const hT=dw`
1093
1138
  query listWorkspaces($limit: Int!, $page: Int!) {
1094
1139
  workspaces(limit: $limit, page: $page) {
1095
1140
  id
@@ -1097,7 +1142,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1097
1142
  description
1098
1143
  }
1099
1144
  }
1100
- `,uT=100,fT=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,""),hT={searchTerm:e.string().optional().describe("The search term to filter the workspaces by. If not provided, all workspaces will be returned. [IMPORANT] Only alphanumeric characters are supported."),limit:e.number().min(1).max(uT).default(uT).describe("The number of workspaces to return. Default and maximum allowed is 100"),page:e.number().min(1).default(1).describe("The page number to return. Default is 1.")};const vT=dw`
1145
+ `,vT=100,gT=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,""),bT={searchTerm:e.string().optional().describe("The search term to filter the workspaces by. If not provided, all workspaces will be returned. [IMPORANT] Only alphanumeric characters are supported."),limit:e.number().min(1).max(vT).default(vT).describe("The number of workspaces to return. Default and maximum allowed is 100"),page:e.number().min(1).default(1).describe("The page number to return. Default is 1.")};const yT=dw`
1101
1146
  query getItemBoard($itemId: ID!) {
1102
1147
  items(ids: [$itemId]) {
1103
1148
  id
@@ -1110,7 +1155,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1110
1155
  }
1111
1156
  }
1112
1157
  }
1113
- `,gT=dw`
1158
+ `,wT=dw`
1114
1159
  mutation createDoc($location: CreateDocInput!) {
1115
1160
  create_doc(location: $location) {
1116
1161
  id
@@ -1118,7 +1163,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1118
1163
  name
1119
1164
  }
1120
1165
  }
1121
- `,bT=dw`
1166
+ `,xT=dw`
1122
1167
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1123
1168
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1124
1169
  success
@@ -1126,11 +1171,11 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1126
1171
  error
1127
1172
  }
1128
1173
  }
1129
- `,yT=dw`
1174
+ `,_T=dw`
1130
1175
  mutation updateDocName($docId: ID!, $name: String!) {
1131
1176
  update_doc_name(docId: $docId, name: $name)
1132
1177
  }
1133
- `,wT=e.enum(["workspace","item"]),xT=e.discriminatedUnion("type",[e.object({type:e.literal(wT.enum.workspace).describe("Create document in workspace"),workspace_id:e.number().describe("Workspace ID under which to create the new document"),doc_kind:e.nativeEnum(ig).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:e.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),e.object({type:e.literal(wT.enum.item).describe("Create document attached to item"),item_id:e.number().describe("Item ID to attach the new document to"),column_id:e.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.")})]),_T={doc_name:e.string().describe("Name for the new document."),markdown:e.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:e.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:e.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:e.nativeEnum(ig).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:e.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:e.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:e.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 TT=dw`
1178
+ `,TT=e.enum(["workspace","item"]),ET=e.discriminatedUnion("type",[e.object({type:e.literal(TT.enum.workspace).describe("Create document in workspace"),workspace_id:e.number().describe("Workspace ID under which to create the new document"),doc_kind:e.nativeEnum(ig).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:e.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),e.object({type:e.literal(TT.enum.item).describe("Create document attached to item"),item_id:e.number().describe("Item ID to attach the new document to"),column_id:e.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.")})]),IT={doc_name:e.string().describe("Name for the new document."),markdown:e.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:e.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:e.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:e.nativeEnum(ig).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:e.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:e.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:e.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 NT=dw`
1134
1179
  mutation CreateDashboard(
1135
1180
  $name: String!
1136
1181
  $workspace_id: ID!
@@ -1152,14 +1197,14 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1152
1197
  board_folder_id
1153
1198
  }
1154
1199
  }
1155
- `,ET=dw`
1200
+ `,ST=dw`
1156
1201
  query GetAllWidgetsSchema {
1157
1202
  all_widgets_schema {
1158
1203
  widget_type
1159
1204
  schema
1160
1205
  }
1161
1206
  }
1162
- `,IT=dw`
1207
+ `,AT=dw`
1163
1208
  mutation CreateWidget($parent: WidgetParentInput!, $kind: ExternalWidget!, $name: String!, $settings: JSON!) {
1164
1209
  create_widget(parent: $parent, kind: $kind, name: $name, settings: $settings) {
1165
1210
  id
@@ -1171,13 +1216,13 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1171
1216
  }
1172
1217
  }
1173
1218
  }
1174
- `,NT={name:e.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:e.string().describe("ID of the workspace that will own the dashboard"),board_ids:e.array(e.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.nativeEnum(xg).default(xg.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:e.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const ST={parent_container_id:e.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:e.nativeEnum(Bb).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:e.nativeEnum(kg).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:e.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.record(e.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."),settingsStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The settings object. Send this as a stringified JSON of "settings" field. Read "settings" field description for details how to use it.')};const AT=dw`
1219
+ `,DT={name:e.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:e.string().describe("ID of the workspace that will own the dashboard"),board_ids:e.array(e.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.nativeEnum(xg).default(xg.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:e.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const OT={parent_container_id:e.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:e.nativeEnum(Bb).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:e.nativeEnum(kg).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:e.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.record(e.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."),settingsStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The settings object. Send this as a stringified JSON of "settings" field. Read "settings" field description for details how to use it.')};const kT=dw`
1175
1220
  mutation updateWorkspace($id: ID!, $attributes: UpdateWorkspaceAttributesInput!) {
1176
1221
  update_workspace(id: $id, attributes: $attributes) {
1177
1222
  id
1178
1223
  }
1179
1224
  }
1180
- `,DT={id:e.string().describe("The ID of the workspace to update"),attributeAccountProductId:e.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:e.string().optional().describe("The description of the workspace to update"),attributeKind:e.nativeEnum(Mb).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:e.string().optional().describe("The name of the workspace to update")};const OT=dw`
1225
+ `,RT={id:e.string().describe("The ID of the workspace to update"),attributeAccountProductId:e.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:e.string().optional().describe("The description of the workspace to update"),attributeKind:e.nativeEnum(Mb).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:e.string().optional().describe("The name of the workspace to update")};const CT=dw`
1181
1226
  mutation updateFolder(
1182
1227
  $folderId: ID!
1183
1228
  $name: String
@@ -1203,7 +1248,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1203
1248
  id
1204
1249
  }
1205
1250
  }
1206
- `,kT={folderId:e.string().describe("The ID of the folder to update"),name:e.string().optional().describe("The new name of the folder"),color:e.nativeEnum(Lg).optional().describe("The new color of the folder"),fontWeight:e.nativeEnum(jg).optional().describe("The new font weight of the folder"),customIcon:e.nativeEnum(Fg).optional().describe("The new custom icon of the folder"),parentFolderId:e.string().optional().describe("The ID of the new parent folder"),workspaceId:e.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:e.string().optional().describe("The account product ID associated with the folder"),position_object_id:e.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.nativeEnum(lb).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.boolean().optional().describe("Whether to position the folder after the object")};const RT=dw`
1251
+ `,$T={folderId:e.string().describe("The ID of the folder to update"),name:e.string().optional().describe("The new name of the folder"),color:e.nativeEnum(Lg).optional().describe("The new color of the folder"),fontWeight:e.nativeEnum(jg).optional().describe("The new font weight of the folder"),customIcon:e.nativeEnum(Fg).optional().describe("The new custom icon of the folder"),parentFolderId:e.string().optional().describe("The ID of the new parent folder"),workspaceId:e.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:e.string().optional().describe("The account product ID associated with the folder"),position_object_id:e.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.nativeEnum(lb).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.boolean().optional().describe("Whether to position the folder after the object")};const LT=dw`
1207
1252
  mutation createWorkspace(
1208
1253
  $name: String!
1209
1254
  $workspaceKind: WorkspaceKind!
@@ -1219,7 +1264,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1219
1264
  id
1220
1265
  }
1221
1266
  }
1222
- `,CT={name:e.string().describe("The name of the new workspace to be created"),workspaceKind:e.nativeEnum(Mb).describe("The kind of workspace to create"),description:e.string().optional().describe("The description of the new workspace"),accountProductId:e.string().optional().describe("The account product ID associated with the workspace")};const $T=dw`
1267
+ `,FT={name:e.string().describe("The name of the new workspace to be created"),workspaceKind:e.nativeEnum(Mb).describe("The kind of workspace to create"),description:e.string().optional().describe("The description of the new workspace"),accountProductId:e.string().optional().describe("The account product ID associated with the workspace")};const jT=dw`
1223
1268
  mutation createFolder(
1224
1269
  $workspaceId: ID!
1225
1270
  $name: String!
@@ -1239,7 +1284,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1239
1284
  id
1240
1285
  }
1241
1286
  }
1242
- `,LT={workspaceId:e.string().describe("The ID of the workspace where the folder will be created"),name:e.string().describe("The name of the folder to be created"),color:e.nativeEnum(Lg).optional().describe("The color of the folder"),fontWeight:e.nativeEnum(jg).optional().describe("The font weight of the folder"),customIcon:e.nativeEnum(Fg).optional().describe("The custom icon of the folder"),parentFolderId:e.string().optional().describe("The ID of the parent folder")};const FT=dw`
1287
+ `,PT={workspaceId:e.string().describe("The ID of the workspace where the folder will be created"),name:e.string().describe("The name of the folder to be created"),color:e.nativeEnum(Lg).optional().describe("The color of the folder"),fontWeight:e.nativeEnum(jg).optional().describe("The font weight of the folder"),customIcon:e.nativeEnum(Fg).optional().describe("The custom icon of the folder"),parentFolderId:e.string().optional().describe("The ID of the parent folder")};const VT=dw`
1243
1288
  mutation updateBoardHierarchy($boardId: ID!, $attributes: UpdateBoardHierarchyAttributesInput!) {
1244
1289
  update_board_hierarchy(board_id: $boardId, attributes: $attributes) {
1245
1290
  success
@@ -1249,7 +1294,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1249
1294
  }
1250
1295
  }
1251
1296
  }
1252
- `,jT=dw`
1297
+ `,UT=dw`
1253
1298
  mutation updateOverviewHierarchy($overviewId: ID!, $attributes: UpdateOverviewHierarchyAttributesInput!) {
1254
1299
  update_overview_hierarchy(overview_id: $overviewId, attributes: $attributes) {
1255
1300
  success
@@ -1259,7 +1304,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1259
1304
  }
1260
1305
  }
1261
1306
  }
1262
- `,PT={objectType:e.nativeEnum(lb).describe("The type of object to move"),id:e.string().describe("The ID of the object to move"),position_object_id:e.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.nativeEnum(lb).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.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:e.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:e.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:e.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const VT=dw`
1307
+ `,BT={objectType:e.nativeEnum(lb).describe("The type of object to move"),id:e.string().describe("The ID of the object to move"),position_object_id:e.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.nativeEnum(lb).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.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:e.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:e.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:e.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const MT=dw`
1263
1308
  query aggregateBoardInsights($query: AggregateQueryInput!) {
1264
1309
  aggregate(query: $query) {
1265
1310
  results {
@@ -1280,7 +1325,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1280
1325
  }
1281
1326
  }
1282
1327
  }
1283
- `,UT=new Set([Mv.Case,Mv.Between,Mv.Left,Mv.Raw,Mv.None,Mv.CountKeys]),BT=Object.values(Mv).filter((e=>!UT.has(e))),MT=new Set([Mv.Left,Mv.Trim,Mv.Upper,Mv.Lower,Mv.DateTruncDay,Mv.DateTruncWeek,Mv.DateTruncMonth,Mv.DateTruncQuarter,Mv.DateTruncYear,Mv.Color,Mv.Label,Mv.EndDate,Mv.StartDate,Mv.Hour,Mv.PhoneCountryShortName,Mv.Person,Mv.Upper,Mv.Lower,Mv.Order,Mv.Length,Mv.Flatten,Mv.IsDone]);function qT(e){return{column_id:e}}new Set([Mv.Count,Mv.CountDistinct,Mv.CountSubitems,Mv.CountItems,Mv.First,Mv.Sum,Mv.Average,Mv.Median,Mv.Min,Mv.Max,Mv.MinMax]);const HT={boardId:e.number().describe("The id of the board to get insights for"),aggregationsStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The aggregations to get. Send this as a stringified JSON array of "aggregations" field. Read "aggregations" field description for details how to use it.'),aggregations:e.array(e.object({function:e.enum(BT).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:e.string().describe("The id of the column to aggregate")})).describe("The aggregations to get. Transformative functions and plain columns (no function) must be in group by. [REQUIRED PRECONDITION]: Either send this field or the stringified version of it.").optional(),groupBy:e.array(e.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.number().describe("The limit of the results").max(1e3).optional().default(1e3),filtersStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The filters to apply on the items. Send this as a stringified JSON array of "filters" field. Read "filters" field description for details how to use it.'),filters:e.array(e.object({columnId:e.string().describe("The id of the column to filter by"),compareAttribute:e.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:e.any().describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:e.nativeEnum(eb).optional().default(eb.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.'),filtersOperator:e.nativeEnum(Zg).optional().default(Zg.And).describe("The logical operator to use for the filters"),orderByStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The order by to apply on the items. Send this as a stringified JSON array of "orderBy" field. Read "orderBy" field description for details how to use it.'),orderBy:e.array(e.object({columnId:e.string().describe("The id of the column to order by"),direction:e.nativeEnum(Xg).optional().default(Xg.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 GT=dw`
1328
+ `,qT=new Set([Mv.Case,Mv.Between,Mv.Left,Mv.Raw,Mv.None,Mv.CountKeys]),HT=Object.values(Mv).filter((e=>!qT.has(e))),GT=new Set([Mv.Left,Mv.Trim,Mv.Upper,Mv.Lower,Mv.DateTruncDay,Mv.DateTruncWeek,Mv.DateTruncMonth,Mv.DateTruncQuarter,Mv.DateTruncYear,Mv.Color,Mv.Label,Mv.EndDate,Mv.StartDate,Mv.Hour,Mv.PhoneCountryShortName,Mv.Person,Mv.Upper,Mv.Lower,Mv.Order,Mv.Length,Mv.Flatten,Mv.IsDone]);function zT(e){return{column_id:e}}new Set([Mv.Count,Mv.CountDistinct,Mv.CountSubitems,Mv.CountItems,Mv.First,Mv.Sum,Mv.Average,Mv.Median,Mv.Min,Mv.Max,Mv.MinMax]);const WT={boardId:e.number().describe("The id of the board to get insights for"),aggregationsStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The aggregations to get. Send this as a stringified JSON array of "aggregations" field. Read "aggregations" field description for details how to use it.'),aggregations:e.array(e.object({function:e.enum(HT).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:e.string().describe("The id of the column to aggregate")})).describe("The aggregations to get. Transformative functions and plain columns (no function) must be in group by. [REQUIRED PRECONDITION]: Either send this field or the stringified version of it.").optional(),groupBy:e.array(e.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.number().describe("The limit of the results").max(1e3).optional().default(1e3),filtersStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The filters to apply on the items. Send this as a stringified JSON array of "filters" field. Read "filters" field description for details how to use it.'),filters:e.array(e.object({columnId:e.string().describe("The id of the column to filter by"),compareAttribute:e.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:e.any().describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:e.nativeEnum(eb).optional().default(eb.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.'),filtersOperator:e.nativeEnum(Zg).optional().default(Zg.And).describe("The logical operator to use for the filters"),orderByStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The order by to apply on the items. Send this as a stringified JSON array of "orderBy" field. Read "orderBy" field description for details how to use it.'),orderBy:e.array(e.object({columnId:e.string().describe("The id of the column to order by"),direction:e.nativeEnum(Xg).optional().default(Xg.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 YT=dw`
1284
1329
  query GetBoards($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1285
1330
  boards(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1286
1331
  id
@@ -1288,7 +1333,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1288
1333
  url
1289
1334
  }
1290
1335
  }
1291
- `,zT=dw`
1336
+ `,KT=dw`
1292
1337
  query GetDocs($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1293
1338
  docs(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1294
1339
  id
@@ -1296,14 +1341,14 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1296
1341
  url
1297
1342
  }
1298
1343
  }
1299
- `,WT=dw`
1344
+ `,JT=dw`
1300
1345
  query GetFolders($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1301
1346
  folders(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1302
1347
  id
1303
1348
  name
1304
1349
  }
1305
1350
  }
1306
- `;var YT,KT;!function(e){e.BOARD="board-",e.DOCUMENT="doc-",e.FOLDER="folder-"}(YT||(YT={})),function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS"}(KT||(KT={}));const JT=100,QT={searchTerm:e.string().optional().describe("The search term to use for the search."),searchType:e.nativeEnum(KT).describe("The type of search to perform."),limit:e.number().max(JT).optional().default(JT).describe("The number of items to get. The max and default value is 100."),page:e.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:e.array(e.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.")};e.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'),e.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const XT=dw`
1351
+ `;var QT,XT;!function(e){e.BOARD="board-",e.DOCUMENT="doc-",e.FOLDER="folder-"}(QT||(QT={})),function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS"}(XT||(XT={}));const ZT=100,eE={searchTerm:e.string().optional().describe("The search term to use for the search."),searchType:e.nativeEnum(XT).describe("The type of search to perform."),limit:e.number().max(ZT).optional().default(ZT).describe("The number of items to get. The max and default value is 100."),page:e.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:e.array(e.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.")};e.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'),e.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const aE=dw`
1307
1352
  query getSprintsByIds($ids: [ID!]) {
1308
1353
  items(ids: $ids) {
1309
1354
  id
@@ -1338,7 +1383,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1338
1383
  }
1339
1384
  }
1340
1385
  }
1341
- `,ZT={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"},eE={...ZT,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},aE="BOARD_NOT_FOUND:",tE="SPRINT_NOT_FOUND:",iE="DOCUMENT_NOT_FOUND:",nE="DOCUMENT_INVALID:",oE="DOCUMENT_EMPTY:",sE="EXPORT_FAILED:",rE="INTERNAL_ERROR:",pE="VALIDATION_ERROR:",dE="task_sprint",lE={[eE.SPRINT_TASKS]:"Sprint Tasks",[eE.SPRINT_TIMELINE]:"Sprint Timeline",[eE.SPRINT_COMPLETION]:"Sprint Completion",[eE.SPRINT_START_DATE]:"Sprint Start Date",[eE.SPRINT_END_DATE]:"Sprint End Date",[eE.SPRINT_ACTIVATION]:"Sprint Activation",[eE.SPRINT_SUMMARY]:"Sprint Summary",[eE.SPRINT_CAPACITY]:"Sprint Capacity"},cE=xb,mE={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},uE=(e,a)=>e.column_values?.find((e=>e.id===a)),fE=(e,a)=>{const t=uE(e,a);return"CheckboxValue"===t?.__typename?t.checked??!1:null},hE=(e,a)=>{const t=uE(e,a);return"DateValue"===t?.__typename?t.date??null:null},vE=(e,a)=>{const t=uE(e,a);return"DocValue"===t?.__typename&&t.file?.doc?.object_id?t.file.doc.object_id:null},gE=(e,a)=>{const t=a.filter((a=>!e.has(a)));return{isValid:0===t.length,missingColumns:t}},bE=(e,a)=>{if(!e.columns)return!1;const t=new Set(e.columns.filter((e=>null!==e)).map((e=>e.id)));return a.every((e=>t.has(e)))},yE=e=>bE(e,Object.values(ZT)),wE=e=>bE(e,Object.values(mE)),xE=e=>{if(!e?.settings)return null;const a=e.settings;return a.boardIds&&Array.isArray(a.boardIds)&&a.boardIds[0]?.toString()||a.boardId?.toString()||null},_E=(e,a)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===a&&e.type===e_.BoardRelation))||null,TE={sprintId:e.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const EE=dw`
1386
+ `,tE={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"},iE={...tE,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},nE="BOARD_NOT_FOUND:",oE="SPRINT_NOT_FOUND:",sE="DOCUMENT_NOT_FOUND:",rE="DOCUMENT_INVALID:",pE="DOCUMENT_EMPTY:",dE="EXPORT_FAILED:",lE="INTERNAL_ERROR:",cE="VALIDATION_ERROR:",mE="task_sprint",uE={[iE.SPRINT_TASKS]:"Sprint Tasks",[iE.SPRINT_TIMELINE]:"Sprint Timeline",[iE.SPRINT_COMPLETION]:"Sprint Completion",[iE.SPRINT_START_DATE]:"Sprint Start Date",[iE.SPRINT_END_DATE]:"Sprint End Date",[iE.SPRINT_ACTIVATION]:"Sprint Activation",[iE.SPRINT_SUMMARY]:"Sprint Summary",[iE.SPRINT_CAPACITY]:"Sprint Capacity"},fE=xb,hE={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},vE=(e,a)=>e.column_values?.find((e=>e.id===a)),gE=(e,a)=>{const t=vE(e,a);return"CheckboxValue"===t?.__typename?t.checked??!1:null},bE=(e,a)=>{const t=vE(e,a);return"DateValue"===t?.__typename?t.date??null:null},yE=(e,a)=>{const t=vE(e,a);return"DocValue"===t?.__typename&&t.file?.doc?.object_id?t.file.doc.object_id:null},wE=(e,a)=>{const t=a.filter((a=>!e.has(a)));return{isValid:0===t.length,missingColumns:t}},xE=(e,a)=>{if(!e.columns)return!1;const t=new Set(e.columns.filter((e=>null!==e)).map((e=>e.id)));return a.every((e=>t.has(e)))},_E=e=>xE(e,Object.values(tE)),TE=e=>xE(e,Object.values(hE)),EE=e=>{if(!e?.settings)return null;const a=e.settings;return a.boardIds&&Array.isArray(a.boardIds)&&a.boardIds[0]?.toString()||a.boardId?.toString()||null},IE=(e,a)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===a&&e.type===e_.BoardRelation))||null,NE={sprintId:e.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const SE=dw`
1342
1387
  query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
1343
1388
  boards(ids: [$boardId]) {
1344
1389
  items_page(limit: $limit) {
@@ -1374,7 +1419,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1374
1419
  }
1375
1420
  }
1376
1421
  }
1377
- `,IE={sprintsBoardId:e.number().describe("The ID of the monday-dev board containing the sprints"),limit:e.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const NE=dw`
1422
+ `,AE={sprintsBoardId:e.number().describe("The ID of the monday-dev board containing the sprints"),limit:e.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const DE=dw`
1378
1423
  query GetRecentBoards($limit: Int) {
1379
1424
  boards(limit: $limit, order_by: used_at, state: active) {
1380
1425
  id
@@ -1390,7 +1435,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1390
1435
  }
1391
1436
  }
1392
1437
  }
1393
- `,SE={};const AE=[class extends $m{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=g.READ,this.annotations=Cm({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 SE}async executeInternal(e){try{const e={limit:100},a=((await this.mondayApi.request(NE,e)).boards||[]).filter((e=>null!==e));if(0===a.length)return{content:`${aE} No boards found in your account. Please verify you have access to monday.com boards.`};const t=this.extractBoardPairs(a);if(0===t.length)return{content:this.generateNotFoundMessage(a.length)};return{content:this.generateReport(t)}}catch(e){return{content:`${rE} 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,a){return`### Pair ${a+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 a=e.length>1?this.generateMultiplePairsWarning(e.length):"",t=e.map(((e,a)=>this.generatePairDetails(e,a))).join(""),i=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${a}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${t}${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,a,t){return{id:e,name:a?.name||t,workspaceId:a?.workspace?.id||"unknown",workspaceName:a?.workspace?.name||"Unknown"}}processSprintsBoard(e,a,t){const i=_E(e,ZT.SPRINT_TASKS);if(!i)return;const n=xE(i);if(!n)return;const o=`${e.id}:${n}`;if(t.has(o))return;const s=a.get(n);t.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,s,`Tasks Board ${n}`)})}processTasksBoard(e,a,t){const i=_E(e,dE);if(!i)return;const n=xE(i);if(!n)return;const o=`${n}:${e.id}`;if(t.has(o))return;const s=a.get(n);t.set(o,{sprintsBoard:this.createBoardInfo(n,s,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const a=new Map,t=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(yE(i)&&this.processSprintsBoard(i,t,a),wE(i)&&this.processTasksBoard(i,t,a));return Array.from(a.values())}},class extends $m{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=g.READ,this.annotations=Cm({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 IE}async executeInternal(e){try{const a=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!a.success)return{content:a.error||"Board schema validation failed"};const t={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(EE,t),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${rE} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const a={boardId:e.toString()},t=await this.mondayApi.request(mw,a),i=t.boards?.[0];if(!i)return{success:!1,error:`${aE} 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:`${pE} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${rE} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const a=new Set(e.filter((e=>null!==e)).map((e=>e.id))),t=Object.values(ZT),i=gE(a,t);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((a=>{const t=(e=>lE[e]||e)(a);e+=`- ${t}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let a="# Sprints Metadata Report\n\n";return a+=`**Total Sprints:** ${e.length}\n\n`,a+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",a+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const t=e.name||"Unknown",i=e.id,n=fE(e,eE.SPRINT_ACTIVATION),o=fE(e,eE.SPRINT_COMPLETION),s=hE(e,eE.SPRINT_START_DATE),r=hE(e,eE.SPRINT_END_DATE),p=((e,a)=>{const t=uE(e,a);if("TimelineValue"===t?.__typename&&t.from&&t.to)return{from:t.from.split("T")[0],to:t.to.split("T")[0]};return null})(e,eE.SPRINT_TIMELINE),d=vE(e,eE.SPRINT_SUMMARY);let l=cE.Planned;o?l=cE.Completed:(n||s)&&(l=cE.Active);const c=p?`${p.from} to ${p.to}`:"Not set";a+=`| ${t} | ${i} | ${l} | ${c} | ${s||"Not started"} | ${r||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),a+="\n## Status Definitions:\n",a+=`- **${cE.Planned}**: Sprint not yet started (no activation, no start date)\n`,a+=`- **${cE.Active}**: Sprint is active (activated but not completed)\n`,a+=`- **${cE.Completed}**: Sprint is finished\n\n`,a}},class extends $m{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=g.READ,this.annotations=Cm({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 TE}async executeInternal(e){try{const a=await this.getSprintMetadata(e.sprintId);if(!a.success)return{content:a.error||`${rE} Unknown error occurred while getting sprint metadata`};const t=await this.readSprintSummaryDocument(a.documentObjectId);return t.success?{content:t.content}:{content:t.error||`${rE} Unknown error occurred while reading document content`}}catch(e){return{content:`${rE} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const a={ids:[String(e)]},t=(await this.mondayApi.request(XT,a)).items||[];if(0===t.length)return{success:!1,error:`${tE} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=t[0];if(!i)return{success:!1,error:`${tE} Sprint with ID ${e} not found.`};const n=((e,a=[])=>{const t=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(ZT),...a];return gE(t,i)})(i,[eE.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${pE} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=vE(i,eE.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${iE} 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:`${rE} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const a={object_ids:[e],limit:1},t=(await this.mondayApi.request(Tw,a)).docs||[];if(0===t.length)return{success:!1,error:`${iE} Document with object ID ${e} not found or not accessible.`};const i=t[0];if(!i||!i.id)return{success:!1,error:`${nE} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(Ew,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${sE} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const s=o.export_markdown_from_doc.markdown;return s?{success:!0,content:s}:{success:!1,error:`${oE} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${rE} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],DE=[class extends $m{constructor(){super(...arguments),this.name="delete_item",this.type=g.WRITE,this.annotations=Cm({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return T_}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(lw,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends $m{constructor(){super(...arguments),this.name="get_board_items_page",this.type=g.READ,this.annotations=Cm({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. 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.[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."}getInputSchema(){return F_}async executeInternal(e){const a=!e.cursor;if(a&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch{Ax(e,"filters",F_.filters),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const t={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems};Ax(e,"filters",F_.filters),Ax(e,"orderBy",F_.orderBy),a&&(e.itemIds||e.filters||e.orderBy)&&(t.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($_,t),n=this.mapResult(i,e);return{content:JSON.stringify(n,null,2)}}rebuildFiltersWithManualSearch(e,a){return(a=(a=a??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:eb.ContainsText,compareValue:e}),a}mapResult(e,a){const t=e.boards?.[0],i=t?.items_page,n=i?.items||[];return{board:{id:t?.id,name:t?.name},items:n.map((e=>this.mapItem(e,a))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,a){const t={id:e.id,name:e.name,created_at:e.created_at,updated_at:e.updated_at};if(a.includeColumns&&e.column_values){t.column_values={};for(const a of e.column_values)t.column_values[a.id]=this.getColumnValueData(a)}return a.includeSubItems&&"subitems"in e&&e.subitems&&(t.subitems=e.subitems.slice(0,a.subItemLimit).map((e=>this.mapItem(e,a)))),t}getColumnValueData(e){if(!e.value)return e.text||null;try{return JSON.parse(e.value)}catch{return e.value}}async getItemIdsFromSmartSearchAsync(e){const a={board_ids:[e.boardId.toString()],searchTerm:e.searchTerm},t=await this.mondayApi.request(L_,a),i=t.search_items?.results?.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 $m{constructor(){super(...arguments),this.name="create_item",this.type=g.WRITE,this.annotations=Cm({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?f_:h_}async executeInternal(e){const a=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,a):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,a)}async duplicateAndUpdateItem(e,a){try{const t={boardId:a.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(r_,t);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},s=new Ow(this.mondayApi,this.apiToken,{boardId:a}),r=await s.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)});if(r.content.includes("Error"))throw new Error("Failed to update duplicated item: "+r.content);return{content:`Item ${i.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){u_(e,"duplicate item")}}async createSubitem(e){const a={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const t=await this.mondayApi.request(p_,a);if(!t.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:`Subitem ${t.create_subitem.id} successfully created under parent item ${e.parentItemId}`}}catch(e){u_(e,"create subitem")}}async createNewItem(e,a){try{const t={boardId:a.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(cw,t);return{content:`Item ${i.create_item?.id} successfully created`}}catch(e){u_(e,"create item")}}},class extends $m{constructor(){super(...arguments),this.name="create_update",this.type=g.WRITE,this.annotations=Cm({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."}getInputSchema(){return w_}async executeInternal(e){let a;if(e.mentionsList)try{const t=JSON.parse(e.mentionsList),i=y_.safeParse(t);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);a=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},i=await this.mondayApi.request(g_,t);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}`}}catch(e){u_(e,"create update")}}},class extends $m{constructor(){super(...arguments),this.name="get_board_schema",this.type=g.READ,this.annotations=Cm({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 j_}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},i=await this.mondayApi.request(mw,t);return{content:`The current schema of the board ${a} 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 $m{constructor(){super(...arguments),this.name="get_board_activity",this.type=g.READ,this.annotations=Cm({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 N_}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-m_.MONTH30Days),i=e?.fromDate||t.toISOString(),n=e?.toDate||a.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1},s=await this.mondayApi.request(I_,o),r=s.boards?.[0]?.activity_logs;if(!r||0===r.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=r.filter((e=>null!=e)).map((e=>`• ${e.created_at}: ${e.event} on ${e.entity} by user ${e.user_id}${e.data?` - Data: ${e.data}`:""}`)).join("\n");return{content:`Activity logs for board ${e.boardId} from ${i} to ${n} (${r.length} entries):\n\n${p}`}}},class extends $m{constructor(){super(...arguments),this.name="get_board_info",this.type=g.READ,this.annotations=Cm({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return C_}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(S_,a),i=t.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:JSON.stringify(D_(i,n),null,2)}}async getSubItemsBoardAsync(e){const a=e.columns?.find((e=>e?.type===e_.Subtasks));if(!a)return null;const t=a.settings.boardIds[0],i=await this.mondayApi.request(A_,{boardId:t});return i.boards?.[0]??null}},class extends $m{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=g.READ,this.annotations=Cm({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\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 \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."}getInputSchema(){return pT}async executeInternal(e){const a=e.userIds&&e.userIds.length>0,t=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,s=!!e.name;if(e.getMe||!1){if(a||t||i||n||o||s)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(iT);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const r={users:[e.me]};return{content:nT(r)}}if(s){if(a||t||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const s={name:e.name},r=await this.mondayApi.request(tT,s);if(!r.users||0===r.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=r.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n");return{content:`Found ${r.users.length} user(s) matching "${e.name}":\n\n${p}`}}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(a&&e.userIds&&e.userIds.length>oT)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(t&&e.teamIds&&e.teamIds.length>sT)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let r;if(n||!a&&t&&!i)if(o){const a={teamIds:e.teamIds};r=await this.mondayApi.request(aT,a)}else{const a={teamIds:e.teamIds};r=await this.mondayApi.request(eT,a)}else if(i){const a={userIds:e.userIds,teamIds:e.teamIds,limit:rT};r=await this.mondayApi.request(Z_,a)}else if(a){const a={userIds:e.userIds,limit:rT};r=await this.mondayApi.request(Q_,a)}else{const e={userIds:void 0,limit:rT};r=await this.mondayApi.request(X_,e)}return{content:nT(r)}}},Ow,class extends $m{constructor(){super(...arguments),this.name="move_item_to_group",this.type=g.WRITE,this.annotations=Cm({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 dT}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(fw,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends $m{constructor(){super(...arguments),this.name="create_board",this.type=g.WRITE,this.annotations=Cm({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return kw}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(hw,a);return{content:`Board ${t.create_board?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_form",this.type=g.WRITE,this.annotations=Cm({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 px}async executeInternal(e){const a={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},t=await this.mondayApi.request(Uw,a);return{content:`Form created successfully. Board ID: ${t.create_form?.boardId}, Token: ${t.create_form?.token}`}}},class extends $m{constructor(){super(...arguments),this.name="update_form",this.type=g.WRITE,this.annotations=Cm({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Xx(this.mondayApi),this.actionHandlers=new Map([[Dx.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Dx.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Dx.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Dx.activate,this.helpers.activateForm.bind(this.helpers)],[Dx.createTag,this.helpers.createTag.bind(this.helpers)],[Dx.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Dx.updateTag,this.helpers.updateTag.bind(this.helpers)],[Dx.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Dx.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Dx.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Dx.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Dx.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 Qx}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(Ax(e,"tag",Qx.tag),Ax(e,"form",Qx.form),await a(e)):{content:"Received an invalid action for the update form tool."}}},class extends $m{constructor(){super(...arguments),this.name="get_form",this.type=g.READ,this.annotations=Cm({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 Zx}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(Bw,a);return t.form?{content:`The form with the token ${e.formToken} is: ${JSON.stringify(t.form,null,2)}`}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends $m{constructor(){super(...arguments),this.name="form_questions_editor",this.type=g.WRITE,this.annotations=Cm({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Sx(this.mondayApi),this.actionHandlers=new Map([[Ex.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Ex.Update,this.helpers.updateQuestion.bind(this.helpers)],[Ex.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Nx}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(Ax(e,"question",Nx.question),await a(e)):{content:`Unknown action: ${e.action}`}}},class extends $m{constructor(){super(...arguments),this.name="create_column",this.type=g.WRITE,this.annotations=Cm({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?a_:t_}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a?.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(vw,t);return{content:`Column ${i.create_column?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_group",this.type=g.WRITE,this.annotations=Cm({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 s_}async executeInternal(e){const a={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},t=await this.mondayApi.request(n_,a);return{content:`Group "${t.create_group?.title}" (ID: ${t.create_group?.id}) successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="delete_column",this.type=g.WRITE,this.annotations=Cm({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?x_:__}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},t=await this.mondayApi.request(gw,a);return{content:`Column ${t.delete_column?.id} successfully deleted`}}},Sw,class extends $m{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=g.ALL_API,this.annotations=Cm({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 U_}async executeInternal(e){try{const a=await this.mondayApi.request(bw),t=e?.operationType,i=a.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=a.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=a.__schema,s=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let r="## GraphQL Schema\n";return t&&"read"!==t||(r+=`- Query Type: ${a.__schema?.queryType?.name}\n\n`,r+=`## Query Fields\n${i}\n\n`),t&&"write"!==t||(r+=`- Mutation Type: ${a.__schema?.mutationType?.name}\n\n`,r+=`## Mutation Fields\n${n}\n\n`),r+=`## Available Types\n${s}\n\n`,r+='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:r}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends $m{constructor(){super(...arguments),this.name="get_column_type_info",this.type=g.READ,this.annotations=Cm({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 V_}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(P_,a);if(!t?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:t.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(i,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="get_type_details",this.type=g.ALL_API,this.annotations=Cm({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 B_}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const t=(a=e.typeName,dw`
1438
+ `,OE={};const kE=[class extends $m{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=g.READ,this.annotations=Cm({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 OE}async executeInternal(e){try{const e={limit:100},a=((await this.mondayApi.request(DE,e)).boards||[]).filter((e=>null!==e));if(0===a.length)return{content:`${nE} No boards found in your account. Please verify you have access to monday.com boards.`};const t=this.extractBoardPairs(a);if(0===t.length)return{content:this.generateNotFoundMessage(a.length)};return{content:this.generateReport(t)}}catch(e){return{content:`${lE} 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,a){return`### Pair ${a+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 a=e.length>1?this.generateMultiplePairsWarning(e.length):"",t=e.map(((e,a)=>this.generatePairDetails(e,a))).join(""),i=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${a}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${t}${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,a,t){return{id:e,name:a?.name||t,workspaceId:a?.workspace?.id||"unknown",workspaceName:a?.workspace?.name||"Unknown"}}processSprintsBoard(e,a,t){const i=IE(e,tE.SPRINT_TASKS);if(!i)return;const n=EE(i);if(!n)return;const o=`${e.id}:${n}`;if(t.has(o))return;const s=a.get(n);t.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,s,`Tasks Board ${n}`)})}processTasksBoard(e,a,t){const i=IE(e,mE);if(!i)return;const n=EE(i);if(!n)return;const o=`${n}:${e.id}`;if(t.has(o))return;const s=a.get(n);t.set(o,{sprintsBoard:this.createBoardInfo(n,s,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const a=new Map,t=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(_E(i)&&this.processSprintsBoard(i,t,a),TE(i)&&this.processTasksBoard(i,t,a));return Array.from(a.values())}},class extends $m{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=g.READ,this.annotations=Cm({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 AE}async executeInternal(e){try{const a=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!a.success)return{content:a.error||"Board schema validation failed"};const t={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(SE,t),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${lE} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const a={boardId:e.toString()},t=await this.mondayApi.request(mw,a),i=t.boards?.[0];if(!i)return{success:!1,error:`${nE} 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:`${cE} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${lE} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const a=new Set(e.filter((e=>null!==e)).map((e=>e.id))),t=Object.values(tE),i=wE(a,t);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((a=>{const t=(e=>uE[e]||e)(a);e+=`- ${t}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let a="# Sprints Metadata Report\n\n";return a+=`**Total Sprints:** ${e.length}\n\n`,a+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",a+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const t=e.name||"Unknown",i=e.id,n=gE(e,iE.SPRINT_ACTIVATION),o=gE(e,iE.SPRINT_COMPLETION),s=bE(e,iE.SPRINT_START_DATE),r=bE(e,iE.SPRINT_END_DATE),p=((e,a)=>{const t=vE(e,a);if("TimelineValue"===t?.__typename&&t.from&&t.to)return{from:t.from.split("T")[0],to:t.to.split("T")[0]};return null})(e,iE.SPRINT_TIMELINE),d=yE(e,iE.SPRINT_SUMMARY);let l=fE.Planned;o?l=fE.Completed:(n||s)&&(l=fE.Active);const c=p?`${p.from} to ${p.to}`:"Not set";a+=`| ${t} | ${i} | ${l} | ${c} | ${s||"Not started"} | ${r||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),a+="\n## Status Definitions:\n",a+=`- **${fE.Planned}**: Sprint not yet started (no activation, no start date)\n`,a+=`- **${fE.Active}**: Sprint is active (activated but not completed)\n`,a+=`- **${fE.Completed}**: Sprint is finished\n\n`,a}},class extends $m{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=g.READ,this.annotations=Cm({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 NE}async executeInternal(e){try{const a=await this.getSprintMetadata(e.sprintId);if(!a.success)return{content:a.error||`${lE} Unknown error occurred while getting sprint metadata`};const t=await this.readSprintSummaryDocument(a.documentObjectId);return t.success?{content:t.content}:{content:t.error||`${lE} Unknown error occurred while reading document content`}}catch(e){return{content:`${lE} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const a={ids:[String(e)]},t=(await this.mondayApi.request(aE,a)).items||[];if(0===t.length)return{success:!1,error:`${oE} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=t[0];if(!i)return{success:!1,error:`${oE} Sprint with ID ${e} not found.`};const n=((e,a=[])=>{const t=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(tE),...a];return wE(t,i)})(i,[iE.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${cE} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=yE(i,iE.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${sE} 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:`${lE} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const a={object_ids:[e],limit:1},t=(await this.mondayApi.request(Tw,a)).docs||[];if(0===t.length)return{success:!1,error:`${sE} Document with object ID ${e} not found or not accessible.`};const i=t[0];if(!i||!i.id)return{success:!1,error:`${rE} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(Ew,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${dE} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const s=o.export_markdown_from_doc.markdown;return s?{success:!0,content:s}:{success:!1,error:`${pE} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${lE} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],RE=[class extends $m{constructor(){super(...arguments),this.name="delete_item",this.type=g.WRITE,this.annotations=Cm({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return T_}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(lw,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends $m{constructor(){super(...arguments),this.name="get_board_items_page",this.type=g.READ,this.annotations=Cm({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. 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.[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."}getInputSchema(){return V_}async executeInternal(e){const a=!e.cursor;if(a&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch{Ax(e,"filters",V_.filters),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const t={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems};Ax(e,"filters",V_.filters),Ax(e,"orderBy",V_.orderBy),a&&(e.itemIds||e.filters||e.orderBy)&&(t.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(j_,t),n=this.mapResult(i,e);return{content:JSON.stringify(n,null,2)}}rebuildFiltersWithManualSearch(e,a){return(a=(a=a??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:eb.ContainsText,compareValue:e}),a}mapResult(e,a){const t=e.boards?.[0],i=t?.items_page,n=i?.items||[];return{board:{id:t?.id,name:t?.name},items:n.map((e=>this.mapItem(e,a))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,a){const t={id:e.id,name:e.name,created_at:e.created_at,updated_at:e.updated_at};if(a.includeColumns&&e.column_values){t.column_values={};for(const a of e.column_values)t.column_values[a.id]=this.getColumnValueData(a)}return a.includeSubItems&&"subitems"in e&&e.subitems&&(t.subitems=e.subitems.slice(0,a.subItemLimit).map((e=>this.mapItem(e,a)))),t}getColumnValueData(e){if(!e.value)return e.text||null;try{return JSON.parse(e.value)}catch{return e.value}}async getItemIdsFromSmartSearchAsync(e){const a={board_ids:[e.boardId.toString()],searchTerm:e.searchTerm},t=await this.mondayApi.request(P_,a),i=t.search_items?.results?.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 $m{constructor(){super(...arguments),this.name="create_item",this.type=g.WRITE,this.annotations=Cm({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?f_:h_}async executeInternal(e){const a=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,a):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,a)}async duplicateAndUpdateItem(e,a){try{const t={boardId:a.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(r_,t);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},s=new Ow(this.mondayApi,this.apiToken,{boardId:a}),r=await s.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)});if(r.content.includes("Error"))throw new Error("Failed to update duplicated item: "+r.content);return{content:`Item ${i.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){u_(e,"duplicate item")}}async createSubitem(e){const a={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const t=await this.mondayApi.request(p_,a);if(!t.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:`Subitem ${t.create_subitem.id} successfully created under parent item ${e.parentItemId}`}}catch(e){u_(e,"create subitem")}}async createNewItem(e,a){try{const t={boardId:a.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(cw,t);return{content:`Item ${i.create_item?.id} successfully created`}}catch(e){u_(e,"create item")}}},class extends $m{constructor(){super(...arguments),this.name="create_update",this.type=g.WRITE,this.annotations=Cm({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."}getInputSchema(){return w_}async executeInternal(e){let a;if(e.mentionsList)try{const t=JSON.parse(e.mentionsList),i=y_.safeParse(t);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);a=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},i=await this.mondayApi.request(g_,t);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}`}}catch(e){u_(e,"create update")}}},class extends $m{constructor(){super(...arguments),this.name="get_board_schema",this.type=g.READ,this.annotations=Cm({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 U_}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},i=await this.mondayApi.request(mw,t);return{content:`The current schema of the board ${a} 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 $m{constructor(){super(...arguments),this.name="get_board_activity",this.type=g.READ,this.annotations=Cm({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 D_}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-m_.MONTH30Days),i=e?.fromDate||t.toISOString(),n=e?.toDate||a.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1},s=await this.mondayApi.request(A_,o),r=s.boards?.[0]?.activity_logs;if(!r||0===r.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=r.filter((e=>null!=e)).map((e=>`• ${e.created_at}: ${e.event} on ${e.entity} by user ${e.user_id}${e.data?` - Data: ${e.data}`:""}`)).join("\n");return{content:`Activity logs for board ${e.boardId} from ${i} to ${n} (${r.length} entries):\n\n${p}`}}},class extends $m{constructor(){super(...arguments),this.name="get_board_info",this.type=g.READ,this.annotations=Cm({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return F_}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(O_,a),i=t.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:JSON.stringify(R_(i,n),null,2)}}async getSubItemsBoardAsync(e){const a=e.columns?.find((e=>e?.type===e_.Subtasks));if(!a)return null;const t=a.settings.boardIds[0],i=await this.mondayApi.request(k_,{boardId:t});return i.boards?.[0]??null}},class extends $m{constructor(){super(...arguments),this.name="get_full_board_data",this.type=g.READ,this.annotations=Cm({title:"Get Full Board Data",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve comprehensive board data including items (up to 7), columns, updates, and associated user information. This tool fetches board structure and content, then enriches it with user details from update creators and people column values."}getInputSchema(){return S_}async executeInternal(e){try{const a={boardId:e.boardId.toString(),itemsLimit:7},t=await this.mondayApi.request(I_,a);if(!t.boards||0===t.boards.length||!t.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=t.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id)})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const a=e;a.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));let o=[];if(n.size>0){const e={userIds:Array.from(n)},a=await this.mondayApi.request(N_,e);o=a.users?.filter((e=>null!==e))||[]}const s=new Map(o.map((e=>[e.id,e]))),r={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})))||[]})))},users:o,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,a)=>e+(a.updates?.length||0)),0),total_unique_creators:o.length}};return{content:JSON.stringify(r,null,2)}}catch(e){u_(e,"get full board data")}}},class extends $m{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=g.READ,this.annotations=Cm({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\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 \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."}getInputSchema(){return cT}async executeInternal(e){const a=e.userIds&&e.userIds.length>0,t=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,s=!!e.name;if(e.getMe||!1){if(a||t||i||n||o||s)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(sT);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const r={users:[e.me]};return{content:rT(r)}}if(s){if(a||t||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const s={name:e.name},r=await this.mondayApi.request(oT,s);if(!r.users||0===r.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=r.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n");return{content:`Found ${r.users.length} user(s) matching "${e.name}":\n\n${p}`}}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(a&&e.userIds&&e.userIds.length>pT)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(t&&e.teamIds&&e.teamIds.length>dT)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let r;if(n||!a&&t&&!i)if(o){const a={teamIds:e.teamIds};r=await this.mondayApi.request(nT,a)}else{const a={teamIds:e.teamIds};r=await this.mondayApi.request(iT,a)}else if(i){const a={userIds:e.userIds,teamIds:e.teamIds,limit:lT};r=await this.mondayApi.request(tT,a)}else if(a){const a={userIds:e.userIds,limit:lT};r=await this.mondayApi.request(eT,a)}else{const e={userIds:void 0,limit:lT};r=await this.mondayApi.request(aT,e)}return{content:rT(r)}}},Ow,class extends $m{constructor(){super(...arguments),this.name="move_item_to_group",this.type=g.WRITE,this.annotations=Cm({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 mT}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(fw,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends $m{constructor(){super(...arguments),this.name="create_board",this.type=g.WRITE,this.annotations=Cm({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return kw}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(hw,a);return{content:`Board ${t.create_board?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_form",this.type=g.WRITE,this.annotations=Cm({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 px}async executeInternal(e){const a={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},t=await this.mondayApi.request(Uw,a);return{content:`Form created successfully. Board ID: ${t.create_form?.boardId}, Token: ${t.create_form?.token}`}}},class extends $m{constructor(){super(...arguments),this.name="update_form",this.type=g.WRITE,this.annotations=Cm({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Xx(this.mondayApi),this.actionHandlers=new Map([[Dx.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Dx.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Dx.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Dx.activate,this.helpers.activateForm.bind(this.helpers)],[Dx.createTag,this.helpers.createTag.bind(this.helpers)],[Dx.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Dx.updateTag,this.helpers.updateTag.bind(this.helpers)],[Dx.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Dx.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Dx.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Dx.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Dx.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 Qx}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(Ax(e,"tag",Qx.tag),Ax(e,"form",Qx.form),await a(e)):{content:"Received an invalid action for the update form tool."}}},class extends $m{constructor(){super(...arguments),this.name="get_form",this.type=g.READ,this.annotations=Cm({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 Zx}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(Bw,a);return t.form?{content:`The form with the token ${e.formToken} is: ${JSON.stringify(t.form,null,2)}`}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends $m{constructor(){super(...arguments),this.name="form_questions_editor",this.type=g.WRITE,this.annotations=Cm({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Sx(this.mondayApi),this.actionHandlers=new Map([[Ex.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Ex.Update,this.helpers.updateQuestion.bind(this.helpers)],[Ex.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Nx}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(Ax(e,"question",Nx.question),await a(e)):{content:`Unknown action: ${e.action}`}}},class extends $m{constructor(){super(...arguments),this.name="create_column",this.type=g.WRITE,this.annotations=Cm({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?a_:t_}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a?.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(vw,t);return{content:`Column ${i.create_column?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_group",this.type=g.WRITE,this.annotations=Cm({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 s_}async executeInternal(e){const a={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},t=await this.mondayApi.request(n_,a);return{content:`Group "${t.create_group?.title}" (ID: ${t.create_group?.id}) successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="delete_column",this.type=g.WRITE,this.annotations=Cm({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?x_:__}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},t=await this.mondayApi.request(gw,a);return{content:`Column ${t.delete_column?.id} successfully deleted`}}},Sw,class extends $m{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=g.ALL_API,this.annotations=Cm({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 q_}async executeInternal(e){try{const a=await this.mondayApi.request(bw),t=e?.operationType,i=a.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=a.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=a.__schema,s=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let r="## GraphQL Schema\n";return t&&"read"!==t||(r+=`- Query Type: ${a.__schema?.queryType?.name}\n\n`,r+=`## Query Fields\n${i}\n\n`),t&&"write"!==t||(r+=`- Mutation Type: ${a.__schema?.mutationType?.name}\n\n`,r+=`## Mutation Fields\n${n}\n\n`),r+=`## Available Types\n${s}\n\n`,r+='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:r}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends $m{constructor(){super(...arguments),this.name="get_column_type_info",this.type=g.READ,this.annotations=Cm({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 M_}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(B_,a);if(!t?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:t.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(i,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="get_type_details",this.type=g.ALL_API,this.annotations=Cm({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 H_}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const t=(a=e.typeName,dw`
1394
1439
  query getTypeDetails {
1395
1440
  __type(name: "${a}") {
1396
1441
  name
@@ -1478,5 +1523,5 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1478
1523
  }
1479
1524
  }
1480
1525
  }
1481
- `),i=await this.mondayApi.request(t);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 a=M_(e.type);n+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(n+=" Arguments:\n",e.args.forEach((e=>{const a=M_(e.type);n+=` - ${e.name}: ${a}${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 a=M_(e.type);n+=`- ${e.name}: ${a}${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 a=e instanceof Error?e.message:"Unknown error",t=a.includes("JSON");return{content:`Error fetching type details: ${a}${t?"\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 a}},class extends $m{constructor(){super(...arguments),this.name="create_custom_activity",this.type=g.WRITE,this.annotations=Cm({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return i_}async executeInternal(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(ww,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_timeline_item",this.type=g.WRITE,this.annotations=Cm({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return v_}async executeInternal(e){const a={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&&(a.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const t=await this.mondayApi.request(xw,a);return{content:`Timeline item '${e.title}' with ID ${t.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends $m{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=g.READ,this.annotations=Cm({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return E_}async executeInternal(e){const a=await this.mondayApi.request(_w);if(!a.custom_activity||0===a.custom_activity.length)return{content:"No custom activities found"};const t=a.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${t.length} custom activities: ${JSON.stringify(t,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="read_docs",this.type=g.READ,this.annotations=Cm({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get a collection of monday.com documents with their content as markdown. \n\nPAGINATION: \n- Default limit is 25 documents per page\n- Use 'page' parameter to get additional pages (starts at 1)\n- Check response for 'has_more_pages' to know if you should continue paginating\n- If user asks for \"all documents\" and you get exactly 25 results, continue with page 2, 3, etc.\n\nFILTERING: Provide a type value and array of ids:\n- type: 'ids' for specific document IDs\n- type: 'object_ids' for specific document object IDs \n- type: 'workspace_ids' for all docs in specific workspaces\n- ids: array of ID strings (at least 1 required)\n\nExamples:\n- { type: 'ids', ids: ['123', '456'] }\n- { type: 'object_ids', ids: ['123'] }\n- { type: 'workspace_ids', ids: ['ws_101'] }\n\nUSAGE PATTERNS:\n- For specific documents: use type 'ids' or 'object_ids' (A monday doc has two unique identifiers)\n- For workspace exploration: use type 'workspace_ids' with pagination\n- For large searches: start with page 1, then paginate if has_more_pages=true"}getInputSchema(){return lT}async executeInternal(e){try{let a,t,i;switch(e.type){case"ids":a=e.ids;break;case"object_ids":t=e.ids;break;case"workspace_ids":i=e.ids}const n={ids:a,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i};let o=await this.mondayApi.request(Tw,n);if((!o.docs||0===o.docs.length)&&a){const t={ids:void 0,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i};o=await this.mondayApi.request(Tw,t)}if(!o.docs||0===o.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const s=await this.enrichDocsWithMarkdown(o.docs,n),r=this.shouldSuggestPagination(o.docs.length,n.limit||25,n.page||1);return{content:s.content+r}}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}shouldSuggestPagination(e,a,t){return e===a?`\n\n🔄 PAGINATION SUGGESTION: You received exactly ${a} documents, which suggests there may be more. Consider calling this tool again with page: ${t+1} to get additional documents.`:""}async enrichDocsWithMarkdown(e,a){const t=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let a="";try{const t={docId:e.id},i=await this.mondayApi.request(Ew,t);a=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){a=`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,blocks_as_markdown:a}}))),i=a.page||1,n=a.limit||25,o=t.length,s=o===n;return{content:`Successfully retrieved ${t.length} document${1===t.length?"":"s"}.\n\nPAGINATION INFO:\n- Current page: ${i}\n- Documents per page: ${n}\n- Documents in this response: ${o}\n- Has more pages: ${s?"YES - call again with page: "+(i+1):"NO"}\n\nDOCUMENTS:\n${JSON.stringify(t,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="workspace_info",this.type=g.READ,this.annotations=Cm({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 cT}async executeInternal(e){const a={workspace_id:e.workspace_id},t=await this.mondayApi.request(Iw,a);if(!t.workspaces||0===t.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e){const{workspaces:a,boards:t,docs:i,folders:n}=e,o=a?.[0];if(!o)throw new Error("No workspace found");const s=new Map((n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),r=[];(t||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const a={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(a):r.push(a)}));const p=[];return(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const a={id:e.id,name:e.name};e.doc_folder_id&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(a):p.push(a)})),{workspace:{id:o.id,name:o.name,description:o.description||"",kind:o.kind||"",created_at:o.created_at||"",state:o.state||"",is_default_workspace:o.is_default_workspace||!1,owners_subscribers:(o.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:r,docs:p}}}(t);return{content:`Workspace Information:\n\n**Workspace:** ${i.workspace.name} (ID: ${i.workspace.id})\n- Description: ${i.workspace.description||"No description"}\n- Kind: ${i.workspace.kind}\n- State: ${i.workspace.state}\n- Default Workspace: ${i.workspace.is_default_workspace?"Yes":"No"}\n- Created: ${i.workspace.created_at}\n- Owners/Subscribers: ${i.workspace.owners_subscribers.length} users\n\n**Folders (${i.folders.length}):**\n${i.folders.map((e=>`\n📁 ${e.name} (ID: ${e.id})\n - Boards (${e.boards.length}): ${e.boards.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n - Docs (${e.docs.length}): ${e.docs.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}`)).join("\n")}\n\n**Root Level Items:**\n- Boards (${i.root_items.boards.length}): ${i.root_items.boards.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n- Docs (${i.root_items.docs.length}): ${i.root_items.docs.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n\n**Summary:**\n- Total Folders: ${i.folders.length}\n- Total Boards: ${i.folders.reduce(((e,a)=>e+a.boards.length),0)+i.root_items.boards.length}\n- Total Docs: ${i.folders.reduce(((e,a)=>e+a.docs.length),0)+i.root_items.docs.length}\n\n${JSON.stringify(i,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="list_workspaces",this.type=g.READ,this.annotations=Cm({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 hT}async executeInternal(e){const a=e.searchTerm?1e4:e.limit,t=e.searchTerm?1:e.page;let i=null;if(e.searchTerm&&(i=fT(e.searchTerm),0===i.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const n={limit:a,page:t},o=await this.mondayApi.request(mT,n),s=o.workspaces?.filter((e=>e));if(!s||0===s.length)return{content:"No workspaces found."};const r=i&&s.length<=uT,p=this.filterWorkspacesIfNeeded(i,s,e);if(0===p.length)return{content:"No workspaces found matching the search term. Try using the tool without a search term"};const d=p.length===e.limit;return{content:`\n${r?"IMPORTANT: Search term was not applied. Returning all workspaces. Please perform the filtering manually.":""}\n${p.map((e=>{const a=e.description?` - ${e.description}`:"";return`• **${e.name}** (ID: ${e.id})${a}`})).join("\n")}\n${d?`PAGINATION INFO: More results available - call the tool again with page: ${e.page+1}`:""}\n `}}filterWorkspacesIfNeeded(e,a,t){if(!e||a.length<=uT)return a;const i=(t.page-1)*t.limit,n=i+t.limit;return a.filter((a=>fT(a.name).includes(e))).slice(i,n)}},class extends $m{constructor(){super(...arguments),this.name="create_doc",this.type=g.WRITE,this.annotations=Cm({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 _T}async executeInternal(e){const a=xT.safeParse({...e,type:e.location});if(!a.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const t=a.data;try{let a,i;if(t.type===wT.enum.workspace){const n={location:{workspace:{workspace_id:t.workspace_id.toString(),name:e.doc_name,kind:t.doc_kind||ig.Public,folder_id:t.folder_id?.toString()}}},o=await this.mondayApi.request(gT,n);a=o?.create_doc?.id??void 0,i=o?.create_doc?.url??void 0}else if(t.type===wT.enum.item){const n={itemId:t.item_id.toString()},o=await this.mondayApi.request(vT,n),s=o.items?.[0];if(!s)return{content:`Error: Item with id ${t.item_id} not found.`};const r=s.board?.id,p=s.board?.columns?.find((e=>e&&e.type===e_.Doc));let d=t.column_id;if(!d)if(p)d=p.id;else{const e={boardId:r.toString(),columnType:e_.Doc,columnTitle:"Doc"},a=await this.mondayApi.request(vw,e);if(d=a?.create_column?.id,!d)return{content:"Error: Failed to create doc column."}}const l={location:{board:{item_id:t.item_id.toString(),column_id:d}}},c=await this.mondayApi.request(gT,l);if(a=c.create_doc?.id??void 0,i=c.create_doc?.url??void 0,e.doc_name&&a)try{const t={docId:a,name:e.doc_name};await this.mondayApi.request(yT,t)}catch(e){console.warn("Failed to update doc name:",e)}}if(!a)return{content:"Error: Failed to create document."};const n={docId:a,markdown:e.markdown},o=await this.mondayApi.request(bT,n),s=o?.add_content_to_doc_from_markdown?.success,r=o?.add_content_to_doc_from_markdown?.error;return s?{content:`✅ Document successfully created (id: ${a}). ${i?`\n\nURL: ${i}`:""}`}:{content:`Document ${a} created, but failed to add markdown content: ${r||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends $m{constructor(){super(...arguments),this.name="update_workspace",this.type=g.WRITE,this.annotations=Cm({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return DT}async executeInternal(e){const a={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},t=await this.mondayApi.request(AT,a);return{content:`Workspace ${t.update_workspace?.id} successfully updated`}}},class extends $m{constructor(){super(...arguments),this.name="update_folder",this.type=g.WRITE,this.annotations=Cm({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return kT}async executeInternal(e){const{position_object_id:a,position_object_type:t,position_is_after:i}=e;if(!!a!=!!t)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:a?{position_is_after:i,position_object_id:a,position_object_type:t}:void 0},o=await this.mondayApi.request(OT,n);return{content:`Folder ${o.update_folder?.id} successfully updated`}}},class extends $m{constructor(){super(...arguments),this.name="create_workspace",this.type=g.WRITE,this.annotations=Cm({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return CT}async executeInternal(e){const a={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},t=await this.mondayApi.request(RT,a);return{content:`Workspace ${t.create_workspace?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_folder",this.type=g.WRITE,this.annotations=Cm({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return LT}async executeInternal(e){const a={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},t=await this.mondayApi.request($T,a);return{content:`Folder ${t.create_folder?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="move_object",this.type=g.WRITE,this.annotations=Cm({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 PT}async executeUpdateFolder(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:s,accountProductId:r}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={folderId:a,position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,parentFolderId:o,workspaceId:s,accountProductId:r},d=await this.mondayApi.request(OT,p);return{content:`Object ${d.update_folder?.id} successfully moved`}}async executeUpdateBoardHierarchy(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:s,accountProductId:r}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={boardId:a,attributes:{position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,folder_id:o,workspace_id:s,account_product_id:r}},d=await this.mondayApi.request(FT,p);return d.update_board_hierarchy?.success?{content:`Board ${d.update_board_hierarchy?.board?.id} position updated successfully`}:{content:`Board position updated failed: ${d.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:s,accountProductId:r}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={overviewId:a,attributes:{position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,folder_id:o,workspace_id:s,account_product_id:r}},d=await this.mondayApi.request(jT,p);return d.update_overview_hierarchy?.success?{content:`Overview ${d.update_overview_hierarchy?.overview?.id} position updated successfully`}:{content:`Overview position updated failed: ${d.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:a}=e;switch(a){case lb.Folder:return this.executeUpdateFolder(e);case lb.Board:return this.executeUpdateBoardHierarchy(e);case lb.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${a}`)}}},class extends $m{constructor(){super(...arguments),this.name="create_dashboard",this.type=g.WRITE,this.annotations=Cm({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 NT}async executeInternal(e){try{const a={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()},t=await this.mondayApi.request(TT,a);if(!t.create_dashboard)throw new Error("Failed to create dashboard");const i=t.create_dashboard,n=i.board_folder_id?` in folder ${i.board_folder_id}`:" in workspace root",o=i.kind===xg.Public?"(visible to all workspace members)":"(private - visible only to invited users)";return{content:`✅ Dashboard "${i.name}" successfully created!\n\nDashboard Details:\n• ID: ${i.id}\n• Name: ${i.name}\n• Workspace ID: ${i.workspace_id}${n}\n• Visibility: ${i.kind} ${o}\n• Connected Boards: ${e.board_ids.length} board(s)\n\nNext Steps:\n1. Use 'all_widgets_schema' to understand available widget types\n2. Understand the connected boards structure, columns, and metadata. Map board ids to column ids\n3. Plan Domain-Beneficial Widgets - Strategic widget planning based on real data analysis\n4. Use 'create_widget' to add widgets to the dashboard`}}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${a}`)}}},class extends $m{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=g.READ,this.annotations=Cm({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={},a=await this.mondayApi.request(ET,e);if(!a.all_widgets_schema||0===a.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const t={};let i=0;for(const e of a.all_widgets_schema)if(e?.widget_type&&e?.schema){const a="string"==typeof e.schema?JSON.parse(e.schema):e.schema,n=a?.description||a?.title||`${e.widget_type} widget for data visualization`;t[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");return{content:`**Widget Schemas Retrieved Successfully!**\n\n🎯 **Available Widget Types** (${i} schemas found):\n${Object.keys(t).map((e=>`• **${e}**: ${t[e].description}`)).join("\n")}\n\n**Complete JSON Schema 7 Definitions:**\n\n${JSON.stringify(t,null,2)}\n\n**Schema Compliance Tips:**\n- All required fields MUST be provided in widget settings\n- Enum values must match exactly as specified in the schema\n- Data types must conform to the schema definitions\n- Nested objects must follow the exact structure\n\n⚡ **Next Steps:**\n- Use these schemas to validate widget settings before calling 'create_widget'\n- Reference the schema structure when planning widget configurations\n- Ensure 100% compliance with field requirements and data types`}}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${a}`)}}},class extends $m{constructor(){super(...arguments),this.name="create_widget",this.type=g.WRITE,this.annotations=Cm({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 ST}async executeInternal(e){if(Ax(e,"settings",ST.settings),!e.settings)throw new Error("You must pass either settings or settingsStringified parameter");try{const a={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},t=await this.mondayApi.request(IT,a);if(!t.create_widget)throw new Error("Failed to create widget");const i=t.create_widget,n=i.parent?.kind===Bb.Dashboard?`dashboard ${i.parent.id}`:`board view ${i.parent?.id}`;return{content:`✅ Widget "${i.name}" successfully created!\n\n**Widget Details:**\n• **ID**: ${i.id}\n• **Name**: ${i.name}\n• **Type**: ${i.kind}\n• **Location**: Placed in ${n}\n\n**Widget Configuration:**\n• **Settings Applied**: ${JSON.stringify(e.settings,null,2)}`}}catch(a){const t=a instanceof Error?a.message:String(a);throw new Error(`Failed to create ${e.widget_kind} widget: ${t}`)}}},class extends $m{constructor(){super(...arguments),this.name="board_insights",this.type=g.READ,this.annotations=Cm({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."}getInputSchema(){return HT}async executeInternal(e){if(!e.aggregations&&!e.aggregationsStringified)return{content:'Input must contain either the "aggregations" field or the "aggregationsStringified" field.'};Ax(e,"aggregations",HT.aggregations),Ax(e,"filters",HT.filters),Ax(e,"orderBy",HT.orderBy);const{selectElements:a,groupByElements:t}=function(e){const a={},t=e.groupBy?.map((e=>({column_id:e})))||[],i=e.aggregations.map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,s=a[o]||0;a[o]=s+1;const r=`${o}_${s}`;return MT.has(e.function)&&(t.some((e=>e.column_id===r))||t.push({column_id:r})),{type:Bv.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===Mv.CountItems?[]:[{type:Bv.Column,column:qT(n),as:n}]}),as:r}}var i,n;const o={type:Bv.Column,column:qT(e.columnId),as:e.columnId};return t.some((a=>a.column_id===e.columnId))||t.push({column_id:e.columnId}),o}));return t.forEach((e=>{i.some((a=>a.as===e.column_id))||i.push({type:Bv.Column,column:qT(e.column_id),as:e.column_id})})),{selectElements:i,groupByElements:t}}(e),i=function(e){if(!e.filters&&!e.orderBy)return;const a={};return e.filters&&(a.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),a.operator=e.filtersOperator),e.orderBy&&(a.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),a}(e),n=function(e){return{id:e.boardId.toString(),type:Uv.Table}}(e),o={query:{from:n,query:i,select:a,group_by:t,limit:e.limit}},s=await this.mondayApi.request(VT,o),r=(s.aggregate?.results??[]).map((e=>{const a={};return(e.entries??[]).forEach((e=>{const t=e.alias??"";if(!t)return;const i=e.value;if(!i)return void(a[t]=null);const n=i.result??i.value_string??i.value_int??i.value_float??i.value_boolean??null;a[t]=n})),a}));return r.length?{content:`Board insights result (${r.length} rows):\n${JSON.stringify(r,null,2)}`}:{content:"No board insights found for the given query."}}},class extends $m{constructor(){super(...arguments),this.name="search",this.type=g.READ,this.annotations=Cm({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 QT}async executeInternal(e){const a={[KT.BOARD]:this.searchBoardsAsync.bind(this),[KT.DOCUMENTS]:this.searchDocsAsync.bind(this),[KT.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!a)throw new Error(`Unsupported search type: ${e.searchType}`);const t=await a(e),i={disclaimer:t.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",results:t.items};return{content:JSON.stringify(i,null,2)}}async searchFoldersAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(WT,a),i=this.searchAndVirtuallyPaginate(e,t.folders||[],(e=>e.name));return{items:i.items.map((e=>({id:YT.FOLDER+e.id,title:e.name}))),wasFiltered:i.wasFiltered}}async searchDocsAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(zT,a),i=this.searchAndVirtuallyPaginate(e,t.docs||[],(e=>e.name));return{items:i.items.map((e=>({id:YT.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:i.wasFiltered}}async searchBoardsAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(GT,a),i=this.searchAndVirtuallyPaginate(e,t.boards||[],(e=>e.name));return{items:i.items.map((e=>({id:YT.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:i.wasFiltered}}getPagingParamsForSearch(e){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?1e4:e.limit}}searchAndVirtuallyPaginate(e,a,t){if(a.length<=JT)return{items:a,wasFiltered:!1};const i=fT(e.searchTerm??""),n=(e.page-1)*e.limit,o=n+e.limit;return{items:a.filter((e=>fT(t(e)).includes(i))).slice(n,o),wasFiltered:!0}}}],OE=[...DE,...AE,...b];export{d_ as ToolMode,g as ToolType,DE as allGraphqlApiTools,b as allMondayAppsTools,AE as allMondayDevTools,OE as allTools};
1526
+ `),i=await this.mondayApi.request(t);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 a=G_(e.type);n+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(n+=" Arguments:\n",e.args.forEach((e=>{const a=G_(e.type);n+=` - ${e.name}: ${a}${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 a=G_(e.type);n+=`- ${e.name}: ${a}${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 a=e instanceof Error?e.message:"Unknown error",t=a.includes("JSON");return{content:`Error fetching type details: ${a}${t?"\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 a}},class extends $m{constructor(){super(...arguments),this.name="create_custom_activity",this.type=g.WRITE,this.annotations=Cm({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return i_}async executeInternal(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(ww,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_timeline_item",this.type=g.WRITE,this.annotations=Cm({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return v_}async executeInternal(e){const a={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&&(a.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const t=await this.mondayApi.request(xw,a);return{content:`Timeline item '${e.title}' with ID ${t.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends $m{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=g.READ,this.annotations=Cm({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return E_}async executeInternal(e){const a=await this.mondayApi.request(_w);if(!a.custom_activity||0===a.custom_activity.length)return{content:"No custom activities found"};const t=a.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${t.length} custom activities: ${JSON.stringify(t,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="read_docs",this.type=g.READ,this.annotations=Cm({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get a collection of monday.com documents with their content as markdown. \n\nPAGINATION: \n- Default limit is 25 documents per page\n- Use 'page' parameter to get additional pages (starts at 1)\n- Check response for 'has_more_pages' to know if you should continue paginating\n- If user asks for \"all documents\" and you get exactly 25 results, continue with page 2, 3, etc.\n\nFILTERING: Provide a type value and array of ids:\n- type: 'ids' for specific document IDs\n- type: 'object_ids' for specific document object IDs \n- type: 'workspace_ids' for all docs in specific workspaces\n- ids: array of ID strings (at least 1 required)\n\nExamples:\n- { type: 'ids', ids: ['123', '456'] }\n- { type: 'object_ids', ids: ['123'] }\n- { type: 'workspace_ids', ids: ['ws_101'] }\n\nUSAGE PATTERNS:\n- For specific documents: use type 'ids' or 'object_ids' (A monday doc has two unique identifiers)\n- For workspace exploration: use type 'workspace_ids' with pagination\n- For large searches: start with page 1, then paginate if has_more_pages=true"}getInputSchema(){return uT}async executeInternal(e){try{let a,t,i;switch(e.type){case"ids":a=e.ids;break;case"object_ids":t=e.ids;break;case"workspace_ids":i=e.ids}const n={ids:a,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i};let o=await this.mondayApi.request(Tw,n);if((!o.docs||0===o.docs.length)&&a){const t={ids:void 0,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i};o=await this.mondayApi.request(Tw,t)}if(!o.docs||0===o.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const s=await this.enrichDocsWithMarkdown(o.docs,n),r=this.shouldSuggestPagination(o.docs.length,n.limit||25,n.page||1);return{content:s.content+r}}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}shouldSuggestPagination(e,a,t){return e===a?`\n\n🔄 PAGINATION SUGGESTION: You received exactly ${a} documents, which suggests there may be more. Consider calling this tool again with page: ${t+1} to get additional documents.`:""}async enrichDocsWithMarkdown(e,a){const t=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let a="";try{const t={docId:e.id},i=await this.mondayApi.request(Ew,t);a=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){a=`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,blocks_as_markdown:a}}))),i=a.page||1,n=a.limit||25,o=t.length,s=o===n;return{content:`Successfully retrieved ${t.length} document${1===t.length?"":"s"}.\n\nPAGINATION INFO:\n- Current page: ${i}\n- Documents per page: ${n}\n- Documents in this response: ${o}\n- Has more pages: ${s?"YES - call again with page: "+(i+1):"NO"}\n\nDOCUMENTS:\n${JSON.stringify(t,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="workspace_info",this.type=g.READ,this.annotations=Cm({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 fT}async executeInternal(e){const a={workspace_id:e.workspace_id},t=await this.mondayApi.request(Iw,a);if(!t.workspaces||0===t.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e){const{workspaces:a,boards:t,docs:i,folders:n}=e,o=a?.[0];if(!o)throw new Error("No workspace found");const s=new Map((n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),r=[];(t||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const a={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(a):r.push(a)}));const p=[];return(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const a={id:e.id,name:e.name};e.doc_folder_id&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(a):p.push(a)})),{workspace:{id:o.id,name:o.name,description:o.description||"",kind:o.kind||"",created_at:o.created_at||"",state:o.state||"",is_default_workspace:o.is_default_workspace||!1,owners_subscribers:(o.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:r,docs:p}}}(t);return{content:`Workspace Information:\n\n**Workspace:** ${i.workspace.name} (ID: ${i.workspace.id})\n- Description: ${i.workspace.description||"No description"}\n- Kind: ${i.workspace.kind}\n- State: ${i.workspace.state}\n- Default Workspace: ${i.workspace.is_default_workspace?"Yes":"No"}\n- Created: ${i.workspace.created_at}\n- Owners/Subscribers: ${i.workspace.owners_subscribers.length} users\n\n**Folders (${i.folders.length}):**\n${i.folders.map((e=>`\n📁 ${e.name} (ID: ${e.id})\n - Boards (${e.boards.length}): ${e.boards.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n - Docs (${e.docs.length}): ${e.docs.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}`)).join("\n")}\n\n**Root Level Items:**\n- Boards (${i.root_items.boards.length}): ${i.root_items.boards.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n- Docs (${i.root_items.docs.length}): ${i.root_items.docs.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n\n**Summary:**\n- Total Folders: ${i.folders.length}\n- Total Boards: ${i.folders.reduce(((e,a)=>e+a.boards.length),0)+i.root_items.boards.length}\n- Total Docs: ${i.folders.reduce(((e,a)=>e+a.docs.length),0)+i.root_items.docs.length}\n\n${JSON.stringify(i,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="list_workspaces",this.type=g.READ,this.annotations=Cm({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 bT}async executeInternal(e){const a=e.searchTerm?1e4:e.limit,t=e.searchTerm?1:e.page;let i=null;if(e.searchTerm&&(i=gT(e.searchTerm),0===i.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const n={limit:a,page:t},o=await this.mondayApi.request(hT,n),s=o.workspaces?.filter((e=>e));if(!s||0===s.length)return{content:"No workspaces found."};const r=i&&s.length<=vT,p=this.filterWorkspacesIfNeeded(i,s,e);if(0===p.length)return{content:"No workspaces found matching the search term. Try using the tool without a search term"};const d=p.length===e.limit;return{content:`\n${r?"IMPORTANT: Search term was not applied. Returning all workspaces. Please perform the filtering manually.":""}\n${p.map((e=>{const a=e.description?` - ${e.description}`:"";return`• **${e.name}** (ID: ${e.id})${a}`})).join("\n")}\n${d?`PAGINATION INFO: More results available - call the tool again with page: ${e.page+1}`:""}\n `}}filterWorkspacesIfNeeded(e,a,t){if(!e||a.length<=vT)return a;const i=(t.page-1)*t.limit,n=i+t.limit;return a.filter((a=>gT(a.name).includes(e))).slice(i,n)}},class extends $m{constructor(){super(...arguments),this.name="create_doc",this.type=g.WRITE,this.annotations=Cm({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 IT}async executeInternal(e){const a=ET.safeParse({...e,type:e.location});if(!a.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const t=a.data;try{let a,i;if(t.type===TT.enum.workspace){const n={location:{workspace:{workspace_id:t.workspace_id.toString(),name:e.doc_name,kind:t.doc_kind||ig.Public,folder_id:t.folder_id?.toString()}}},o=await this.mondayApi.request(wT,n);a=o?.create_doc?.id??void 0,i=o?.create_doc?.url??void 0}else if(t.type===TT.enum.item){const n={itemId:t.item_id.toString()},o=await this.mondayApi.request(yT,n),s=o.items?.[0];if(!s)return{content:`Error: Item with id ${t.item_id} not found.`};const r=s.board?.id,p=s.board?.columns?.find((e=>e&&e.type===e_.Doc));let d=t.column_id;if(!d)if(p)d=p.id;else{const e={boardId:r.toString(),columnType:e_.Doc,columnTitle:"Doc"},a=await this.mondayApi.request(vw,e);if(d=a?.create_column?.id,!d)return{content:"Error: Failed to create doc column."}}const l={location:{board:{item_id:t.item_id.toString(),column_id:d}}},c=await this.mondayApi.request(wT,l);if(a=c.create_doc?.id??void 0,i=c.create_doc?.url??void 0,e.doc_name&&a)try{const t={docId:a,name:e.doc_name};await this.mondayApi.request(_T,t)}catch(e){console.warn("Failed to update doc name:",e)}}if(!a)return{content:"Error: Failed to create document."};const n={docId:a,markdown:e.markdown},o=await this.mondayApi.request(xT,n),s=o?.add_content_to_doc_from_markdown?.success,r=o?.add_content_to_doc_from_markdown?.error;return s?{content:`✅ Document successfully created (id: ${a}). ${i?`\n\nURL: ${i}`:""}`}:{content:`Document ${a} created, but failed to add markdown content: ${r||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends $m{constructor(){super(...arguments),this.name="update_workspace",this.type=g.WRITE,this.annotations=Cm({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return RT}async executeInternal(e){const a={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},t=await this.mondayApi.request(kT,a);return{content:`Workspace ${t.update_workspace?.id} successfully updated`}}},class extends $m{constructor(){super(...arguments),this.name="update_folder",this.type=g.WRITE,this.annotations=Cm({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return $T}async executeInternal(e){const{position_object_id:a,position_object_type:t,position_is_after:i}=e;if(!!a!=!!t)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:a?{position_is_after:i,position_object_id:a,position_object_type:t}:void 0},o=await this.mondayApi.request(CT,n);return{content:`Folder ${o.update_folder?.id} successfully updated`}}},class extends $m{constructor(){super(...arguments),this.name="create_workspace",this.type=g.WRITE,this.annotations=Cm({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return FT}async executeInternal(e){const a={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},t=await this.mondayApi.request(LT,a);return{content:`Workspace ${t.create_workspace?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_folder",this.type=g.WRITE,this.annotations=Cm({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return PT}async executeInternal(e){const a={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},t=await this.mondayApi.request(jT,a);return{content:`Folder ${t.create_folder?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="move_object",this.type=g.WRITE,this.annotations=Cm({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 BT}async executeUpdateFolder(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:s,accountProductId:r}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={folderId:a,position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,parentFolderId:o,workspaceId:s,accountProductId:r},d=await this.mondayApi.request(CT,p);return{content:`Object ${d.update_folder?.id} successfully moved`}}async executeUpdateBoardHierarchy(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:s,accountProductId:r}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={boardId:a,attributes:{position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,folder_id:o,workspace_id:s,account_product_id:r}},d=await this.mondayApi.request(VT,p);return d.update_board_hierarchy?.success?{content:`Board ${d.update_board_hierarchy?.board?.id} position updated successfully`}:{content:`Board position updated failed: ${d.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:s,accountProductId:r}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={overviewId:a,attributes:{position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,folder_id:o,workspace_id:s,account_product_id:r}},d=await this.mondayApi.request(UT,p);return d.update_overview_hierarchy?.success?{content:`Overview ${d.update_overview_hierarchy?.overview?.id} position updated successfully`}:{content:`Overview position updated failed: ${d.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:a}=e;switch(a){case lb.Folder:return this.executeUpdateFolder(e);case lb.Board:return this.executeUpdateBoardHierarchy(e);case lb.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${a}`)}}},class extends $m{constructor(){super(...arguments),this.name="create_dashboard",this.type=g.WRITE,this.annotations=Cm({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 DT}async executeInternal(e){try{const a={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()},t=await this.mondayApi.request(NT,a);if(!t.create_dashboard)throw new Error("Failed to create dashboard");const i=t.create_dashboard,n=i.board_folder_id?` in folder ${i.board_folder_id}`:" in workspace root",o=i.kind===xg.Public?"(visible to all workspace members)":"(private - visible only to invited users)";return{content:`✅ Dashboard "${i.name}" successfully created!\n\nDashboard Details:\n• ID: ${i.id}\n• Name: ${i.name}\n• Workspace ID: ${i.workspace_id}${n}\n• Visibility: ${i.kind} ${o}\n• Connected Boards: ${e.board_ids.length} board(s)\n\nNext Steps:\n1. Use 'all_widgets_schema' to understand available widget types\n2. Understand the connected boards structure, columns, and metadata. Map board ids to column ids\n3. Plan Domain-Beneficial Widgets - Strategic widget planning based on real data analysis\n4. Use 'create_widget' to add widgets to the dashboard`}}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${a}`)}}},class extends $m{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=g.READ,this.annotations=Cm({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={},a=await this.mondayApi.request(ST,e);if(!a.all_widgets_schema||0===a.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const t={};let i=0;for(const e of a.all_widgets_schema)if(e?.widget_type&&e?.schema){const a="string"==typeof e.schema?JSON.parse(e.schema):e.schema,n=a?.description||a?.title||`${e.widget_type} widget for data visualization`;t[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");return{content:`**Widget Schemas Retrieved Successfully!**\n\n🎯 **Available Widget Types** (${i} schemas found):\n${Object.keys(t).map((e=>`• **${e}**: ${t[e].description}`)).join("\n")}\n\n**Complete JSON Schema 7 Definitions:**\n\n${JSON.stringify(t,null,2)}\n\n**Schema Compliance Tips:**\n- All required fields MUST be provided in widget settings\n- Enum values must match exactly as specified in the schema\n- Data types must conform to the schema definitions\n- Nested objects must follow the exact structure\n\n⚡ **Next Steps:**\n- Use these schemas to validate widget settings before calling 'create_widget'\n- Reference the schema structure when planning widget configurations\n- Ensure 100% compliance with field requirements and data types`}}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${a}`)}}},class extends $m{constructor(){super(...arguments),this.name="create_widget",this.type=g.WRITE,this.annotations=Cm({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 OT}async executeInternal(e){if(Ax(e,"settings",OT.settings),!e.settings)throw new Error("You must pass either settings or settingsStringified parameter");try{const a={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},t=await this.mondayApi.request(AT,a);if(!t.create_widget)throw new Error("Failed to create widget");const i=t.create_widget,n=i.parent?.kind===Bb.Dashboard?`dashboard ${i.parent.id}`:`board view ${i.parent?.id}`;return{content:`✅ Widget "${i.name}" successfully created!\n\n**Widget Details:**\n• **ID**: ${i.id}\n• **Name**: ${i.name}\n• **Type**: ${i.kind}\n• **Location**: Placed in ${n}\n\n**Widget Configuration:**\n• **Settings Applied**: ${JSON.stringify(e.settings,null,2)}`}}catch(a){const t=a instanceof Error?a.message:String(a);throw new Error(`Failed to create ${e.widget_kind} widget: ${t}`)}}},class extends $m{constructor(){super(...arguments),this.name="board_insights",this.type=g.READ,this.annotations=Cm({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."}getInputSchema(){return WT}async executeInternal(e){if(!e.aggregations&&!e.aggregationsStringified)return{content:'Input must contain either the "aggregations" field or the "aggregationsStringified" field.'};Ax(e,"aggregations",WT.aggregations),Ax(e,"filters",WT.filters),Ax(e,"orderBy",WT.orderBy);const{selectElements:a,groupByElements:t}=function(e){const a={},t=e.groupBy?.map((e=>({column_id:e})))||[],i=e.aggregations.map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,s=a[o]||0;a[o]=s+1;const r=`${o}_${s}`;return GT.has(e.function)&&(t.some((e=>e.column_id===r))||t.push({column_id:r})),{type:Bv.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===Mv.CountItems?[]:[{type:Bv.Column,column:zT(n),as:n}]}),as:r}}var i,n;const o={type:Bv.Column,column:zT(e.columnId),as:e.columnId};return t.some((a=>a.column_id===e.columnId))||t.push({column_id:e.columnId}),o}));return t.forEach((e=>{i.some((a=>a.as===e.column_id))||i.push({type:Bv.Column,column:zT(e.column_id),as:e.column_id})})),{selectElements:i,groupByElements:t}}(e),i=function(e){if(!e.filters&&!e.orderBy)return;const a={};return e.filters&&(a.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),a.operator=e.filtersOperator),e.orderBy&&(a.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),a}(e),n=function(e){return{id:e.boardId.toString(),type:Uv.Table}}(e),o={query:{from:n,query:i,select:a,group_by:t,limit:e.limit}},s=await this.mondayApi.request(MT,o),r=(s.aggregate?.results??[]).map((e=>{const a={};return(e.entries??[]).forEach((e=>{const t=e.alias??"";if(!t)return;const i=e.value;if(!i)return void(a[t]=null);const n=i.result??i.value_string??i.value_int??i.value_float??i.value_boolean??null;a[t]=n})),a}));return r.length?{content:`Board insights result (${r.length} rows):\n${JSON.stringify(r,null,2)}`}:{content:"No board insights found for the given query."}}},class extends $m{constructor(){super(...arguments),this.name="search",this.type=g.READ,this.annotations=Cm({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 eE}async executeInternal(e){const a={[XT.BOARD]:this.searchBoardsAsync.bind(this),[XT.DOCUMENTS]:this.searchDocsAsync.bind(this),[XT.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!a)throw new Error(`Unsupported search type: ${e.searchType}`);const t=await a(e),i={disclaimer:t.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",results:t.items};return{content:JSON.stringify(i,null,2)}}async searchFoldersAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(JT,a),i=this.searchAndVirtuallyPaginate(e,t.folders||[],(e=>e.name));return{items:i.items.map((e=>({id:QT.FOLDER+e.id,title:e.name}))),wasFiltered:i.wasFiltered}}async searchDocsAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(KT,a),i=this.searchAndVirtuallyPaginate(e,t.docs||[],(e=>e.name));return{items:i.items.map((e=>({id:QT.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:i.wasFiltered}}async searchBoardsAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(YT,a),i=this.searchAndVirtuallyPaginate(e,t.boards||[],(e=>e.name));return{items:i.items.map((e=>({id:QT.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:i.wasFiltered}}getPagingParamsForSearch(e){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?1e4:e.limit}}searchAndVirtuallyPaginate(e,a,t){if(a.length<=ZT)return{items:a,wasFiltered:!1};const i=gT(e.searchTerm??""),n=(e.page-1)*e.limit,o=n+e.limit;return{items:a.filter((e=>gT(t(e)).includes(i))).slice(n,o),wasFiltered:!0}}}],CE=[...RE,...kE,...b];export{d_ as ToolMode,g as ToolType,RE as allGraphqlApiTools,b as allMondayAppsTools,kE as allMondayDevTools,CE as allTools};
1482
1527
  //# sourceMappingURL=index.js.map