@mondaydotcomorg/agent-toolkit 2.19.2 → 2.20.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.
@@ -839,7 +839,7 @@
839
839
  title
840
840
  description
841
841
  type
842
- settings_str
842
+ settings
843
843
  }
844
844
 
845
845
  # All Groups with Metadata
@@ -873,28 +873,49 @@
873
873
  }
874
874
  }
875
875
  }
876
- `,M_=e=>{const a=[];return a.push("# Board Information\n"),a.push(`**Name:** ${e?.name||"N/A"}`),a.push(`**ID:** ${e?.id||"N/A"}`),a.push(`**Description:** ${e?.description||"No description"}`),a.push(`**State:** ${e?.state||"N/A"}`),a.push(`**Kind:** ${e?.board_kind||"N/A"}`),a.push(`**URL:** ${e?.url||"N/A"}`),a.push(`**Updated:** ${e?.updated_at||"N/A"}`),a.push(`**Item Terminology:** ${e?.item_terminology||"items"}`),a.push(`**Items Count:** ${e?.items_count||0}`),a.push(`**Items Limit:** ${e?.items_limit||"No limit"}`),a.push(`**Board Folder ID:** ${e?.board_folder_id||"None"}`),e?.creator&&(a.push("\n## Creator"),a.push(`**Name:** ${e.creator.name||"N/A"}`),a.push(`**ID:** ${e.creator.id||"N/A"}`),a.push(`**Email:** ${e.creator.email||"N/A"}`)),e?.workspace&&(a.push("\n## Workspace"),a.push(`**Name:** ${e.workspace.name||"N/A"}`),a.push(`**ID:** ${e.workspace.id||"N/A"}`),a.push(`**Kind:** ${e.workspace.kind||"N/A"}`),a.push(`**Description:** ${e.workspace.description||"No description"}`)),e?.owners&&e.owners.length>0&&(a.push("\n## Board Owners"),e.owners.forEach(((e,t)=>{e&&a.push(`${t+1}. **${e.name||"N/A"}** (ID: ${e.id||"N/A"})`)}))),e?.team_owners&&e.team_owners.length>0&&(a.push("\n## Team Owners"),e.team_owners.forEach(((e,t)=>{e&&a.push(`${t+1}. **${e.name||"N/A"}** (ID: ${e.id||"N/A"})`)}))),e?.groups&&e.groups.length>0&&(a.push("\n## Groups"),e.groups.forEach(((e,t)=>{e&&a.push(`${t+1}. **${e.title||"Untitled"}** (ID: ${e.id||"N/A"})`)}))),e?.top_group&&(a.push("\n## Top Group"),a.push(`**ID:** ${e.top_group.id||"N/A"}`)),e?.columns&&e.columns.length>0&&(a.push("\n## Columns"),e.columns.forEach(((e,t)=>{e&&(a.push(`${t+1}. **${e.title||"Untitled"}** (${e.type||"unknown"})`),a.push(` - **ID:** ${e.id||"N/A"}`),e.description&&a.push(` - **Description:** ${e.description}`),e.settings_str&&a.push(` - **Settings:** ${e.settings_str}`))}))),e?.tags&&e.tags.length>0&&(a.push("\n## Tags"),e.tags.forEach(((e,t)=>{e&&a.push(`${t+1}. **${e.name||"N/A"}** (ID: ${e.id||"N/A"})`)}))),e?.permissions&&(a.push("\n## Permissions"),a.push(`${e.permissions}`)),e?.columns&&a.push(G_(e.columns.filter(q_))),a.join("\n")};function q_(e){return!!e&&["id","type"].every((a=>a in e))}const z_={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 - index 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 index 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 index 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 ✅ 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'},G_=e=>{const a=e.reduce(((e,a)=>z_[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(", ")}) - ${z_[e]}`)).join("\n\n")}\n `},H_={boardId:a.z.number().describe("The id of the board to get information for")};const W_=Ew`
877
- query GetBoardItemsPage($boardId: ID!, $limit: Int, $cursor: String, $includeColumns: Boolean!, $columnIds: [String!], $queryParams: ItemsQuery) {
876
+ `,M_=Ew`
877
+ query GetBoardInfoJustColumns($boardId: ID!) {
878
+ boards(ids: [$boardId]) {
879
+ columns {
880
+ id
881
+ title
882
+ description
883
+ type
884
+ settings
885
+ }
886
+
887
+ }
888
+ }
889
+ `,q_=(e,a)=>{let t=[];return t.push("# Board Information\n"),t.push(`**Name:** ${e.name||"N/A"}`),t.push(`**ID:** ${e.id||"N/A"}`),t.push(`**Description:** ${e.description||"No description"}`),t.push(`**State:** ${e.state||"N/A"}`),t.push(`**Kind:** ${e.board_kind||"N/A"}`),t.push(`**URL:** ${e.url||"N/A"}`),t.push(`**Updated:** ${e.updated_at||"N/A"}`),t.push(`**Item Terminology:** ${e.item_terminology||"items"}`),t.push(`**Items Count:** ${e.items_count||0}`),t.push(`**Items Limit:** ${e.items_limit||"No limit"}`),t.push(`**Board Folder ID:** ${e.board_folder_id||"None"}`),e.creator&&(t.push("\n## Creator"),t.push(`**Name:** ${e.creator.name||"N/A"}`),t.push(`**ID:** ${e.creator.id||"N/A"}`),t.push(`**Email:** ${e.creator.email||"N/A"}`)),e.workspace&&(t.push("\n## Workspace"),t.push(`**Name:** ${e.workspace.name||"N/A"}`),t.push(`**ID:** ${e.workspace.id||"N/A"}`),t.push(`**Kind:** ${e.workspace.kind||"N/A"}`),t.push(`**Description:** ${e.workspace.description||"No description"}`)),e.owners&&e.owners.length>0&&(t.push("\n## Board Owners"),e.owners.forEach(((e,a)=>{e&&t.push(`${a+1}. **${e.name||"N/A"}** (ID: ${e.id||"N/A"})`)}))),e.team_owners&&e.team_owners.length>0&&(t.push("\n## Team Owners"),e.team_owners.forEach(((e,a)=>{e&&t.push(`${a+1}. **${e.name||"N/A"}** (ID: ${e.id||"N/A"})`)}))),e.groups&&e.groups.length>0&&(t.push("\n## Groups"),e.groups.forEach(((e,a)=>{e&&t.push(`${a+1}. **${e.title||"Untitled"}** (ID: ${e.id||"N/A"})`)}))),e.top_group&&(t.push("\n## Top Group"),t.push(`**ID:** ${e.top_group.id||"N/A"}`)),t=t.concat(H_(e,!1)),a&&(t=t.concat(H_(a,!0))),e.columns&&e.columns.length>0&&(t.push("\n## Columns"),e.columns.forEach(((e,a)=>{e&&(t.push(`${a+1}. **${e.title||"Untitled"}** (${e.type||"unknown"})`),t.push(` - **ID:** ${e.id||"N/A"}`),e.description&&t.push(` - **Description:** ${e.description}`),e.settings&&t.push(` - **Settings:** ${JSON.stringify(e.settings)}`))}))),e.tags&&e.tags.length>0&&(t.push("\n## Tags"),e.tags.forEach(((e,a)=>{e&&t.push(`${a+1}. **${e.name||"N/A"}** (ID: ${e.id||"N/A"})`)}))),e.permissions&&(t.push("\n## Permissions"),t.push(`${e.permissions}`)),e?.columns&&t.push(W_(e.columns.filter(z_))),t.join("\n")};function z_(e){return!!e&&["id","type"].every((a=>a in e))}const G_={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 - index 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 index 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 index 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'},H_=(e,a)=>{const t=[];return e.columns&&e.columns.length>0&&(t.push("\n## "+(a?"Sub Items Columns":"Columns")),e.columns.forEach(((e,a)=>{e&&(t.push(`${a+1}. **${e.title||"Untitled"}** (${e.type||"unknown"})`),t.push(` - **ID:** ${e.id||"N/A"}`),e.description&&t.push(` - **Description:** ${e.description}`),e.settings&&t.push(` - **Settings:** ${JSON.stringify(e.settings)}`))}))),t},W_=e=>{const a=e.reduce(((e,a)=>G_[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(", ")}) - ${G_[e]}`)).join("\n\n")}\n\n## [IMPORTANT] Sub Items Columns MUST NOT BE USED FOR FILTERING.\n `},Y_={boardId:a.z.number().describe("The id of the board to get information for")};const K_=Ew`
890
+ fragment ItemDataFragment on Item {
891
+ id
892
+ name
893
+ created_at
894
+ updated_at
895
+ column_values(ids: $columnIds) @include(if: $includeColumns) {
896
+ id
897
+ text
898
+ value
899
+ }
900
+ }
901
+
902
+ query GetBoardItemsPage($boardId: ID!, $limit: Int, $cursor: String, $includeColumns: Boolean!, $columnIds: [String!], $queryParams: ItemsQuery, $includeSubItems: Boolean!) {
878
903
  boards(ids: [$boardId]) {
879
904
  id
880
905
  name
881
906
  items_page(limit: $limit, cursor: $cursor, query_params: $queryParams) {
882
907
  items {
883
- id
884
- name
885
- created_at
886
- updated_at
887
- column_values(ids: $columnIds) @include(if: $includeColumns) {
888
- id
889
- text
890
- value
908
+ ...ItemDataFragment
909
+
910
+ subitems @include(if: $includeSubItems) {
911
+ ...ItemDataFragment
891
912
  }
892
913
  }
893
914
  cursor
894
915
  }
895
916
  }
896
917
  }
897
- `,Y_=Ew`
918
+ `,J_=Ew`
898
919
  query SmartSearchBoardItemIds($searchTerm: String!, $boardId: ID!) {
899
920
  search_items(boardId: $boardId, query: $searchTerm, searchType: LEXICAL, size: 100) {
900
921
  results {
@@ -904,11 +925,11 @@
904
925
  }
905
926
  }
906
927
  }
907
- `,K_={boardId:a.z.number().describe("The id of the board to get items from"),itemIds:a.z.array(a.z.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:a.z.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:a.z.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:a.z.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:a.z.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),filtersStringified:a.z.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:a.z.array(a.z.object({columnId:a.z.string().describe("The id of the column to filter by"),compareAttribute:a.z.string().optional().describe("The attribute to compare the value to"),compareValue:a.z.any().describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:a.z.nativeEnum(hb).optional().default(hb.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 "Filtering Guidelines" section for filtering by the column.'),filtersOperator:a.z.nativeEnum(fb).optional().default(fb.And).describe("The operator to use for the filters"),columnIds:a.z.array(a.z.string()).optional().describe("The ids of the 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:a.z.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:a.z.array(a.z.object({columnId:a.z.string().describe("The id of the column to order by"),direction:a.z.nativeEnum(ub).optional().default(ub.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:a.z.number().describe("The id of the board to get the schema of")};const Q_=Ew`
928
+ `,Q_={boardId:a.z.number().describe("The id of the board to get items from"),itemIds:a.z.array(a.z.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:a.z.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:a.z.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:a.z.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:a.z.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeSubItems:a.z.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:a.z.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filtersStringified:a.z.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:a.z.array(a.z.object({columnId:a.z.string().describe("The id of the column to filter by"),compareAttribute:a.z.string().optional().describe("The attribute to compare the value to"),compareValue:a.z.any().describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:a.z.nativeEnum(hb).optional().default(hb.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 "Filtering Guidelines" section for filtering by the column.'),filtersOperator:a.z.nativeEnum(fb).optional().default(fb.And).describe("The operator to use for the filters"),columnIds:a.z.array(a.z.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderByStringified:a.z.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:a.z.array(a.z.object({columnId:a.z.string().describe("The id of the column to order by"),direction:a.z.nativeEnum(ub).optional().default(ub.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 X_={boardId:a.z.number().describe("The id of the board to get the schema of")};const Z_=Ew`
908
929
  query GetColumnTypeSchema($type: ColumnType!) {
909
930
  get_column_type_schema(type: $type)
910
931
  }
911
- `,X_={columnType:a.z.nativeEnum(Rg).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const Z_={random_string:a.z.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:a.z.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const eT={typeName:a.z.string().describe("The name of the GraphQL type to get details for")};function aT(e){return e?"NON_NULL"===e.kind?`${aT(e.ofType)}!`:"LIST"===e.kind?`[${aT(e.ofType)}]`:e.name||"unknown":"unknown"}const tT={name:a.z.string().optional().describe("The name or partial name of the user to get")};const iT=Ew`
932
+ `,eT={columnType:a.z.nativeEnum(Rg).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const aT={random_string:a.z.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:a.z.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const tT={typeName:a.z.string().describe("The name of the GraphQL type to get details for")};function iT(e){return e?"NON_NULL"===e.kind?`${iT(e.ofType)}!`:"LIST"===e.kind?`[${iT(e.ofType)}]`:e.name||"unknown":"unknown"}const nT={name:a.z.string().optional().describe("The name or partial name of the user to get")};const oT=Ew`
912
933
  fragment UserDetails on User {
913
934
  # Basic User Information
914
935
  id
@@ -936,31 +957,31 @@
936
957
  time_zone_identifier
937
958
  utc_hours_diff
938
959
  }
939
- `,nT=Ew`
960
+ `,sT=Ew`
940
961
  fragment UserTeamMembership on Team {
941
962
  id
942
963
  name
943
964
  is_guest
944
965
  picture_url
945
966
  }
946
- `,oT=Ew`
967
+ `,rT=Ew`
947
968
  fragment TeamBasicInfo on Team {
948
969
  id
949
970
  name
950
971
  }
951
- `,sT=Ew`
972
+ `,pT=Ew`
952
973
  fragment TeamExtendedInfo on Team {
953
974
  ...TeamBasicInfo
954
975
  is_guest
955
976
  picture_url
956
977
  }
957
- `,rT=Ew`
978
+ `,dT=Ew`
958
979
  fragment TeamOwner on User {
959
980
  id
960
981
  name
961
982
  email
962
983
  }
963
- `,pT=Ew`
984
+ `,lT=Ew`
964
985
  fragment TeamMember on User {
965
986
  id
966
987
  name
@@ -980,7 +1001,7 @@
980
1001
  time_zone_identifier
981
1002
  utc_hours_diff
982
1003
  }
983
- `,dT=Ew`
1004
+ `,cT=Ew`
984
1005
  fragment TeamMemberSimplified on User {
985
1006
  id
986
1007
  name
@@ -989,15 +1010,15 @@
989
1010
  is_admin
990
1011
  is_guest
991
1012
  }
992
- `,lT=Ew`
1013
+ `,mT=Ew`
993
1014
  fragment UserTeamMembershipSimplified on Team {
994
1015
  id
995
1016
  name
996
1017
  is_guest
997
1018
  }
998
- `,cT=Ew`
999
- ${iT}
1000
- ${nT}
1019
+ `,uT=Ew`
1020
+ ${oT}
1021
+ ${sT}
1001
1022
 
1002
1023
  query listUsersWithTeams($userIds: [ID!], $limit: Int = 1000) {
1003
1024
  users(ids: $userIds, limit: $limit) {
@@ -1009,9 +1030,9 @@
1009
1030
  }
1010
1031
  }
1011
1032
  }
