@mondaydotcomorg/agent-toolkit 2.32.0 → 2.32.1

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.
@@ -893,7 +893,6 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import a from"util";import t,{R
893
893
  type
894
894
  settings
895
895
  }
896
-
897
896
  }
898
897
  }
899
898
  `,LT=(e,a)=>({board:{...e,subItemColumns:a?.columns??void 0},filteringGuidelines:VT(e.columns.filter(FT)),aggregationGuidelines:jT()});function FT(e){return!!e&&["id","type"].every((a=>a in e))}const PT={last_updated:'Supported operators: any_of, not_any_of. CompareValue should be either:\n - "TODAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "YESTERDAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\nEXAMPLES:\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // using TODAY with correct compareAttribute\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "UPDATED_AT"} // using THIS_WEEK with not_any_of\n ❌ Wrong: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of"} // missing required compareAttribute\n ❌ Wrong: {"columnId": "last_updated", "compareValue": "TODAY", "operator": "any_of", "compareAttribute": "UPDATED_AT"} // not using array for any_of operator',date:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue should be either:\n - Date in "YYYY-MM-DD" format must be passed along with "EXACT" string e.g. compareValue:["2025-01-01", "EXACT"]\n - "TODAY" - Item with today\'s date\n - "TOMORROW" - Item with tomorrow\'s date\n - "THIS_WEEK" - Item with this week\'s date\n - "ONE_WEEK_AGO" - Item with one week ago\'s date\nEXAMPLES:\n ✅ Correct: {"columnId": "date", "compareValue": ["2025-01-01", "EXACT"], "operator": "any_of"} // using exact date format with EXACT\n ✅ Correct: {"columnId": "date", "compareValue": "TODAY", "operator": "greater_than"} // using TODAY with greater_than\n ❌ Wrong: {"columnId": "date", "compareValue": "2025-01-01", "operator": "any_of"} // missing EXACT string for exact date\n ❌ Wrong: {"columnId": "date", "compareValue": ["TODAY"], "operator": "greater_than"} // using array with single value operator',email:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be:\n - empty string "" when searching for blank values\n - whole email address when searching for specific email\n - partial email when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "email", "compareValue": ["john@example.com"], "operator": "any_of"} // using array with any_of for specific email\n ✅ Correct: {"columnId": "email", "compareValue": "gmail", "operator": "contains_text"} // using partial email with contains_text\n ❌ Wrong: {"columnId": "email", "compareValue": "john@example.com", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "email", "compareValue": ["gmail"], "operator": "contains_text"} // using array with single value operator',long_text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "long_text", "compareValue": ["Complete project description"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "long_text", "compareValue": "urgent", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "long_text", "compareValue": "Complete project description", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "long_text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "text", "compareValue": ["Task Name"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "text", "compareValue": "bug", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "text", "compareValue": "Task Name", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',numbers:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue is a number or "$$$blank$$$" when searching for blank values\nEXAMPLES:\n ✅ Correct: {"columnId": "numbers", "compareValue": [100, 200], "operator": "any_of"} // using array with any_of for multiple numbers\n ✅ Correct: {"columnId": "numbers", "compareValue": 50, "operator": "greater_than"} // using single number with greater_than\n ❌ Wrong: {"columnId": "numbers", "compareValue": 100, "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "numbers", "compareValue": ["50"], "operator": "greater_than"} // using array with single value operator',name:'Supported operators: "contains_text", "not_contains_text". CompareValue can be full or partial text\nEXAMPLES:\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "contains_text"} // using string with contains_text\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "not_contains_text"} // using string with not_contains_text',status:'Supported operators: any_of, not_any_of, contains_terms. CompareValue should be either:\n - id of label from column settings - when used with any_of, not_any_of operators\n - label\'s text - when use with contains_terms\nEXAMPLES:\n ✅ Correct: {"columnId": "status", "compareValue": [0, 1], "operator": "any_of"} // Using id values\n ✅ Correct: {"columnId": "status", "compareValue": "Done", "operator": "contains_terms"} // Using label text\n ❌ Wrong: {"columnId": "status", "compareValue": "Done", "operator": "any_of"} // Using label text with wrong operator\n ❌ Wrong: {"columnId": "status", "compareValue": [0, 1], "operator": "contains_terms"} // Using id with wrong operator',checkbox:'Supported operators: is_empty, is_not_empty. Compare value must be an empty array\nEXAMPLES:\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": null, "operator": "is_empty"} // not using empty array with is_empty operator',people:'Supported operators: any_of, not_any_of, is_empty, is_not_empty. **CRITICAL**: CompareValue MUST be in one of following:\n - "assigned_to_me" - when searching for current user\n - "person-123" - when searching for specific person with id 123\n - "team-456" - when searching for specific team with id 456\n - empty array when using is_empty, is_not_empty operators\nEXAMPLES: \n ❌ Wrong: {"columnId": "column_id", "compareValue": ["person—123"], "operator": "any_of"} // Using long hyphen \'—\' instead of short hyphen \'-\'\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ✅ Correct: {"columnId": "column_id", "compareValue": ["person-80120403"], "operator": "any_of"} // using person prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["team-9000"], "operator": "any_of"} // using team prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["assigned_to_me"], "operator": "any_of"} // using assigned_to_me value\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "is_empty"} // using id with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "any_of"} // not using person or team prefix'},jT=()=>`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${Ug.CountItems} function. Do not use ${Ug.Count} function for that purpose.\n `,VT=e=>{const a=e.reduce(((e,a)=>PT[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(", ")}) - ${PT[e]}`)).join("\n\n")}\n\n## [IMPORTANT] Sub Items Columns MUST NOT BE USED FOR FILTERING.\n `},UT={boardId:b.number().describe("The id of the board to get information for")};const BT=m_`
