@mondaydotcomorg/agent-toolkit 3.0.9 → 3.0.11

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.
@@ -1003,6 +1003,14 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
1003
1003
  }
1004
1004
  }
1005
1005
  }
1006
+ description @include(if: $includeDescription) {
1007
+ id
1008
+ blocks {
1009
+ id
1010
+ type
1011
+ content
1012
+ }
1013
+ }
1006
1014
  }
1007
1015
 
1008
1016
  query GetBoardItemsPage(
@@ -1013,6 +1021,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
1013
1021
  $columnIds: [String!]
1014
1022
  $queryParams: ItemsQuery
1015
1023
  $includeSubItems: Boolean!
1024
+ $includeDescription: Boolean!
1016
1025
  ) {
1017
1026
  boards(ids: [$boardId]) {
1018
1027
  id
@@ -1040,7 +1049,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
1040
1049
  }
1041
1050
  }
1042
1051
  }
1043
- `;var pA,dA;!function(e){e.BOARD="board-",e.DOCUMENT="doc-",e.FOLDER="folder-"}(pA||(pA={})),function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS"}(dA||(dA={}));const lA={boardId:e.number().describe("The id of the board to get items from"),itemIds:e.array(e.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:e.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:e.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:e.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:e.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeSubItems:e.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:e.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filters:WN,filtersOperator:QN,columnIds:e.array(e.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderBy:e.array(e.object({columnId:e.string().describe("The id of the column to order by"),direction:e.nativeEnum(nE).optional().default(nE.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 cA={boardId:e.number().describe("The id of the board to get the schema of")};const mA=EI`
1052
+ `;var pA,dA;!function(e){e.BOARD="board-",e.DOCUMENT="doc-",e.FOLDER="folder-"}(pA||(pA={})),function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS"}(dA||(dA={}));const lA={boardId:e.number().describe("The id of the board to get items from"),itemIds:e.array(e.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:e.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:e.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:e.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:e.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeDescription:e.boolean().optional().default(!1).describe("Whether to include the item description (rich-text body) in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the description content."),includeSubItems:e.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:e.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filters:WN,filtersOperator:QN,columnIds:e.array(e.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderBy:e.array(e.object({columnId:e.string().describe("The id of the column to order by"),direction:e.nativeEnum(nE).optional().default(nE.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 cA={boardId:e.number().describe("The id of the board to get the schema of")};const mA=EI`
1044
1053
  query GetColumnTypeSchema($type: ColumnType!) {
1045
1054
  get_column_type_schema(type: $type)
1046
1055
  }
@@ -1258,7 +1267,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
1258
1267
  description
1259
1268
  }
1260
1269
  }
1261
- `,qA=100,HA=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,"");function zA(e){const t=e.workspaces?.filter((e=>null!==e));return t||[]}function GA(e){return Array.isArray(e)&&e.length>0}const WA={searchTerm:e.string().optional().describe("Optional search term used to filter workspaces. [IMPORANT] Only alphanumeric characters are supported."),limit:e.number().min(1).max(qA).default(qA).describe("Number of workspaces to return. Set to max (100) lower for smaller response size"),page:e.number().min(1).default(1).describe("Page number to return. Default is 1.")};const QA=EI`
1270
+ `,qA=100,HA=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,"");function zA(e){const t=e.workspaces?.filter((e=>null!==e));return t||[]}function GA(e){return Array.isArray(e)&&e.length>0}const WA={searchTerm:e.string().optional().describe("Optional search term used to filter workspaces. [IMPORTANT] Only alphanumeric characters are supported."),limit:e.number().min(1).max(qA).default(qA).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:e.number().min(1).default(1).describe("Page number to return. Default is 1.")};const QA=EI`
1262
1271
  query getItemBoard($itemId: ID!) {
1263
1272
  items(ids: [$itemId]) {
1264
1273
  id
@@ -1695,7 +1704,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
1695
1704
  }
1696
1705
  }
1697
1706
  }