1012
- `,mT=Ew`
1013
- ${iT}
1014
- ${nT}
1033
+ `,fT=Ew`
1034
+ ${oT}
1035
+ ${sT}
1015
1036
 
1016
1037
  query listUsersOnly($userIds: [ID!], $limit: Int = 1000) {
1017
1038
  users(ids: $userIds, limit: $limit) {
@@ -1023,13 +1044,13 @@
1023
1044
  }
1024
1045
  }
1025
1046
  }
1026
- `,uT=Ew`
1027
- ${iT}
1028
- ${lT}
1029
- ${sT}
1047
+ `,hT=Ew`
1030
1048
  ${oT}
1049
+ ${mT}
1050
+ ${pT}
1031
1051
  ${rT}
1032
1052
  ${dT}
1053
+ ${cT}
1033
1054
 
1034
1055
  query listUsersAndTeams($userIds: [ID!], $teamIds: [ID!], $limit: Int = 1000) {
1035
1056
  users(ids: $userIds, limit: $limit) {
@@ -1055,19 +1076,19 @@
1055
1076
  }
1056
1077
  }
1057
1078
  }
1058
- `,fT=Ew`
1059
- ${oT}
1079
+ `,vT=Ew`
1080
+ ${rT}
1060
1081
 
1061
1082
  query listTeamsOnly($teamIds: [ID!]) {
1062
1083
  teams(ids: $teamIds) {
1063
1084
  ...TeamBasicInfo
1064
1085
  }
1065
1086
  }
1066
- `,hT=Ew`
1067
- ${sT}
1068
- ${oT}
1069
- ${rT}
1087
+ `,gT=Ew`
1070
1088
  ${pT}
1089
+ ${rT}
1090
+ ${dT}
1091
+ ${lT}
1071
1092
 
1072
1093
  query listTeamsWithMembers($teamIds: [ID!]) {
1073
1094
  teams(ids: $teamIds) {
@@ -1084,9 +1105,9 @@
1084
1105
  }
1085
1106
  }
1086
1107
  }
1087
- `,vT=Ew`
1088
- ${iT}
1089
- ${nT}
1108
+ `,bT=Ew`
1109
+ ${oT}
1110
+ ${sT}
1090
1111
 
1091
1112
  query getUserByName($name: String) {
1092
1113
  users(name: $name) {
@@ -1098,7 +1119,7 @@
1098
1119
  }
1099
1120
  }
1100
1121
  }
1101
- `,gT=Ew`
1122
+ `,yT=Ew`
1102
1123
  query getCurrentUser {
1103
1124
  me {
1104
1125
  id
@@ -1109,7 +1130,7 @@
1109
1130
  is_guest
1110
1131
  }
1111
1132
  }
