@mondaydotcomorg/agent-toolkit 5.6.0 → 5.6.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.
@@ -2117,7 +2117,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
2117
2117
  }
2118
2118
  }
2119
2119
  }
2120
- `,ry={};const iy=[class extends bi{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=xr.READ,this.annotations=yi({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 ry}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(ay,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${$g} No boards found in your account. Please verify you have access to monday.com boards.`};const a=this.extractBoardPairs(t);return 0===a.length?{content:{message:"No monday-dev sprints board pairs found. ### 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### 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`;",boards_checked:t.length,pairs:[]}}:{content:{message:`Found ${a.length} matched pair(s)`,...a.length>1?{warning:"Multiple board pairs detected. Confirm with user which pair and workspace to use before any operation."}:{},pairs:a.map((e=>({sprints_board:{id:e.sprintsBoard.id,name:e.sprintsBoard.name,workspace_id:e.sprintsBoard.workspaceId,workspace_name:e.sprintsBoard.workspaceName},tasks_board:{id:e.tasksBoard.id,name:e.tasksBoard.name,workspace_id:e.tasksBoard.workspaceId,workspace_name:e.tasksBoard.workspaceName}}))),technical_reference:"Sprint Operations (all require correct board pair): Add to Sprint: Update `task_sprint` column with sprint item ID. Remove from Sprint: Clear `task_sprint` column (set to null). Search in Sprint: Filter where `task_sprint` equals sprint item ID. Move Between Sprints: Update `task_sprint` with new sprint item ID. Backlog Tasks: `task_sprint` is empty/null. Critical: `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}}}catch(e){return{content:`${Lg} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}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 r=Xg(e,kg.SPRINT_TASKS);if(!r)return;const i=Jg(r);if(!i)return;const o=`${e.id}:${i}`;if(a.has(o))return;const n=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(i,n,`Tasks Board ${i}`)})}processTasksBoard(e,t,a){const r=Xg(e,jg);if(!r)return;const i=Jg(r);if(!i)return;const o=`${i}:${e.id}`;if(a.has(o))return;const n=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(i,n,`Sprints Board ${i}`),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 r of e)r.columns&&(Yg(r)&&this.processSprintsBoard(r,a,t),Kg(r)&&this.processTasksBoard(r,a,t));return Array.from(t.values())}},class extends bi{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=xr.READ,this.annotations=yi({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 ty}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},r=await this.mondayApi.request(ey,a),i=r.boards?.[0],o=i?.items_page?.items||[],n=this.buildSprintsMetadata(o);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:o.length,data:n}}}catch(e){return{content:`${Lg} 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(Dc,t),r=a.boards?.[0];if(!r)return{success:!1,error:`${$g} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const i=r.columns||[],o=this.validateSprintsBoardSchemaFromColumns(i);return o.isValid?{success:!0}:{success:!1,error:`${Vg} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${Lg} 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(kg),r=Qg(t,a);if(!r.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return r.missingColumns.forEach((t=>{const a=(e=>Ug[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=Hg(e,Og.SPRINT_ACTIVATION),a=Hg(e,Og.SPRINT_COMPLETION),r=Gg(e,Og.SPRINT_START_DATE),i=Gg(e,Og.SPRINT_END_DATE),o=((e,t)=>{const a=qg(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,Og.SPRINT_TIMELINE),n=Wg(e,Og.SPRINT_SUMMARY);let s=Mg.Planned;return a?s=Mg.Completed:(t||r)&&(s=Mg.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:r||null,end_date:i||null,is_completed:a,document_object_id:n||null}}))}},class extends bi{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=xr.READ,this.annotations=yi({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 Zg}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${Lg} Unknown error occurred while getting sprint metadata`};const a=await this.readSprintSummaryDocument(t.documentObjectId);return a.success?{content:{message:"Sprint summary retrieved",sprint_id:e.sprintId,sprint_name:t.sprintName,markdown:a.content}}:{content:a.error||`${Lg} Unknown error occurred while reading document content`}}catch(e){return{content:`${Lg} 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(Ag,t)).items||[];if(0===a.length)return{success:!1,error:`${Rg} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const r=a[0];if(!r)return{success:!1,error:`${Rg} Sprint with ID ${e} not found.`};const i=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),r=[...Object.values(kg),...t];return Qg(a,r)})(r,[Og.SPRINT_SUMMARY]);if(!i.isValid)return{success:!1,error:`${Vg} Sprint item is missing required columns: ${i.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=Wg(r,Og.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:r.name}:{success:!1,error:`${Pg} No sprint summary document found for sprint "${r.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${Lg} 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(bc,t)).docs||[];if(0===a.length)return{success:!1,error:`${Pg} Document with object ID ${e} not found or not accessible.`};const r=a[0];if(!r||!r.id)return{success:!1,error:`${Cg} Document data is invalid for object ID ${e}.`};const i={docId:r.id,blockIds:[]},o=await this.mondayApi.request(Lc,i);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${Fg} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const n=o.export_markdown_from_doc.markdown;return n?{success:!0,content:n}:{success:!1,error:`${xg} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${Lg} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],oy=[class extends bi{constructor(){super(...arguments),this.name="delete_item",this.type=xr.WRITE,this.annotations=yi({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Tf}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(Ec,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends bi{constructor(){super(...arguments),this.name="get_board_items_page",this.type=xr.READ,this.annotations=yi({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 description (the rich-text body/details of a monday.com item), set includeItemDescription to true — the response will include the item description document blocks with their content, type, and id. Use this whenever the user asks about an item description, body, details, or notes. [REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available. VIEW-BASED FILTERING: If the user refers to a board view by name (e.g. "show me items in the Overdue view"), first call get_board_info to get the board views, find the matching view by name, then extract its filter field and pass it as the filters argument here.'}getInputSchema(){return Bf}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){Mh(t),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeItemDescription};t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const r=await this.mondayApi.request(Uf,a);return{content:this.mapResult(r,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:Yp.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],r=a?.items_page,i=r?.items||[];return{board:{id:a?.id,name:a?.name},items:i.map((e=>this.mapItem(e,t))),pagination:{has_more:!!r?.cursor,nextCursor:r?.cursor||null,count:i.length}}}mapItem(e,t){const a={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}if(t.includeItemDescription&&"description"in e&&e.description){const t=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));a.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case Jh.BoardRelation:return e.linked_items;case Jh.Formula:return e.display_value;case Jh.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:20,boardIds:[e.boardId.toString()]},a=(await this.mondayApi.request(Mf,t,{versionOverride:"dev",timeout:jh})).search.items.results.map((e=>Number(e.id)));if(0===a.length)throw new Error("No items found for search term or new search is not enabled for this account");const r=e.itemIds??[];if(0===r.length)return a;const i=new Set(r);return a.filter((e=>i.has(e)))}},class extends bi{constructor(){super(...arguments),this.name="create_item",this.type=xr.WRITE,this.annotations=yi({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?pf:lf}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()},r=await this.mondayApi.request(sf,a);if(!r.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},n=new qc(this.mondayApi,{boardId:t});return await n.execute({itemId:parseInt(r.duplicate_item.id),columnValues:JSON.stringify(o)}),{content:{message:`Item ${r.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:r.duplicate_item.id,item_name:r.duplicate_item.name,item_url:r.duplicate_item.url,board_id:t}}}catch(e){Uh(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(df,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:{message:`Subitem ${a.create_subitem.id} created under ${e.parentItemId}`,item_id:a.create_subitem.id,item_name:a.create_subitem.name,item_url:a.create_subitem.url}}}catch(e){Uh(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},r=await this.mondayApi.request(Sc,a);return{content:{message:`Item ${r.create_item?.id} successfully created`,item_id:r.create_item?.id,item_name:r.create_item?.name,item_url:r.create_item?.url,board_id:t}}}catch(e){Uh(e,"create item")}}},class extends bi{constructor(){super(...arguments),this.name="create_update",this.type=xr.WRITE,this.annotations=yi({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 ff}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),r=hf.safeParse(a);if(!r.success)throw new Error(`Invalid mentionsList format: ${r.error.message}`);t=r.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()},r=await this.mondayApi.request(cf,a);if(!r.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${r.create_update.id} created on item ${e.itemId}`,update_id:r.create_update.id,item_id:e.itemId,item_name:r.create_update.item?.name,item_url:r.create_update.item?.url}}}catch(e){Uh(e,"create update")}}},class extends bi{constructor(){super(...arguments),this.name="get_updates",this.type=xr.READ,this.annotations=yi({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. For Board queries, you can filter by date range using fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion. Set includeItemUpdates to true to also include updates on individual items. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return yf}async executeInternal(e){try{const t=void 0!==e.fromDate,a=void 0!==e.toDate;if(t!==a)throw new Error("Both fromDate and toDate must be provided together for date range filtering");if((t||a)&&e.objectType===gf.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const r={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let i;i=e.objectType===gf.Item?await this.mondayApi.request(vf,{...r,itemId:e.objectId}):await this.mondayApi.request(_f,{...r,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:bf(e.fromDate),toDate:bf(e.toDate)}:{}});const o=e.objectType===gf.Item?i.items?.[0]?.updates:i.boards?.[0]?.updates;if(!o||0===o.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const n=o.map((t=>{const a={id:t.id,text_body:t.text_body,created_at:t.created_at,updated_at:t.updated_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:t.item_id};return e.includeReplies&&t.replies&&(a.replies=t.replies.map((e=>({id:e.id,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&t.assets&&(a.assets=t.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),a})),s=e.objectType===gf.Item?i.items?.[0]?.url:i.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:n,pagination:{page:e.page??1,limit:e.limit??25,count:n.length}}}}catch(e){Uh(e,"get updates")}}},class extends bi{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=xr.WRITE,this.annotations=yi({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 cg}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),r=mg.safeParse(a);if(!r.success)throw new Error(`Invalid mentionsList format: ${r.error.message}`);t=r.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},r=await this.mondayApi.request(cf,a);if(!r.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${r.create_update.id} successfully created on item ${e.itemId}`,update_id:r.create_update.id,item_id:e.itemId,next_steps:"Now call the full board data tool to get data, then immediately call the show table tool to show that data. 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){Uh(e,"create update")}}},class extends bi{constructor(){super(...arguments),this.name="get_board_schema",this.type=xr.READ,this.annotations=yi({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 qf}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},r=await this.mondayApi.request(Dc,a);return{content:{message:"Board schema retrieved",board_id:t,columns:r.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type})))??[],groups:r.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends bi{constructor(){super(...arguments),this.name="get_board_activity",this.type=xr.READ,this.annotations=yi({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 $f}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-Vh.MONTH30Days),r=e?.fromDate||a.toISOString(),i=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:r,toDate:i,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},n=await this.mondayApi.request(Of,o),s=n.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${r} to ${i}).`};const d=n.boards?.[0],p=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:d?.name,board_url:d?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...p&&e.data?{data:e.data}:{}})))}}}},class extends bi{constructor(){super(...arguments),this.name="get_board_info",this.type=xr.READ,this.annotations=yi({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. Also returns the board's views (e.g. table views, filter views) — each view includes its id, name, type, and a structured filter object. "}getInputSchema(){return jf}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(Rf,t),r=a.boards?.[0];if(!r)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const i=await this.getSubItemsBoardAsync(r);return{content:Cf(r,i)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===Jh.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],r=await this.mondayApi.request(Pf,{boardId:a});return r.boards?.[0]??null}},class extends bi{constructor(){super(...arguments),this.name="get_full_board_data",this.type=xr.READ,this.annotations=yi({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 kf}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(Sf,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const r=a.boards[0],i=new Set;r.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 t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&i.add(e.id)}))}}))}));const o=Array.from(i).filter((e=>!(Number(e)<0)));let n=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(Df,e);n=t.users?.filter((e=>null!==e))||[]}const s=new Map(n.map((e=>[e.id,e])));return{content:{board:{id:r.id,name:r.name,columns:r.columns,items:r.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:n,stats:{total_items:r.items_page.items.length,total_updates:r.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:n.length}}}}catch(e){Uh(e,"get full board data")}}},class extends bi{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=xr.READ,this.annotations=yi({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 yv}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,r=e.includeTeams||!1,i=e.teamsOnly||!1,o=e.includeTeamMembers||!1,n=!!e.name;if(e.getMe||!1){if(t||a||r||i||o||n)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(pv);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=cv(s),p=await _v(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}if(n){if(t||a||r||i||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const n={name:e.name},s=await this.mondayApi.request(dv,n);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 d=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),p=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${d}`,l=await _v(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(i&&r)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>uv)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>hv)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(i||!t&&a&&!r)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(sv,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(nv,t)}else if(r){const t={userIds:e.userIds,teamIds:e.teamIds,limit:fv};s=await this.mondayApi.request(ov,t)}else if(t){const t={userIds:e.userIds,limit:fv};s=await this.mondayApi.request(rv,t)}else{const e={userIds:void 0,limit:fv};s=await this.mondayApi.request(iv,e)}const d=cv(s),p=await _v(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},qc,class extends bi{constructor(){super(...arguments),this.name="move_item_to_group",this.type=xr.WRITE,this.annotations=yi({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 bv}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(Ac,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends bi{constructor(){super(...arguments),this.name="create_board",this.type=xr.WRITE,this.annotations=yi({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return mu}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(kc,t);return{content:{message:`Board ${a.create_board?.id} successfully created`,board_id:a.create_board?.id,board_name:a.create_board?.name,board_url:a.create_board?.url}}}},class extends bi{constructor(){super(...arguments),this.name="create_form",this.type=xr.WRITE,this.annotations=yi({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. Also creates a backing board to store responses. Returns the formToken for future mutations."}getInputSchema(){return Hu}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(Iu,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends bi{constructor(){super(...arguments),this.name="update_form",this.type=xr.WRITE,this.annotations=yi({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Ch(this.mondayApi),this.actionHandlers=new Map([[lh.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[lh.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[lh.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[lh.activate,this.helpers.activateForm.bind(this.helpers)],[lh.createTag,this.helpers.createTag.bind(this.helpers)],[lh.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[lh.updateTag,this.helpers.updateTag.bind(this.helpers)],[lh.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[lh.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[lh.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[lh.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[lh.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return"Update a monday.com form. Use the action field to specify the operation."}getInputSchema(){return Ph}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 bi{constructor(){super(...arguments),this.name="get_form",this.type=xr.READ,this.annotations=yi({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 formToken is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the formToken is abc123def456ghi789."}getInputSchema(){return xh}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Tu,t);return a.form?{content:{message:"Form retrieved",form_token:e.formToken,data:a.form}}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends bi{constructor(){super(...arguments),this.name="form_questions_editor",this.type=xr.WRITE,this.annotations=yi({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new ph(this.mondayApi),this.actionHandlers=new Map([[nh.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[nh.Update,this.helpers.updateQuestion.bind(this.helpers)],[nh.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return dh}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends bi{constructor(){super(...arguments),this.name="create_form_submission",this.type=xr.WRITE,this.annotations=yi({title:"Create WorkForm Submission",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Submit a response to a monday.com WorkForm. Use get_form first to retrieve the WorkForm, then:\n- Inspect each question's showIfRules to determine which questions are conditionally shown based on previous answers.\n- Inspect each question's settings for any answer constraints (e.g. rating limits, select options, label limits).\n- Take note of any titles, descriptions, and content blocks to present the form naturally as you walk the user through it.\n- Take note of pages and question order to present questions in the correct sequence.\nGather all answers upfront before calling this tool — do not submit one question at a time. Accepts a bare form token, a full WorkForm URL (e.g. https://forms.monday.com/forms/{form_token}?r=use1), or a shortened wkf.ms URL (e.g. https://wkf.ms/4tqP28t) — shortened URLs are automatically resolved by following the redirect. Returns the submission ID."}getInputSchema(){return Kh}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(e){if(e.includes("wkf.ms")){const t=(await i.head(e,{maxRedirects:0,validateStatus:e=>e<400})).headers.location;return t?this.extractTokenFromUrl(t):null}return e.startsWith("http://")||e.startsWith("https://")?this.extractTokenFromUrl(e):e}async executeInternal(e){const t=await this.resolveFormToken(e.form_token);if(!t)return{content:`Could not resolve a WorkForm token from "${e.form_token}". Please provide a valid WorkForm token or full WorkForm URL (e.g. https://forms.monday.com/forms/abc123).`};const a={form_token:t,answers:e.answers,form_timezone_offset:e.form_timezone_offset,password:e.password,tags:e.tags};try{const e=await this.mondayApi.request(Bh,a,{versionOverride:"dev"});return e.create_form_submission?{content:{message:"WorkForm submitted successfully",submission_id:e.create_form_submission.id}}:{content:`WorkForm with token ${t} was not found or is not accepting submissions. Verify the WorkForm token is correct, the WorkForm is active, and any required password was provided.`}}catch(e){Uh(e,"submit form")}}},class extends bi{constructor(){super(...arguments),this.name="create_column",this.type=xr.WRITE,this.annotations=yi({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?Xh:Zh}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},r=await this.mondayApi.request(Oc,a);return{content:{message:"Column successfully created",column_id:r.create_column?.id,column_title:r.create_column?.title}}}},class extends bi{constructor(){super(...arguments),this.name="create_group",this.type=xr.WRITE,this.annotations=yi({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 nf}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(rf,t);return{content:{message:"Group created successfully",group_id:a.create_group?.id,group_title:a.create_group?.title,board_id:e.boardId,group_name:e.groupName}}}},class extends bi{constructor(){super(...arguments),this.name="delete_column",this.type=xr.WRITE,this.annotations=yi({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?wf:If}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request($c,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Uc,class extends bi{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=xr.ALL_API,this.annotations=yi({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 Qf}async executeInternal(e){try{const t=await this.mondayApi.request(Rc),a=e?.operationType,r=t.__schema,i="write"!==a?t.queryType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,o="read"!==a?t.mutationType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,n=r?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>({name:e.name,kind:e.kind??"unknown"})))??[];return{content:{message:"GraphQL schema retrieved",...void 0!==i&&{query_fields:i},...void 0!==o&&{mutation_fields:o},types:n}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends bi{constructor(){super(...arguments),this.name="get_column_type_info",this.type=xr.READ,this.annotations=yi({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 Wf}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(Hf,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const r={schema:a.get_column_type_schema};return{content:{message:`Column type info for ${e.columnType}`,data:r,url:Gf}}}},class extends bi{constructor(){super(...arguments),this.name="get_type_details",this.type=xr.ALL_API,this.annotations=yi({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 zf}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,yc`
2120
+ `,ry={};const iy=[class extends bi{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=xr.READ,this.annotations=yi({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 ry}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(ay,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${$g} No boards found in your account. Please verify you have access to monday.com boards.`};const a=this.extractBoardPairs(t);return 0===a.length?{content:{message:"No monday-dev sprints board pairs found. ### 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### 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`;",boards_checked:t.length,pairs:[]}}:{content:{message:`Found ${a.length} matched pair(s)`,...a.length>1?{warning:"Multiple board pairs detected. Confirm with user which pair and workspace to use before any operation."}:{},pairs:a.map((e=>({sprints_board:{id:e.sprintsBoard.id,name:e.sprintsBoard.name,workspace_id:e.sprintsBoard.workspaceId,workspace_name:e.sprintsBoard.workspaceName},tasks_board:{id:e.tasksBoard.id,name:e.tasksBoard.name,workspace_id:e.tasksBoard.workspaceId,workspace_name:e.tasksBoard.workspaceName}}))),technical_reference:"Sprint Operations (all require correct board pair): Add to Sprint: Update `task_sprint` column with sprint item ID. Remove from Sprint: Clear `task_sprint` column (set to null). Search in Sprint: Filter where `task_sprint` equals sprint item ID. Move Between Sprints: Update `task_sprint` with new sprint item ID. Backlog Tasks: `task_sprint` is empty/null. Critical: `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}}}catch(e){return{content:`${Lg} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}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 r=Xg(e,kg.SPRINT_TASKS);if(!r)return;const i=Jg(r);if(!i)return;const o=`${e.id}:${i}`;if(a.has(o))return;const n=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(i,n,`Tasks Board ${i}`)})}processTasksBoard(e,t,a){const r=Xg(e,jg);if(!r)return;const i=Jg(r);if(!i)return;const o=`${i}:${e.id}`;if(a.has(o))return;const n=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(i,n,`Sprints Board ${i}`),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 r of e)r.columns&&(Yg(r)&&this.processSprintsBoard(r,a,t),Kg(r)&&this.processTasksBoard(r,a,t));return Array.from(t.values())}},class extends bi{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=xr.READ,this.annotations=yi({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 ty}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},r=await this.mondayApi.request(ey,a),i=r.boards?.[0],o=i?.items_page?.items||[],n=this.buildSprintsMetadata(o);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:o.length,data:n}}}catch(e){return{content:`${Lg} 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(Dc,t),r=a.boards?.[0];if(!r)return{success:!1,error:`${$g} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const i=r.columns||[],o=this.validateSprintsBoardSchemaFromColumns(i);return o.isValid?{success:!0}:{success:!1,error:`${Vg} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${Lg} 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(kg),r=Qg(t,a);if(!r.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return r.missingColumns.forEach((t=>{const a=(e=>Ug[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=Hg(e,Og.SPRINT_ACTIVATION),a=Hg(e,Og.SPRINT_COMPLETION),r=Gg(e,Og.SPRINT_START_DATE),i=Gg(e,Og.SPRINT_END_DATE),o=((e,t)=>{const a=qg(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,Og.SPRINT_TIMELINE),n=Wg(e,Og.SPRINT_SUMMARY);let s=Mg.Planned;return a?s=Mg.Completed:(t||r)&&(s=Mg.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:r||null,end_date:i||null,is_completed:a,document_object_id:n||null}}))}},class extends bi{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=xr.READ,this.annotations=yi({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 Zg}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${Lg} Unknown error occurred while getting sprint metadata`};const a=await this.readSprintSummaryDocument(t.documentObjectId);return a.success?{content:{message:"Sprint summary retrieved",sprint_id:e.sprintId,sprint_name:t.sprintName,markdown:a.content}}:{content:a.error||`${Lg} Unknown error occurred while reading document content`}}catch(e){return{content:`${Lg} 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(Ag,t)).items||[];if(0===a.length)return{success:!1,error:`${Rg} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const r=a[0];if(!r)return{success:!1,error:`${Rg} Sprint with ID ${e} not found.`};const i=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),r=[...Object.values(kg),...t];return Qg(a,r)})(r,[Og.SPRINT_SUMMARY]);if(!i.isValid)return{success:!1,error:`${Vg} Sprint item is missing required columns: ${i.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=Wg(r,Og.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:r.name}:{success:!1,error:`${Pg} No sprint summary document found for sprint "${r.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${Lg} 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(bc,t)).docs||[];if(0===a.length)return{success:!1,error:`${Pg} Document with object ID ${e} not found or not accessible.`};const r=a[0];if(!r||!r.id)return{success:!1,error:`${Cg} Document data is invalid for object ID ${e}.`};const i={docId:r.id,blockIds:[]},o=await this.mondayApi.request(Lc,i);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${Fg} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const n=o.export_markdown_from_doc.markdown;return n?{success:!0,content:n}:{success:!1,error:`${xg} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${Lg} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],oy=[class extends bi{constructor(){super(...arguments),this.name="delete_item",this.type=xr.WRITE,this.annotations=yi({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Tf}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(Ec,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends bi{constructor(){super(...arguments),this.name="get_board_items_page",this.type=xr.READ,this.annotations=yi({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 description (the rich-text body/details of a monday.com item), set includeItemDescription to true — the response will include the item description document blocks with their content, type, and id. Use this whenever the user asks about an item description, body, details, or notes. [REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board 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. [REQUIRED PRECONDITION]: For board-relation / cross-board linking tasks, call link_board_items_workflow before using this tool. VIEW-BASED FILTERING: If the user refers to a board view by name (e.g. "show me items in the Overdue view"), first call get_board_info to get the board views, find the matching view by name, then extract its filter field and pass it as the filters argument here.'}getInputSchema(){return Bf}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){Mh(t),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeItemDescription};t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const r=await this.mondayApi.request(Uf,a);return{content:this.mapResult(r,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:Yp.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],r=a?.items_page,i=r?.items||[];return{board:{id:a?.id,name:a?.name},items:i.map((e=>this.mapItem(e,t))),pagination:{has_more:!!r?.cursor,nextCursor:r?.cursor||null,count:i.length}}}mapItem(e,t){const a={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}if(t.includeItemDescription&&"description"in e&&e.description){const t=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));a.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case Jh.BoardRelation:return e.linked_items;case Jh.Formula:return e.display_value;case Jh.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:20,boardIds:[e.boardId.toString()]},a=(await this.mondayApi.request(Mf,t,{versionOverride:"dev",timeout:jh})).search.items.results.map((e=>Number(e.id)));if(0===a.length)throw new Error("No items found for search term or new search is not enabled for this account");const r=e.itemIds??[];if(0===r.length)return a;const i=new Set(r);return a.filter((e=>i.has(e)))}},class extends bi{constructor(){super(...arguments),this.name="create_item",this.type=xr.WRITE,this.annotations=yi({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?pf:lf}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()},r=await this.mondayApi.request(sf,a);if(!r.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},n=new qc(this.mondayApi,{boardId:t});return await n.execute({itemId:parseInt(r.duplicate_item.id),columnValues:JSON.stringify(o)}),{content:{message:`Item ${r.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:r.duplicate_item.id,item_name:r.duplicate_item.name,item_url:r.duplicate_item.url,board_id:t}}}catch(e){Uh(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(df,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:{message:`Subitem ${a.create_subitem.id} created under ${e.parentItemId}`,item_id:a.create_subitem.id,item_name:a.create_subitem.name,item_url:a.create_subitem.url}}}catch(e){Uh(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},r=await this.mondayApi.request(Sc,a);return{content:{message:`Item ${r.create_item?.id} successfully created`,item_id:r.create_item?.id,item_name:r.create_item?.name,item_url:r.create_item?.url,board_id:t}}}catch(e){Uh(e,"create item")}}},class extends bi{constructor(){super(...arguments),this.name="create_update",this.type=xr.WRITE,this.annotations=yi({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 ff}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),r=hf.safeParse(a);if(!r.success)throw new Error(`Invalid mentionsList format: ${r.error.message}`);t=r.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()},r=await this.mondayApi.request(cf,a);if(!r.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${r.create_update.id} created on item ${e.itemId}`,update_id:r.create_update.id,item_id:e.itemId,item_name:r.create_update.item?.name,item_url:r.create_update.item?.url}}}catch(e){Uh(e,"create update")}}},class extends bi{constructor(){super(...arguments),this.name="get_updates",this.type=xr.READ,this.annotations=yi({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. For Board queries, you can filter by date range using fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion. Set includeItemUpdates to true to also include updates on individual items. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return yf}async executeInternal(e){try{const t=void 0!==e.fromDate,a=void 0!==e.toDate;if(t!==a)throw new Error("Both fromDate and toDate must be provided together for date range filtering");if((t||a)&&e.objectType===gf.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const r={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let i;i=e.objectType===gf.Item?await this.mondayApi.request(vf,{...r,itemId:e.objectId}):await this.mondayApi.request(_f,{...r,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:bf(e.fromDate),toDate:bf(e.toDate)}:{}});const o=e.objectType===gf.Item?i.items?.[0]?.updates:i.boards?.[0]?.updates;if(!o||0===o.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const n=o.map((t=>{const a={id:t.id,text_body:t.text_body,created_at:t.created_at,updated_at:t.updated_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:t.item_id};return e.includeReplies&&t.replies&&(a.replies=t.replies.map((e=>({id:e.id,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&t.assets&&(a.assets=t.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),a})),s=e.objectType===gf.Item?i.items?.[0]?.url:i.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:n,pagination:{page:e.page??1,limit:e.limit??25,count:n.length}}}}catch(e){Uh(e,"get updates")}}},class extends bi{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=xr.WRITE,this.annotations=yi({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 cg}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),r=mg.safeParse(a);if(!r.success)throw new Error(`Invalid mentionsList format: ${r.error.message}`);t=r.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},r=await this.mondayApi.request(cf,a);if(!r.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${r.create_update.id} successfully created on item ${e.itemId}`,update_id:r.create_update.id,item_id:e.itemId,next_steps:"Now call the full board data tool to get data, then immediately call the show table tool to show that data. 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){Uh(e,"create update")}}},class extends bi{constructor(){super(...arguments),this.name="get_board_schema",this.type=xr.READ,this.annotations=yi({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 qf}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},r=await this.mondayApi.request(Dc,a);return{content:{message:"Board schema retrieved",board_id:t,columns:r.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type})))??[],groups:r.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends bi{constructor(){super(...arguments),this.name="get_board_activity",this.type=xr.READ,this.annotations=yi({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 $f}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-Vh.MONTH30Days),r=e?.fromDate||a.toISOString(),i=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:r,toDate:i,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},n=await this.mondayApi.request(Of,o),s=n.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${r} to ${i}).`};const d=n.boards?.[0],p=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:d?.name,board_url:d?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...p&&e.data?{data:e.data}:{}})))}}}},class extends bi{constructor(){super(...arguments),this.name="get_board_info",this.type=xr.READ,this.annotations=yi({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. Also returns the board's views (e.g. table views, filter views) — each view includes its id, name, type, and a structured filter object. "}getInputSchema(){return jf}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(Rf,t),r=a.boards?.[0];if(!r)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const i=await this.getSubItemsBoardAsync(r);return{content:Cf(r,i)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===Jh.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],r=await this.mondayApi.request(Pf,{boardId:a});return r.boards?.[0]??null}},class extends bi{constructor(){super(...arguments),this.name="get_full_board_data",this.type=xr.READ,this.annotations=yi({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 kf}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(Sf,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const r=a.boards[0],i=new Set;r.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 t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&i.add(e.id)}))}}))}));const o=Array.from(i).filter((e=>!(Number(e)<0)));let n=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(Df,e);n=t.users?.filter((e=>null!==e))||[]}const s=new Map(n.map((e=>[e.id,e])));return{content:{board:{id:r.id,name:r.name,columns:r.columns,items:r.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:n,stats:{total_items:r.items_page.items.length,total_updates:r.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:n.length}}}}catch(e){Uh(e,"get full board data")}}},class extends bi{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=xr.READ,this.annotations=yi({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 yv}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,r=e.includeTeams||!1,i=e.teamsOnly||!1,o=e.includeTeamMembers||!1,n=!!e.name;if(e.getMe||!1){if(t||a||r||i||o||n)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(pv);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=cv(s),p=await _v(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}if(n){if(t||a||r||i||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const n={name:e.name},s=await this.mondayApi.request(dv,n);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 d=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),p=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${d}`,l=await _v(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(i&&r)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>uv)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>hv)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(i||!t&&a&&!r)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(sv,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(nv,t)}else if(r){const t={userIds:e.userIds,teamIds:e.teamIds,limit:fv};s=await this.mondayApi.request(ov,t)}else if(t){const t={userIds:e.userIds,limit:fv};s=await this.mondayApi.request(rv,t)}else{const e={userIds:void 0,limit:fv};s=await this.mondayApi.request(iv,e)}const d=cv(s),p=await _v(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},qc,class extends bi{constructor(){super(...arguments),this.name="move_item_to_group",this.type=xr.WRITE,this.annotations=yi({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 bv}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(Ac,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends bi{constructor(){super(...arguments),this.name="create_board",this.type=xr.WRITE,this.annotations=yi({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return mu}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(kc,t);return{content:{message:`Board ${a.create_board?.id} successfully created`,board_id:a.create_board?.id,board_name:a.create_board?.name,board_url:a.create_board?.url}}}},class extends bi{constructor(){super(...arguments),this.name="create_form",this.type=xr.WRITE,this.annotations=yi({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. Also creates a backing board to store responses. Returns the formToken for future mutations."}getInputSchema(){return Hu}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(Iu,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends bi{constructor(){super(...arguments),this.name="update_form",this.type=xr.WRITE,this.annotations=yi({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Ch(this.mondayApi),this.actionHandlers=new Map([[lh.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[lh.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[lh.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[lh.activate,this.helpers.activateForm.bind(this.helpers)],[lh.createTag,this.helpers.createTag.bind(this.helpers)],[lh.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[lh.updateTag,this.helpers.updateTag.bind(this.helpers)],[lh.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[lh.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[lh.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[lh.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[lh.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return"Update a monday.com form. Use the action field to specify the operation."}getInputSchema(){return Ph}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 bi{constructor(){super(...arguments),this.name="get_form",this.type=xr.READ,this.annotations=yi({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 formToken is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the formToken is abc123def456ghi789."}getInputSchema(){return xh}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Tu,t);return a.form?{content:{message:"Form retrieved",form_token:e.formToken,data:a.form}}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends bi{constructor(){super(...arguments),this.name="form_questions_editor",this.type=xr.WRITE,this.annotations=yi({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new ph(this.mondayApi),this.actionHandlers=new Map([[nh.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[nh.Update,this.helpers.updateQuestion.bind(this.helpers)],[nh.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return dh}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends bi{constructor(){super(...arguments),this.name="create_form_submission",this.type=xr.WRITE,this.annotations=yi({title:"Create WorkForm Submission",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Submit a response to a monday.com WorkForm. Use get_form first to retrieve the WorkForm, then:\n- Inspect each question's showIfRules to determine which questions are conditionally shown based on previous answers.\n- Inspect each question's settings for any answer constraints (e.g. rating limits, select options, label limits).\n- Take note of any titles, descriptions, and content blocks to present the form naturally as you walk the user through it.\n- Take note of pages and question order to present questions in the correct sequence.\nGather all answers upfront before calling this tool — do not submit one question at a time. Accepts a bare form token, a full WorkForm URL (e.g. https://forms.monday.com/forms/{form_token}?r=use1), or a shortened wkf.ms URL (e.g. https://wkf.ms/4tqP28t) — shortened URLs are automatically resolved by following the redirect. Returns the submission ID."}getInputSchema(){return Kh}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(e){if(e.includes("wkf.ms")){const t=(await i.head(e,{maxRedirects:0,validateStatus:e=>e<400})).headers.location;return t?this.extractTokenFromUrl(t):null}return e.startsWith("http://")||e.startsWith("https://")?this.extractTokenFromUrl(e):e}async executeInternal(e){const t=await this.resolveFormToken(e.form_token);if(!t)return{content:`Could not resolve a WorkForm token from "${e.form_token}". Please provide a valid WorkForm token or full WorkForm URL (e.g. https://forms.monday.com/forms/abc123).`};const a={form_token:t,answers:e.answers,form_timezone_offset:e.form_timezone_offset,password:e.password,tags:e.tags};try{const e=await this.mondayApi.request(Bh,a,{versionOverride:"dev"});return e.create_form_submission?{content:{message:"WorkForm submitted successfully",submission_id:e.create_form_submission.id}}:{content:`WorkForm with token ${t} was not found or is not accepting submissions. Verify the WorkForm token is correct, the WorkForm is active, and any required password was provided.`}}catch(e){Uh(e,"submit form")}}},class extends bi{constructor(){super(...arguments),this.name="create_column",this.type=xr.WRITE,this.annotations=yi({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?Xh:Zh}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},r=await this.mondayApi.request(Oc,a);return{content:{message:"Column successfully created",column_id:r.create_column?.id,column_title:r.create_column?.title}}}},class extends bi{constructor(){super(...arguments),this.name="create_group",this.type=xr.WRITE,this.annotations=yi({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 nf}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(rf,t);return{content:{message:"Group created successfully",group_id:a.create_group?.id,group_title:a.create_group?.title,board_id:e.boardId,group_name:e.groupName}}}},class extends bi{constructor(){super(...arguments),this.name="delete_column",this.type=xr.WRITE,this.annotations=yi({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?wf:If}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request($c,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Uc,class extends bi{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=xr.ALL_API,this.annotations=yi({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 Qf}async executeInternal(e){try{const t=await this.mondayApi.request(Rc),a=e?.operationType,r=t.__schema,i="write"!==a?t.queryType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,o="read"!==a?t.mutationType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,n=r?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>({name:e.name,kind:e.kind??"unknown"})))??[];return{content:{message:"GraphQL schema retrieved",...void 0!==i&&{query_fields:i},...void 0!==o&&{mutation_fields:o},types:n}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends bi{constructor(){super(...arguments),this.name="get_column_type_info",this.type=xr.READ,this.annotations=yi({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 Wf}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(Hf,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const r={schema:a.get_column_type_schema};return{content:{message:`Column type info for ${e.columnType}`,data:r,url:Gf}}}},class extends bi{constructor(){super(...arguments),this.name="get_type_details",this.type=xr.ALL_API,this.annotations=yi({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 zf}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,yc`
2121
2121
  query getTypeDetails {
2122
2122
  __type(name: "${t}") {
2123
2123
  name