@mondaydotcomorg/agent-toolkit 5.71.4 → 5.71.5
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.
- package/dist/cjs/core/index.js +2 -2
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/mcp/index.js +2 -2
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.js +2 -2
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/core/index.js +2 -2
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/mcp/index.js +2 -2
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.js +2 -2
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/core/index.js
CHANGED
|
@@ -1123,7 +1123,7 @@
|
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
1125
|
}
|
|
1126
|
-
`,Sh={name:a.z.string().min(1,"Item name cannot be empty").max(255,"Item name must be 255 characters or fewer").describe("The name of the new item to be created, must be relevant to the user's request. 1–255 characters."),groupId:a.z.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:a.z.string().describe(Gc),createLabelsIfMissing:a.z.boolean().optional().describe("When true, missing status/dropdown labels referenced in columnValues will be auto-created on the board instead of erroring with ColumnValueException. Requires permission to change board structure. Use when the caller specifies label names that may not yet exist on the board."),parentItemId:a.z.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:a.z.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},Nh={boardId:a.z.number().describe("The id of the board to which the new item will be added"),...Sh};class Dh extends le{constructor(){super(...arguments),this.name="create_item",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a single item or subitem on a monday.com board, or duplicate an existing item. [IMPORTANT] If you need to create multiple items in one call, use create_items instead of calling this tool in a loop. Otherwise: 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 with filters.columns.only to get column metadata without fetching views. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?Sh:Nh}async executeInternal(e){const t={...e,columnValues:Hc(e.columnValues)},a=this.context?.boardId??t.boardId;if(t.duplicateFromItemId&&t.parentItemId)throw new kc("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.","INVALID_ARGUMENTS_COMBINATION");return t.duplicateFromItemId?await this.duplicateAndUpdateItem(t,a):t.parentItemId?await this.createSubitem(t):await this.createNewItem(t,a)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},n=await this.mondayApi.request(wh,a);if(!n.duplicate_item?.id)throw new kc("Failed to duplicate item: no item duplicated","EMPTY_API_RESPONSE");let i;try{i=JSON.parse(e.columnValues)}catch(e){throw new kc("Invalid columnValues JSON: expected a JSON object keyed by column id","INVALID_COLUMN_VALUES_JSON")}const o={...i,name:e.name},r=new Kc(this.mondayApi,{boardId:t});return await r.execute({itemId:parseInt(n.duplicate_item.id),columnValues:JSON.stringify(o),createLabelsIfMissing:e.createLabelsIfMissing}),{content:{message:`Item ${n.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:n.duplicate_item.id,item_name:n.duplicate_item.name,item_url:n.duplicate_item.url,board_id:t}}}catch(e){Lc(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing};try{const a=await this.mondayApi.request(Ah,t);if(!a.create_subitem?.id)throw new kc("Failed to create subitem: no subitem created","EMPTY_API_RESPONSE");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){Lc(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing},n=await this.mondayApi.request(cc,a);return{content:{message:`Item ${n.create_item?.id} successfully created`,item_id:n.create_item?.id,item_name:n.create_item?.name,item_url:n.create_item?.url,board_id:t}}}catch(e){Lc(e,"create item")}}}const Oh={items:a.z.array(a.z.object({name:a.z.string().min(1,"Item name cannot be empty").max(255,"Item name must be 255 characters or fewer").optional().describe("Required. The name of the item to be created. 1-255 characters."),columnValues:a.z.string().default("{}").describe(`Column values for this item, keyed by column id. Defaults to "{}" (no column values). ${Gc}`),groupId:a.z.string().optional().describe("The id of the group to add this item to. Ignored when parentItemId is set (subitems inherit their parent group). If neither is set, the board default group is used."),parentItemId:a.z.number().optional().describe("If provided, this item is created as a subitem of this parent (uses create_subitem mutation) and groupId is ignored. Mutually exclusive with duplicateFromItemId."),duplicateFromItemId:a.z.number().optional().describe("The id of an existing item to duplicate and then patch with this item name and columnValues. Use for bulk templating (e.g., duplicate a template item N times with different overrides). Mutually exclusive with parentItemId."),createLabelsIfMissing:a.z.boolean().optional().describe("When true, missing status/dropdown labels referenced in this item's columnValues will be auto-created on the board instead of erroring with ColumnValueException. Requires permission to change board structure.")})).min(1,"items must not be empty").max(20,"items must not exceed 20 per call").describe("The items to create, up to 20 per call. Each item returns its own item_id and item_url on success, or a raw error message on failure. Each item independently chooses its groupId, parentItemId, and createLabelsIfMissing.")},Rh={boardId:a.z.number().describe("The id of the board to which the new items will be added"),...Oh};function Ch(e,t){const a=e?.response?.errors?.[0],n=e instanceof Error?e.message:String(e);return{...a?.extensions??{},message:a?.message??n,path:["results",t]}}const kh={item_id:a.z.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:a.z.string().describe("The ID of the custom activity for the timeline item"),title:a.z.string().describe("The title of the new timeline item"),summary:a.z.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:a.z.string().optional().describe("The content of the new timeline item"),timestamp:a.z.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:a.z.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:a.z.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:a.z.string().optional().describe("The location to add to the new timeline item"),phone:a.z.string().optional().describe("The phone number to add to the new timeline item"),url:a.z.string().optional().describe("The URL to add to the new timeline item")};const Lh=oc`
|
|
1126
|
+
`,Sh={name:a.z.string().min(1,"Item name cannot be empty").max(255,"Item name must be 255 characters or fewer").describe("The name of the new item to be created, must be relevant to the user's request. 1–255 characters."),groupId:a.z.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:a.z.string().describe(Gc),createLabelsIfMissing:a.z.boolean().optional().describe("When true, missing status/dropdown labels referenced in columnValues will be auto-created on the board instead of erroring with ColumnValueException. Requires permission to change board structure. Use when the caller specifies label names that may not yet exist on the board."),parentItemId:a.z.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:a.z.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},Nh={boardId:a.z.number().describe("The id of the board to which the new item will be added"),...Sh};class Dh extends le{constructor(){super(...arguments),this.name="create_item",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a single item or subitem on a monday.com board, or duplicate an existing item. [IMPORTANT] If you need to create multiple items in one call, use create_items instead of calling this tool in a loop. Otherwise: 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 with filters.columns.only to get column metadata without fetching views. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?Sh:Nh}async executeInternal(e){const t={...e,columnValues:Hc(e.columnValues)},a=this.context?.boardId??t.boardId;if(t.duplicateFromItemId&&t.parentItemId)throw new kc("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.","INVALID_ARGUMENTS_COMBINATION");return t.duplicateFromItemId?await this.duplicateAndUpdateItem(t,a):t.parentItemId?await this.createSubitem(t):await this.createNewItem(t,a)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},n=await this.mondayApi.request(wh,a);if(!n.duplicate_item?.id)throw new kc("Failed to duplicate item: no item duplicated","EMPTY_API_RESPONSE");let i;try{i=JSON.parse(e.columnValues)}catch(e){throw new kc("Invalid columnValues JSON: expected a JSON object keyed by column id","INVALID_COLUMN_VALUES_JSON")}const o={...i,name:e.name},r=new Kc(this.mondayApi,{boardId:t});return await r.execute({itemId:parseInt(n.duplicate_item.id),columnValues:JSON.stringify(o),createLabelsIfMissing:e.createLabelsIfMissing}),{content:{message:`Item ${n.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:n.duplicate_item.id,item_name:n.duplicate_item.name,item_url:n.duplicate_item.url,board_id:t}}}catch(e){Lc(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing};try{const a=await this.mondayApi.request(Ah,t);if(!a.create_subitem?.id)throw new kc("Failed to create subitem: no subitem created","EMPTY_API_RESPONSE");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){Lc(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing},n=await this.mondayApi.request(cc,a);return{content:{message:`Item ${n.create_item?.id} successfully created`,item_id:n.create_item?.id,item_name:n.create_item?.name,item_url:n.create_item?.url,board_id:t}}}catch(e){Lc(e,"create item")}}}const Oh={items:a.z.array(a.z.object({name:a.z.string().min(1,"Item name cannot be empty").max(255,"Item name must be 255 characters or fewer").optional().describe("Required. The name of the item to be created. 1-255 characters."),columnValues:a.z.string().default("{}").describe(`Column values for this item, keyed by column id. Defaults to "{}" (no column values). ${Gc}`),groupId:a.z.string().optional().describe("The id of the group to add this item to. Ignored when parentItemId is set (subitems inherit their parent group). If neither is set, the board default group is used."),parentItemId:a.z.number().optional().describe("If provided, this item is created as a subitem of this parent (uses create_subitem mutation) and groupId is ignored. Mutually exclusive with duplicateFromItemId."),duplicateFromItemId:a.z.number().optional().describe("The id of an existing item to duplicate and then patch with this item name and columnValues. Use for bulk templating (e.g., duplicate a template item N times with different overrides). Mutually exclusive with parentItemId."),createLabelsIfMissing:a.z.boolean().optional().describe("When true, missing status/dropdown labels referenced in this item's columnValues will be auto-created on the board instead of erroring with ColumnValueException. Requires permission to change board structure.")})).min(1,"items must not be empty").max(20,"items must not exceed 20 per call").describe("The items to create, up to 20 per call. Each item returns its own item_id and item_url on success, or a raw error message on failure. Each item independently chooses its groupId, parentItemId, and createLabelsIfMissing.")},Rh={boardId:a.z.number().describe("The id of the board to which the new items will be added"),...Oh};function Ch(e,t){const a=e?.response?.errors?.[0],n=e instanceof Error?e.message:String(e);return{...e instanceof kc?{code:e.code}:{},...a?.extensions??{},message:a?.message??n,path:["results",t]}}const kh={item_id:a.z.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:a.z.string().describe("The ID of the custom activity for the timeline item"),title:a.z.string().describe("The title of the new timeline item"),summary:a.z.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:a.z.string().optional().describe("The content of the new timeline item"),timestamp:a.z.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:a.z.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:a.z.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:a.z.string().optional().describe("The location to add to the new timeline item"),phone:a.z.string().optional().describe("The phone number to add to the new timeline item"),url:a.z.string().optional().describe("The URL to add to the new timeline item")};const Lh=oc`
|
|
1127
1127
|
mutation createUpdate($itemId: ID!, $body: String!, $mentionsList: [UpdateMention], $parentId: ID) {
|
|
1128
1128
|
create_update(body: $body, item_id: $itemId, mentions_list: $mentionsList, parent_id: $parentId) {
|
|
1129
1129
|
id
|
|
@@ -2956,7 +2956,7 @@
|
|
|
2956
2956
|
}
|
|
2957
2957
|
}
|
|
2958
2958
|
}
|
|
2959
|
-
`,fS={};const gS=[class extends le{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=exports.ToolType.READ,this.annotations=pe({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 fS}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(_S,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${jA} 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:`${QA} 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 n=cS(e,zA.SPRINT_TASKS);if(!n)return;const i=lS(n);if(!i)return;const o=`${e.id}:${i}`;if(a.has(o))return;const r=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(i,r,`Tasks Board ${i}`)})}processTasksBoard(e,t,a){const n=cS(e,XA);if(!n)return;const i=lS(n);if(!i)return;const o=`${i}:${e.id}`;if(a.has(o))return;const r=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(i,r,`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 n of e)n.columns&&(dS(n)&&this.processSprintsBoard(n,a,t),pS(n)&&this.processTasksBoard(n,a,t));return Array.from(t.values())}},class extends le{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=exports.ToolType.READ,this.annotations=pe({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List the sprints of a monday-dev sprints board with their metadata.\n\nReturns comprehensive sprint metadata 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. If you do not already have it, call get_monday_dev_sprints_boards first to discover it.\n\n## Call this before:\n- get_sprint_summary — this tool returns the Sprint IDs that get_sprint_summary requires. Never guess a sprint ID."}getInputSchema(){return hS}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},n=await this.mondayApi.request(uS,a),i=n.boards?.[0],o=i?.items_page?.items||[],r=this.buildSprintsMetadata(o);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:o.length,data:r}}}catch(e){return{content:`${QA} 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(mc,t),n=a.boards?.[0];if(!n)return{success:!1,error:`${jA} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const i=n.columns||[],o=this.validateSprintsBoardSchemaFromColumns(i);return o.isValid?{success:!0}:{success:!1,error:`${JA} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${QA} 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(zA),n=rS(t,a);if(!n.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return n.missingColumns.forEach((t=>{const a=(e=>ZA[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=nS(e,qA.SPRINT_ACTIVATION),a=nS(e,qA.SPRINT_COMPLETION),n=iS(e,qA.SPRINT_START_DATE),i=iS(e,qA.SPRINT_END_DATE),o=((e,t)=>{const a=aS(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,qA.SPRINT_TIMELINE),r=oS(e,qA.SPRINT_SUMMARY);let s=eS.Planned;return a?s=eS.Completed:(t||n)&&(s=eS.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:n||null,end_date:i||null,is_completed:a,document_object_id:r||null}}))}},class extends le{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=exports.ToolType.READ,this.annotations=pe({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- Requires a sprintId. [REQUIRED PRECONDITION]: call get_sprints_metadata first to list the sprints on the board and resolve the sprintId (and to confirm the sprint is completed). If you do not know the sprints board ID either, start with get_monday_dev_sprints_boards.\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 mS}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${QA} 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||`${QA} Unknown error occurred while reading document content`}}catch(e){return{content:`${QA} 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(BA,t)).items||[];if(0===a.length)return{success:!1,error:`${GA} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const n=a[0];if(!n)return{success:!1,error:`${GA} Sprint with ID ${e} not found.`};const i=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),n=[...Object.values(zA),...t];return rS(a,n)})(n,[qA.SPRINT_SUMMARY]);if(!i.isValid)return{success:!1,error:`${JA} Sprint item is missing required columns: ${i.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=oS(n,qA.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:n.name}:{success:!1,error:`${HA} No sprint summary document found for sprint "${n.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${QA} 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(rc,t)).docs||[];if(0===a.length)return{success:!1,error:`${HA} Document with object ID ${e} not found or not accessible.`};const n=a[0];if(!n||!n.id)return{success:!1,error:`${WA} Document data is invalid for object ID ${e}.`};const i={docId:n.id,blockIds:[]},o=await this.mondayApi.request(wc,i);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${KA} 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:`${YA} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${QA} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],bS=[class extends le{constructor(){super(...arguments),this.name="delete_item",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Hh}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(lc,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends le{constructor(){super(...arguments),this.name="get_board_items_page",this.type=exports.ToolType.READ,this.annotations=pe({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. [MULTI-LEVEL BOARDS]: The response includes hierarchy_type on the board ("multi_level" for MLS boards) and parent_item_id on each item. On multi-level boards, items form a tree (up to 5 levels). Use includeSubItems to get all descendants (returned flat with parent_item_id to reconstruct the tree). Top-level items have no parent_item_id. Subitems reference their parent. [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 with filters.columns.only to get column metadata without fetching views. This is essential for constructing proper filters and knowing which columns are available. [VIRTUAL COLUMNS]: Four filterable columns exist that get_board_info never returns - "group" (the item\'s board group), "__creation_log__" (creation time), "__last_updated__" (update time) and "__item_id__" (item id). All four are also valid in orderBy, e.g. "__creation_log__" with direction "desc" to sort newest-first. Call get_column_type_info with the matching column type for each one\'s compareValue and operator rules. [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 with filters.views.names set to that view name (avoids downloading all views on large boards), extract the matching view\'s filter field, then pass it as the filters argument here.'}getInputSchema(){return __}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){Uc(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,includeGroup:e.includeGroup};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 n=await this.mondayApi.request(d_,a);return{content:this.mapResult(n,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:hs.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],n=a?.items_page,i=n?.items||[];return{board:{id:a?.id,name:a?.name,hierarchy_type:a?.hierarchy_type||null},items:i.map((e=>this.mapItem(e,t))),pagination:{has_more:!!n?.cursor,nextCursor:n?.cursor||null,count:i.length}}}mapItem(e,t){const a=e.parent_item?.id||null,n={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at,...a&&{parent_item_id:a}};if(t.includeColumns&&e.column_values){n.column_values={};for(const t of e.column_values)n.column_values[t.id]=this.getColumnValueData(t)}if(t.includeGroup&&"group"in e&&e.group&&(n.group={id:e.group.id,title:e.group.title}),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})));n.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(n.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),n}getColumnValueData(e){switch(e.type){case uh.BoardRelation:return e.linked_items;case uh.Formula:return e.display_value;case uh.Mirror:return"Column value type is not supported"}if("battery_value"in e)return e.battery_value;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(p_,t,{versionOverride:"dev",timeout:qc})).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 n=e.itemIds??[];if(0===n.length)return a;const i=new Set(n);return a.filter((e=>i.has(e)))}},Dh,class extends le{constructor(){super(...arguments),this.name="create_items",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Create Multiple Items",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create up to 20 new items in a single call. Each item is fully independent - it chooses its own groupId, parentItemId (for subitems), duplicateFromItemId (for bulk templating from an existing item), and createLabelsIfMissing. A single call can therefore span multiple groups, mix regular items with subitems under different parents, and mix fresh creates with duplicates of existing items. Each item returns its own item_id and item_url on success, or a raw error message on failure. [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 with filters.columns.only to get column metadata without fetching views. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?Oh:Rh}async executeInternal(e){const t=e.items.flatMap(((e,t)=>void 0===e.name?[{message:"Item name is required",path:["items",t,"name"]}]:[]));if(t.length)throw new kc(`${t.length} of ${e.items.length} items are missing the required name field`,Cc,t);const a=this.context?.boardId??e.boardId;this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.items.length;const n=new Dh(this.mondayApi,{boardId:a}),i="Skipped: a previous item hit the minute rate limit; this item was not attempted",o=e.items.map(((e,t)=>async()=>{const a=await n.execute({name:e.name,columnValues:e.columnValues,groupId:e.groupId,parentItemId:e.parentItemId,duplicateFromItemId:e.duplicateFromItemId,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,...a.content}})),r=await jc(o,{limit:15,onSkipped:e=>({index:e,error:i,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:i,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:Ch(e,t)})}),s=r.filter((e=>"error"in e)).map((e=>e._errorEntry)),d=r.map((({_errorEntry:e,...t})=>t)),p=r.length,l=s.length,c={board_id:a,summary:{total:p,created:p-l,failed:l},is_partial_success:l>0&&l<p,results:d};return s.length&&(c.errors=s),{content:c}}},class extends le{constructor(){super(...arguments),this.name="create_update",this.type=exports.ToolType.WRITE,this.annotations=pe({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 Ph}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),n=xh.safeParse(a);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);t=n.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()},n=await this.mondayApi.request(Lh,a);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${n.create_update.id} created on item ${e.itemId}`,update_id:n.create_update.id,item_id:e.itemId,item_name:n.create_update.item?.name,item_url:n.create_update.item?.url}}}catch(e){Lc(e,"create update")}}},class extends le{constructor(){super(...arguments),this.name="delete_update",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Delete Update",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an update (comment/post) from a monday.com item."}getInputSchema(){return Mh}async executeInternal(e){try{const t={id:e.id.toString()},a=await this.mondayApi.request($h,t);if(!a.delete_update?.id)throw new Error("Failed to delete update: update not found or already deleted");return{content:{message:`Update ${a.delete_update.id} successfully deleted`,update_id:a.delete_update.id}}}catch(e){Lc(e,"delete update")}}},class extends le{constructor(){super(...arguments),this.name="get_updates",this.type=exports.ToolType.READ,this.annotations=pe({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 zh}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===Bh.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const n={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let i;i=e.objectType===Bh.Item?await this.mondayApi.request(Vh,{...n,itemId:e.objectId}):await this.mondayApi.request(Fh,{...n,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:qh(e.fromDate),toDate:qh(e.toDate)}:{}});const o=e.objectType===Bh.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 r=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===Bh.Item?i.items?.[0]?.url:i.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:r,pagination:{page:e.page??1,limit:e.limit??25,count:r.length}}}}catch(e){Lc(e,"get updates")}}},class extends le{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=exports.ToolType.WRITE,this.annotations=pe({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 Jg}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),n=Qg.safeParse(a);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);t=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},n=await this.mondayApi.request(Lh,a);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${n.create_update.id} successfully created on item ${e.itemId}`,update_id:n.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){Lc(e,"create update")}}},class extends le{constructor(){super(...arguments),this.name="get_board_schema",this.type=exports.ToolType.READ,this.annotations=pe({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id. Returns each column id, title, type, and revision, plus each group id and title. Call this before tools that need a column id, type, and revision resolved from schema: update_column (which also needs the revision returned here), delete_column, configure_ai_column, and remove_ai_from_column — get_board_info returns the same column id/type/revision fields and also satisfies this precondition, but prefer this tool when you only need columns and groups, not the rest of the board. For broader board metadata (owners, views, and their filters) use get_board_info instead — pass filters.views.ids / filters.views.names and/or filters.columns.ids there when you only need a subset."}getInputSchema(){if(!this.context?.boardId)return f_}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},n=await this.mondayApi.request(mc,a);return{content:{message:"Board schema retrieved",board_id:t,columns:n.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type,revision:e?.revision})))??[],groups:n.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends le{constructor(){super(...arguments),this.name="get_board_activity",this.type=exports.ToolType.READ,this.annotations=pe({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). Optionally filter by item ids or user ids to avoid fetching activity for the entire board. [REQUIRED PRECONDITION]: Call this with includeData=true before undo_action — it is the source of the action_record_uuid that identifies the action to undo."}getInputSchema(){return e_}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-zc.MONTH30Days),n=e?.fromDate||a.toISOString(),i=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),itemIds:e.itemIds?.map(String),userIds:e.userIds?.map(String),fromDate:n,toDate:i,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},r=await this.mondayApi.request(Zh,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 (${n} to ${i}).`};const d=r.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 le{constructor(e,t,a){super(e,a),this.name="get_board_info",this.type=exports.ToolType.READ,this.annotations=pe({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. "+(this.shouldIncludeKnowledge()?"Also returns generated board knowledge when available, including human-readable business context, workflow and status meanings, column purposes, people roles, and related boards. Knowledge is best-effort and may be null while it is unavailable or still being generated. ":"")+'Also returns the board\'s views (e.g. table views, filter views) — each view includes its id, name, type, and a structured filter object. On large boards, ALWAYS narrow the response: use filters.views.names or filters.views.ids when you only need specific views, and/or filters.columns.ids when you only need specific columns. Set filters.views.only or filters.columns.only when you want just that section — full views[].settings across many views can be multi-MB. The response includes hierarchy_type which indicates if the board is a multi-level board ("multi_level") where items can have nested subitems up to 5 levels deep on the same board. On multi-level boards, subitems share the same columns as parent items and subItemColumns will be null. Call this FIRST whenever you are not already familiar with a board structure (column IDs, column types, column revisions, status labels) — before reading or writing its data, or before any tool that declares this as a required precondition (e.g. get_board_items_page, board_insights, create_item, create_items, update_items, change_item_column_values, update_column, create_view, create_view_table, update_view, update_view_table). Also use the views it returns to resolve a view referenced by name (pass that name in filters.views.names), and as the source of view ids for update_view and update_view_table. Each column\'s "settings" field is the raw API value for that existing column, shown so you can read current labels/config — it is NOT the format expected by the columnSettings parameter of create_column or update_column. Never copy a column\'s "settings" object verbatim into columnSettings — use get_column_type_info with fetchMode "schema" to get the correct shape for the column type you are creating or updating.'}getInputSchema(){return s_}async executeInternal(e){const{columnIds:t,viewIds:a,includeColumns:n,includeViews:i,unmatchedViewNames:o,availableViewNames:r}=await this.resolveFiltersAsync(e);if(e.filters?.views?.names?.length&&i&&void 0!==a&&0===a.length){const t=r.length>0?r.join(", "):"(none)";return{content:`None of the requested view names matched on board ${e.boardId}. Requested: ${e.filters.views.names.join(", ")}. Available views: ${t}.`}}const s={boardId:e.boardId.toString(),columnIds:n?t:void 0,viewIds:i?a:void 0,includeColumns:n,includeViews:i},d=this.mondayApi.request(t_,s),p=this.shouldIncludeKnowledge(),l=p?this.mondayApi.request(i_,{boardId:e.boardId.toString()},{versionOverride:"dev",timeout:1e3}).catch((t=>(this.context?.deps?.logger?.warn({err:t,boardId:e.boardId,timeoutMs:1e3},"Failed to fetch board knowledge"),null))):Promise.resolve(null),[c,m]=await Promise.all([d,l]),u=c.boards?.[0];if(!u)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const h=n?await this.getSubItemsBoardAsync(u):null;return{content:o_(u,h,o,m?.entity_knowledge??null,p)}}shouldIncludeKnowledge(){return this.context?.deps?.flagChecker?.("mcp-get-board-info-entity-knowledge")??!0}async resolveFiltersAsync(e){const t=e.filters?.columns,a=e.filters?.views,n=Boolean(t?.only),i=Boolean(a?.only),o=void 0!==a?.ids,r=Boolean(a?.names?.length),s=!i||n,d=!n||i,p=s?t?.ids:void 0;if(!d)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(!o&&!r)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(o&&!r)return{columnIds:p,viewIds:a?.ids??[],includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};const l=await this.mondayApi.request(a_,{boardId:e.boardId.toString()}),c=l.boards?.[0]?.views??[],m=c.map((e=>e?.name)).filter((e=>Boolean(e))),{viewIds:u,unmatchedViewNames:h}=((e,t)=>{const a=new Map;for(const t of e){if(!t?.id||!t.name)continue;const e=r_(t.name),n=a.get(e)??[];n.push(t.id),a.set(e,n)}const n=[],i=[];for(const e of t){const t=a.get(r_(e));t?.length?n.push(...t):i.push(e)}return{viewIds:n,unmatchedViewNames:i}})(c,a?.names??[]);return{columnIds:p,viewIds:[...new Set([...a?.ids??[],...u])],includeColumns:s,includeViews:d,unmatchedViewNames:h,availableViewNames:m}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===uh.Subtasks));if(!t)return null;const a=t.settings.boardIds[0];if(a===e.id)return null;const n=await this.mondayApi.request(n_,{boardId:a});return n.boards?.[0]??null}},class extends le{constructor(){super(...arguments),this.name="get_full_board_data",this.type=exports.ToolType.READ,this.annotations=pe({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 Xh}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(Yh,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const n=a.boards[0],i=new Set;n.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&i.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&i.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const 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 r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(Kh,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e])));return{content:{board:{id:n.id,name:n.name,columns:n.columns,items:n.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:r,stats:{total_items:n.items_page.items.length,total_updates:n.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){Lc(e,"get full board data")}}},class extends le{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=exports.ToolType.READ,this.annotations=pe({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 Y_}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,n=e.includeTeams||!1,i=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||n||i||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(M_);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=B_(s),p=await H_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}if(r){if(t||a||n||i||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($_,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 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 H_(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(i&&n)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>z_)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>q_)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&&!n)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(P_,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(x_,t)}else if(n){const t={userIds:e.userIds,teamIds:e.teamIds,limit:j_};s=await this.mondayApi.request(U_,t)}else if(t){const t={userIds:e.userIds,limit:j_};s=await this.mondayApi.request(k_,t)}else{const e={userIds:void 0,limit:j_};s=await this.mondayApi.request(L_,e)}const d=B_(s),p=await H_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},Kc,class extends le{constructor(){super(...arguments),this.name="update_items",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Update Multiple Items",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update column values for up to 40 items in a single call. Each update targets one item by itemId and sets one or more column values on it. Each update is independent - it can target its own board via boardId and set its own column values, so a single call can update many items across multiple boards, apply the same value to many items, or apply different values per item. Each update returns its own item_id and item_url on success or a raw error message on failure. To link board-relation columns, call link_board_items_workflow before using this tool. [REQUIRED PRECONDITION]: Before using this tool, if you are not familiar with the board structure (column IDs, column types, status labels), first use get_board_info with filters.columns.only to get column metadata without fetching views. This is essential for constructing valid column values."}getInputSchema(){return this.context?.boardId?Jc:Xc}async executeInternal(e){this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const t=this.context?.boardId??e.boardId,a=e.updates.map((e=>e.boardId??t)),n=a.map(((e,t)=>null==e?t:-1)).filter((e=>e>=0));if(n.length>0)throw new kc(`Missing boardId for update(s) at index ${n.join(", ")}. Set a boardId on each update or provide a batch-level boardId.`,"MISSING_REQUIRED_PARAMETER");const i="Skipped: a previous update hit the minute rate limit, this update was not attempted",o=new Kc(this.mondayApi),r=e.updates.map(((e,t)=>async()=>{const n=a[t],i=await o.execute({boardId:n,itemId:e.itemId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,board_id:n,...i.content}})),s=await jc(r,{limit:15,onSkipped:e=>({index:e,error:i,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:i,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:Zc(e,t)})}),d=s.filter((e=>"error"in e)).map((e=>e._errorEntry)),p=s.map((({_errorEntry:e,...t})=>t)),l=s.length,c=d.length,m={summary:{total:l,updated:l-c,failed:c},is_partial_success:c>0&&c<l,results:p};return d.length&&(m.errors=d),{content:m}}},class extends le{constructor(){super(...arguments),this.name="move_item_to_group",this.type=exports.ToolType.WRITE,this.annotations=pe({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 K_}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(hc,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends le{constructor(){super(...arguments),this.name="create_board",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Tm}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId,...void 0!==e.boardOwnerIds?{boardOwnerIds:e.boardOwnerIds}:{},...void 0!==e.useMlsTemplate?{useMlsTemplate:e.useMlsTemplate}:{},...void 0!==e.useDatasetTemplate?{useDatasetTemplate:e.useDatasetTemplate}:{}},a=await this.mondayApi.request(_c,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 le{constructor(){super(...arguments),this.name="use_template",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Use Template",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Apply a monday.com template to create boards in a workspace. Returns a process_id immediately — the operation runs asynchronously and can take 30 seconds to 2+ minutes. Use check_template_status(processId) to poll every 5–10 seconds until status is COMPLETE or FAILED. Stop polling on COMPLETE (boards ready) or FAILED (unrecoverable error). Give up after ~5 minutes if neither terminal status is reached. Boards exist as empty shells until status is COMPLETE."}getInputSchema(){return Em}async executeInternal(e){const t={templateId:e.templateId,destinationWorkspaceId:e.destinationWorkspaceId,destinationName:e.destinationName,boardKind:e.boardKind},a=await this.mondayApi.request(Sc,t),n=a.use_template?.process_id;return null==n?{content:{processId:null,message:"Failed to start template application. The request was rejected."}}:{content:{processId:n,message:"Template application started. Poll check_template_status with processId every 5–10 seconds. Stop on COMPLETE (boards ready) or FAILED (unrecoverable). Give up after ~5 minutes."}}}},class extends le{constructor(){super(...arguments),this.name="check_template_status",this.type=exports.ToolType.READ,this.annotations=pe({title:"Check Template Status",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Check the status of a use_template operation. Poll after calling use_template — wait 5–10 seconds between polls. Status values: PENDING | IN_PROGRESS | COMPLETE | FAILED. Stop polling when status is COMPLETE (boards ready) or FAILED (unrecoverable). Give up after ~5 minutes if neither terminal status is reached. Board IDs are only available once COMPLETE — boards exist but are empty during IN_PROGRESS. Returns null if process_id is invalid or expired (1-hour TTL)."}getInputSchema(){return wm}async executeInternal(e){const t={processId:e.processId},a=(await this.mondayApi.request(Nc,t)).template_installation_status;return a?a.status===Pd.Complete?{content:{status:Pd.Complete,board_ids:a.board_ids,board_ids_map:a.board_ids_map,message:`Template application complete. ${a.board_ids.length} board(s) created.`}}:a.status===Pd.Failed?{content:{status:Pd.Failed,board_ids:[],board_ids_map:[],message:"Template application failed. Please try again."}}:a.status===Pd.Pending||a.status===Pd.InProgress?{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Template application ${a.status===Pd.InProgress?"in progress":"pending"}. Board IDs will be available once complete.`}}:{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Unexpected status: ${a.status}. Poll again or contact support.`}}:{content:{status:null,message:"Status not found. The process_id is invalid or has expired."}}}},class extends le{constructor(){super(...arguments),this.name="create_form",this.type=exports.ToolType.WRITE,this.annotations=pe({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 mu}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(Gm,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends le{constructor(){super(...arguments),this.name="update_form",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new ah((()=>this.mondayApi)),this.actionHandlers=new Map([[ku.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[ku.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[ku.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[ku.activate,this.helpers.activateForm.bind(this.helpers)],[ku.createTag,this.helpers.createTag.bind(this.helpers)],[ku.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[ku.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[ku.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[ku.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[ku.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[ku.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return"Update a monday.com form. Use the action field to specify the operation. [REQUIRED PRECONDITION]: Call get_form first to read the current form state — you need it to resolve the formToken, and for actions that reference existing entities (updateQuestionOrder needs the question ids, deleteTag needs the tag id) or that overwrite existing settings (updateAppearance, updateAccessibility, updateFeatures, updateFormHeader)."}getInputSchema(){return th}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 le{constructor(){super(...arguments),this.name="get_form",this.type=exports.ToolType.READ,this.annotations=pe({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token, including its pages, questions, question ids, settings, and conditional showIfRules. 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. Call this FIRST before any tool that acts on an existing form: create_form_submission (to know the questions and their constraints), form_questions_editor (to resolve question ids and current structure), and update_form (to see the current settings before changing them)."}getInputSchema(){return nh}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Hm,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 le{constructor(){super(...arguments),this.name="form_questions_editor",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Cu((()=>this.mondayApi)),this.actionHandlers=new Map([[Du.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Du.Update,this.helpers.updateQuestion.bind(this.helpers)],[Du.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form. [REQUIRED PRECONDITION]: For update and delete, call get_form first to resolve the exact question id and see its current type and settings — never guess a question id. For create, get_form shows the existing questions so you do not duplicate one."}getInputSchema(){return Ru}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends le{constructor(){super(...arguments),this.name="create_form_submission",this.type=exports.ToolType.WRITE,this.annotations=pe({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 mh}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(e){if(e.includes("wkf.ms")){const t=(await y.default.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(ih,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){Lc(e,"submit form")}}},class extends le{constructor(){super(...arguments),this.name="create_column",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new column in a monday.com board. [REQUIRED PRECONDITION]: If the column needs type-specific configuration (columnSettings) — e.g. status/dropdown labels, formula definitions, number units — first call get_column_type_info with fetchMode "${um.Schema}" for that column type to learn the valid settings structure. Do not guess the settings shape. To give the new column AI behavior, create it here first, then call configure_ai_column.`}getInputSchema(){return this.context?.boardId?hh:_h}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},n=await this.mondayApi.request(fc,a);return{content:{message:"Column successfully created",column_id:n.create_column?.id,column_title:n.create_column?.title}}}},class extends le{constructor(){super(...arguments),this.name="update_column",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Update Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Update properties of an existing monday.com column (title, description, settings). [REQUIRED PRECONDITION]: Uses optimistic concurrency control via the revision field — fetch the column id, type, and current revision via get_board_schema first (preferred), or get_board_info if you already have it, then call this tool. If the update fails because the revision is stale, re-fetch and try again. After a successful update, use the new revision returned in the response for any further update to this column, not the one you started with. [REQUIRED PRECONDITION]: If you are changing columnSettings, also call get_column_type_info with fetchMode "${um.Schema}" for that column type first to learn the valid settings structure. columnSettings is the flat payload for that column type (e.g. {"labels": [...]}) — not get_board_info's column.settings object copied as-is, and not wrapped again as {"settings": {"labels": [...]}}. To edit existing status or dropdown labels (rename, recolor, or reorder): first call get_board_info with filters.columns.ids for that column (or filters.columns.only) to read its current settings.labels, where each existing label's id lives. Editing an existing label requires sending its id in that label's entry — omitting it fails validation, since only a brand-new label can omit id. Status labels need the full label shape (id, label, color, index, and so on), not just a renamed string. Never invent an id — reuse the ids from get_board_info and add new labels without one. Flow: get_board_info for the revision and current settings.labels with ids, get_column_type_info (schema mode) for the valid shape, then build columnSettings.labels reusing existing ids and adding new labels without id.`}getInputSchema(){return this.context?.boardId?fh:gh}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnId:e.columnId,columnType:e.columnType,revision:e.revision,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},n=await this.mondayApi.request(bc,a);return{content:{message:"Column successfully updated. Use the new revision below for any subsequent update to this column.",column_id:n.update_column?.id,column_title:n.update_column?.title,revision:n.update_column?.revision}}}},class extends le{constructor(){super(...arguments),this.name="create_group",this.type=exports.ToolType.WRITE,this.annotations=pe({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 Eh}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(Ih,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 le{constructor(){super(...arguments),this.name="delete_column",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board. This is irreversible — the column and all of its values are removed. [REQUIRED PRECONDITION]: Call get_board_schema or get_board_info first to resolve the exact columnId and confirm you are deleting the intended column. Never guess a column id."}getInputSchema(){return this.context?.boardId?jh:Gh}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(gc,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Mc,class extends Mc{constructor(e,t){super(e,t),this.name="all_api_read",this.type=exports.ToolType.READ,this.annotations=pe({title:"Run read-only Query on the monday.com API",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Execute read-only GraphQL queries against the monday.com API. Only queries are accepted — mutations are rejected with an error before the request is sent. Use the get_type_details tool first to understand the schema before crafting your query."}async executeInternal(e){const t=rt(e.query);this.recordGraphqlOperationCounts(t);const a=hi(t);if(a?.operation===Se.MUTATION)throw new kc("all_api_read only accepts read queries. Mutations are not allowed.",Oc);return super.executeInternal(e)}},class extends Mc{constructor(e,t){super(e,t),this.name="all_api_write",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Run Mutation on the monday.com API",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Execute GraphQL mutations against the monday.com API to create, update, or delete data. Only mutations are accepted — queries are rejected with an error before the request is sent. Use get_graphql_schema and get_type_details tools first to understand the schema before crafting your mutation."}async executeInternal(e){const t=rt(e.query);this.recordGraphqlOperationCounts(t);const a=hi(t);if(a&&a.operation!==Se.MUTATION)throw new kc("all_api_write only accepts mutations. Read queries are not allowed.",Oc);return super.executeInternal(e)}},class extends le{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=exports.ToolType.ALL_API,this.annotations=pe({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 T_}async executeInternal(e){try{const t=await this.mondayApi.request(yc),a=e?.operationType,n=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,r=n?.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:r}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends le{constructor(){super(...arguments),this.name="get_column_type_info",this.type=exports.ToolType.READ,this.annotations=pe({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Retrieves comprehensive information about a specific column type. Use fetchMode "${um.Schema}" (default) to get the JSON schema definition from the API — to understand structure, validation rules, and available properties for column settings. Call this BEFORE any tool that writes column settings: create_column, update_column, and manage_object_schema_columns. Use fetchMode "${um.Guidelines}" to get only guidelines.filter and guidelines.aggregation (no schema, no GraphQL round-trip). Call this before building any filter rule that uses compare_value/operator for that column type — e.g. get_board_items_page, board_insights, or a view's filters (create_view, create_view_table, update_view, update_view_table) — and before building board insights aggregation counts. `}getInputSchema(){return I_}async executeInternal(e){if(e.fetchMode===um.Guidelines)return{content:{message:`Column type guidelines for ${e.columnType}`,data:{guidelines:{filter:v_(e.columnType),aggregation:`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${Ci.CountItems} function. Do not use ${Ci.Count} function for that purpose.\n `}},url:b_}};const t={type:e.columnType},a=await this.mondayApi.request(g_,t);return a?.get_column_type_schema?{content:{message:`Column type schema for ${e.columnType}`,data:{schema:a.get_column_type_schema},url:b_}}:{content:`Information for column type "${e.columnType}" not found or not available.`}}},class extends le{constructor(e,t){super("function"==typeof e?()=>Pc(e()):Pc(e),t),this.name="get_type_details",this.type=exports.ToolType.ALL_API,this.annotations=pe({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, including its fields, input fields, and enum values. Call this with a known type name to confirm its exact fields, arguments, and enum values before referencing that type in an operation for all_monday_api, all_api_read, or all_api_write, so the fields and arguments you send actually exist."}getInputSchema(){return E_}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,oc`
|
|
2959
|
+
`,fS={};const gS=[class extends le{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=exports.ToolType.READ,this.annotations=pe({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 fS}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(_S,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${jA} 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:`${QA} 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 n=cS(e,zA.SPRINT_TASKS);if(!n)return;const i=lS(n);if(!i)return;const o=`${e.id}:${i}`;if(a.has(o))return;const r=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(i,r,`Tasks Board ${i}`)})}processTasksBoard(e,t,a){const n=cS(e,XA);if(!n)return;const i=lS(n);if(!i)return;const o=`${i}:${e.id}`;if(a.has(o))return;const r=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(i,r,`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 n of e)n.columns&&(dS(n)&&this.processSprintsBoard(n,a,t),pS(n)&&this.processTasksBoard(n,a,t));return Array.from(t.values())}},class extends le{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=exports.ToolType.READ,this.annotations=pe({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List the sprints of a monday-dev sprints board with their metadata.\n\nReturns comprehensive sprint metadata 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. If you do not already have it, call get_monday_dev_sprints_boards first to discover it.\n\n## Call this before:\n- get_sprint_summary — this tool returns the Sprint IDs that get_sprint_summary requires. Never guess a sprint ID."}getInputSchema(){return hS}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},n=await this.mondayApi.request(uS,a),i=n.boards?.[0],o=i?.items_page?.items||[],r=this.buildSprintsMetadata(o);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:o.length,data:r}}}catch(e){return{content:`${QA} 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(mc,t),n=a.boards?.[0];if(!n)return{success:!1,error:`${jA} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const i=n.columns||[],o=this.validateSprintsBoardSchemaFromColumns(i);return o.isValid?{success:!0}:{success:!1,error:`${JA} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${QA} 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(zA),n=rS(t,a);if(!n.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return n.missingColumns.forEach((t=>{const a=(e=>ZA[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=nS(e,qA.SPRINT_ACTIVATION),a=nS(e,qA.SPRINT_COMPLETION),n=iS(e,qA.SPRINT_START_DATE),i=iS(e,qA.SPRINT_END_DATE),o=((e,t)=>{const a=aS(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,qA.SPRINT_TIMELINE),r=oS(e,qA.SPRINT_SUMMARY);let s=eS.Planned;return a?s=eS.Completed:(t||n)&&(s=eS.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:n||null,end_date:i||null,is_completed:a,document_object_id:r||null}}))}},class extends le{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=exports.ToolType.READ,this.annotations=pe({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- Requires a sprintId. [REQUIRED PRECONDITION]: call get_sprints_metadata first to list the sprints on the board and resolve the sprintId (and to confirm the sprint is completed). If you do not know the sprints board ID either, start with get_monday_dev_sprints_boards.\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 mS}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${QA} 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||`${QA} Unknown error occurred while reading document content`}}catch(e){return{content:`${QA} 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(BA,t)).items||[];if(0===a.length)return{success:!1,error:`${GA} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const n=a[0];if(!n)return{success:!1,error:`${GA} Sprint with ID ${e} not found.`};const i=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),n=[...Object.values(zA),...t];return rS(a,n)})(n,[qA.SPRINT_SUMMARY]);if(!i.isValid)return{success:!1,error:`${JA} Sprint item is missing required columns: ${i.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=oS(n,qA.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:n.name}:{success:!1,error:`${HA} No sprint summary document found for sprint "${n.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${QA} 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(rc,t)).docs||[];if(0===a.length)return{success:!1,error:`${HA} Document with object ID ${e} not found or not accessible.`};const n=a[0];if(!n||!n.id)return{success:!1,error:`${WA} Document data is invalid for object ID ${e}.`};const i={docId:n.id,blockIds:[]},o=await this.mondayApi.request(wc,i);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${KA} 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:`${YA} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${QA} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],bS=[class extends le{constructor(){super(...arguments),this.name="delete_item",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Hh}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(lc,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends le{constructor(){super(...arguments),this.name="get_board_items_page",this.type=exports.ToolType.READ,this.annotations=pe({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. [MULTI-LEVEL BOARDS]: The response includes hierarchy_type on the board ("multi_level" for MLS boards) and parent_item_id on each item. On multi-level boards, items form a tree (up to 5 levels). Use includeSubItems to get all descendants (returned flat with parent_item_id to reconstruct the tree). Top-level items have no parent_item_id. Subitems reference their parent. [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 with filters.columns.only to get column metadata without fetching views. This is essential for constructing proper filters and knowing which columns are available. [VIRTUAL COLUMNS]: Four filterable columns exist that get_board_info never returns - "group" (the item\'s board group), "__creation_log__" (creation time), "__last_updated__" (update time) and "__item_id__" (item id). All four are also valid in orderBy, e.g. "__creation_log__" with direction "desc" to sort newest-first. Call get_column_type_info with the matching column type for each one\'s compareValue and operator rules. [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 with filters.views.names set to that view name (avoids downloading all views on large boards), extract the matching view\'s filter field, then pass it as the filters argument here.'}getInputSchema(){return __}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){Uc(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,includeGroup:e.includeGroup};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 n=await this.mondayApi.request(d_,a);return{content:this.mapResult(n,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:hs.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],n=a?.items_page,i=n?.items||[];return{board:{id:a?.id,name:a?.name,hierarchy_type:a?.hierarchy_type||null},items:i.map((e=>this.mapItem(e,t))),pagination:{has_more:!!n?.cursor,nextCursor:n?.cursor||null,count:i.length}}}mapItem(e,t){const a=e.parent_item?.id||null,n={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at,...a&&{parent_item_id:a}};if(t.includeColumns&&e.column_values){n.column_values={};for(const t of e.column_values)n.column_values[t.id]=this.getColumnValueData(t)}if(t.includeGroup&&"group"in e&&e.group&&(n.group={id:e.group.id,title:e.group.title}),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})));n.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(n.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),n}getColumnValueData(e){switch(e.type){case uh.BoardRelation:return e.linked_items;case uh.Formula:return e.display_value;case uh.Mirror:return"Column value type is not supported"}if("battery_value"in e)return e.battery_value;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(p_,t,{versionOverride:"dev",timeout:qc})).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 n=e.itemIds??[];if(0===n.length)return a;const i=new Set(n);return a.filter((e=>i.has(e)))}},Dh,class extends le{constructor(){super(...arguments),this.name="create_items",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Create Multiple Items",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create up to 20 new items in a single call. Each item is fully independent - it chooses its own groupId, parentItemId (for subitems), duplicateFromItemId (for bulk templating from an existing item), and createLabelsIfMissing. A single call can therefore span multiple groups, mix regular items with subitems under different parents, and mix fresh creates with duplicates of existing items. Each item returns its own item_id and item_url on success, or a raw error message on failure. [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 with filters.columns.only to get column metadata without fetching views. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?Oh:Rh}async executeInternal(e){const t=e.items.flatMap(((e,t)=>void 0===e.name?[Ch(new kc("Item name is required",Cc),t)]:[]));if(t.length)throw new kc(`${t.length} of ${e.items.length} items are missing the required name field`,Cc,t);const a=this.context?.boardId??e.boardId;this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.items.length;const n=new Dh(this.mondayApi,{boardId:a}),i="Skipped: a previous item hit the minute rate limit; this item was not attempted",o=e.items.map(((e,t)=>async()=>{const a=await n.execute({name:e.name,columnValues:e.columnValues,groupId:e.groupId,parentItemId:e.parentItemId,duplicateFromItemId:e.duplicateFromItemId,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,...a.content}})),r=await jc(o,{limit:15,onSkipped:e=>({index:e,error:i,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:i,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:Ch(e,t)})}),s=r.filter((e=>"error"in e)).map((e=>e._errorEntry)),d=r.map((({_errorEntry:e,...t})=>t)),p=r.length,l=s.length,c={board_id:a,summary:{total:p,created:p-l,failed:l},is_partial_success:l>0&&l<p,results:d};return s.length&&(c.errors=s),{content:c}}},class extends le{constructor(){super(...arguments),this.name="create_update",this.type=exports.ToolType.WRITE,this.annotations=pe({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 Ph}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),n=xh.safeParse(a);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);t=n.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()},n=await this.mondayApi.request(Lh,a);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${n.create_update.id} created on item ${e.itemId}`,update_id:n.create_update.id,item_id:e.itemId,item_name:n.create_update.item?.name,item_url:n.create_update.item?.url}}}catch(e){Lc(e,"create update")}}},class extends le{constructor(){super(...arguments),this.name="delete_update",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Delete Update",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an update (comment/post) from a monday.com item."}getInputSchema(){return Mh}async executeInternal(e){try{const t={id:e.id.toString()},a=await this.mondayApi.request($h,t);if(!a.delete_update?.id)throw new Error("Failed to delete update: update not found or already deleted");return{content:{message:`Update ${a.delete_update.id} successfully deleted`,update_id:a.delete_update.id}}}catch(e){Lc(e,"delete update")}}},class extends le{constructor(){super(...arguments),this.name="get_updates",this.type=exports.ToolType.READ,this.annotations=pe({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 zh}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===Bh.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const n={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let i;i=e.objectType===Bh.Item?await this.mondayApi.request(Vh,{...n,itemId:e.objectId}):await this.mondayApi.request(Fh,{...n,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:qh(e.fromDate),toDate:qh(e.toDate)}:{}});const o=e.objectType===Bh.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 r=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===Bh.Item?i.items?.[0]?.url:i.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:r,pagination:{page:e.page??1,limit:e.limit??25,count:r.length}}}}catch(e){Lc(e,"get updates")}}},class extends le{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=exports.ToolType.WRITE,this.annotations=pe({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 Jg}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),n=Qg.safeParse(a);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);t=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},n=await this.mondayApi.request(Lh,a);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${n.create_update.id} successfully created on item ${e.itemId}`,update_id:n.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){Lc(e,"create update")}}},class extends le{constructor(){super(...arguments),this.name="get_board_schema",this.type=exports.ToolType.READ,this.annotations=pe({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id. Returns each column id, title, type, and revision, plus each group id and title. Call this before tools that need a column id, type, and revision resolved from schema: update_column (which also needs the revision returned here), delete_column, configure_ai_column, and remove_ai_from_column — get_board_info returns the same column id/type/revision fields and also satisfies this precondition, but prefer this tool when you only need columns and groups, not the rest of the board. For broader board metadata (owners, views, and their filters) use get_board_info instead — pass filters.views.ids / filters.views.names and/or filters.columns.ids there when you only need a subset."}getInputSchema(){if(!this.context?.boardId)return f_}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},n=await this.mondayApi.request(mc,a);return{content:{message:"Board schema retrieved",board_id:t,columns:n.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type,revision:e?.revision})))??[],groups:n.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends le{constructor(){super(...arguments),this.name="get_board_activity",this.type=exports.ToolType.READ,this.annotations=pe({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). Optionally filter by item ids or user ids to avoid fetching activity for the entire board. [REQUIRED PRECONDITION]: Call this with includeData=true before undo_action — it is the source of the action_record_uuid that identifies the action to undo."}getInputSchema(){return e_}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-zc.MONTH30Days),n=e?.fromDate||a.toISOString(),i=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),itemIds:e.itemIds?.map(String),userIds:e.userIds?.map(String),fromDate:n,toDate:i,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},r=await this.mondayApi.request(Zh,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 (${n} to ${i}).`};const d=r.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 le{constructor(e,t,a){super(e,a),this.name="get_board_info",this.type=exports.ToolType.READ,this.annotations=pe({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. "+(this.shouldIncludeKnowledge()?"Also returns generated board knowledge when available, including human-readable business context, workflow and status meanings, column purposes, people roles, and related boards. Knowledge is best-effort and may be null while it is unavailable or still being generated. ":"")+'Also returns the board\'s views (e.g. table views, filter views) — each view includes its id, name, type, and a structured filter object. On large boards, ALWAYS narrow the response: use filters.views.names or filters.views.ids when you only need specific views, and/or filters.columns.ids when you only need specific columns. Set filters.views.only or filters.columns.only when you want just that section — full views[].settings across many views can be multi-MB. The response includes hierarchy_type which indicates if the board is a multi-level board ("multi_level") where items can have nested subitems up to 5 levels deep on the same board. On multi-level boards, subitems share the same columns as parent items and subItemColumns will be null. Call this FIRST whenever you are not already familiar with a board structure (column IDs, column types, column revisions, status labels) — before reading or writing its data, or before any tool that declares this as a required precondition (e.g. get_board_items_page, board_insights, create_item, create_items, update_items, change_item_column_values, update_column, create_view, create_view_table, update_view, update_view_table). Also use the views it returns to resolve a view referenced by name (pass that name in filters.views.names), and as the source of view ids for update_view and update_view_table. Each column\'s "settings" field is the raw API value for that existing column, shown so you can read current labels/config — it is NOT the format expected by the columnSettings parameter of create_column or update_column. Never copy a column\'s "settings" object verbatim into columnSettings — use get_column_type_info with fetchMode "schema" to get the correct shape for the column type you are creating or updating.'}getInputSchema(){return s_}async executeInternal(e){const{columnIds:t,viewIds:a,includeColumns:n,includeViews:i,unmatchedViewNames:o,availableViewNames:r}=await this.resolveFiltersAsync(e);if(e.filters?.views?.names?.length&&i&&void 0!==a&&0===a.length){const t=r.length>0?r.join(", "):"(none)";return{content:`None of the requested view names matched on board ${e.boardId}. Requested: ${e.filters.views.names.join(", ")}. Available views: ${t}.`}}const s={boardId:e.boardId.toString(),columnIds:n?t:void 0,viewIds:i?a:void 0,includeColumns:n,includeViews:i},d=this.mondayApi.request(t_,s),p=this.shouldIncludeKnowledge(),l=p?this.mondayApi.request(i_,{boardId:e.boardId.toString()},{versionOverride:"dev",timeout:1e3}).catch((t=>(this.context?.deps?.logger?.warn({err:t,boardId:e.boardId,timeoutMs:1e3},"Failed to fetch board knowledge"),null))):Promise.resolve(null),[c,m]=await Promise.all([d,l]),u=c.boards?.[0];if(!u)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const h=n?await this.getSubItemsBoardAsync(u):null;return{content:o_(u,h,o,m?.entity_knowledge??null,p)}}shouldIncludeKnowledge(){return this.context?.deps?.flagChecker?.("mcp-get-board-info-entity-knowledge")??!0}async resolveFiltersAsync(e){const t=e.filters?.columns,a=e.filters?.views,n=Boolean(t?.only),i=Boolean(a?.only),o=void 0!==a?.ids,r=Boolean(a?.names?.length),s=!i||n,d=!n||i,p=s?t?.ids:void 0;if(!d)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(!o&&!r)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(o&&!r)return{columnIds:p,viewIds:a?.ids??[],includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};const l=await this.mondayApi.request(a_,{boardId:e.boardId.toString()}),c=l.boards?.[0]?.views??[],m=c.map((e=>e?.name)).filter((e=>Boolean(e))),{viewIds:u,unmatchedViewNames:h}=((e,t)=>{const a=new Map;for(const t of e){if(!t?.id||!t.name)continue;const e=r_(t.name),n=a.get(e)??[];n.push(t.id),a.set(e,n)}const n=[],i=[];for(const e of t){const t=a.get(r_(e));t?.length?n.push(...t):i.push(e)}return{viewIds:n,unmatchedViewNames:i}})(c,a?.names??[]);return{columnIds:p,viewIds:[...new Set([...a?.ids??[],...u])],includeColumns:s,includeViews:d,unmatchedViewNames:h,availableViewNames:m}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===uh.Subtasks));if(!t)return null;const a=t.settings.boardIds[0];if(a===e.id)return null;const n=await this.mondayApi.request(n_,{boardId:a});return n.boards?.[0]??null}},class extends le{constructor(){super(...arguments),this.name="get_full_board_data",this.type=exports.ToolType.READ,this.annotations=pe({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 Xh}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(Yh,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const n=a.boards[0],i=new Set;n.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&i.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&i.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const 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 r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(Kh,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e])));return{content:{board:{id:n.id,name:n.name,columns:n.columns,items:n.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:r,stats:{total_items:n.items_page.items.length,total_updates:n.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){Lc(e,"get full board data")}}},class extends le{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=exports.ToolType.READ,this.annotations=pe({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 Y_}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,n=e.includeTeams||!1,i=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||n||i||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(M_);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=B_(s),p=await H_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}if(r){if(t||a||n||i||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($_,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 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 H_(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(i&&n)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>z_)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>q_)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&&!n)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(P_,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(x_,t)}else if(n){const t={userIds:e.userIds,teamIds:e.teamIds,limit:j_};s=await this.mondayApi.request(U_,t)}else if(t){const t={userIds:e.userIds,limit:j_};s=await this.mondayApi.request(k_,t)}else{const e={userIds:void 0,limit:j_};s=await this.mondayApi.request(L_,e)}const d=B_(s),p=await H_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},Kc,class extends le{constructor(){super(...arguments),this.name="update_items",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Update Multiple Items",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update column values for up to 40 items in a single call. Each update targets one item by itemId and sets one or more column values on it. Each update is independent - it can target its own board via boardId and set its own column values, so a single call can update many items across multiple boards, apply the same value to many items, or apply different values per item. Each update returns its own item_id and item_url on success or a raw error message on failure. To link board-relation columns, call link_board_items_workflow before using this tool. [REQUIRED PRECONDITION]: Before using this tool, if you are not familiar with the board structure (column IDs, column types, status labels), first use get_board_info with filters.columns.only to get column metadata without fetching views. This is essential for constructing valid column values."}getInputSchema(){return this.context?.boardId?Jc:Xc}async executeInternal(e){this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const t=this.context?.boardId??e.boardId,a=e.updates.map((e=>e.boardId??t)),n=a.map(((e,t)=>null==e?t:-1)).filter((e=>e>=0));if(n.length>0)throw new kc(`Missing boardId for update(s) at index ${n.join(", ")}. Set a boardId on each update or provide a batch-level boardId.`,"MISSING_REQUIRED_PARAMETER");const i="Skipped: a previous update hit the minute rate limit, this update was not attempted",o=new Kc(this.mondayApi),r=e.updates.map(((e,t)=>async()=>{const n=a[t],i=await o.execute({boardId:n,itemId:e.itemId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,board_id:n,...i.content}})),s=await jc(r,{limit:15,onSkipped:e=>({index:e,error:i,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:i,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:Zc(e,t)})}),d=s.filter((e=>"error"in e)).map((e=>e._errorEntry)),p=s.map((({_errorEntry:e,...t})=>t)),l=s.length,c=d.length,m={summary:{total:l,updated:l-c,failed:c},is_partial_success:c>0&&c<l,results:p};return d.length&&(m.errors=d),{content:m}}},class extends le{constructor(){super(...arguments),this.name="move_item_to_group",this.type=exports.ToolType.WRITE,this.annotations=pe({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 K_}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(hc,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends le{constructor(){super(...arguments),this.name="create_board",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Tm}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId,...void 0!==e.boardOwnerIds?{boardOwnerIds:e.boardOwnerIds}:{},...void 0!==e.useMlsTemplate?{useMlsTemplate:e.useMlsTemplate}:{},...void 0!==e.useDatasetTemplate?{useDatasetTemplate:e.useDatasetTemplate}:{}},a=await this.mondayApi.request(_c,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 le{constructor(){super(...arguments),this.name="use_template",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Use Template",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Apply a monday.com template to create boards in a workspace. Returns a process_id immediately — the operation runs asynchronously and can take 30 seconds to 2+ minutes. Use check_template_status(processId) to poll every 5–10 seconds until status is COMPLETE or FAILED. Stop polling on COMPLETE (boards ready) or FAILED (unrecoverable error). Give up after ~5 minutes if neither terminal status is reached. Boards exist as empty shells until status is COMPLETE."}getInputSchema(){return Em}async executeInternal(e){const t={templateId:e.templateId,destinationWorkspaceId:e.destinationWorkspaceId,destinationName:e.destinationName,boardKind:e.boardKind},a=await this.mondayApi.request(Sc,t),n=a.use_template?.process_id;return null==n?{content:{processId:null,message:"Failed to start template application. The request was rejected."}}:{content:{processId:n,message:"Template application started. Poll check_template_status with processId every 5–10 seconds. Stop on COMPLETE (boards ready) or FAILED (unrecoverable). Give up after ~5 minutes."}}}},class extends le{constructor(){super(...arguments),this.name="check_template_status",this.type=exports.ToolType.READ,this.annotations=pe({title:"Check Template Status",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Check the status of a use_template operation. Poll after calling use_template — wait 5–10 seconds between polls. Status values: PENDING | IN_PROGRESS | COMPLETE | FAILED. Stop polling when status is COMPLETE (boards ready) or FAILED (unrecoverable). Give up after ~5 minutes if neither terminal status is reached. Board IDs are only available once COMPLETE — boards exist but are empty during IN_PROGRESS. Returns null if process_id is invalid or expired (1-hour TTL)."}getInputSchema(){return wm}async executeInternal(e){const t={processId:e.processId},a=(await this.mondayApi.request(Nc,t)).template_installation_status;return a?a.status===Pd.Complete?{content:{status:Pd.Complete,board_ids:a.board_ids,board_ids_map:a.board_ids_map,message:`Template application complete. ${a.board_ids.length} board(s) created.`}}:a.status===Pd.Failed?{content:{status:Pd.Failed,board_ids:[],board_ids_map:[],message:"Template application failed. Please try again."}}:a.status===Pd.Pending||a.status===Pd.InProgress?{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Template application ${a.status===Pd.InProgress?"in progress":"pending"}. Board IDs will be available once complete.`}}:{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Unexpected status: ${a.status}. Poll again or contact support.`}}:{content:{status:null,message:"Status not found. The process_id is invalid or has expired."}}}},class extends le{constructor(){super(...arguments),this.name="create_form",this.type=exports.ToolType.WRITE,this.annotations=pe({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 mu}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(Gm,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends le{constructor(){super(...arguments),this.name="update_form",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new ah((()=>this.mondayApi)),this.actionHandlers=new Map([[ku.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[ku.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[ku.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[ku.activate,this.helpers.activateForm.bind(this.helpers)],[ku.createTag,this.helpers.createTag.bind(this.helpers)],[ku.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[ku.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[ku.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[ku.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[ku.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[ku.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return"Update a monday.com form. Use the action field to specify the operation. [REQUIRED PRECONDITION]: Call get_form first to read the current form state — you need it to resolve the formToken, and for actions that reference existing entities (updateQuestionOrder needs the question ids, deleteTag needs the tag id) or that overwrite existing settings (updateAppearance, updateAccessibility, updateFeatures, updateFormHeader)."}getInputSchema(){return th}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 le{constructor(){super(...arguments),this.name="get_form",this.type=exports.ToolType.READ,this.annotations=pe({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token, including its pages, questions, question ids, settings, and conditional showIfRules. 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. Call this FIRST before any tool that acts on an existing form: create_form_submission (to know the questions and their constraints), form_questions_editor (to resolve question ids and current structure), and update_form (to see the current settings before changing them)."}getInputSchema(){return nh}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Hm,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 le{constructor(){super(...arguments),this.name="form_questions_editor",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Cu((()=>this.mondayApi)),this.actionHandlers=new Map([[Du.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Du.Update,this.helpers.updateQuestion.bind(this.helpers)],[Du.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form. [REQUIRED PRECONDITION]: For update and delete, call get_form first to resolve the exact question id and see its current type and settings — never guess a question id. For create, get_form shows the existing questions so you do not duplicate one."}getInputSchema(){return Ru}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends le{constructor(){super(...arguments),this.name="create_form_submission",this.type=exports.ToolType.WRITE,this.annotations=pe({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 mh}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(e){if(e.includes("wkf.ms")){const t=(await y.default.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(ih,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){Lc(e,"submit form")}}},class extends le{constructor(){super(...arguments),this.name="create_column",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new column in a monday.com board. [REQUIRED PRECONDITION]: If the column needs type-specific configuration (columnSettings) — e.g. status/dropdown labels, formula definitions, number units — first call get_column_type_info with fetchMode "${um.Schema}" for that column type to learn the valid settings structure. Do not guess the settings shape. To give the new column AI behavior, create it here first, then call configure_ai_column.`}getInputSchema(){return this.context?.boardId?hh:_h}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},n=await this.mondayApi.request(fc,a);return{content:{message:"Column successfully created",column_id:n.create_column?.id,column_title:n.create_column?.title}}}},class extends le{constructor(){super(...arguments),this.name="update_column",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Update Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Update properties of an existing monday.com column (title, description, settings). [REQUIRED PRECONDITION]: Uses optimistic concurrency control via the revision field — fetch the column id, type, and current revision via get_board_schema first (preferred), or get_board_info if you already have it, then call this tool. If the update fails because the revision is stale, re-fetch and try again. After a successful update, use the new revision returned in the response for any further update to this column, not the one you started with. [REQUIRED PRECONDITION]: If you are changing columnSettings, also call get_column_type_info with fetchMode "${um.Schema}" for that column type first to learn the valid settings structure. columnSettings is the flat payload for that column type (e.g. {"labels": [...]}) — not get_board_info's column.settings object copied as-is, and not wrapped again as {"settings": {"labels": [...]}}. To edit existing status or dropdown labels (rename, recolor, or reorder): first call get_board_info with filters.columns.ids for that column (or filters.columns.only) to read its current settings.labels, where each existing label's id lives. Editing an existing label requires sending its id in that label's entry — omitting it fails validation, since only a brand-new label can omit id. Status labels need the full label shape (id, label, color, index, and so on), not just a renamed string. Never invent an id — reuse the ids from get_board_info and add new labels without one. Flow: get_board_info for the revision and current settings.labels with ids, get_column_type_info (schema mode) for the valid shape, then build columnSettings.labels reusing existing ids and adding new labels without id.`}getInputSchema(){return this.context?.boardId?fh:gh}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnId:e.columnId,columnType:e.columnType,revision:e.revision,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},n=await this.mondayApi.request(bc,a);return{content:{message:"Column successfully updated. Use the new revision below for any subsequent update to this column.",column_id:n.update_column?.id,column_title:n.update_column?.title,revision:n.update_column?.revision}}}},class extends le{constructor(){super(...arguments),this.name="create_group",this.type=exports.ToolType.WRITE,this.annotations=pe({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 Eh}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(Ih,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 le{constructor(){super(...arguments),this.name="delete_column",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board. This is irreversible — the column and all of its values are removed. [REQUIRED PRECONDITION]: Call get_board_schema or get_board_info first to resolve the exact columnId and confirm you are deleting the intended column. Never guess a column id."}getInputSchema(){return this.context?.boardId?jh:Gh}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(gc,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Mc,class extends Mc{constructor(e,t){super(e,t),this.name="all_api_read",this.type=exports.ToolType.READ,this.annotations=pe({title:"Run read-only Query on the monday.com API",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Execute read-only GraphQL queries against the monday.com API. Only queries are accepted — mutations are rejected with an error before the request is sent. Use the get_type_details tool first to understand the schema before crafting your query."}async executeInternal(e){const t=rt(e.query);this.recordGraphqlOperationCounts(t);const a=hi(t);if(a?.operation===Se.MUTATION)throw new kc("all_api_read only accepts read queries. Mutations are not allowed.",Oc);return super.executeInternal(e)}},class extends Mc{constructor(e,t){super(e,t),this.name="all_api_write",this.type=exports.ToolType.WRITE,this.annotations=pe({title:"Run Mutation on the monday.com API",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Execute GraphQL mutations against the monday.com API to create, update, or delete data. Only mutations are accepted — queries are rejected with an error before the request is sent. Use get_graphql_schema and get_type_details tools first to understand the schema before crafting your mutation."}async executeInternal(e){const t=rt(e.query);this.recordGraphqlOperationCounts(t);const a=hi(t);if(a&&a.operation!==Se.MUTATION)throw new kc("all_api_write only accepts mutations. Read queries are not allowed.",Oc);return super.executeInternal(e)}},class extends le{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=exports.ToolType.ALL_API,this.annotations=pe({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 T_}async executeInternal(e){try{const t=await this.mondayApi.request(yc),a=e?.operationType,n=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,r=n?.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:r}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends le{constructor(){super(...arguments),this.name="get_column_type_info",this.type=exports.ToolType.READ,this.annotations=pe({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Retrieves comprehensive information about a specific column type. Use fetchMode "${um.Schema}" (default) to get the JSON schema definition from the API — to understand structure, validation rules, and available properties for column settings. Call this BEFORE any tool that writes column settings: create_column, update_column, and manage_object_schema_columns. Use fetchMode "${um.Guidelines}" to get only guidelines.filter and guidelines.aggregation (no schema, no GraphQL round-trip). Call this before building any filter rule that uses compare_value/operator for that column type — e.g. get_board_items_page, board_insights, or a view's filters (create_view, create_view_table, update_view, update_view_table) — and before building board insights aggregation counts. `}getInputSchema(){return I_}async executeInternal(e){if(e.fetchMode===um.Guidelines)return{content:{message:`Column type guidelines for ${e.columnType}`,data:{guidelines:{filter:v_(e.columnType),aggregation:`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${Ci.CountItems} function. Do not use ${Ci.Count} function for that purpose.\n `}},url:b_}};const t={type:e.columnType},a=await this.mondayApi.request(g_,t);return a?.get_column_type_schema?{content:{message:`Column type schema for ${e.columnType}`,data:{schema:a.get_column_type_schema},url:b_}}:{content:`Information for column type "${e.columnType}" not found or not available.`}}},class extends le{constructor(e,t){super("function"==typeof e?()=>Pc(e()):Pc(e),t),this.name="get_type_details",this.type=exports.ToolType.ALL_API,this.annotations=pe({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, including its fields, input fields, and enum values. Call this with a known type name to confirm its exact fields, arguments, and enum values before referencing that type in an operation for all_monday_api, all_api_read, or all_api_write, so the fields and arguments you send actually exist."}getInputSchema(){return E_}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,oc`
|
|
2960
2960
|
query getTypeDetails {
|
|
2961
2961
|
__type(name: "${t}") {
|
|
2962
2962
|
name
|