1112
- `;const bT=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()},yT=500,wT=500,xT=1e3,_T={userIds:a.z.array(a.z.string()).max(yT).optional().describe('[HIGH PRIORITY] Specific user IDs to fetch (max 500). ALWAYS use this when you have user IDs from board assignments, mentions, previous queries, or any context where user IDs are available.\n \n AI AGENT DIRECTIVE: This is the MOST EFFICIENT parameter. Use whenever you have specific user IDs - never use broad searches when IDs are available.\n \n RETURNS: Complete user profiles with team memberships. EXAMPLES: ["12345678", "87654321"]'),teamIds:a.z.array(a.z.string()).max(wT).optional().describe('[HIGH PRIORITY] Specific team IDs to fetch (max 500). ALWAYS use this when you have team IDs from board permissions, assignments, team context or elsewhere.\n \n AI AGENT DIRECTIVE: Use with teamsOnly: true for teams without user data, or includeTeamMembers: true for detailed member analysis. NEVER fetch all teams when specific IDs are available.\n \n RETURNS: Team details with owners and optional member data. EXAMPLES: ["98765432", "11223344"]'),name:a.z.string().optional().describe('[SECOND PRIORITY] Name-based user search. STANDALONE parameter - cannot be combined with others.\n \n AI AGENT DIRECTIVE: Use ONLY when you have user names but no IDs. This is your PREFERRED method for finding users when you know names. Performs fuzzy matching.\n \n CRITICAL: This parameter CONFLICTS with all others. EXAMPLES: "John Smith", "john", "smith"'),getMe:a.z.boolean().optional().describe('[TOP PRIORITY] Current authenticated user lookup. STANDALONE parameter - cannot be combined with others.\n \n AI AGENT DIRECTIVE: Use ALWAYS when requesting current user information. Returns basic profile: id, name, title, enabled, is_admin, is_guest. Should be used when a user asks to get "my user" or "me".\n \n CRITICAL: This parameter CONFLICTS with all others. Pass boolean value true (not string "true") for authenticated user\'s basic details.'),includeTeams:a.z.boolean().optional().describe("[AVOID UNLESS NECESSARY] Include general teams data alongside users. Creates dual query overhead. This does not fetch a specific user's teams rather all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get the team memberships.\n \n AI AGENT DIRECTIVE: AVOID this parameter unless you specifically need both users AND teams in one response. Use teamsOnly: true for teams-only queries instead.\n \n PERFORMANCE WARNING: Adds significant query overhead. Use sparingly."),teamsOnly:a.z.boolean().optional().describe("[RECOMMENDED FOR TEAMS] Fetch only teams, no users returned. Optimized single-purpose query.\n \n AI AGENT DIRECTIVE: Use teamsOnly: true when you only need team information. More efficient than includeTeams: true. Combine with includeTeamMembers for member details.\n \n USAGE: teamsOnly: true for team lists, add includeTeamMembers: true for member analysis."),includeTeamMembers:a.z.boolean().optional().describe("[CONDITIONAL] Control team member data inclusion. Use strategically for performance.\n \n AI AGENT DIRECTIVE: Set to false for simple team lists (faster), true only when you need member composition analysis. Default is false for better performance.\n \n DECISION LOGIC: false=team names/IDs only, true=full member details with roles and permissions.")};const TT={itemId:a.z.number().describe("The id of the item to which the update will be added"),groupId:a.z.string().describe("The id of the group to which the item will be moved")};const ET={type:a.z.enum(["ids","object_ids","workspace_ids"]).describe("Query type of ids parameter that is used query by: ids, object_ids, or workspace_ids"),ids:a.z.array(a.z.string()).min(1).describe("Array of ID values for this query type (at least 1 required)"),limit:a.z.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:a.z.nativeEnum(qg).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:a.z.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 IT={workspace_id:a.z.number().describe("The ID of the workspace to get information for")};const NT=Ew`
1133
+ `;const wT=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()},xT=500,_T=500,TT=1e3,ET={userIds:a.z.array(a.z.string()).max(xT).optional().describe('[HIGH PRIORITY] Specific user IDs to fetch (max 500). ALWAYS use this when you have user IDs from board assignments, mentions, previous queries, or any context where user IDs are available.\n \n AI AGENT DIRECTIVE: This is the MOST EFFICIENT parameter. Use whenever you have specific user IDs - never use broad searches when IDs are available.\n \n RETURNS: Complete user profiles with team memberships. EXAMPLES: ["12345678", "87654321"]'),teamIds:a.z.array(a.z.string()).max(_T).optional().describe('[HIGH PRIORITY] Specific team IDs to fetch (max 500). ALWAYS use this when you have team IDs from board permissions, assignments, team context or elsewhere.\n \n AI AGENT DIRECTIVE: Use with teamsOnly: true for teams without user data, or includeTeamMembers: true for detailed member analysis. NEVER fetch all teams when specific IDs are available.\n \n RETURNS: Team details with owners and optional member data. EXAMPLES: ["98765432", "11223344"]'),name:a.z.string().optional().describe('[SECOND PRIORITY] Name-based user search. STANDALONE parameter - cannot be combined with others.\n \n AI AGENT DIRECTIVE: Use ONLY when you have user names but no IDs. This is your PREFERRED method for finding users when you know names. Performs fuzzy matching.\n \n CRITICAL: This parameter CONFLICTS with all others. EXAMPLES: "John Smith", "john", "smith"'),getMe:a.z.boolean().optional().describe('[TOP PRIORITY] Current authenticated user lookup. STANDALONE parameter - cannot be combined with others.\n \n AI AGENT DIRECTIVE: Use ALWAYS when requesting current user information. Returns basic profile: id, name, title, enabled, is_admin, is_guest. Should be used when a user asks to get "my user" or "me".\n \n CRITICAL: This parameter CONFLICTS with all others. Pass boolean value true (not string "true") for authenticated user\'s basic details.'),includeTeams:a.z.boolean().optional().describe("[AVOID UNLESS NECESSARY] Include general teams data alongside users. Creates dual query overhead. This does not fetch a specific user's teams rather all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get the team memberships.\n \n AI AGENT DIRECTIVE: AVOID this parameter unless you specifically need both users AND teams in one response. Use teamsOnly: true for teams-only queries instead.\n \n PERFORMANCE WARNING: Adds significant query overhead. Use sparingly."),teamsOnly:a.z.boolean().optional().describe("[RECOMMENDED FOR TEAMS] Fetch only teams, no users returned. Optimized single-purpose query.\n \n AI AGENT DIRECTIVE: Use teamsOnly: true when you only need team information. More efficient than includeTeams: true. Combine with includeTeamMembers for member details.\n \n USAGE: teamsOnly: true for team lists, add includeTeamMembers: true for member analysis."),includeTeamMembers:a.z.boolean().optional().describe("[CONDITIONAL] Control team member data inclusion. Use strategically for performance.\n \n AI AGENT DIRECTIVE: Set to false for simple team lists (faster), true only when you need member composition analysis. Default is false for better performance.\n \n DECISION LOGIC: false=team names/IDs only, true=full member details with roles and permissions.")};const IT={itemId:a.z.number().describe("The id of the item to which the update will be added"),groupId:a.z.string().describe("The id of the group to which the item will be moved")};const NT={type:a.z.enum(["ids","object_ids","workspace_ids"]).describe("Query type of ids parameter that is used query by: ids, object_ids, or workspace_ids"),ids:a.z.array(a.z.string()).min(1).describe("Array of ID values for this query type (at least 1 required)"),limit:a.z.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:a.z.nativeEnum(qg).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:a.z.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 ST={workspace_id:a.z.number().describe("The ID of the workspace to get information for")};const AT=Ew`
1113
1134
  query listWorkspaces($limit: Int!) {
1114
1135
  workspaces(limit: $limit) {
1115
1136
  id
@@ -1117,7 +1138,7 @@
1117
1138
  description
1118
1139
  }
1119
1140
  }
1120
- `,ST={};const AT=a.z.enum(["workspace","item"]),DT={location:a.z.discriminatedUnion("type",[a.z.object({type:a.z.literal(AT.enum.workspace).describe("Create document in workspace"),workspace_id:a.z.number().describe("Workspace ID under which to create the new document"),doc_kind:a.z.nativeEnum(wg).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:a.z.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),a.z.object({type:a.z.literal(AT.enum.item).describe("Create document attached to item"),item_id:a.z.number().describe("Item ID to attach the new document to"),column_id:a.z.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]).describe("Location where the document should be created - either in a workspace or attached to an item"),doc_name:a.z.string().describe("Name for the new document."),markdown:a.z.string().describe("Markdown content that will be imported into the newly created document as blocks.")};const OT=Ew`
1141
+ `,DT={};const OT=a.z.enum(["workspace","item"]),kT={location:a.z.discriminatedUnion("type",[a.z.object({type:a.z.literal(OT.enum.workspace).describe("Create document in workspace"),workspace_id:a.z.number().describe("Workspace ID under which to create the new document"),doc_kind:a.z.nativeEnum(wg).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:a.z.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),a.z.object({type:a.z.literal(OT.enum.item).describe("Create document attached to item"),item_id:a.z.number().describe("Item ID to attach the new document to"),column_id:a.z.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]).describe("Location where the document should be created - either in a workspace or attached to an item"),doc_name:a.z.string().describe("Name for the new document."),markdown:a.z.string().describe("Markdown content that will be imported into the newly created document as blocks.")};const RT=Ew`
1121
1142
  mutation CreateDashboard(
1122
1143
  $name: String!
1123
1144
  $workspace_id: ID!
@@ -1139,14 +1160,14 @@
1139
1160
  board_folder_id
1140
1161
  }