1698
- `,_O={};const xO=[class extends Vg{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=Mi.READ,this.annotations=jg({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 _O}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(wO,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${KD} No boards found in your account. Please verify you have access to monday.com boards.`};const a=this.extractBoardPairs(t);if(0===a.length)return{content:this.generateNotFoundMessage(t.length)};return{content:this.generateReport(a)}}catch(e){return{content:`${tO} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}generateMultiplePairsWarning(e){return`## ⚠️ Multiple SprintsBoard Detected\n**${e}** different board pairs found. Each pair is isolated and workspace-specific.\n**AI Agent - REQUIRED:** Before ANY operation, confirm with user which pair and workspace to use.\n---\n`}generatePairDetails(e,t){return`### Pair ${t+1}\n**Sprints Board:**\n- ID: \`${e.sprintsBoard.id}\`\n- Name: ${e.sprintsBoard.name}\n- Workspace: ${e.sprintsBoard.workspaceName} (ID: ${e.sprintsBoard.workspaceId})\n\n**Tasks Board:**\n- ID: \`${e.tasksBoard.id}\`\n- Name: ${e.tasksBoard.name}\n- Workspace: ${e.tasksBoard.workspaceName} (ID: ${e.tasksBoard.workspaceId})\n---\n\n`}generateTechnicalReference(){return"## 📋 Technical Reference\n\n**Sprint Operations** (all require correct board pair):\n• Add to Sprint: Update `task_sprint` column with sprint item ID\n• Remove from Sprint: Clear `task_sprint` column (set to null)\n• Search in Sprint: Filter where `task_sprint` equals sprint item ID\n• Move Between Sprints: Update `task_sprint` with new sprint item ID\n• Backlog Tasks: `task_sprint` is empty/null\n\n**Critical:** `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}generateReport(e){const t=e.length>1?this.generateMultiplePairsWarning(e.length):"",a=e.map(((e,t)=>this.generatePairDetails(e,t))).join(""),i=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${t}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${a}${i}`}generateNotFoundMessage(e){return`## No Monday-Dev Sprints Board Pairs Found\n\n**Boards Checked:** ${e} (recently used)\n\nNo board pairs with sprint relationships found in your recent boards.\n\n### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`}createBoardInfo(e,t,a){return{id:e,name:t?.name||a,workspaceId:t?.workspace?.id||"unknown",workspaceName:t?.workspace?.name||"Unknown"}}processSprintsBoard(e,t,a){const i=vO(e,WD.SPRINT_TASKS);if(!i)return;const n=fO(i);if(!n)return;const o=`${e.id}:${n}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,t,a){const i=vO(e,iO);if(!i)return;const n=fO(i);if(!n)return;const o=`${n}:${e.id}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(uO(i)&&this.processSprintsBoard(i,a,t),hO(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends Vg{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=Mi.READ,this.annotations=jg({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 bO}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(yO,a),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${tO} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const t={boardId:e.toString()},a=await this.mondayApi.request(SI,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${KD} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${aO} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${tO} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const t=new Set(e.filter((e=>null!==e)).map((e=>e.id))),a=Object.values(WD),i=cO(t,a);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((t=>{const a=(e=>nO[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let t="# Sprints Metadata Report\n\n";return t+=`**Total Sprints:** ${e.length}\n\n`,t+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",t+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const a=e.name||"Unknown",i=e.id,n=pO(e,QD.SPRINT_ACTIVATION),o=pO(e,QD.SPRINT_COMPLETION),r=dO(e,QD.SPRINT_START_DATE),s=dO(e,QD.SPRINT_END_DATE),p=((e,t)=>{const a=sO(e,t);if("TimelineValue"===a?.__typename&&a.from&&a.to)return{from:a.from.split("T")[0],to:a.to.split("T")[0]};return null})(e,QD.SPRINT_TIMELINE),d=lO(e,QD.SPRINT_SUMMARY);let l=oO.Planned;o?l=oO.Completed:(n||r)&&(l=oO.Active);const c=p?`${p.from} to ${p.to}`:"Not set";t+=`| ${a} | ${i} | ${l} | ${c} | ${r||"Not started"} | ${s||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),t+="\n## Status Definitions:\n",t+=`- **${oO.Planned}**: Sprint not yet started (no activation, no start date)\n`,t+=`- **${oO.Active}**: Sprint is active (activated but not completed)\n`,t+=`- **${oO.Completed}**: Sprint is finished\n\n`,t}},class extends Vg{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=Mi.READ,this.annotations=jg({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 gO}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${tO} Unknown error occurred while getting sprint metadata`};const a=await this.readSprintSummaryDocument(t.documentObjectId);return a.success?{content:a.content}:{content:a.error||`${tO} Unknown error occurred while reading document content`}}catch(e){return{content:`${tO} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const t={ids:[String(e)]},a=(await this.mondayApi.request(GD,t)).items||[];if(0===a.length)return{success:!1,error:`${YD} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${YD} Sprint with ID ${e} not found.`};const n=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(WD),...t];return cO(a,i)})(i,[QD.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${aO} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=lO(i,QD.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${JD} No sprint summary document found for sprint "${i.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${tO} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const t={object_ids:[e],limit:1},a=(await this.mondayApi.request(LI,t)).docs||[];if(0===a.length)return{success:!1,error:`${JD} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${XD} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(jI,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${eO} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const r=o.export_markdown_from_doc.markdown;return r?{success:!0,content:r}:{success:!1,error:`${ZD} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${tO} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],EO=[class extends Vg{constructor(){super(...arguments),this.name="delete_item",this.type=Mi.WRITE,this.annotations=jg({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return qN}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(TI,t);return{content:`Item ${a.delete_item?.id} successfully deleted`}}},class extends Vg{constructor(){super(...arguments),this.name="get_board_items_page",this.type=Mi.READ,this.annotations=jg({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 lA}async executeInternal(e){const t=!e.cursor;if(t&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch(t){DN(t),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems};t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(rA,a),n=this.mapResult(i,e);return{content:JSON.stringify(n,null,2)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:rE.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],i=a?.items_page,n=i?.items||[];return{board:{id:a?.id,name:a?.name},items:n.map((e=>this.mapItem(e,t))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,t){const a={id:e.id,name:e.name,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case uN.BoardRelation:return e.linked_items;case uN.Formula:return e.display_value;case uN.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const t={query:e.searchTerm,limit:100,filters:{entities:[{items:{board_ids:[e.boardId.toString()]}}]}},a=await this.mondayApi.request(sA,t,{versionOverride:"dev",timeout:NN}),i=a.search?.filter((e=>"ItemSearchResult"===e.__typename))?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends Vg{constructor(){super(...arguments),this.name="create_item",this.type=Mi.WRITE,this.annotations=jg({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?ON:RN}async executeInternal(e){const t=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,t):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,t)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(xN,a);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},r=new HI(this.mondayApi,this.apiToken,{boardId:t}),s=await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)});if(s.content.includes("Error"))throw new Error("Failed to update duplicated item: "+s.content);return{content:`Item ${i.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){AN(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const a=await this.mondayApi.request(EN,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:`Subitem ${a.create_subitem.id} successfully created under parent item ${e.parentItemId}`}}catch(e){AN(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(II,a);return{content:`Item ${i.create_item?.id} successfully created`}}catch(e){AN(e,"create item")}}},class extends Vg{constructor(){super(...arguments),this.name="create_update",this.type=Mi.WRITE,this.annotations=jg({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. You can also reply to an existing update by using the parentId parameter."}getInputSchema(){return FN}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=CN.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t,parentId:e.parentId?.toString()},i=await this.mondayApi.request(PN,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${i.create_update.id} successfully created on item ${e.itemId}`}}catch(e){AN(e,"create update")}}},class extends Vg{constructor(){super(...arguments),this.name="get_updates",this.type=Mi.READ,this.annotations=jg({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return UN}async executeInternal(e){try{const t={limit:e.limit??25,page:e.page??1};let a;a=e.objectType===VN.Item?await this.mondayApi.request(LN,{...t,itemId:e.objectId}):await this.mondayApi.request(jN,{...t,boardId:e.objectId});const i=e.objectType===VN.Item?a.items?.[0]?.updates:a.boards?.[0]?.updates;if(!i||0===i.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const n=i.map((t=>{const a={id:t.id,body:t.body,text_body:t.text_body,created_at:t.created_at,updated_at:t.updated_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:t.item_id};return e.includeReplies&&t.replies&&(a.replies=t.replies.map((e=>({id:e.id,body:e.body,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&t.assets&&(a.assets=t.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),a})),o={updates:n,pagination:{page:e.page??1,limit:e.limit??25,count:n.length}};return{content:JSON.stringify(o,null,2)}}catch(e){AN(e,"get updates")}}},class extends Vg{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=Mi.WRITE,this.annotations=jg({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 $D}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=PD.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},i=await this.mondayApi.request(PN,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${i.create_update.id} successfully created on item ${e.itemId}. Now we want to show the updated data, so call the full board data tool to get data, and then immediately after that call the show table tool to show the data from that tool. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received.`}}catch(e){AN(e,"create update")}}},class extends Vg{constructor(){super(...arguments),this.name="get_board_schema",this.type=Mi.READ,this.annotations=jg({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 cA}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(SI,a);return{content:`The current schema of the board ${t} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends Vg{constructor(){super(...arguments),this.name="get_board_activity",this.type=Mi.READ,this.annotations=jg({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 JN}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-SN.MONTH30Days),i=e?.fromDate||a.toISOString(),n=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1},r=await this.mondayApi.request(YN,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=s.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} (${s.length} entries):\n\n${p}`}}},class extends Vg{constructor(){super(...arguments),this.name="get_board_info",this.type=Mi.READ,this.annotations=jg({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return oA}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(XN,t),i=a.boards?.[0];if(!i)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const n=await this.getSubItemsBoardAsync(i);return{content:JSON.stringify(eA(i,n),null,2)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===uN.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],i=await this.mondayApi.request(ZN,{boardId:a});return i.boards?.[0]??null}},class extends Vg{constructor(){super(...arguments),this.name="get_full_board_data",this.type=Mi.READ,this.annotations=jg({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 KN}async executeInternal(e){try{const t={boardId:e.boardId,itemsLimit:7};e.filters&&(t.queryParams={operator:e.filtersOperator,rules:e.filters.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute})))});const a=await this.mondayApi.request(zN,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=a.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&n.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));const o=Array.from(n).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(GN,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e]))),p={board:{id:i.id,name:i.name,columns:i.columns,items:i.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:r,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}};return{content:JSON.stringify(p,null,2)}}catch(e){AN(e,"get full board data")}}},class extends Vg{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=Mi.READ,this.annotations=jg({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 jA}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(RA);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]};return{content:$A(s)}}if(r){if(t||a||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(OA,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const p=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n");return{content:`Found ${s.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(t&&e.userIds&&e.userIds.length>CA)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(a&&e.teamIds&&e.teamIds.length>FA)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!t&&a&&!i)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(DA,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(AA,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:LA};s=await this.mondayApi.request(NA,t)}else if(t){const t={userIds:e.userIds,limit:LA};s=await this.mondayApi.request(IA,t)}else{const e={userIds:void 0,limit:LA};s=await this.mondayApi.request(SA,e)}return{content:$A(s)}}},HI,class extends Vg{constructor(){super(...arguments),this.name="move_item_to_group",this.type=Mi.WRITE,this.annotations=jg({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 VA}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(AI,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends Vg{constructor(){super(...arguments),this.name="create_board",this.type=Mi.WRITE,this.annotations=jg({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return zI}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(DI,t);return{content:`Board ${a.create_board?.id} successfully created`}}},class extends Vg{constructor(){super(...arguments),this.name="create_form",this.type=Mi.WRITE,this.annotations=jg({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 xS}async executeInternal(e){const t={destination_workspace_id:e.destination_workspace_id,destination_folder_id:e.destination_folder_id,destination_folder_name:e.destination_folder_name,board_kind:e.board_kind,destination_name:e.destination_name,board_owner_ids:e.board_owner_ids,board_owner_team_ids:e.board_owner_team_ids,board_subscriber_ids:e.board_subscriber_ids,board_subscriber_teams_ids:e.board_subscriber_teams_ids},a=await this.mondayApi.request(eS,t);return{content:`Form created successfully. Board ID: ${a.create_form?.boardId}, Token: ${a.create_form?.token}`}}},class extends Vg{constructor(){super(...arguments),this.name="update_form",this.type=Mi.WRITE,this.annotations=jg({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new cN(this.mondayApi),this.actionHandlers=new Map([[MS.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[MS.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[MS.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[MS.activate,this.helpers.activateForm.bind(this.helpers)],[MS.createTag,this.helpers.createTag.bind(this.helpers)],[MS.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[MS.updateTag,this.helpers.updateTag.bind(this.helpers)],[MS.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[MS.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[MS.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[MS.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[MS.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 lN}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:"Received an invalid action for the update form tool."}}},class extends Vg{constructor(){super(...arguments),this.name="get_form",this.type=Mi.READ,this.annotations=jg({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 mN}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(tS,t);return a.form?{content:`The form with the token ${e.formToken} is: ${JSON.stringify(a.form,null,2)}`}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends Vg{constructor(){super(...arguments),this.name="form_questions_editor",this.type=Mi.WRITE,this.annotations=jg({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new BS(this.mondayApi),this.actionHandlers=new Map([[jS.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[jS.Update,this.helpers.updateQuestion.bind(this.helpers)],[jS.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return US}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends Vg{constructor(){super(...arguments),this.name="create_column",this.type=Mi.WRITE,this.annotations=jg({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?hN:fN}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},i=await this.mondayApi.request(OI,a);return{content:`Column ${i.create_column?.id} successfully created`}}},class extends Vg{constructor(){super(...arguments),this.name="create_group",this.type=Mi.WRITE,this.annotations=jg({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 _N}async executeInternal(e){const t={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},a=await this.mondayApi.request(bN,t);return{content:`Group "${a.create_group?.title}" (ID: ${a.create_group?.id}) successfully created`}}},class extends Vg{constructor(){super(...arguments),this.name="delete_column",this.type=Mi.WRITE,this.annotations=jg({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?BN:MN}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(RI,t);return{content:`Column ${a.delete_column?.id} successfully deleted`}}},BI,class extends Vg{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=Mi.ALL_API,this.annotations=jg({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 hA}async executeInternal(e){try{const t=await this.mondayApi.request(kI),a=e?.operationType,i=t.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=t.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=t.__schema,r=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let s="## GraphQL Schema\n";return a&&"read"!==a||(s+=`- Query Type: ${t.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${i}\n\n`),a&&"write"!==a||(s+=`- Mutation Type: ${t.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${n}\n\n`),s+=`## Available Types\n${r}\n\n`,s+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:s}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends Vg{constructor(){super(...arguments),this.name="get_column_type_info",this.type=Mi.READ,this.annotations=jg({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 uA}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(mA,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:a.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(i,null,2)}`}}},class extends Vg{constructor(){super(...arguments),this.name="get_type_details",this.type=Mi.ALL_API,this.annotations=jg({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 fA}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const a=(t=e.typeName,EI`
1707
+ `,_O={};const xO=[class extends Vg{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=Mi.READ,this.annotations=jg({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 _O}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(wO,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${KD} No boards found in your account. Please verify you have access to monday.com boards.`};const a=this.extractBoardPairs(t);if(0===a.length)return{content:this.generateNotFoundMessage(t.length)};return{content:this.generateReport(a)}}catch(e){return{content:`${tO} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}generateMultiplePairsWarning(e){return`## ⚠️ Multiple SprintsBoard Detected\n**${e}** different board pairs found. Each pair is isolated and workspace-specific.\n**AI Agent - REQUIRED:** Before ANY operation, confirm with user which pair and workspace to use.\n---\n`}generatePairDetails(e,t){return`### Pair ${t+1}\n**Sprints Board:**\n- ID: \`${e.sprintsBoard.id}\`\n- Name: ${e.sprintsBoard.name}\n- Workspace: ${e.sprintsBoard.workspaceName} (ID: ${e.sprintsBoard.workspaceId})\n\n**Tasks Board:**\n- ID: \`${e.tasksBoard.id}\`\n- Name: ${e.tasksBoard.name}\n- Workspace: ${e.tasksBoard.workspaceName} (ID: ${e.tasksBoard.workspaceId})\n---\n\n`}generateTechnicalReference(){return"## 📋 Technical Reference\n\n**Sprint Operations** (all require correct board pair):\n• Add to Sprint: Update `task_sprint` column with sprint item ID\n• Remove from Sprint: Clear `task_sprint` column (set to null)\n• Search in Sprint: Filter where `task_sprint` equals sprint item ID\n• Move Between Sprints: Update `task_sprint` with new sprint item ID\n• Backlog Tasks: `task_sprint` is empty/null\n\n**Critical:** `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}generateReport(e){const t=e.length>1?this.generateMultiplePairsWarning(e.length):"",a=e.map(((e,t)=>this.generatePairDetails(e,t))).join(""),i=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${t}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${a}${i}`}generateNotFoundMessage(e){return`## No Monday-Dev Sprints Board Pairs Found\n\n**Boards Checked:** ${e} (recently used)\n\nNo board pairs with sprint relationships found in your recent boards.\n\n### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`}createBoardInfo(e,t,a){return{id:e,name:t?.name||a,workspaceId:t?.workspace?.id||"unknown",workspaceName:t?.workspace?.name||"Unknown"}}processSprintsBoard(e,t,a){const i=vO(e,WD.SPRINT_TASKS);if(!i)return;const n=fO(i);if(!n)return;const o=`${e.id}:${n}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,t,a){const i=vO(e,iO);if(!i)return;const n=fO(i);if(!n)return;const o=`${n}:${e.id}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(uO(i)&&this.processSprintsBoard(i,a,t),hO(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends Vg{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=Mi.READ,this.annotations=jg({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 bO}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(yO,a),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${tO} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const t={boardId:e.toString()},a=await this.mondayApi.request(SI,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${KD} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${aO} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${tO} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const t=new Set(e.filter((e=>null!==e)).map((e=>e.id))),a=Object.values(WD),i=cO(t,a);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((t=>{const a=(e=>nO[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let t="# Sprints Metadata Report\n\n";return t+=`**Total Sprints:** ${e.length}\n\n`,t+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",t+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const a=e.name||"Unknown",i=e.id,n=pO(e,QD.SPRINT_ACTIVATION),o=pO(e,QD.SPRINT_COMPLETION),r=dO(e,QD.SPRINT_START_DATE),s=dO(e,QD.SPRINT_END_DATE),p=((e,t)=>{const a=sO(e,t);if("TimelineValue"===a?.__typename&&a.from&&a.to)return{from:a.from.split("T")[0],to:a.to.split("T")[0]};return null})(e,QD.SPRINT_TIMELINE),d=lO(e,QD.SPRINT_SUMMARY);let l=oO.Planned;o?l=oO.Completed:(n||r)&&(l=oO.Active);const c=p?`${p.from} to ${p.to}`:"Not set";t+=`| ${a} | ${i} | ${l} | ${c} | ${r||"Not started"} | ${s||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),t+="\n## Status Definitions:\n",t+=`- **${oO.Planned}**: Sprint not yet started (no activation, no start date)\n`,t+=`- **${oO.Active}**: Sprint is active (activated but not completed)\n`,t+=`- **${oO.Completed}**: Sprint is finished\n\n`,t}},class extends Vg{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=Mi.READ,this.annotations=jg({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 gO}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${tO} Unknown error occurred while getting sprint metadata`};const a=await this.readSprintSummaryDocument(t.documentObjectId);return a.success?{content:a.content}:{content:a.error||`${tO} Unknown error occurred while reading document content`}}catch(e){return{content:`${tO} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const t={ids:[String(e)]},a=(await this.mondayApi.request(GD,t)).items||[];if(0===a.length)return{success:!1,error:`${YD} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${YD} Sprint with ID ${e} not found.`};const n=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(WD),...t];return cO(a,i)})(i,[QD.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${aO} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=lO(i,QD.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${JD} No sprint summary document found for sprint "${i.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${tO} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const t={object_ids:[e],limit:1},a=(await this.mondayApi.request(LI,t)).docs||[];if(0===a.length)return{success:!1,error:`${JD} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${XD} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(jI,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${eO} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const r=o.export_markdown_from_doc.markdown;return r?{success:!0,content:r}:{success:!1,error:`${ZD} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${tO} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],EO=[class extends Vg{constructor(){super(...arguments),this.name="delete_item",this.type=Mi.WRITE,this.annotations=jg({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return qN}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(TI,t);return{content:`Item ${a.delete_item?.id} successfully deleted`}}},class extends Vg{constructor(){super(...arguments),this.name="get_board_items_page",this.type=Mi.READ,this.annotations=jg({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values and item descriptions. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true. To retrieve an item's description (rich-text body), set 'includeDescription' to true — the response will include the description's document blocks with their content, type, and id. [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 lA}async executeInternal(e){const t=!e.cursor;if(t&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch(t){DN(t),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeDescription};t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(rA,a),n=this.mapResult(i,e);return{content:JSON.stringify(n,null,2)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:rE.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],i=a?.items_page,n=i?.items||[];return{board:{id:a?.id,name:a?.name},items:n.map((e=>this.mapItem(e,t))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,t){const a={id:e.id,name:e.name,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}if(t.includeDescription&&"description"in e&&e.description){const t=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));a.description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case uN.BoardRelation:return e.linked_items;case uN.Formula:return e.display_value;case uN.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const t={query:e.searchTerm,limit:100,filters:{entities:[{items:{board_ids:[e.boardId.toString()]}}]}},a=await this.mondayApi.request(sA,t,{versionOverride:"dev",timeout:NN}),i=a.search?.filter((e=>"ItemSearchResult"===e.__typename))?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends Vg{constructor(){super(...arguments),this.name="create_item",this.type=Mi.WRITE,this.annotations=jg({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?ON:RN}async executeInternal(e){const t=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,t):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,t)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(xN,a);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},r=new HI(this.mondayApi,this.apiToken,{boardId:t}),s=await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)});if(s.content.includes("Error"))throw new Error("Failed to update duplicated item: "+s.content);return{content:`Item ${i.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){AN(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const a=await this.mondayApi.request(EN,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:`Subitem ${a.create_subitem.id} successfully created under parent item ${e.parentItemId}`}}catch(e){AN(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(II,a);return{content:`Item ${i.create_item?.id} successfully created`}}catch(e){AN(e,"create item")}}},class extends Vg{constructor(){super(...arguments),this.name="create_update",this.type=Mi.WRITE,this.annotations=jg({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. You can also reply to an existing update by using the parentId parameter."}getInputSchema(){return FN}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=CN.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t,parentId:e.parentId?.toString()},i=await this.mondayApi.request(PN,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${i.create_update.id} successfully created on item ${e.itemId}`}}catch(e){AN(e,"create update")}}},class extends Vg{constructor(){super(...arguments),this.name="get_updates",this.type=Mi.READ,this.annotations=jg({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return UN}async executeInternal(e){try{const t={limit:e.limit??25,page:e.page??1};let a;a=e.objectType===VN.Item?await this.mondayApi.request(LN,{...t,itemId:e.objectId}):await this.mondayApi.request(jN,{...t,boardId:e.objectId});const i=e.objectType===VN.Item?a.items?.[0]?.updates:a.boards?.[0]?.updates;if(!i||0===i.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const n=i.map((t=>{const a={id:t.id,body:t.body,text_body:t.text_body,created_at:t.created_at,updated_at:t.updated_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:t.item_id};return e.includeReplies&&t.replies&&(a.replies=t.replies.map((e=>({id:e.id,body:e.body,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&t.assets&&(a.assets=t.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),a})),o={updates:n,pagination:{page:e.page??1,limit:e.limit??25,count:n.length}};return{content:JSON.stringify(o,null,2)}}catch(e){AN(e,"get updates")}}},class extends Vg{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=Mi.WRITE,this.annotations=jg({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 $D}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=PD.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},i=await this.mondayApi.request(PN,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${i.create_update.id} successfully created on item ${e.itemId}. Now we want to show the updated data, so call the full board data tool to get data, and then immediately after that call the show table tool to show the data from that tool. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received.`}}catch(e){AN(e,"create update")}}},class extends Vg{constructor(){super(...arguments),this.name="get_board_schema",this.type=Mi.READ,this.annotations=jg({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 cA}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(SI,a);return{content:`The current schema of the board ${t} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends Vg{constructor(){super(...arguments),this.name="get_board_activity",this.type=Mi.READ,this.annotations=jg({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 JN}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-SN.MONTH30Days),i=e?.fromDate||a.toISOString(),n=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1},r=await this.mondayApi.request(YN,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=s.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} (${s.length} entries):\n\n${p}`}}},class extends Vg{constructor(){super(...arguments),this.name="get_board_info",this.type=Mi.READ,this.annotations=jg({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return oA}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(XN,t),i=a.boards?.[0];if(!i)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const n=await this.getSubItemsBoardAsync(i);return{content:JSON.stringify(eA(i,n),null,2)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===uN.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],i=await this.mondayApi.request(ZN,{boardId:a});return i.boards?.[0]??null}},class extends Vg{constructor(){super(...arguments),this.name="get_full_board_data",this.type=Mi.READ,this.annotations=jg({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 KN}async executeInternal(e){try{const t={boardId:e.boardId,itemsLimit:7};e.filters&&(t.queryParams={operator:e.filtersOperator,rules:e.filters.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute})))});const a=await this.mondayApi.request(zN,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=a.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&n.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));const o=Array.from(n).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(GN,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e]))),p={board:{id:i.id,name:i.name,columns:i.columns,items:i.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:r,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}};return{content:JSON.stringify(p,null,2)}}catch(e){AN(e,"get full board data")}}},class extends Vg{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=Mi.READ,this.annotations=jg({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 jA}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(RA);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]};return{content:$A(s)}}if(r){if(t||a||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(OA,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const p=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n");return{content:`Found ${s.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(t&&e.userIds&&e.userIds.length>CA)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(a&&e.teamIds&&e.teamIds.length>FA)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!t&&a&&!i)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(DA,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(AA,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:LA};s=await this.mondayApi.request(NA,t)}else if(t){const t={userIds:e.userIds,limit:LA};s=await this.mondayApi.request(IA,t)}else{const e={userIds:void 0,limit:LA};s=await this.mondayApi.request(SA,e)}return{content:$A(s)}}},HI,class extends Vg{constructor(){super(...arguments),this.name="move_item_to_group",this.type=Mi.WRITE,this.annotations=jg({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 VA}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(AI,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends Vg{constructor(){super(...arguments),this.name="create_board",this.type=Mi.WRITE,this.annotations=jg({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return zI}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(DI,t);return{content:`Board ${a.create_board?.id} successfully created`}}},class extends Vg{constructor(){super(...arguments),this.name="create_form",this.type=Mi.WRITE,this.annotations=jg({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 xS}async executeInternal(e){const t={destination_workspace_id:e.destination_workspace_id,destination_folder_id:e.destination_folder_id,destination_folder_name:e.destination_folder_name,board_kind:e.board_kind,destination_name:e.destination_name,board_owner_ids:e.board_owner_ids,board_owner_team_ids:e.board_owner_team_ids,board_subscriber_ids:e.board_subscriber_ids,board_subscriber_teams_ids:e.board_subscriber_teams_ids},a=await this.mondayApi.request(eS,t);return{content:`Form created successfully. Board ID: ${a.create_form?.boardId}, Token: ${a.create_form?.token}`}}},class extends Vg{constructor(){super(...arguments),this.name="update_form",this.type=Mi.WRITE,this.annotations=jg({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new cN(this.mondayApi),this.actionHandlers=new Map([[MS.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[MS.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[MS.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[MS.activate,this.helpers.activateForm.bind(this.helpers)],[MS.createTag,this.helpers.createTag.bind(this.helpers)],[MS.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[MS.updateTag,this.helpers.updateTag.bind(this.helpers)],[MS.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[MS.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[MS.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[MS.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[MS.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 lN}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:"Received an invalid action for the update form tool."}}},class extends Vg{constructor(){super(...arguments),this.name="get_form",this.type=Mi.READ,this.annotations=jg({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 mN}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(tS,t);return a.form?{content:`The form with the token ${e.formToken} is: ${JSON.stringify(a.form,null,2)}`}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends Vg{constructor(){super(...arguments),this.name="form_questions_editor",this.type=Mi.WRITE,this.annotations=jg({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new BS(this.mondayApi),this.actionHandlers=new Map([[jS.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[jS.Update,this.helpers.updateQuestion.bind(this.helpers)],[jS.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return US}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends Vg{constructor(){super(...arguments),this.name="create_column",this.type=Mi.WRITE,this.annotations=jg({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?hN:fN}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},i=await this.mondayApi.request(OI,a);return{content:`Column ${i.create_column?.id} successfully created`}}},class extends Vg{constructor(){super(...arguments),this.name="create_group",this.type=Mi.WRITE,this.annotations=jg({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 _N}async executeInternal(e){const t={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},a=await this.mondayApi.request(bN,t);return{content:`Group "${a.create_group?.title}" (ID: ${a.create_group?.id}) successfully created`}}},class extends Vg{constructor(){super(...arguments),this.name="delete_column",this.type=Mi.WRITE,this.annotations=jg({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?BN:MN}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(RI,t);return{content:`Column ${a.delete_column?.id} successfully deleted`}}},BI,class extends Vg{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=Mi.ALL_API,this.annotations=jg({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 hA}async executeInternal(e){try{const t=await this.mondayApi.request(kI),a=e?.operationType,i=t.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=t.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=t.__schema,r=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let s="## GraphQL Schema\n";return a&&"read"!==a||(s+=`- Query Type: ${t.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${i}\n\n`),a&&"write"!==a||(s+=`- Mutation Type: ${t.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${n}\n\n`),s+=`## Available Types\n${r}\n\n`,s+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:s}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends Vg{constructor(){super(...arguments),this.name="get_column_type_info",this.type=Mi.READ,this.annotations=jg({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 uA}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(mA,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:a.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(i,null,2)}`}}},class extends Vg{constructor(){super(...arguments),this.name="get_type_details",this.type=Mi.ALL_API,this.annotations=jg({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 fA}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const a=(t=e.typeName,EI`
1699
1708
  query getTypeDetails {
1700
1709
  __type(name: "${t}") {
1701
1710
  name