@@ -914,7 +913,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import a from"util";import t,{R
914
913
 
915
914
  ... on BoardRelationValue {
916
915
  linked_items {
917
- id
916
+ id
918
917
  name
919
918
  board {
920
919
  id
@@ -924,8 +923,16 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import a from"util";import t,{R
924
923
  }
925
924
  }
926
925
  }
927
-
928
- query GetBoardItemsPage($boardId: ID!, $limit: Int, $cursor: String, $includeColumns: Boolean!, $columnIds: [String!], $queryParams: ItemsQuery, $includeSubItems: Boolean!) {
926
+
927
+ query GetBoardItemsPage(
928
+ $boardId: ID!
929
+ $limit: Int
930
+ $cursor: String
931
+ $includeColumns: Boolean!
932
+ $columnIds: [String!]
933
+ $queryParams: ItemsQuery
934
+ $includeSubItems: Boolean!
935
+ ) {
929
936
  boards(ids: [$boardId]) {
930
937
  id
931
938
  name
@@ -942,7 +949,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import a from"util";import t,{R
942
949
  }
943
950
  }
944
951
  `,MT=m_`
945
- query SmartSearchBoardItemIds($searchTerm: String!, $board_ids: [ID!]) {
952
+ query SearchItemsDev($searchTerm: String!, $board_ids: [ID!]) {
946
953
  search_items(board_ids: $board_ids, query: $searchTerm, size: 100) {
947
954
  results {
948
955
  data {
@@ -1459,7 +1466,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import a from"util";import t,{R
1459
1466
  }
1460
1467
  }
1461
1468
  }
1462
- `,VI={};const UI=[class extends Ru{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=_.READ,this.annotations=ku({title:"monday-dev: Get Sprints Boards",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Discover monday-dev sprints boards and their associated tasks boards in your account.\n\n## Purpose:\nIdentifies and returns monday-dev sprints board IDs and tasks board IDs that you need to use with other monday-dev tools. \nThis tool scans your recently used boards (up to 100) to find valid monday-dev sprint management boards.\n\n## What it Returns:\n- Pairs of sprints boards and their corresponding tasks boards\n- Board IDs, names, and workspace information for each pair\n- The bidirectional relationship between each sprints board and its tasks board\n\n## Note:\nSearches recently used boards (up to 100). If none found, ask user to provide board IDs manually."}getInputSchema(){return VI}async executeInternal(e){try{const e={limit:100},a=((await this.mondayApi.request(jI,e)).boards||[]).filter((e=>null!==e));if(0===a.length)return{content:`${uI} No boards found in your account. Please verify you have access to monday.com boards.`};const t=this.extractBoardPairs(a);if(0===t.length)return{content:this.generateNotFoundMessage(a.length)};return{content:this.generateReport(t)}}catch(e){return{content:`${yI} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}generateMultiplePairsWarning(e){return`## ⚠️ Multiple SprintsBoard Detected\n**${e}** different board pairs found. Each pair is isolated and workspace-specific.\n**AI Agent - REQUIRED:** Before ANY operation, confirm with user which pair and workspace to use.\n---\n`}generatePairDetails(e,a){return`### Pair ${a+1}\n**Sprints Board:**\n- ID: \`${e.sprintsBoard.id}\`\n- Name: ${e.sprintsBoard.name}\n- Workspace: ${e.sprintsBoard.workspaceName} (ID: ${e.sprintsBoard.workspaceId})\n\n**Tasks Board:**\n- ID: \`${e.tasksBoard.id}\`\n- Name: ${e.tasksBoard.name}\n- Workspace: ${e.tasksBoard.workspaceName} (ID: ${e.tasksBoard.workspaceId})\n---\n\n`}generateTechnicalReference(){return"## 📋 Technical Reference\n\n**Sprint Operations** (all require correct board pair):\n• Add to Sprint: Update `task_sprint` column with sprint item ID\n• Remove from Sprint: Clear `task_sprint` column (set to null)\n• Search in Sprint: Filter where `task_sprint` equals sprint item ID\n• Move Between Sprints: Update `task_sprint` with new sprint item ID\n• Backlog Tasks: `task_sprint` is empty/null\n\n**Critical:** `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}generateReport(e){const a=e.length>1?this.generateMultiplePairsWarning(e.length):"",t=e.map(((e,a)=>this.generatePairDetails(e,a))).join(""),n=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${a}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${t}${n}`}generateNotFoundMessage(e){return`## No Monday-Dev Sprints Board Pairs Found\n\n**Boards Checked:** ${e} (recently used)\n\nNo board pairs with sprint relationships found in your recent boards.\n\n### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`}createBoardInfo(e,a,t){return{id:e,name:a?.name||t,workspaceId:a?.workspace?.id||"unknown",workspaceName:a?.workspace?.name||"Unknown"}}processSprintsBoard(e,a,t){const n=$I(e,lI.SPRINT_TASKS);if(!n)return;const i=CI(n);if(!i)return;const o=`${e.id}:${i}`;if(t.has(o))return;const s=a.get(i);t.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(i,s,`Tasks Board ${i}`)})}processTasksBoard(e,a,t){const n=$I(e,_I);if(!n)return;const i=CI(n);if(!i)return;const o=`${i}:${e.id}`;if(t.has(o))return;const s=a.get(i);t.set(o,{sprintsBoard:this.createBoardInfo(i,s,`Sprints Board ${i}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const a=new Map,t=new Map(e.map((e=>[e.id,e])));for(const n of e)n.columns&&(kI(n)&&this.processSprintsBoard(n,t,a),RI(n)&&this.processTasksBoard(n,t,a));return Array.from(a.values())}},class extends Ru{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=_.READ,this.annotations=ku({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive sprint metadata from a monday-dev sprints board including:\n\n## Data Retrieved:\nA table of sprints with the following information:\n- Sprint ID\n- Sprint Name\n- Sprint timeline (planned from/to dates)\n- Sprint completion status (completed/in-progress/planned)\n- Sprint start date (actual)\n- Sprint end date (actual)\n- Sprint activation status\n- Sprint summary document object ID\n\n## Parameters:\n- **limit**: Number of sprints to retrieve (default: 25, max: 100)\n\nRequires the Main Sprints board ID of the monday-dev containing your sprints."}getInputSchema(){return PI}async executeInternal(e){try{const a=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!a.success)return{content:a.error||"Board schema validation failed"};const t={boardId:e.sprintsBoardId.toString(),limit:e.limit},n=await this.mondayApi.request(FI,t),i=n.boards?.[0],o=i?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${yI} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const a={boardId:e.toString()},t=await this.mondayApi.request(h_,a),n=t.boards?.[0];if(!n)return{success:!1,error:`${uI} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const i=n.columns||[],o=this.validateSprintsBoardSchemaFromColumns(i);return o.isValid?{success:!0}:{success:!1,error:`${wI} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${yI} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const a=new Set(e.filter((e=>null!==e)).map((e=>e.id))),t=Object.values(lI),n=DI(a,t);if(!n.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return n.missingColumns.forEach((a=>{const t=(e=>xI[e]||e)(a);e+=`- ${t}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let a="# Sprints Metadata Report\n\n";return a+=`**Total Sprints:** ${e.length}\n\n`,a+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",a+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const t=e.name||"Unknown",n=e.id,i=SI(e,mI.SPRINT_ACTIVATION),o=SI(e,mI.SPRINT_COMPLETION),s=NI(e,mI.SPRINT_START_DATE),r=NI(e,mI.SPRINT_END_DATE),p=((e,a)=>{const t=II(e,a);if("TimelineValue"===t?.__typename&&t.from&&t.to)return{from:t.from.split("T")[0],to:t.to.split("T")[0]};return null})(e,mI.SPRINT_TIMELINE),d=AI(e,mI.SPRINT_SUMMARY);let c=TI.Planned;o?c=TI.Completed:(i||s)&&(c=TI.Active);const l=p?`${p.from} to ${p.to}`:"Not set";a+=`| ${t} | ${n} | ${c} | ${l} | ${s||"Not started"} | ${r||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),a+="\n## Status Definitions:\n",a+=`- **${TI.Planned}**: Sprint not yet started (no activation, no start date)\n`,a+=`- **${TI.Active}**: Sprint is active (activated but not completed)\n`,a+=`- **${TI.Completed}**: Sprint is finished\n\n`,a}},class extends Ru{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=_.READ,this.annotations=ku({title:"monday-dev: Get Sprint Summary",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the complete summary and analysis of a sprint.\n\n## Purpose:\nUnlock deep insights into completed sprint performance. \n\nThe sprint summary content including:\n- **Scope Management**: Analysis of planned vs. unplanned tasks, scope creep\n- **Velocity & Performance**: Individual velocity, task completion rates, workload distribution per team member\n- **Task Distribution**: Breakdown of completed tasks by type (Feature, Bug, Tech Debt, Infrastructure, etc.)\n- **AI Recommendations**: Action items, process improvements, retrospective focus areas\n\n## Requirements:\n- Sprint must be completed and must be created after 1/1/2025 \n\n## Important Note:\nWhen viewing the section "Completed by Assignee", you\'ll see user IDs in the format "@user-12345678". the 8 digits after the @is the user ID. To retrieve the actual owner names, use the list_users_and_teams tool with the user ID and set includeTeams=false for optimal performance.\n\n'}getInputSchema(){return LI}async executeInternal(e){try{const a=await this.getSprintMetadata(e.sprintId);if(!a.success)return{content:a.error||`${yI} Unknown error occurred while getting sprint metadata`};const t=await this.readSprintSummaryDocument(a.documentObjectId);return t.success?{content:t.content}:{content:t.error||`${yI} Unknown error occurred while reading document content`}}catch(e){return{content:`${yI} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const a={ids:[String(e)]},t=(await this.mondayApi.request(cI,a)).items||[];if(0===t.length)return{success:!1,error:`${fI} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const n=t[0];if(!n)return{success:!1,error:`${fI} Sprint with ID ${e} not found.`};const i=((e,a=[])=>{const t=new Set((e.column_values||[]).map((e=>e.id))),n=[...Object.values(lI),...a];return DI(t,n)})(n,[mI.SPRINT_SUMMARY]);if(!i.isValid)return{success:!1,error:`${wI} Sprint item is missing required columns: ${i.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=AI(n,mI.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:n.name}:{success:!1,error:`${hI} No sprint summary document found for sprint "${n.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${yI} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const a={object_ids:[e],limit:1},t=(await this.mondayApi.request(S_,a)).docs||[];if(0===t.length)return{success:!1,error:`${hI} Document with object ID ${e} not found or not accessible.`};const n=t[0];if(!n||!n.id)return{success:!1,error:`${vI} Document data is invalid for object ID ${e}.`};const i={docId:n.id,blockIds:[]},o=await this.mondayApi.request(N_,i);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${bI} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const s=o.export_markdown_from_doc.markdown;return s?{success:!0,content:s}:{success:!1,error:`${gI} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${yI} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],BI=[class extends Ru{constructor(){super(...arguments),this.name="delete_item",this.type=_.WRITE,this.annotations=ku({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return ST}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(u_,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends Ru{constructor(){super(...arguments),this.name="get_board_items_page",this.type=_.READ,this.annotations=ku({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available."}getInputSchema(){return qT}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{Rx(e,"filters",qT.filters),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const t={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems};Rx(e,"filters",qT.filters),Rx(e,"orderBy",qT.orderBy),a&&(e.itemIds||e.filters||e.orderBy)&&(t.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const n=await this.mondayApi.request(BT,t),i=this.mapResult(n,e);return{content:JSON.stringify(i,null,2)}}rebuildFiltersWithManualSearch(e,a){return(a=(a=a??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:ey.ContainsText,compareValue:e}),a}mapResult(e,a){const t=e.boards?.[0],n=t?.items_page,i=n?.items||[];return{board:{id:t?.id,name:t?.name},items:i.map((e=>this.mapItem(e,a))),pagination:{has_more:!!n?.cursor,nextCursor:n?.cursor||null,count:i.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){switch(e.type){case iT.BoardRelation:return e.linked_items;case iT.Formula:return e.display_value;case iT.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const a={board_ids:[e.boardId.toString()],searchTerm:e.searchTerm},t=await this.mondayApi.request(MT,a),n=t.search_items?.results?.map((e=>Number(e.data.id)))??[];if(0===n.length)throw new Error("No items found for search term or new search is not enabled for this account");const i=e.itemIds??[];if(0===i.length)return n;const o=new Set(i);return n.filter((e=>o.has(e)))}},class extends Ru{constructor(){super(...arguments),this.name="create_item",this.type=_.WRITE,this.annotations=ku({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?gT:bT}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()},n=await this.mondayApi.request(lT,t);if(!n.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let i;try{i=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...i,name:e.name},s=new $_(this.mondayApi,this.apiToken,{boardId:a}),r=await s.execute({itemId:parseInt(n.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 ${n.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){vT(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(mT,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){vT(e,"create subitem")}}async createNewItem(e,a){try{const t={boardId:a.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},n=await this.mondayApi.request(f_,t);return{content:`Item ${n.create_item?.id} successfully created`}}catch(e){vT(e,"create item")}}},class extends Ru{constructor(){super(...arguments),this.name="create_update",this.type=_.WRITE,this.annotations=ku({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update."}getInputSchema(){return TT}async executeInternal(e){let a;if(e.mentionsList)try{const t=JSON.parse(e.mentionsList),n=xT.safeParse(t);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);a=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},n=await this.mondayApi.request(wT,t);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${n.create_update.id} successfully created on item ${e.itemId}`}}catch(e){vT(e,"create update")}}},class extends Ru{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=_.WRITE,this.annotations=ku({title:"Create Update in Monday, after calling this tool you should",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. After calling this tool you should call the full board data tool to get data, and immediately after that call the show table tool to show the data from that tool. IMPORTANT: You MUST use the COMPLETE data from the full board data tool - do NOT cut, truncate, or omit any data. Pass the entire dataset to the show table tool."}getInputSchema(){return dI}async executeInternal(e){let a;if(e.mentionsList)try{const t=JSON.parse(e.mentionsList),n=pI.safeParse(t);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);a=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},n=await this.mondayApi.request(wT,t);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${n.create_update.id} successfully created on item ${e.itemId}. Now we want to show the updated data, so call the full board data tool to get data, and then immediately after that call the show table tool to show the data from that tool. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received.`}}catch(e){vT(e,"create update")}}},class extends Ru{constructor(){super(...arguments),this.name="get_board_schema",this.type=_.READ,this.annotations=ku({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 GT}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},n=await this.mondayApi.request(h_,t);return{content:`The current schema of the board ${a} is: \n \n\nColumns:\n ${n.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${n.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends Ru{constructor(){super(...arguments),this.name="get_board_activity",this.type=_.READ,this.annotations=ku({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 RT}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-hT.MONTH30Days),n=e?.fromDate||t.toISOString(),i=e?.toDate||a.toISOString(),o={boardId:e.boardId.toString(),fromDate:n,toDate:i,limit:this.defaultLimit,page:1},s=await this.mondayApi.request(kT,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 (${n} to ${i}).`};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 ${n} to ${i} (${r.length} entries):\n\n${p}`}}},class extends Ru{constructor(){super(...arguments),this.name="get_board_info",this.type=_.READ,this.annotations=ku({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return UT}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(CT,a),n=t.boards?.[0];if(!n)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const i=await this.getSubItemsBoardAsync(n);return{content:JSON.stringify(LT(n,i),null,2)}}async getSubItemsBoardAsync(e){const a=e.columns?.find((e=>e?.type===iT.Subtasks));if(!a)return null;const t=a.settings.boardIds[0],n=await this.mondayApi.request($T,{boardId:t});return n.boards?.[0]??null}},class extends Ru{constructor(){super(...arguments),this.name="get_full_board_data",this.type=_.READ,this.annotations=ku({title:"Get Full Board Data",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"INTERNAL USE ONLY - DO NOT CALL THIS TOOL DIRECTLY. This tool is exclusively triggered by UI components and should never be invoked directly by the agent."}getInputSchema(){return OT}async executeInternal(e){try{const a={boardId:e.boardId.toString(),itemsLimit:7},t=await this.mondayApi.request(AT,a);if(!t.boards||0===t.boards.length||!t.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const n=t.boards[0],i=new Set;n.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&i.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&i.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const a=e;a.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&i.add(e.id)}))}}))}));let o=[];if(i.size>0){const e={userIds:Array.from(i)},a=await this.mondayApi.request(DT,e);o=a.users?.filter((e=>null!==e))||[]}const s=new Map(o.map((e=>[e.id,e]))),r={board:{id:n.id,name:n.name,columns:n.columns,items:n.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:o,stats:{total_items:n.items_page.items.length,total_updates:n.items_page.items.reduce(((e,a)=>e+(a.updates?.length||0)),0),total_unique_creators:o.length}};return{content:JSON.stringify(r,null,2)}}catch(e){vT(e,"get full board data")}}},class extends Ru{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=_.READ,this.annotations=ku({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Tool to fetch users and/or teams data. \n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs or names when available\n 2. If no ids available, use name search if possible (USERS ONLY)\n 3. Use 'getMe: true' to get current user information\n 4. AVOID broad queries (no parameters) - use only as last resort\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe - STANDALONE\n 2. userIds\n 3. name - STANDALONE (USERS ONLY, NOT for teams)\n 4. teamIds + teamsOnly\n 5. No parameters - LAST RESORT\n\n CRITICAL USAGE RULES:\n • userIds + teamIds requires explicit includeTeams: true flag\n • includeTeams: true fetches both users and teams, do not use this to fetch a specific user's teams rather fetch that user by id and you will get their team memberships.\n • name parameter is for USER search ONLY - it cannot be used to search for teams. Use teamIds to fetch specific teams."}getInputSchema(){return gE}async executeInternal(e){const a=e.userIds&&e.userIds.length>0,t=e.teamIds&&e.teamIds.length>0,n=e.includeTeams||!1,i=e.teamsOnly||!1,o=e.includeTeamMembers||!1,s=!!e.name;if(e.getMe||!1){if(a||t||n||i||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(cE);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const r={users:[e.me]};return{content:uE(r)}}if(s){if(a||t||n||i||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(dE,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(i&&n)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>fE)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>hE)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(i||!a&&t&&!n)if(o){const a={teamIds:e.teamIds};r=await this.mondayApi.request(pE,a)}else{const a={teamIds:e.teamIds};r=await this.mondayApi.request(rE,a)}else if(n){const a={userIds:e.userIds,teamIds:e.teamIds,limit:vE};r=await this.mondayApi.request(sE,a)}else if(a){const a={userIds:e.userIds,limit:vE};r=await this.mondayApi.request(iE,a)}else{const e={userIds:void 0,limit:vE};r=await this.mondayApi.request(oE,e)}return{content:uE(r)}}},$_,class extends Ru{constructor(){super(...arguments),this.name="move_item_to_group",this.type=_.WRITE,this.annotations=ku({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 bE}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(g_,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends Ru{constructor(){super(...arguments),this.name="create_board",this.type=_.WRITE,this.annotations=ku({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return L_}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(b_,a);return{content:`Board ${t.create_board?.id} successfully created`}}},class extends Ru{constructor(){super(...arguments),this.name="create_form",this.type=_.WRITE,this.annotations=ku({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 mx}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(G_,a);return{content:`Form created successfully. Board ID: ${t.create_form?.boardId}, Token: ${t.create_form?.token}`}}},class extends Ru{constructor(){super(...arguments),this.name="update_form",this.type=_.WRITE,this.annotations=ku({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new tT(this.mondayApi),this.actionHandlers=new Map([[Cx.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Cx.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Cx.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Cx.activate,this.helpers.activateForm.bind(this.helpers)],[Cx.createTag,this.helpers.createTag.bind(this.helpers)],[Cx.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Cx.updateTag,this.helpers.updateTag.bind(this.helpers)],[Cx.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Cx.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Cx.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Cx.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Cx.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 aT}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(Rx(e,"tag",aT.tag),Rx(e,"form",aT.form),await a(e)):{content:"Received an invalid action for the update form tool."}}},class extends Ru{constructor(){super(...arguments),this.name="get_form",this.type=_.READ,this.annotations=ku({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 nT}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(H_,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 Ru{constructor(){super(...arguments),this.name="form_questions_editor",this.type=_.WRITE,this.annotations=ku({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new kx(this.mondayApi),this.actionHandlers=new Map([[Ax.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Ax.Update,this.helpers.updateQuestion.bind(this.helpers)],[Ax.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Ox}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(Rx(e,"question",Ox.question),await a(e)):{content:`Unknown action: ${e.action}`}}},class extends Ru{constructor(){super(...arguments),this.name="create_column",this.type=_.WRITE,this.annotations=ku({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?oT:sT}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},n=await this.mondayApi.request(y_,t);return{content:`Column ${n.create_column?.id} successfully created`}}},class extends Ru{constructor(){super(...arguments),this.name="create_group",this.type=_.WRITE,this.annotations=ku({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 cT}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(pT,a);return{content:`Group "${t.create_group?.title}" (ID: ${t.create_group?.id}) successfully created`}}},class extends Ru{constructor(){super(...arguments),this.name="delete_column",this.type=_.WRITE,this.annotations=ku({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?ET:IT}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`}}},k_,class extends Ru{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=_.ALL_API,this.annotations=ku({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 WT}async executeInternal(e){try{const a=await this.mondayApi.request(__),t=e?.operationType,n=a.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",i=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${n}\n\n`),t&&"write"!==t||(r+=`- Mutation Type: ${a.__schema?.mutationType?.name}\n\n`,r+=`## Mutation Fields\n${i}\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 Ru{constructor(){super(...arguments),this.name="get_column_type_info",this.type=_.READ,this.annotations=ku({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 zT}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(HT,a);if(!t?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const n={schema:t.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(n,null,2)}`}}},class extends Ru{constructor(){super(...arguments),this.name="get_type_details",this.type=_.ALL_API,this.annotations=ku({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 YT}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,m_`
1469
+ `,VI={};const UI=[class extends Ru{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=_.READ,this.annotations=ku({title:"monday-dev: Get Sprints Boards",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Discover monday-dev sprints boards and their associated tasks boards in your account.\n\n## Purpose:\nIdentifies and returns monday-dev sprints board IDs and tasks board IDs that you need to use with other monday-dev tools. \nThis tool scans your recently used boards (up to 100) to find valid monday-dev sprint management boards.\n\n## What it Returns:\n- Pairs of sprints boards and their corresponding tasks boards\n- Board IDs, names, and workspace information for each pair\n- The bidirectional relationship between each sprints board and its tasks board\n\n## Note:\nSearches recently used boards (up to 100). If none found, ask user to provide board IDs manually."}getInputSchema(){return VI}async executeInternal(e){try{const e={limit:100},a=((await this.mondayApi.request(jI,e)).boards||[]).filter((e=>null!==e));if(0===a.length)return{content:`${uI} No boards found in your account. Please verify you have access to monday.com boards.`};const t=this.extractBoardPairs(a);if(0===t.length)return{content:this.generateNotFoundMessage(a.length)};return{content:this.generateReport(t)}}catch(e){return{content:`${yI} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}generateMultiplePairsWarning(e){return`## ⚠️ Multiple SprintsBoard Detected\n**${e}** different board pairs found. Each pair is isolated and workspace-specific.\n**AI Agent - REQUIRED:** Before ANY operation, confirm with user which pair and workspace to use.\n---\n`}generatePairDetails(e,a){return`### Pair ${a+1}\n**Sprints Board:**\n- ID: \`${e.sprintsBoard.id}\`\n- Name: ${e.sprintsBoard.name}\n- Workspace: ${e.sprintsBoard.workspaceName} (ID: ${e.sprintsBoard.workspaceId})\n\n**Tasks Board:**\n- ID: \`${e.tasksBoard.id}\`\n- Name: ${e.tasksBoard.name}\n- Workspace: ${e.tasksBoard.workspaceName} (ID: ${e.tasksBoard.workspaceId})\n---\n\n`}generateTechnicalReference(){return"## 📋 Technical Reference\n\n**Sprint Operations** (all require correct board pair):\n• Add to Sprint: Update `task_sprint` column with sprint item ID\n• Remove from Sprint: Clear `task_sprint` column (set to null)\n• Search in Sprint: Filter where `task_sprint` equals sprint item ID\n• Move Between Sprints: Update `task_sprint` with new sprint item ID\n• Backlog Tasks: `task_sprint` is empty/null\n\n**Critical:** `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}generateReport(e){const a=e.length>1?this.generateMultiplePairsWarning(e.length):"",t=e.map(((e,a)=>this.generatePairDetails(e,a))).join(""),n=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${a}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${t}${n}`}generateNotFoundMessage(e){return`## No Monday-Dev Sprints Board Pairs Found\n\n**Boards Checked:** ${e} (recently used)\n\nNo board pairs with sprint relationships found in your recent boards.\n\n### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`}createBoardInfo(e,a,t){return{id:e,name:a?.name||t,workspaceId:a?.workspace?.id||"unknown",workspaceName:a?.workspace?.name||"Unknown"}}processSprintsBoard(e,a,t){const n=$I(e,lI.SPRINT_TASKS);if(!n)return;const i=CI(n);if(!i)return;const o=`${e.id}:${i}`;if(t.has(o))return;const s=a.get(i);t.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(i,s,`Tasks Board ${i}`)})}processTasksBoard(e,a,t){const n=$I(e,_I);if(!n)return;const i=CI(n);if(!i)return;const o=`${i}:${e.id}`;if(t.has(o))return;const s=a.get(i);t.set(o,{sprintsBoard:this.createBoardInfo(i,s,`Sprints Board ${i}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const a=new Map,t=new Map(e.map((e=>[e.id,e])));for(const n of e)n.columns&&(kI(n)&&this.processSprintsBoard(n,t,a),RI(n)&&this.processTasksBoard(n,t,a));return Array.from(a.values())}},class extends Ru{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=_.READ,this.annotations=ku({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive sprint metadata from a monday-dev sprints board including:\n\n## Data Retrieved:\nA table of sprints with the following information:\n- Sprint ID\n- Sprint Name\n- Sprint timeline (planned from/to dates)\n- Sprint completion status (completed/in-progress/planned)\n- Sprint start date (actual)\n- Sprint end date (actual)\n- Sprint activation status\n- Sprint summary document object ID\n\n## Parameters:\n- **limit**: Number of sprints to retrieve (default: 25, max: 100)\n\nRequires the Main Sprints board ID of the monday-dev containing your sprints."}getInputSchema(){return PI}async executeInternal(e){try{const a=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!a.success)return{content:a.error||"Board schema validation failed"};const t={boardId:e.sprintsBoardId.toString(),limit:e.limit},n=await this.mondayApi.request(FI,t),i=n.boards?.[0],o=i?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${yI} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const a={boardId:e.toString()},t=await this.mondayApi.request(h_,a),n=t.boards?.[0];if(!n)return{success:!1,error:`${uI} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const i=n.columns||[],o=this.validateSprintsBoardSchemaFromColumns(i);return o.isValid?{success:!0}:{success:!1,error:`${wI} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${yI} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const a=new Set(e.filter((e=>null!==e)).map((e=>e.id))),t=Object.values(lI),n=DI(a,t);if(!n.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return n.missingColumns.forEach((a=>{const t=(e=>xI[e]||e)(a);e+=`- ${t}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let a="# Sprints Metadata Report\n\n";return a+=`**Total Sprints:** ${e.length}\n\n`,a+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",a+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const t=e.name||"Unknown",n=e.id,i=SI(e,mI.SPRINT_ACTIVATION),o=SI(e,mI.SPRINT_COMPLETION),s=NI(e,mI.SPRINT_START_DATE),r=NI(e,mI.SPRINT_END_DATE),p=((e,a)=>{const t=II(e,a);if("TimelineValue"===t?.__typename&&t.from&&t.to)return{from:t.from.split("T")[0],to:t.to.split("T")[0]};return null})(e,mI.SPRINT_TIMELINE),d=AI(e,mI.SPRINT_SUMMARY);let c=TI.Planned;o?c=TI.Completed:(i||s)&&(c=TI.Active);const l=p?`${p.from} to ${p.to}`:"Not set";a+=`| ${t} | ${n} | ${c} | ${l} | ${s||"Not started"} | ${r||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),a+="\n## Status Definitions:\n",a+=`- **${TI.Planned}**: Sprint not yet started (no activation, no start date)\n`,a+=`- **${TI.Active}**: Sprint is active (activated but not completed)\n`,a+=`- **${TI.Completed}**: Sprint is finished\n\n`,a}},class extends Ru{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=_.READ,this.annotations=ku({title:"monday-dev: Get Sprint Summary",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the complete summary and analysis of a sprint.\n\n## Purpose:\nUnlock deep insights into completed sprint performance. \n\nThe sprint summary content including:\n- **Scope Management**: Analysis of planned vs. unplanned tasks, scope creep\n- **Velocity & Performance**: Individual velocity, task completion rates, workload distribution per team member\n- **Task Distribution**: Breakdown of completed tasks by type (Feature, Bug, Tech Debt, Infrastructure, etc.)\n- **AI Recommendations**: Action items, process improvements, retrospective focus areas\n\n## Requirements:\n- Sprint must be completed and must be created after 1/1/2025 \n\n## Important Note:\nWhen viewing the section "Completed by Assignee", you\'ll see user IDs in the format "@user-12345678". the 8 digits after the @is the user ID. To retrieve the actual owner names, use the list_users_and_teams tool with the user ID and set includeTeams=false for optimal performance.\n\n'}getInputSchema(){return LI}async executeInternal(e){try{const a=await this.getSprintMetadata(e.sprintId);if(!a.success)return{content:a.error||`${yI} Unknown error occurred while getting sprint metadata`};const t=await this.readSprintSummaryDocument(a.documentObjectId);return t.success?{content:t.content}:{content:t.error||`${yI} Unknown error occurred while reading document content`}}catch(e){return{content:`${yI} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const a={ids:[String(e)]},t=(await this.mondayApi.request(cI,a)).items||[];if(0===t.length)return{success:!1,error:`${fI} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const n=t[0];if(!n)return{success:!1,error:`${fI} Sprint with ID ${e} not found.`};const i=((e,a=[])=>{const t=new Set((e.column_values||[]).map((e=>e.id))),n=[...Object.values(lI),...a];return DI(t,n)})(n,[mI.SPRINT_SUMMARY]);if(!i.isValid)return{success:!1,error:`${wI} Sprint item is missing required columns: ${i.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=AI(n,mI.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:n.name}:{success:!1,error:`${hI} No sprint summary document found for sprint "${n.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${yI} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const a={object_ids:[e],limit:1},t=(await this.mondayApi.request(S_,a)).docs||[];if(0===t.length)return{success:!1,error:`${hI} Document with object ID ${e} not found or not accessible.`};const n=t[0];if(!n||!n.id)return{success:!1,error:`${vI} Document data is invalid for object ID ${e}.`};const i={docId:n.id,blockIds:[]},o=await this.mondayApi.request(N_,i);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${bI} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const s=o.export_markdown_from_doc.markdown;return s?{success:!0,content:s}:{success:!1,error:`${gI} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${yI} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],BI=[class extends Ru{constructor(){super(...arguments),this.name="delete_item",this.type=_.WRITE,this.annotations=ku({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return ST}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(u_,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends Ru{constructor(){super(...arguments),this.name="get_board_items_page",this.type=_.READ,this.annotations=ku({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available."}getInputSchema(){return qT}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{Rx(e,"filters",qT.filters),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const t={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems};Rx(e,"filters",qT.filters),Rx(e,"orderBy",qT.orderBy),a&&(e.itemIds||e.filters||e.orderBy)&&(t.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const n=await this.mondayApi.request(BT,t),i=this.mapResult(n,e);return{content:JSON.stringify(i,null,2)}}rebuildFiltersWithManualSearch(e,a){return(a=(a=a??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:ey.ContainsText,compareValue:e}),a}mapResult(e,a){const t=e.boards?.[0],n=t?.items_page,i=n?.items||[];return{board:{id:t?.id,name:t?.name},items:i.map((e=>this.mapItem(e,a))),pagination:{has_more:!!n?.cursor,nextCursor:n?.cursor||null,count:i.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){switch(e.type){case iT.BoardRelation:return e.linked_items;case iT.Formula:return e.display_value;case iT.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const a={board_ids:[e.boardId.toString()],searchTerm:e.searchTerm},t=await this.mondayApi.request(MT,a,{versionOverride:"dev"}),n=t.search_items?.results?.map((e=>Number(e.data.id)))??[];if(0===n.length)throw new Error("No items found for search term or new search is not enabled for this account");const i=e.itemIds??[];if(0===i.length)return n;const o=new Set(i);return n.filter((e=>o.has(e)))}},class extends Ru{constructor(){super(...arguments),this.name="create_item",this.type=_.WRITE,this.annotations=ku({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?gT:bT}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()},n=await this.mondayApi.request(lT,t);if(!n.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let i;try{i=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...i,name:e.name},s=new $_(this.mondayApi,this.apiToken,{boardId:a}),r=await s.execute({itemId:parseInt(n.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 ${n.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){vT(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(mT,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){vT(e,"create subitem")}}async createNewItem(e,a){try{const t={boardId:a.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},n=await this.mondayApi.request(f_,t);return{content:`Item ${n.create_item?.id} successfully created`}}catch(e){vT(e,"create item")}}},class extends Ru{constructor(){super(...arguments),this.name="create_update",this.type=_.WRITE,this.annotations=ku({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update."}getInputSchema(){return TT}async executeInternal(e){let a;if(e.mentionsList)try{const t=JSON.parse(e.mentionsList),n=xT.safeParse(t);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);a=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},n=await this.mondayApi.request(wT,t);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${n.create_update.id} successfully created on item ${e.itemId}`}}catch(e){vT(e,"create update")}}},class extends Ru{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=_.WRITE,this.annotations=ku({title:"Create Update in Monday, after calling this tool you should",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. After calling this tool you should call the full board data tool to get data, and immediately after that call the show table tool to show the data from that tool. IMPORTANT: You MUST use the COMPLETE data from the full board data tool - do NOT cut, truncate, or omit any data. Pass the entire dataset to the show table tool."}getInputSchema(){return dI}async executeInternal(e){let a;if(e.mentionsList)try{const t=JSON.parse(e.mentionsList),n=pI.safeParse(t);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);a=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},n=await this.mondayApi.request(wT,t);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${n.create_update.id} successfully created on item ${e.itemId}. Now we want to show the updated data, so call the full board data tool to get data, and then immediately after that call the show table tool to show the data from that tool. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received.`}}catch(e){vT(e,"create update")}}},class extends Ru{constructor(){super(...arguments),this.name="get_board_schema",this.type=_.READ,this.annotations=ku({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 GT}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},n=await this.mondayApi.request(h_,t);return{content:`The current schema of the board ${a} is: \n \n\nColumns:\n ${n.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${n.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends Ru{constructor(){super(...arguments),this.name="get_board_activity",this.type=_.READ,this.annotations=ku({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 RT}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-hT.MONTH30Days),n=e?.fromDate||t.toISOString(),i=e?.toDate||a.toISOString(),o={boardId:e.boardId.toString(),fromDate:n,toDate:i,limit:this.defaultLimit,page:1},s=await this.mondayApi.request(kT,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 (${n} to ${i}).`};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 ${n} to ${i} (${r.length} entries):\n\n${p}`}}},class extends Ru{constructor(){super(...arguments),this.name="get_board_info",this.type=_.READ,this.annotations=ku({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return UT}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(CT,a),n=t.boards?.[0];if(!n)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const i=await this.getSubItemsBoardAsync(n);return{content:JSON.stringify(LT(n,i),null,2)}}async getSubItemsBoardAsync(e){const a=e.columns?.find((e=>e?.type===iT.Subtasks));if(!a)return null;const t=a.settings.boardIds[0],n=await this.mondayApi.request($T,{boardId:t});return n.boards?.[0]??null}},class extends Ru{constructor(){super(...arguments),this.name="get_full_board_data",this.type=_.READ,this.annotations=ku({title:"Get Full Board Data",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"INTERNAL USE ONLY - DO NOT CALL THIS TOOL DIRECTLY. This tool is exclusively triggered by UI components and should never be invoked directly by the agent."}getInputSchema(){return OT}async executeInternal(e){try{const a={boardId:e.boardId.toString(),itemsLimit:7},t=await this.mondayApi.request(AT,a);if(!t.boards||0===t.boards.length||!t.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const n=t.boards[0],i=new Set;n.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&i.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&i.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const a=e;a.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&i.add(e.id)}))}}))}));let o=[];if(i.size>0){const e={userIds:Array.from(i)},a=await this.mondayApi.request(DT,e);o=a.users?.filter((e=>null!==e))||[]}const s=new Map(o.map((e=>[e.id,e]))),r={board:{id:n.id,name:n.name,columns:n.columns,items:n.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:o,stats:{total_items:n.items_page.items.length,total_updates:n.items_page.items.reduce(((e,a)=>e+(a.updates?.length||0)),0),total_unique_creators:o.length}};return{content:JSON.stringify(r,null,2)}}catch(e){vT(e,"get full board data")}}},class extends Ru{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=_.READ,this.annotations=ku({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Tool to fetch users and/or teams data. \n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs or names when available\n 2. If no ids available, use name search if possible (USERS ONLY)\n 3. Use 'getMe: true' to get current user information\n 4. AVOID broad queries (no parameters) - use only as last resort\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe - STANDALONE\n 2. userIds\n 3. name - STANDALONE (USERS ONLY, NOT for teams)\n 4. teamIds + teamsOnly\n 5. No parameters - LAST RESORT\n\n CRITICAL USAGE RULES:\n • userIds + teamIds requires explicit includeTeams: true flag\n • includeTeams: true fetches both users and teams, do not use this to fetch a specific user's teams rather fetch that user by id and you will get their team memberships.\n • name parameter is for USER search ONLY - it cannot be used to search for teams. Use teamIds to fetch specific teams."}getInputSchema(){return gE}async executeInternal(e){const a=e.userIds&&e.userIds.length>0,t=e.teamIds&&e.teamIds.length>0,n=e.includeTeams||!1,i=e.teamsOnly||!1,o=e.includeTeamMembers||!1,s=!!e.name;if(e.getMe||!1){if(a||t||n||i||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(cE);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const r={users:[e.me]};return{content:uE(r)}}if(s){if(a||t||n||i||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(dE,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(i&&n)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>fE)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>hE)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(i||!a&&t&&!n)if(o){const a={teamIds:e.teamIds};r=await this.mondayApi.request(pE,a)}else{const a={teamIds:e.teamIds};r=await this.mondayApi.request(rE,a)}else if(n){const a={userIds:e.userIds,teamIds:e.teamIds,limit:vE};r=await this.mondayApi.request(sE,a)}else if(a){const a={userIds:e.userIds,limit:vE};r=await this.mondayApi.request(iE,a)}else{const e={userIds:void 0,limit:vE};r=await this.mondayApi.request(oE,e)}return{content:uE(r)}}},$_,class extends Ru{constructor(){super(...arguments),this.name="move_item_to_group",this.type=_.WRITE,this.annotations=ku({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 bE}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(g_,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends Ru{constructor(){super(...arguments),this.name="create_board",this.type=_.WRITE,this.annotations=ku({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return L_}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(b_,a);return{content:`Board ${t.create_board?.id} successfully created`}}},class extends Ru{constructor(){super(...arguments),this.name="create_form",this.type=_.WRITE,this.annotations=ku({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 mx}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(G_,a);return{content:`Form created successfully. Board ID: ${t.create_form?.boardId}, Token: ${t.create_form?.token}`}}},class extends Ru{constructor(){super(...arguments),this.name="update_form",this.type=_.WRITE,this.annotations=ku({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new tT(this.mondayApi),this.actionHandlers=new Map([[Cx.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Cx.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Cx.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Cx.activate,this.helpers.activateForm.bind(this.helpers)],[Cx.createTag,this.helpers.createTag.bind(this.helpers)],[Cx.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Cx.updateTag,this.helpers.updateTag.bind(this.helpers)],[Cx.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Cx.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Cx.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Cx.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Cx.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 aT}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(Rx(e,"tag",aT.tag),Rx(e,"form",aT.form),await a(e)):{content:"Received an invalid action for the update form tool."}}},class extends Ru{constructor(){super(...arguments),this.name="get_form",this.type=_.READ,this.annotations=ku({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 nT}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(H_,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 Ru{constructor(){super(...arguments),this.name="form_questions_editor",this.type=_.WRITE,this.annotations=ku({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new kx(this.mondayApi),this.actionHandlers=new Map([[Ax.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Ax.Update,this.helpers.updateQuestion.bind(this.helpers)],[Ax.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Ox}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(Rx(e,"question",Ox.question),await a(e)):{content:`Unknown action: ${e.action}`}}},class extends Ru{constructor(){super(...arguments),this.name="create_column",this.type=_.WRITE,this.annotations=ku({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?oT:sT}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},n=await this.mondayApi.request(y_,t);return{content:`Column ${n.create_column?.id} successfully created`}}},class extends Ru{constructor(){super(...arguments),this.name="create_group",this.type=_.WRITE,this.annotations=ku({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 cT}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(pT,a);return{content:`Group "${t.create_group?.title}" (ID: ${t.create_group?.id}) successfully created`}}},class extends Ru{constructor(){super(...arguments),this.name="delete_column",this.type=_.WRITE,this.annotations=ku({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?ET:IT}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`}}},k_,class extends Ru{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=_.ALL_API,this.annotations=ku({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 WT}async executeInternal(e){try{const a=await this.mondayApi.request(__),t=e?.operationType,n=a.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",i=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${n}\n\n`),t&&"write"!==t||(r+=`- Mutation Type: ${a.__schema?.mutationType?.name}\n\n`,r+=`## Mutation Fields\n${i}\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 Ru{constructor(){super(...arguments),this.name="get_column_type_info",this.type=_.READ,this.annotations=ku({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 zT}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(HT,a);if(!t?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const n={schema:t.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(n,null,2)}`}}},class extends Ru{constructor(){super(...arguments),this.name="get_type_details",this.type=_.ALL_API,this.annotations=ku({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 YT}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,m_`
1463
1470
  query getTypeDetails {
1464
1471
  __type(name: "${a}") {
1465
1472
  name