1141
1162
  }
1142
- `,kT=Ew`
1163
+ `,CT=Ew`
1143
1164
  query GetAllWidgetsSchema {
1144
1165
  all_widgets_schema {
1145
1166
  widget_type
1146
1167
  schema
1147
1168
  }
1148
1169
  }
1149
- `,RT=Ew`
1170
+ `,$T=Ew`
1150
1171
  mutation CreateWidget($parent: WidgetParentInput!, $kind: ExternalWidget!, $name: String!, $settings: JSON!) {
1151
1172
  create_widget(parent: $parent, kind: $kind, name: $name, settings: $settings) {
1152
1173
  id
@@ -1158,13 +1179,13 @@
1158
1179
  }
1159
1180
  }
1160
1181
  }
1161
- `,CT={name:a.z.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:a.z.string().describe("ID of the workspace that will own the dashboard"),board_ids:a.z.array(a.z.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:a.z.nativeEnum(Fg).default(Fg.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:a.z.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const $T={parent_container_id:a.z.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:a.z.nativeEnum(ty).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:a.z.nativeEnum(Hg).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:a.z.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:a.z.record(a.z.unknown()).describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const LT=Ew`
1182
+ `,LT={name:a.z.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:a.z.string().describe("ID of the workspace that will own the dashboard"),board_ids:a.z.array(a.z.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:a.z.nativeEnum(Fg).default(Fg.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:a.z.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const FT={parent_container_id:a.z.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:a.z.nativeEnum(ty).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:a.z.nativeEnum(Hg).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:a.z.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:a.z.record(a.z.unknown()).describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const jT=Ew`
1162
1183
  mutation updateWorkspace($id: ID!, $attributes: UpdateWorkspaceAttributesInput!) {
1163
1184
  update_workspace(id: $id, attributes: $attributes) {
1164
1185
  id
1165
1186
  }
1166
1187
  }
1167
- `,FT={id:a.z.string().describe("The ID of the workspace to update"),attributes:a.z.object({accountProductId:a.z.number().optional(),description:a.z.string().optional(),kind:a.z.nativeEnum(iy).optional(),name:a.z.string().optional()}).describe("Attributes to update in the workspace")};const jT=Ew`
1188
+ `,VT={id:a.z.string().describe("The ID of the workspace to update"),attributes:a.z.object({accountProductId:a.z.number().optional(),description:a.z.string().optional(),kind:a.z.nativeEnum(iy).optional(),name:a.z.string().optional()}).describe("Attributes to update in the workspace")};const PT=Ew`
1168
1189
  mutation updateFolder(
1169
1190
  $folderId: ID!
1170
1191
  $name: String
@@ -1190,7 +1211,7 @@
1190
1211
  id
1191
1212
  }
1192
1213
  }
1193
- `,VT={folderId:a.z.string().describe("The ID of the folder to update"),name:a.z.string().optional().describe("The new name of the folder"),color:a.z.nativeEnum(Jg).optional().describe("The new color of the folder"),fontWeight:a.z.nativeEnum(Xg).optional().describe("The new font weight of the folder"),customIcon:a.z.nativeEnum(Qg).optional().describe("The new custom icon of the folder"),parentFolderId:a.z.string().optional().describe("The ID of the new parent folder"),workspaceId:a.z.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:a.z.string().optional().describe("The account product ID associated with the folder"),position:a.z.object({object_id:a.z.string().describe("The ID of the object to position the folder relative to"),object_type:a.z.nativeEnum(Ib).describe("The type of object to position the folder relative to"),is_after:a.z.boolean().optional().describe("Whether to position the folder after the object")}).optional().describe("The new position of the folder")};const PT=Ew`
1214
+ `,UT={folderId:a.z.string().describe("The ID of the folder to update"),name:a.z.string().optional().describe("The new name of the folder"),color:a.z.nativeEnum(Jg).optional().describe("The new color of the folder"),fontWeight:a.z.nativeEnum(Xg).optional().describe("The new font weight of the folder"),customIcon:a.z.nativeEnum(Qg).optional().describe("The new custom icon of the folder"),parentFolderId:a.z.string().optional().describe("The ID of the new parent folder"),workspaceId:a.z.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:a.z.string().optional().describe("The account product ID associated with the folder"),position:a.z.object({object_id:a.z.string().describe("The ID of the object to position the folder relative to"),object_type:a.z.nativeEnum(Ib).describe("The type of object to position the folder relative to"),is_after:a.z.boolean().optional().describe("Whether to position the folder after the object")}).optional().describe("The new position of the folder")};const BT=Ew`
1194
1215
  mutation createWorkspace(
1195
1216
  $name: String!
1196
1217
  $workspaceKind: WorkspaceKind!
@@ -1206,7 +1227,7 @@
1206
1227
  id
1207
1228
  }
1208
1229
  }
1209
- `,UT={name:a.z.string().describe("The name of the new workspace to be created"),workspaceKind:a.z.nativeEnum(iy).describe("The kind of workspace to create"),description:a.z.string().optional().describe("The description of the new workspace"),accountProductId:a.z.string().optional().describe("The account product ID associated with the workspace")};const BT=Ew`
1230
+ `,MT={name:a.z.string().describe("The name of the new workspace to be created"),workspaceKind:a.z.nativeEnum(iy).describe("The kind of workspace to create"),description:a.z.string().optional().describe("The description of the new workspace"),accountProductId:a.z.string().optional().describe("The account product ID associated with the workspace")};const qT=Ew`
1210
1231
  mutation createFolder(
1211
1232
  $workspaceId: ID!
1212
1233
  $name: String!
@@ -1226,7 +1247,7 @@
1226
1247
  id
1227
1248
  }
1228
1249
  }
1229
- `,MT={workspaceId:a.z.string().describe("The ID of the workspace where the folder will be created"),name:a.z.string().describe("The name of the folder to be created"),color:a.z.nativeEnum(Jg).optional().describe("The color of the folder"),fontWeight:a.z.nativeEnum(Xg).optional().describe("The font weight of the folder"),customIcon:a.z.nativeEnum(Qg).optional().describe("The custom icon of the folder"),parentFolderId:a.z.string().optional().describe("The ID of the parent folder")};const qT=Ew`
1250
+ `,zT={workspaceId:a.z.string().describe("The ID of the workspace where the folder will be created"),name:a.z.string().describe("The name of the folder to be created"),color:a.z.nativeEnum(Jg).optional().describe("The color of the folder"),fontWeight:a.z.nativeEnum(Xg).optional().describe("The font weight of the folder"),customIcon:a.z.nativeEnum(Qg).optional().describe("The custom icon of the folder"),parentFolderId:a.z.string().optional().describe("The ID of the parent folder")};const GT=Ew`
1230
1251
  mutation updateBoardHierarchy($boardId: ID!, $attributes: UpdateBoardHierarchyAttributesInput!) {
1231
1252
  update_board_hierarchy(board_id: $boardId, attributes: $attributes) {
1232
1253
  success
@@ -1236,7 +1257,7 @@
1236
1257
  }
1237
1258
  }
1238
1259
  }
1239
- `,zT=Ew`
1260
+ `,HT=Ew`
1240
1261
  mutation updateOverviewHierarchy($overviewId: ID!, $attributes: UpdateOverviewHierarchyAttributesInput!) {
1241
1262
  update_overview_hierarchy(overview_id: $overviewId, attributes: $attributes) {
1242
1263
  success
@@ -1246,7 +1267,7 @@
1246
1267
  }
1247
1268
  }
1248
1269
  }
1249
- `,GT={objectType:a.z.nativeEnum(Ib).describe("The type of object to move"),id:a.z.string().describe("The ID of the object to move"),position:a.z.object({object_id:a.z.string().describe("The ID of the object to position the object relative to"),object_type:a.z.nativeEnum(Ib).describe("The type of object to position the object relative to"),is_after:a.z.boolean().optional().describe("Whether to position the object after the object")}).optional().describe("The new position of the object. Required if changing the position based on another object."),parentFolderId:a.z.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:a.z.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:a.z.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};a.z.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),a.z.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const HT=[class extends Qm{constructor(){super(...arguments),this.name="delete_item",this.type=y.WRITE,this.annotations=Jm({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return $_}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(Iw,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends Qm{constructor(){super(...arguments),this.name="get_board_items_page",this.type=y.READ,this.annotations=Jm({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 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 K_}parseAndAssignJsonField(e,a,t){if(e[t]&&!e[a])try{e[a]=JSON.parse(e[t])}catch{throw new Error(`${t} is not a valid JSON`)}}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{this.parseAndAssignJsonField(e,"filters","filtersStringified"),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const t={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor,includeColumns:e.includeColumns,columnIds:e.columnIds};this.parseAndAssignJsonField(e,"filters","filtersStringified"),this.parseAndAssignJsonField(e,"orderBy","orderByStringified"),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(W_,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:hb.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=>{const t={id:e.id,name:e.name,created_at:e.created_at,updated_at:e.updated_at};return a.includeColumns&&e.column_values&&(t.column_values={},e.column_values.forEach((e=>{if(e.value)try{t.column_values[e.id]=JSON.parse(e.value)}catch{t.column_values[e.id]=e.value}else t.column_values[e.id]=e.text||null}))),t})),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}async getItemIdsFromSmartSearchAsync(e){const a={boardId:e.boardId.toString(),searchTerm:e.searchTerm},t=await this.mondayApi.request(Y_,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 Qm{constructor(){super(...arguments),this.name="create_item",this.type=y.WRITE,this.annotations=Jm({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."}getInputSchema(){return this.context?.boardId?A_:D_}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(N_,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 Qw(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){this.rethrowWrapped(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(S_,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){this.rethrowWrapped(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(Nw,t);return{content:`Item ${i.create_item?.id} successfully created`}}catch(e){this.rethrowWrapped(e,"create item")}}rethrowWrapped(e,a){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)throw new Error(`Failed to ${a}: ${t.response.errors.map((e=>e.message)).join(", ")}`)}throw new Error(`Failed to ${a}: ${t}`)}},class extends Qm{constructor(){super(...arguments),this.name="create_update",this.type=y.WRITE,this.annotations=Jm({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return k_}async executeInternal(e){let a;if(e.mentionsList)try{a=JSON.parse(e.mentionsList)}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e instanceof Error?e.message:"Unknown error"}`)}const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},i=await this.mondayApi.request(Sw,t);return{content:`Update ${i.create_update?.id} successfully created on item ${e.itemId}`}}},class extends Qm{constructor(){super(...arguments),this.name="get_board_schema",this.type=y.READ,this.annotations=Jm({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(Aw,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 Qm{constructor(){super(...arguments),this.name="get_board_activity",this.type=y.READ,this.annotations=Jm({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 U_}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-P_.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(F_,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 Qm{constructor(){super(...arguments),this.name="get_board_info",this.type=y.READ,this.annotations=Jm({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return H_}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(B_,a),i=t.boards?.[0];return i?{content:M_(i)}:{content:`Board with id ${e.boardId} not found or you don't have access to it.`}}},class extends Qm{constructor(){super(...arguments),this.name="get_users_by_name",this.type=y.READ,this.annotations=Jm({title:"Get Users",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get users, can be filtered by name or partial name"}getInputSchema(){return tT}async executeInternal(e){const a={name:e.name},t=await this.mondayApi.request(Dw,a);return{content:`Relevant users:\n ${t.users?.map((e=>` id: ${e?.id}, name: ${e?.name}, title: ${e?.title}`)).join("\n")}`}}},class extends Qm{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=y.READ,this.annotations=Jm({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'PRECISION-FIRST user and team retrieval tool. AI agents MUST prioritize specific queries over broad searches.\n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs when available (userIds, teamIds) - highest precision and performance\n 2. ALWAYS use name search when you have user names but no IDs \n 3. ALWAYS use boolean getMe: true when requesting current user information\n 4. AVOID broad queries (no parameters) - use only as absolute last resort\n 5. COMBINE parameters strategically to minimize API calls\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe: true (when requesting current user) - STANDALONE ONLY\n 2. name="exact_name" (when searching by name) - STANDALONE ONLY \n 3. userIds=["id1","id2"] (when you have specific user IDs)\n 4. teamIds=["id1","id2"] + teamsOnly: true (when you have specific team IDs)\n 5. No parameters (LAST RESORT - fetches up to 1000 users, avoid unless absolutely necessary)\n\n CRITICAL USAGE RULES:\n • getMe and name parameters CANNOT be combined with any other parameters\n • userIds + teamIds requires explicit includeTeams: true flag\n • teamsOnly: true prevents user data fetching (teams-only queries)\n • includeTeamMembers: true adds detailed member data to teams\n • includeTeams: true fetches both users and teams, do not use this to fetch a specific user\'s teams rather fetch that user by id and you will get their team memberships.\n\n OPTIMIZATION DIRECTIVES:\n • NEVER fetch all users when specific IDs are available\n • NEVER use broad queries for single user/team lookups \n • ALWAYS prefer name search over ID-less queries for individual users\n • SET includeTeamMembers: false for team lists, true only for member analysis \n • AVOID includeTeams: true unless you specifically need both users AND teams\n • AVOID broad queries for single user/team, if you have specific IDs, use them. For example getting a user\'s teams, use that user\'s ID and fetch their team using the includeTeams flag.\n\n RESPONSE CONTENT:\n • Users: id, name, email, title, permissions, contact details, team memberships\n • Teams: id, name, owners, members (when includeTeamMembers: true)\n • Current user: id, name, title, enabled, is_admin, is_guest (basic profile only)'}getInputSchema(){return _T}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(gT);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const r={users:[e.me]};return{content:bT(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(vT,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>yT)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>wT)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(hT,a)}else{const a={teamIds:e.teamIds};r=await this.mondayApi.request(fT,a)}else if(i){const a={userIds:e.userIds,teamIds:e.teamIds,limit:xT};r=await this.mondayApi.request(uT,a)}else if(a){const a={userIds:e.userIds,limit:xT};r=await this.mondayApi.request(cT,a)}else{const e={userIds:void 0,limit:xT};r=await this.mondayApi.request(mT,e)}return{content:bT(r)}}},Qw,class extends Qm{constructor(){super(...arguments),this.name="move_item_to_group",this.type=y.WRITE,this.annotations=Jm({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 TT}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(kw,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends Qm{constructor(){super(...arguments),this.name="create_board",this.type=y.WRITE,this.annotations=Jm({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Xw}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(Rw,a);return{content:`Board ${t.create_board?.id} successfully created`}}},class extends Qm{constructor(){super(...arguments),this.name="create_form",this.type=y.WRITE,this.annotations=Jm({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 Dx}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(rx,a);return{content:`Form created successfully. Board ID: ${t.create_form?.boardId}, Token: ${t.create_form?.token}`}}},class extends Qm{constructor(){super(...arguments),this.name="update_form",this.type=y.WRITE,this.annotations=Jm({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new b_(this.mondayApi),this.actionHandlers=new Map([[Kx.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Kx.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Kx.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Kx.activate,this.helpers.activateForm.bind(this.helpers)],[Kx.createTag,this.helpers.createTag.bind(this.helpers)],[Kx.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Kx.updateTag,this.helpers.updateTag.bind(this.helpers)],[Kx.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Kx.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Kx.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Kx.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Kx.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 g_}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?await a(e):{content:"Received an invalid action for the update form tool."}}},class extends Qm{constructor(){super(...arguments),this.name="get_form",this.type=y.READ,this.annotations=Jm({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 y_}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(px,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 Qm{constructor(){super(...arguments),this.name="form_questions_editor",this.type=y.WRITE,this.annotations=Jm({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Yx(this.mondayApi),this.actionHandlers=new Map([[Gx.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Gx.Update,this.helpers.updateQuestion.bind(this.helpers)],[Gx.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Wx}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?await a(e):{content:`Unknown action: ${e.action}`}}},class extends Qm{constructor(){super(...arguments),this.name="create_column",this.type=y.WRITE,this.annotations=Jm({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?w_:x_}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},t=await this.mondayApi.request(Cw,a);return{content:`Column ${t.create_column?.id} successfully created`}}},class extends Qm{constructor(){super(...arguments),this.name="create_group",this.type=y.WRITE,this.annotations=Jm({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 I_}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(T_,a);return{content:`Group "${t.create_group?.title}" (ID: ${t.create_group?.id}) successfully created`}}},class extends Qm{constructor(){super(...arguments),this.name="delete_column",this.type=y.WRITE,this.annotations=Jm({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?R_:C_}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},t=await this.mondayApi.request($w,a);return{content:`Column ${t.delete_column?.id} successfully deleted`}}},Yw,class extends Qm{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=y.ALL_API,this.annotations=Jm({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 Z_}async executeInternal(e){try{const a=await this.mondayApi.request(Lw),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 Qm{constructor(){super(...arguments),this.name="get_column_type_info",this.type=y.READ,this.annotations=Jm({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 X_}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(Q_,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 Qm{constructor(){super(...arguments),this.name="get_type_details",this.type=y.ALL_API,this.annotations=Jm({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 eT}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,Ew`
1270
+ `,WT={objectType:a.z.nativeEnum(Ib).describe("The type of object to move"),id:a.z.string().describe("The ID of the object to move"),position:a.z.object({object_id:a.z.string().describe("The ID of the object to position the object relative to"),object_type:a.z.nativeEnum(Ib).describe("The type of object to position the object relative to"),is_after:a.z.boolean().optional().describe("Whether to position the object after the object")}).optional().describe("The new position of the object. Required if changing the position based on another object."),parentFolderId:a.z.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:a.z.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:a.z.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};a.z.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),a.z.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const YT=[class extends Qm{constructor(){super(...arguments),this.name="delete_item",this.type=y.WRITE,this.annotations=Jm({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return $_}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(Iw,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends Qm{constructor(){super(...arguments),this.name="get_board_items_page",this.type=y.READ,this.annotations=Jm({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 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 Q_}parseAndAssignJsonField(e,a,t){if(e[t]&&!e[a])try{e[a]=JSON.parse(e[t])}catch{throw new Error(`${t} is not a valid JSON`)}}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{this.parseAndAssignJsonField(e,"filters","filtersStringified"),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};this.parseAndAssignJsonField(e,"filters","filtersStringified"),this.parseAndAssignJsonField(e,"orderBy","orderByStringified"),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(K_,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:hb.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={boardId:e.boardId.toString(),searchTerm:e.searchTerm},t=await this.mondayApi.request(J_,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 Qm{constructor(){super(...arguments),this.name="create_item",this.type=y.WRITE,this.annotations=Jm({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."}getInputSchema(){return this.context?.boardId?A_:D_}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(N_,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 Qw(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){this.rethrowWrapped(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(S_,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){this.rethrowWrapped(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(Nw,t);return{content:`Item ${i.create_item?.id} successfully created`}}catch(e){this.rethrowWrapped(e,"create item")}}rethrowWrapped(e,a){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)throw new Error(`Failed to ${a}: ${t.response.errors.map((e=>e.message)).join(", ")}`)}throw new Error(`Failed to ${a}: ${t}`)}},class extends Qm{constructor(){super(...arguments),this.name="create_update",this.type=y.WRITE,this.annotations=Jm({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return k_}async executeInternal(e){let a;if(e.mentionsList)try{a=JSON.parse(e.mentionsList)}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e instanceof Error?e.message:"Unknown error"}`)}const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},i=await this.mondayApi.request(Sw,t);return{content:`Update ${i.create_update?.id} successfully created on item ${e.itemId}`}}},class extends Qm{constructor(){super(...arguments),this.name="get_board_schema",this.type=y.READ,this.annotations=Jm({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 X_}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},i=await this.mondayApi.request(Aw,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 Qm{constructor(){super(...arguments),this.name="get_board_activity",this.type=y.READ,this.annotations=Jm({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 U_}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-P_.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(F_,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 Qm{constructor(){super(...arguments),this.name="get_board_info",this.type=y.READ,this.annotations=Jm({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return Y_}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(B_,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:q_(i,n)}}async getSubItemsBoardAsync(e){const a=e.columns?.find((e=>e?.type===Rg.Subtasks));if(!a)return null;const t=a.settings.boardIds[0],i=await this.mondayApi.request(M_,{boardId:t});return i.boards?.[0]??null}},class extends Qm{constructor(){super(...arguments),this.name="get_users_by_name",this.type=y.READ,this.annotations=Jm({title:"Get Users",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get users, can be filtered by name or partial name"}getInputSchema(){return nT}async executeInternal(e){const a={name:e.name},t=await this.mondayApi.request(Dw,a);return{content:`Relevant users:\n ${t.users?.map((e=>` id: ${e?.id}, name: ${e?.name}, title: ${e?.title}`)).join("\n")}`}}},class extends Qm{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=y.READ,this.annotations=Jm({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'PRECISION-FIRST user and team retrieval tool. AI agents MUST prioritize specific queries over broad searches.\n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs when available (userIds, teamIds) - highest precision and performance\n 2. ALWAYS use name search when you have user names but no IDs \n 3. ALWAYS use boolean getMe: true when requesting current user information\n 4. AVOID broad queries (no parameters) - use only as absolute last resort\n 5. COMBINE parameters strategically to minimize API calls\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe: true (when requesting current user) - STANDALONE ONLY\n 2. name="exact_name" (when searching by name) - STANDALONE ONLY \n 3. userIds=["id1","id2"] (when you have specific user IDs)\n 4. teamIds=["id1","id2"] + teamsOnly: true (when you have specific team IDs)\n 5. No parameters (LAST RESORT - fetches up to 1000 users, avoid unless absolutely necessary)\n\n CRITICAL USAGE RULES:\n • getMe and name parameters CANNOT be combined with any other parameters\n • userIds + teamIds requires explicit includeTeams: true flag\n • teamsOnly: true prevents user data fetching (teams-only queries)\n • includeTeamMembers: true adds detailed member data to teams\n • includeTeams: true fetches both users and teams, do not use this to fetch a specific user\'s teams rather fetch that user by id and you will get their team memberships.\n\n OPTIMIZATION DIRECTIVES:\n • NEVER fetch all users when specific IDs are available\n • NEVER use broad queries for single user/team lookups \n • ALWAYS prefer name search over ID-less queries for individual users\n • SET includeTeamMembers: false for team lists, true only for member analysis \n • AVOID includeTeams: true unless you specifically need both users AND teams\n • AVOID broad queries for single user/team, if you have specific IDs, use them. For example getting a user\'s teams, use that user\'s ID and fetch their team using the includeTeams flag.\n\n RESPONSE CONTENT:\n • Users: id, name, email, title, permissions, contact details, team memberships\n • Teams: id, name, owners, members (when includeTeamMembers: true)\n • Current user: id, name, title, enabled, is_admin, is_guest (basic profile only)'}getInputSchema(){return ET}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(yT);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const r={users:[e.me]};return{content:wT(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(bT,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>xT)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>_T)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(gT,a)}else{const a={teamIds:e.teamIds};r=await this.mondayApi.request(vT,a)}else if(i){const a={userIds:e.userIds,teamIds:e.teamIds,limit:TT};r=await this.mondayApi.request(hT,a)}else if(a){const a={userIds:e.userIds,limit:TT};r=await this.mondayApi.request(uT,a)}else{const e={userIds:void 0,limit:TT};r=await this.mondayApi.request(fT,e)}return{content:wT(r)}}},Qw,class extends Qm{constructor(){super(...arguments),this.name="move_item_to_group",this.type=y.WRITE,this.annotations=Jm({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 IT}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(kw,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends Qm{constructor(){super(...arguments),this.name="create_board",this.type=y.WRITE,this.annotations=Jm({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Xw}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(Rw,a);return{content:`Board ${t.create_board?.id} successfully created`}}},class extends Qm{constructor(){super(...arguments),this.name="create_form",this.type=y.WRITE,this.annotations=Jm({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 Dx}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(rx,a);return{content:`Form created successfully. Board ID: ${t.create_form?.boardId}, Token: ${t.create_form?.token}`}}},class extends Qm{constructor(){super(...arguments),this.name="update_form",this.type=y.WRITE,this.annotations=Jm({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new b_(this.mondayApi),this.actionHandlers=new Map([[Kx.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Kx.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Kx.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Kx.activate,this.helpers.activateForm.bind(this.helpers)],[Kx.createTag,this.helpers.createTag.bind(this.helpers)],[Kx.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Kx.updateTag,this.helpers.updateTag.bind(this.helpers)],[Kx.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Kx.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Kx.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Kx.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Kx.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 g_}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?await a(e):{content:"Received an invalid action for the update form tool."}}},class extends Qm{constructor(){super(...arguments),this.name="get_form",this.type=y.READ,this.annotations=Jm({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 y_}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(px,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 Qm{constructor(){super(...arguments),this.name="form_questions_editor",this.type=y.WRITE,this.annotations=Jm({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Yx(this.mondayApi),this.actionHandlers=new Map([[Gx.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Gx.Update,this.helpers.updateQuestion.bind(this.helpers)],[Gx.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Wx}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?await a(e):{content:`Unknown action: ${e.action}`}}},class extends Qm{constructor(){super(...arguments),this.name="create_column",this.type=y.WRITE,this.annotations=Jm({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?w_:x_}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},t=await this.mondayApi.request(Cw,a);return{content:`Column ${t.create_column?.id} successfully created`}}},class extends Qm{constructor(){super(...arguments),this.name="create_group",this.type=y.WRITE,this.annotations=Jm({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 I_}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(T_,a);return{content:`Group "${t.create_group?.title}" (ID: ${t.create_group?.id}) successfully created`}}},class extends Qm{constructor(){super(...arguments),this.name="delete_column",this.type=y.WRITE,this.annotations=Jm({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?R_:C_}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},t=await this.mondayApi.request($w,a);return{content:`Column ${t.delete_column?.id} successfully deleted`}}},Yw,class extends Qm{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=y.ALL_API,this.annotations=Jm({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 aT}async executeInternal(e){try{const a=await this.mondayApi.request(Lw),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 Qm{constructor(){super(...arguments),this.name="get_column_type_info",this.type=y.READ,this.annotations=Jm({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 eT}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(Z_,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 Qm{constructor(){super(...arguments),this.name="get_type_details",this.type=y.ALL_API,this.annotations=Jm({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 tT}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,Ew`
1250
1271
  query getTypeDetails {
1251
1272
  __type(name: "${a}") {
1252
1273
  name
@@ -1334,5 +1355,5 @@
1334
1355
  }
1335
1356
  }
1336
1357
  }
1337
- `),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=aT(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=aT(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=aT(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 Qm{constructor(){super(...arguments),this.name="create_custom_activity",this.type=y.WRITE,this.annotations=Jm({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return __}async executeInternal(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(jw,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends Qm{constructor(){super(...arguments),this.name="create_timeline_item",this.type=y.WRITE,this.annotations=Jm({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return O_}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(Vw,a);return{content:`Timeline item '${e.title}' with ID ${t.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends Qm{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=y.READ,this.annotations=Jm({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return L_}async executeInternal(e){const a=await this.mondayApi.request(Pw);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 Qm{constructor(){super(...arguments),this.name="read_docs",this.type=y.READ,this.annotations=Jm({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 ET}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(zw,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(zw,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(Gw,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 Qm{constructor(){super(...arguments),this.name="workspace_info",this.type=y.READ,this.annotations=Jm({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 IT}async executeInternal(e){const a={workspace_id:e.workspace_id},t=await this.mondayApi.request(Hw,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 Qm{constructor(){super(...arguments),this.name="list_workspaces",this.type=y.READ,this.annotations=Jm({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 ST}async executeInternal(e){const a={limit:5e3},t=await this.mondayApi.request(NT,a);if(!t.workspaces||0===t.workspaces.length)return{content:"No workspaces found."};const i=t.workspaces.filter((e=>null!==e)).map((e=>{const a=e.description?` - ${e.description}`:"";return`• **${e.name}** (ID: ${e.id})${a}`})).join("\n");return{content:`**Available Workspaces (${t.workspaces.length}):**\n\n${i}\n\n**Summary:**\nTotal workspaces found: ${t.workspaces.length}\n\n${JSON.stringify(t.workspaces,null,2)}`}}},class extends Qm{constructor(){super(...arguments),this.name="create_doc",this.type=y.WRITE,this.annotations=Jm({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: { type: "workspace", workspace_id: 123, doc_kind: "private" }, markdown: "..." }\n- Workspace doc in folder: { location: { type: "workspace", workspace_id: 123, folder_id: 17264196 }, markdown: "..." }\n- Item doc: { location: { type: "item", item_id: 456, column_id: "doc_col_1" }, markdown: "..." }'}getInputSchema(){return DT}async executeInternal(e){try{let a,t;if(e.location.type===AT.enum.workspace){const i={location:{workspace:{workspace_id:e.location.workspace_id.toString(),name:e.doc_name,kind:e.location.doc_kind||wg.Public,folder_id:e.location.folder_id?.toString()}}},n=await this.mondayApi.request(Bw,i);a=n?.create_doc?.id??void 0,t=n?.create_doc?.url??void 0}else if(e.location.type===AT.enum.item){const i={itemId:e.location.item_id.toString()},n=await this.mondayApi.request(Uw,i),o=n.items?.[0];if(!o)return{content:`Error: Item with id ${e.location.item_id} not found.`};const s=o.board?.id,r=o.board?.columns?.find((e=>e&&e.type===Rg.Doc));let p=e.location.column_id;if(!p)if(r)p=r.id;else{const e={boardId:s.toString(),columnType:Rg.Doc,columnTitle:"Doc"},a=await this.mondayApi.request(Cw,e);if(p=a?.create_column?.id,!p)return{content:"Error: Failed to create doc column."}}const d={location:{board:{item_id:e.location.item_id.toString(),column_id:p}}},l=await this.mondayApi.request(Bw,d);if(a=l.create_doc?.id??void 0,t=l.create_doc?.url??void 0,e.doc_name&&a)try{const t={docId:a,name:e.doc_name};await this.mondayApi.request(qw,t)}catch(e){console.warn("Failed to update doc name:",e)}}if(!a)return{content:"Error: Failed to create document."};const i={docId:a,markdown:e.markdown},n=await this.mondayApi.request(Mw,i),o=n?.add_content_to_doc_from_markdown?.success,s=n?.add_content_to_doc_from_markdown?.error;return o?{content:`✅ Document successfully created (id: ${a}). ${t?`\n\nURL: ${t}`:""}`}:{content:`Document ${a} created, but failed to add markdown content: ${s||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends Qm{constructor(){super(...arguments),this.name="update_workspace",this.type=y.WRITE,this.annotations=Jm({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return FT}async executeInternal(e){const a={id:e.id,attributes:e.attributes},t=await this.mondayApi.request(LT,a);return{content:`Workspace ${t.update_workspace?.id} successfully updated`}}},class extends Qm{constructor(){super(...arguments),this.name="update_folder",this.type=y.WRITE,this.annotations=Jm({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return VT}async executeInternal(e){const a={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:e.position},t=await this.mondayApi.request(jT,a);return{content:`Folder ${t.update_folder?.id} successfully updated`}}},class extends Qm{constructor(){super(...arguments),this.name="create_workspace",this.type=y.WRITE,this.annotations=Jm({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return UT}async executeInternal(e){const a={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},t=await this.mondayApi.request(PT,a);return{content:`Workspace ${t.create_workspace?.id} successfully created`}}},class extends Qm{constructor(){super(...arguments),this.name="create_folder",this.type=y.WRITE,this.annotations=Jm({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return MT}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(BT,a);return{content:`Folder ${t.create_folder?.id} successfully created`}}},class extends Qm{constructor(){super(...arguments),this.name="move_object",this.type=y.WRITE,this.annotations=Jm({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 GT}async executeUpdateFolder(e){const{id:a,position:t,parentFolderId:i,workspaceId:n,accountProductId:o}=e,s={folderId:a,position:t,parentFolderId:i,workspaceId:n,accountProductId:o},r=await this.mondayApi.request(jT,s);return{content:`Object ${r.update_folder?.id} successfully moved`}}async executeUpdateBoardHierarchy(e){const{id:a,position:t,parentFolderId:i,workspaceId:n,accountProductId:o}=e,s={boardId:a,attributes:{position:t,folder_id:i,workspace_id:n,account_product_id:o}},r=await this.mondayApi.request(qT,s);return r.update_board_hierarchy?.success?{content:`Board ${r.update_board_hierarchy?.board?.id} position updated successfully`}:{content:`Board position updated failed: ${r.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:a,position:t,parentFolderId:i,workspaceId:n,accountProductId:o}=e,s={overviewId:a,attributes:{position:t,folder_id:i,workspace_id:n,account_product_id:o}},r=await this.mondayApi.request(zT,s);return r.update_overview_hierarchy?.success?{content:`Overview ${r.update_overview_hierarchy?.overview?.id} position updated successfully`}:{content:`Overview position updated failed: ${r.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:a}=e;switch(a){case Ib.Folder:return this.executeUpdateFolder(e);case Ib.Board:return this.executeUpdateBoardHierarchy(e);case Ib.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${a}`)}}},class extends Qm{constructor(){super(...arguments),this.name="create_dashboard",this.type=y.WRITE,this.annotations=Jm({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 CT}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(OT,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===Fg.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 Qm{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=y.READ,this.annotations=Jm({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(kT,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 Qm{constructor(){super(...arguments),this.name="create_widget",this.type=y.WRITE,this.annotations=Jm({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 $T}async executeInternal(e){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(RT,a);if(!t.create_widget)throw new Error("Failed to create widget");const i=t.create_widget,n=i.parent?.kind===ty.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}`)}}}];var WT;!function(e){e.API="api",e.APPS="apps"}(WT||(WT={}));const YT=(e,a)=>{let t=[];a?.mode===WT.APPS?t=[...$]:a?.mode!==WT.API&&a?.mode||(t=[...HT]);const i=t.map((a=>((e,a)=>e.prototype instanceof Qm?new e(a.apiClient,a.apiToken):new e)(a,e)));return i.filter((e=>{if(!a)return e.type!==y.ALL_API;if(a.mode===WT.API&&"only"===a.enableDynamicApiTools)return e.type===y.ALL_API;let t=!1;return a.mode===WT.API&&!1===a.enableDynamicApiTools&&(t=t||e.type===y.ALL_API),a.readOnlyMode&&(t=t||e.type!==y.READ),a.include?t=t||!a.include?.includes(e.name):a.exclude&&(t=t||a.exclude?.includes(e.name)),!t}))};exports.MondayAgentToolkit=class{constructor(a){this.mondayApi=new e.ApiClient({token:a.mondayApiToken,apiVersion:a.mondayApiVersion,requestConfig:a.mondayApiRequestConfig}),this.mondayApiToken=a.mondayApiToken,this.tools=this.initializeTools(a)}initializeTools(e){const a={apiClient:this.mondayApi,apiToken:this.mondayApiToken};return YT(a,e.toolsConfiguration)}getTools(){return this.tools.map((e=>{const t=e.getInputSchema();return{type:"function",function:{name:e.name,description:e.getDescription(),parameters:t?g.zodToJsonSchema(a.z.object(t)):void 0}}}))}async handleToolCall(e){const{name:t,arguments:i}=e.function,n=JSON.parse(i),o=this.tools.find((e=>e.name===t));if(!o)throw new Error(`Unknown tool: ${t}`);const s=o.getInputSchema();if(s){const t=a.z.object(s).safeParse(n);if(!t.success)throw new Error(`Invalid arguments: ${t.error.message}`);const i=await o.execute(t.data);return{role:"tool",tool_call_id:e.id,content:i.content}}{const a=await o.execute();return{role:"tool",tool_call_id:e.id,content:a.content}}}};
1358
+ `),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=iT(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=iT(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=iT(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 Qm{constructor(){super(...arguments),this.name="create_custom_activity",this.type=y.WRITE,this.annotations=Jm({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return __}async executeInternal(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(jw,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends Qm{constructor(){super(...arguments),this.name="create_timeline_item",this.type=y.WRITE,this.annotations=Jm({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return O_}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(Vw,a);return{content:`Timeline item '${e.title}' with ID ${t.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends Qm{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=y.READ,this.annotations=Jm({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return L_}async executeInternal(e){const a=await this.mondayApi.request(Pw);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 Qm{constructor(){super(...arguments),this.name="read_docs",this.type=y.READ,this.annotations=Jm({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 NT}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(zw,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(zw,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(Gw,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 Qm{constructor(){super(...arguments),this.name="workspace_info",this.type=y.READ,this.annotations=Jm({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 ST}async executeInternal(e){const a={workspace_id:e.workspace_id},t=await this.mondayApi.request(Hw,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 Qm{constructor(){super(...arguments),this.name="list_workspaces",this.type=y.READ,this.annotations=Jm({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 DT}async executeInternal(e){const a={limit:5e3},t=await this.mondayApi.request(AT,a);if(!t.workspaces||0===t.workspaces.length)return{content:"No workspaces found."};const i=t.workspaces.filter((e=>null!==e)).map((e=>{const a=e.description?` - ${e.description}`:"";return`• **${e.name}** (ID: ${e.id})${a}`})).join("\n");return{content:`**Available Workspaces (${t.workspaces.length}):**\n\n${i}\n\n**Summary:**\nTotal workspaces found: ${t.workspaces.length}\n\n${JSON.stringify(t.workspaces,null,2)}`}}},class extends Qm{constructor(){super(...arguments),this.name="create_doc",this.type=y.WRITE,this.annotations=Jm({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: { type: "workspace", workspace_id: 123, doc_kind: "private" }, markdown: "..." }\n- Workspace doc in folder: { location: { type: "workspace", workspace_id: 123, folder_id: 17264196 }, markdown: "..." }\n- Item doc: { location: { type: "item", item_id: 456, column_id: "doc_col_1" }, markdown: "..." }'}getInputSchema(){return kT}async executeInternal(e){try{let a,t;if(e.location.type===OT.enum.workspace){const i={location:{workspace:{workspace_id:e.location.workspace_id.toString(),name:e.doc_name,kind:e.location.doc_kind||wg.Public,folder_id:e.location.folder_id?.toString()}}},n=await this.mondayApi.request(Bw,i);a=n?.create_doc?.id??void 0,t=n?.create_doc?.url??void 0}else if(e.location.type===OT.enum.item){const i={itemId:e.location.item_id.toString()},n=await this.mondayApi.request(Uw,i),o=n.items?.[0];if(!o)return{content:`Error: Item with id ${e.location.item_id} not found.`};const s=o.board?.id,r=o.board?.columns?.find((e=>e&&e.type===Rg.Doc));let p=e.location.column_id;if(!p)if(r)p=r.id;else{const e={boardId:s.toString(),columnType:Rg.Doc,columnTitle:"Doc"},a=await this.mondayApi.request(Cw,e);if(p=a?.create_column?.id,!p)return{content:"Error: Failed to create doc column."}}const d={location:{board:{item_id:e.location.item_id.toString(),column_id:p}}},l=await this.mondayApi.request(Bw,d);if(a=l.create_doc?.id??void 0,t=l.create_doc?.url??void 0,e.doc_name&&a)try{const t={docId:a,name:e.doc_name};await this.mondayApi.request(qw,t)}catch(e){console.warn("Failed to update doc name:",e)}}if(!a)return{content:"Error: Failed to create document."};const i={docId:a,markdown:e.markdown},n=await this.mondayApi.request(Mw,i),o=n?.add_content_to_doc_from_markdown?.success,s=n?.add_content_to_doc_from_markdown?.error;return o?{content:`✅ Document successfully created (id: ${a}). ${t?`\n\nURL: ${t}`:""}`}:{content:`Document ${a} created, but failed to add markdown content: ${s||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends Qm{constructor(){super(...arguments),this.name="update_workspace",this.type=y.WRITE,this.annotations=Jm({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return VT}async executeInternal(e){const a={id:e.id,attributes:e.attributes},t=await this.mondayApi.request(jT,a);return{content:`Workspace ${t.update_workspace?.id} successfully updated`}}},class extends Qm{constructor(){super(...arguments),this.name="update_folder",this.type=y.WRITE,this.annotations=Jm({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return UT}async executeInternal(e){const a={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:e.position},t=await this.mondayApi.request(PT,a);return{content:`Folder ${t.update_folder?.id} successfully updated`}}},class extends Qm{constructor(){super(...arguments),this.name="create_workspace",this.type=y.WRITE,this.annotations=Jm({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return MT}async executeInternal(e){const a={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},t=await this.mondayApi.request(BT,a);return{content:`Workspace ${t.create_workspace?.id} successfully created`}}},class extends Qm{constructor(){super(...arguments),this.name="create_folder",this.type=y.WRITE,this.annotations=Jm({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return zT}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(qT,a);return{content:`Folder ${t.create_folder?.id} successfully created`}}},class extends Qm{constructor(){super(...arguments),this.name="move_object",this.type=y.WRITE,this.annotations=Jm({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 WT}async executeUpdateFolder(e){const{id:a,position:t,parentFolderId:i,workspaceId:n,accountProductId:o}=e,s={folderId:a,position:t,parentFolderId:i,workspaceId:n,accountProductId:o},r=await this.mondayApi.request(PT,s);return{content:`Object ${r.update_folder?.id} successfully moved`}}async executeUpdateBoardHierarchy(e){const{id:a,position:t,parentFolderId:i,workspaceId:n,accountProductId:o}=e,s={boardId:a,attributes:{position:t,folder_id:i,workspace_id:n,account_product_id:o}},r=await this.mondayApi.request(GT,s);return r.update_board_hierarchy?.success?{content:`Board ${r.update_board_hierarchy?.board?.id} position updated successfully`}:{content:`Board position updated failed: ${r.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:a,position:t,parentFolderId:i,workspaceId:n,accountProductId:o}=e,s={overviewId:a,attributes:{position:t,folder_id:i,workspace_id:n,account_product_id:o}},r=await this.mondayApi.request(HT,s);return r.update_overview_hierarchy?.success?{content:`Overview ${r.update_overview_hierarchy?.overview?.id} position updated successfully`}:{content:`Overview position updated failed: ${r.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:a}=e;switch(a){case Ib.Folder:return this.executeUpdateFolder(e);case Ib.Board:return this.executeUpdateBoardHierarchy(e);case Ib.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${a}`)}}},class extends Qm{constructor(){super(...arguments),this.name="create_dashboard",this.type=y.WRITE,this.annotations=Jm({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 LT}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(RT,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===Fg.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 Qm{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=y.READ,this.annotations=Jm({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(CT,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 Qm{constructor(){super(...arguments),this.name="create_widget",this.type=y.WRITE,this.annotations=Jm({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 FT}async executeInternal(e){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($T,a);if(!t.create_widget)throw new Error("Failed to create widget");const i=t.create_widget,n=i.parent?.kind===ty.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}`)}}}];var KT;!function(e){e.API="api",e.APPS="apps"}(KT||(KT={}));const JT=(e,a)=>{let t=[];a?.mode===KT.APPS?t=[...$]:a?.mode!==KT.API&&a?.mode||(t=[...YT]);const i=t.map((a=>((e,a)=>e.prototype instanceof Qm?new e(a.apiClient,a.apiToken):new e)(a,e)));return i.filter((e=>{if(!a)return e.type!==y.ALL_API;if(a.mode===KT.API&&"only"===a.enableDynamicApiTools)return e.type===y.ALL_API;let t=!1;return a.mode===KT.API&&!1===a.enableDynamicApiTools&&(t=t||e.type===y.ALL_API),a.readOnlyMode&&(t=t||e.type!==y.READ),a.include?t=t||!a.include?.includes(e.name):a.exclude&&(t=t||a.exclude?.includes(e.name)),!t}))};exports.MondayAgentToolkit=class{constructor(a){this.mondayApi=new e.ApiClient({token:a.mondayApiToken,apiVersion:a.mondayApiVersion,requestConfig:a.mondayApiRequestConfig}),this.mondayApiToken=a.mondayApiToken,this.tools=this.initializeTools(a)}initializeTools(e){const a={apiClient:this.mondayApi,apiToken:this.mondayApiToken};return JT(a,e.toolsConfiguration)}getTools(){return this.tools.map((e=>{const t=e.getInputSchema();return{type:"function",function:{name:e.name,description:e.getDescription(),parameters:t?g.zodToJsonSchema(a.z.object(t)):void 0}}}))}async handleToolCall(e){const{name:t,arguments:i}=e.function,n=JSON.parse(i),o=this.tools.find((e=>e.name===t));if(!o)throw new Error(`Unknown tool: ${t}`);const s=o.getInputSchema();if(s){const t=a.z.object(s).safeParse(n);if(!t.success)throw new Error(`Invalid arguments: ${t.error.message}`);const i=await o.execute(t.data);return{role:"tool",tool_call_id:e.id,content:i.content}}{const a=await o.execute();return{role:"tool",tool_call_id:e.id,content:a.content}}}};
1338
1359
  //# sourceMappingURL=index.js.map