@mondaydotcomorg/agent-toolkit 5.76.0 → 5.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core/index.js +22 -20
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/mcp/index.js +4 -2
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.js +22 -20
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/core/index.js +24 -22
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/mcp/index.js +4 -2
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.js +26 -24
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/mcp/index.js
CHANGED
|
@@ -238,6 +238,7 @@
|
|
|
238
238
|
$columnTitle: String
|
|
239
239
|
$columnDescription: String
|
|
240
240
|
$columnSettings: JSON
|
|
241
|
+
$capabilities: ColumnCapabilitiesInput
|
|
241
242
|
) {
|
|
242
243
|
update_column(
|
|
243
244
|
board_id: $boardId
|
|
@@ -247,6 +248,7 @@
|
|
|
247
248
|
title: $columnTitle
|
|
248
249
|
description: $columnDescription
|
|
249
250
|
settings: $columnSettings
|
|
251
|
+
capabilities: $capabilities
|
|
250
252
|
) {
|
|
251
253
|
id
|
|
252
254
|
title
|
|
@@ -1069,7 +1071,7 @@
|
|
|
1069
1071
|
id
|
|
1070
1072
|
}
|
|
1071
1073
|
}
|
|
1072
|
-
`,kv=e.z.object({phone:e.z.string().describe("The phone number."),country_short_name:e.z.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Rv=e.z.object({country_name:e.z.string().describe('The full country name (e.g. "United States").'),country_code:e.z.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Cv=e.z.object({date:e.z.string().describe("The date in YYYY-MM-DD format."),zone_diff:e.z.number().int().optional().describe("UTC offset in minutes.")}),$v=e.z.object({from:e.z.string().describe("Start date in YYYY-MM-DD format."),to:e.z.string().describe("End date in YYYY-MM-DD format.")}),xv=e.z.object({lat:e.z.number().describe("Latitude."),lng:e.z.number().describe("Longitude."),place_id:e.z.string().describe("Google Maps place ID."),address:e.z.string().describe("Full formatted address."),country:e.z.object({long_name:e.z.string().describe("Full country name."),short_name:e.z.string().describe("ISO 3166-1 alpha-2 country code.")}),city:e.z.object({long_name:e.z.string().describe("Full city name."),short_name:e.z.string().describe("Abbreviated city name.")}),street:e.z.object({long_name:e.z.string().describe("Full street name."),short_name:e.z.string().describe("Abbreviated street name.")}),street_number:e.z.object({long_name:e.z.string().describe("Full street number."),short_name:e.z.string().describe("Abbreviated street number.")})}),Pv=e.z.object({id:e.z.string().describe("The file ID returned by the workforms upload endpoint."),name:e.z.string().describe('Original file name (e.g. "image.png").'),extension:e.z.string().optional().describe('File extension (e.g. "pdf", "png").'),is_image:e.z.boolean().optional().describe("Whether the file is an image.")}),Lv=e.z.object({question_id:e.z.string().describe("The ID of the question being answered."),name:e.z.string().optional().describe("Answer for name questions."),email:e.z.string().optional().describe("Answer for email questions."),short_text:e.z.string().optional().describe("Answer for short text questions."),long_text:e.z.string().optional().describe("Answer for long text questions."),link:e.z.string().optional().describe("Answer for link questions."),updates:e.z.string().optional().describe("Answer for updates questions."),boolean:e.z.boolean().optional().describe("Answer for boolean questions."),number:e.z.number().optional().describe("Answer for number questions."),rating:e.z.number().min(1).optional().describe("Answer for rating questions. Must be a positive number within the question's configured limit."),single_select:e.z.string().optional().describe("Answer for single-select questions — the selected option ID."),multi_select:e.z.array(e.z.number()).optional().describe("Answer for multi-select questions — list of selected option IDs."),people:e.z.array(e.z.string()).optional().describe("Answer for people questions — list of user IDs. Obtain user IDs via the list_users_and_teams tool."),connected_boards:e.z.array(e.z.string()).optional().describe("Answer for connected boards questions — list of connected item IDs."),phone:kv.optional().describe("Answer for phone questions."),country:Rv.optional().describe("Answer for country questions."),date:Cv.optional().describe("Answer for date questions."),date_range:$v.optional().describe("Answer for date range questions."),location:xv.optional().describe("Answer for location questions. Requires a Google Maps place ID and structured address components."),file:e.z.array(Pv).optional().describe("Answer for file questions. Each file must be uploaded first to obtain a file ID. Up to the question's configured limit."),signature:Pv.optional().describe("Answer for signature questions. The file must be uploaded first to obtain a file ID.")}).describe("An answer for a single form question. Set question_id and exactly one answer field matching the question type. Subitems questions are not supported."),zv={form_token:e.z.string().describe("The unique token identifying the WorkForm. Can be a bare token, a full WorkForm URL (e.g. https://forms.monday.com/forms/abc123?r=use1), or a shortened wkf.ms URL (e.g. https://wkf.ms/4tqP28t). Shortened URLs are automatically resolved by following the redirect."),answers:e.z.array(Lv).describe("Array of answers to submit. Each answer specifies a question_id and the value for that question type."),form_timezone_offset:e.z.number().int().min(-840).max(840).describe("The timezone offset of the submitter in minutes (e.g. -120 for UTC-2, 0 for UTC)."),password:e.z.string().optional().describe("The password for the WorkForm. Only required if the WorkForm has password protection enabled (check features.password.enabled from get_form). If required, ask the user for the password before submitting."),tags:e.z.array(e.z.object({column_id:e.z.string().describe("The column ID this tag maps to."),value:e.z.string().describe("The tag value to submit.")})).optional().describe("Tags to attach to the submission — each tag maps a value to a specific board column.")};const Uv=Object.fromEntries(Object.entries(hl).filter((([e])=>"Person"!==e))),Fv={columnType:e.z.nativeEnum(Uv).describe("The type of the column to be created"),columnTitle:e.z.string().describe("The title of the column to be created"),columnDescription:e.z.string().optional().describe("The description of the column to be created"),columnSettings:e.z.string().optional().describe("Column-specific configuration settings as a JSON string. Shape depends on columnType — see tool description for how to obtain it.")},Vv={boardId:e.z.number().describe("The id of the board to which the new column will be added"),...Fv};const Mv={columnId:e.z.string().describe("The id of the column to update"),columnType:e.z.nativeEnum(Uv).describe("The type of the column being updated. Must match the existing column type."),revision:e.z.string().describe("The current revision of the column. Get it from get_board_schema (preferred) or get_board_info. Used for optimistic concurrency control — if the column changed since you read it, the request fails and you must re-fetch the latest revision before retrying. After a successful update_column, use the new revision from the response for any further update to this column, not the one you started with."),columnTitle:e.z.string().optional().describe("The new title of the column. If omitted, the title is unchanged."),columnDescription:e.z.string().optional().describe("The new description of the column. If omitted, the description is unchanged."),columnSettings:e.z.string().optional().describe("Type-specific configuration as a JSON string. If omitted, settings are unchanged. Shape depends on columnType — see tool description for how to obtain it.")},jv={boardId:e.z.number().describe("The id of the board containing the column"),...Mv};const qv={color:e.z.nativeEnum(Il).describe("The color of the custom activity"),icon_id:e.z.nativeEnum(Tl).describe("The icon ID of the custom activity"),name:e.z.string().describe("The name of the custom activity")};const Bv=Nf`
|
|
1074
|
+
`,kv=e.z.object({phone:e.z.string().describe("The phone number."),country_short_name:e.z.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Rv=e.z.object({country_name:e.z.string().describe('The full country name (e.g. "United States").'),country_code:e.z.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Cv=e.z.object({date:e.z.string().describe("The date in YYYY-MM-DD format."),zone_diff:e.z.number().int().optional().describe("UTC offset in minutes.")}),$v=e.z.object({from:e.z.string().describe("Start date in YYYY-MM-DD format."),to:e.z.string().describe("End date in YYYY-MM-DD format.")}),xv=e.z.object({lat:e.z.number().describe("Latitude."),lng:e.z.number().describe("Longitude."),place_id:e.z.string().describe("Google Maps place ID."),address:e.z.string().describe("Full formatted address."),country:e.z.object({long_name:e.z.string().describe("Full country name."),short_name:e.z.string().describe("ISO 3166-1 alpha-2 country code.")}),city:e.z.object({long_name:e.z.string().describe("Full city name."),short_name:e.z.string().describe("Abbreviated city name.")}),street:e.z.object({long_name:e.z.string().describe("Full street name."),short_name:e.z.string().describe("Abbreviated street name.")}),street_number:e.z.object({long_name:e.z.string().describe("Full street number."),short_name:e.z.string().describe("Abbreviated street number.")})}),Pv=e.z.object({id:e.z.string().describe("The file ID returned by the workforms upload endpoint."),name:e.z.string().describe('Original file name (e.g. "image.png").'),extension:e.z.string().optional().describe('File extension (e.g. "pdf", "png").'),is_image:e.z.boolean().optional().describe("Whether the file is an image.")}),Lv=e.z.object({question_id:e.z.string().describe("The ID of the question being answered."),name:e.z.string().optional().describe("Answer for name questions."),email:e.z.string().optional().describe("Answer for email questions."),short_text:e.z.string().optional().describe("Answer for short text questions."),long_text:e.z.string().optional().describe("Answer for long text questions."),link:e.z.string().optional().describe("Answer for link questions."),updates:e.z.string().optional().describe("Answer for updates questions."),boolean:e.z.boolean().optional().describe("Answer for boolean questions."),number:e.z.number().optional().describe("Answer for number questions."),rating:e.z.number().min(1).optional().describe("Answer for rating questions. Must be a positive number within the question's configured limit."),single_select:e.z.string().optional().describe("Answer for single-select questions — the selected option ID."),multi_select:e.z.array(e.z.number()).optional().describe("Answer for multi-select questions — list of selected option IDs."),people:e.z.array(e.z.string()).optional().describe("Answer for people questions — list of user IDs. Obtain user IDs via the list_users_and_teams tool."),connected_boards:e.z.array(e.z.string()).optional().describe("Answer for connected boards questions — list of connected item IDs."),phone:kv.optional().describe("Answer for phone questions."),country:Rv.optional().describe("Answer for country questions."),date:Cv.optional().describe("Answer for date questions."),date_range:$v.optional().describe("Answer for date range questions."),location:xv.optional().describe("Answer for location questions. Requires a Google Maps place ID and structured address components."),file:e.z.array(Pv).optional().describe("Answer for file questions. Each file must be uploaded first to obtain a file ID. Up to the question's configured limit."),signature:Pv.optional().describe("Answer for signature questions. The file must be uploaded first to obtain a file ID.")}).describe("An answer for a single form question. Set question_id and exactly one answer field matching the question type. Subitems questions are not supported."),zv={form_token:e.z.string().describe("The unique token identifying the WorkForm. Can be a bare token, a full WorkForm URL (e.g. https://forms.monday.com/forms/abc123?r=use1), or a shortened wkf.ms URL (e.g. https://wkf.ms/4tqP28t). Shortened URLs are automatically resolved by following the redirect."),answers:e.z.array(Lv).describe("Array of answers to submit. Each answer specifies a question_id and the value for that question type."),form_timezone_offset:e.z.number().int().min(-840).max(840).describe("The timezone offset of the submitter in minutes (e.g. -120 for UTC-2, 0 for UTC)."),password:e.z.string().optional().describe("The password for the WorkForm. Only required if the WorkForm has password protection enabled (check features.password.enabled from get_form). If required, ask the user for the password before submitting."),tags:e.z.array(e.z.object({column_id:e.z.string().describe("The column ID this tag maps to."),value:e.z.string().describe("The tag value to submit.")})).optional().describe("Tags to attach to the submission — each tag maps a value to a specific board column.")};const Uv=Object.fromEntries(Object.entries(hl).filter((([e])=>"Person"!==e))),Fv={columnType:e.z.nativeEnum(Uv).describe("The type of the column to be created"),columnTitle:e.z.string().describe("The title of the column to be created"),columnDescription:e.z.string().optional().describe("The description of the column to be created"),columnSettings:e.z.string().optional().describe("Column-specific configuration settings as a JSON string. Shape depends on columnType — see tool description for how to obtain it.")},Vv={boardId:e.z.number().describe("The id of the board to which the new column will be added"),...Fv};const Mv={columnId:e.z.string().describe("The id of the column to update"),columnType:e.z.nativeEnum(Uv).describe("The type of the column being updated. Must match the existing column type."),revision:e.z.string().describe("The current revision of the column. Get it from get_board_schema (preferred) or get_board_info. Used for optimistic concurrency control — if the column changed since you read it, the request fails and you must re-fetch the latest revision before retrying. After a successful update_column, use the new revision from the response for any further update to this column, not the one you started with."),columnTitle:e.z.string().optional().describe("The new title of the column. If omitted, the title is unchanged."),columnDescription:e.z.string().optional().describe("The new description of the column. If omitted, the description is unchanged."),columnSettings:e.z.string().optional().describe("Type-specific configuration as a JSON string. If omitted, settings are unchanged. Shape depends on columnType — see tool description for how to obtain it."),rollupFunction:e.z.enum(["MIN","MAX","SUM","MIN_MAX","COUNT_KEYS","NONE"]).nullable().optional().describe("Controls the column rollup (calculated capability), which applies to columns on multi-level boards. Omit to leave it unchanged. Pass a function to turn rollup on or change it, or null to turn it off. Allowed functions per columnType: numbers MIN/MAX/SUM/NONE, date MIN/MAX, timeline MIN_MAX, status COUNT_KEYS, dropdown rollup is not supported by this tool. NONE (numbers only) keeps the capability without calculating anything.")},jv={boardId:e.z.number().describe("The id of the board containing the column"),...Mv};const qv={color:e.z.nativeEnum(Il).describe("The color of the custom activity"),icon_id:e.z.nativeEnum(Tl).describe("The icon ID of the custom activity"),name:e.z.string().describe("The name of the custom activity")};const Bv=Nf`
|
|
1073
1075
|
mutation createNotification($user_id: ID!, $target_id: ID!, $text: String!, $target_type: NotificationTargetType!) {
|
|
1074
1076
|
create_notification(user_id: $user_id, target_id: $target_id, text: $text, target_type: $target_type) {
|
|
1075
1077
|
id
|
|
@@ -2804,7 +2806,7 @@
|
|
|
2804
2806
|
}
|
|
2805
2807
|
}
|
|
2806
2808
|
}
|
|
2807
|
-
`,OE={};const kE=[class extends xo{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=Yi.READ,this.annotations=$o({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 OE}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(NE,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${iE} 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:`${pE} 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 i=EE(e,tE.SPRINT_TASKS);if(!i)return;const o=TE(i);if(!o)return;const r=`${e.id}:${o}`;if(a.has(r))return;const n=t.get(o);a.set(r,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(o,n,`Tasks Board ${o}`)})}processTasksBoard(e,t,a){const i=EE(e,cE);if(!i)return;const o=TE(i);if(!o)return;const r=`${o}:${e.id}`;if(a.has(r))return;const n=t.get(o);a.set(r,{sprintsBoard:this.createBoardInfo(o,n,`Sprints Board ${o}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(wE(i)&&this.processSprintsBoard(i,a,t),IE(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends xo{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=Yi.READ,this.annotations=$o({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 DE}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(AE,a),o=i.boards?.[0],r=o?.items_page?.items||[],n=this.buildSprintsMetadata(r);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:r.length,data:n}}}catch(e){return{content:`${pE} 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(Pf,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${iE} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const o=i.columns||[],r=this.validateSprintsBoardSchemaFromColumns(o);return r.isValid?{success:!0}:{success:!1,error:`${lE} ${r.errorMessage}`}}catch(e){return{success:!1,error:`${pE} 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(tE),i=bE(t,a);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((t=>{const a=(e=>mE[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=_E(e,aE.SPRINT_ACTIVATION),a=_E(e,aE.SPRINT_COMPLETION),i=gE(e,aE.SPRINT_START_DATE),o=gE(e,aE.SPRINT_END_DATE),r=((e,t)=>{const a=fE(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,aE.SPRINT_TIMELINE),n=vE(e,aE.SPRINT_SUMMARY);let s=uE.Planned;return a?s=uE.Completed:(t||i)&&(s=uE.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:r?{from:r.from,to:r.to}:null,start_date:i||null,end_date:o||null,is_completed:a,document_object_id:n||null}}))}},class extends xo{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=Yi.READ,this.annotations=$o({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 SE}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${pE} 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||`${pE} Unknown error occurred while reading document content`}}catch(e){return{content:`${pE} 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(eE,t)).items||[];if(0===a.length)return{success:!1,error:`${oE} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${oE} Sprint with ID ${e} not found.`};const o=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(tE),...t];return bE(a,i)})(i,[aE.SPRINT_SUMMARY]);if(!o.isValid)return{success:!1,error:`${lE} Sprint item is missing required columns: ${o.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const r=vE(i,aE.SPRINT_SUMMARY);return r?{success:!0,documentObjectId:r,sprintName:i.name}:{success:!1,error:`${rE} No sprint summary document found for sprint "${i.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${pE} 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(Of,t)).docs||[];if(0===a.length)return{success:!1,error:`${rE} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${nE} Document data is invalid for object ID ${e}.`};const o={docId:i.id,blockIds:[]},r=await this.mondayApi.request(Wf,o);if(!r.export_markdown_from_doc?.success)return{success:!1,error:`${dE} Failed to export markdown from document: ${r.export_markdown_from_doc?.error||"Unknown error"}`};const n=r.export_markdown_from_doc.markdown;return n?{success:!0,content:n}:{success:!1,error:`${sE} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${pE} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],RE=[class extends xo{constructor(){super(...arguments),this.name="delete_item",this.type=Yi.WRITE,this.annotations=$o({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Ab}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request($f,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends xo{constructor(){super(...arguments),this.name="get_board_items_page",this.type=Yi.READ,this.annotations=$o({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 Qb}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){r_(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 i=await this.mondayApi.request(jb,a);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:zc.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],i=a?.items_page,o=i?.items||[];return{board:{id:a?.id,name:a?.name,hierarchy_type:a?.hierarchy_type||null},items:o.map((e=>this.mapItem(e,t))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:o.length}}}mapItem(e,t){const a=e.parent_item?.id||null,i={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){i.column_values={};for(const t of e.column_values)i.column_values[t.id]=this.getColumnValueData(t)}if(t.includeGroup&&"group"in e&&e.group&&(i.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})));i.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(i.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),i}getColumnValueData(e){switch(e.type){case Uv.BoardRelation:return e.linked_items;case Uv.Formula:return e.display_value;case Uv.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(qb,t,{versionOverride:"dev",timeout:h_})).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 i=e.itemIds??[];if(0===i.length)return a;const o=new Set(i);return a.filter((e=>o.has(e)))}},Zv,class extends xo{constructor(){super(...arguments),this.name="create_items",this.type=Yi.WRITE,this.annotations=$o({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. Batch each parent's subitems into groups of up to 20. Wait for one batch to finish before starting the next batch for that parent. [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?eb:tb}async executeInternal(e){const t=e.items.flatMap(((e,t)=>void 0===e.name?[ob(new i_("Item name is required",a_),t)]:[]));if(t.length)throw new i_(`${t.length} of ${e.items.length} items are missing the required name field`,a_,t);const a=this.context?.boardId??e.boardId;this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.items.length;const i=new Zv(this.mondayApi,{boardId:a}),o="Skipped: a previous item hit a rate limit; this item was not attempted",r=e.items.map(((e,t)=>async()=>{const a=await i.execute({name:e.name,columnValues:e.columnValues,groupId:e.groupId,parentItemId:e.parentItemId,duplicateFromItemId:e.duplicateFromItemId,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,...a.content}})),n=await f_(r,{limit:15,concurrencyGroups:{getGroup:t=>e.items[t].parentItemId,limitPerGroup:5},onSkipped:e=>({index:e,error:o,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:o,path:["results",e]}}),onError:(t,a)=>({index:a,error:ib(t,e.items[a].parentItemId),_errorEntry:ob(t,a)})}),s=n.filter((e=>"error"in e)).map((e=>e._errorEntry)),d=n.map((({_errorEntry:e,...t})=>t)),p=n.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,...l===p?{isError:!0}:{}}}},cb,class extends xo{constructor(){super(...arguments),this.name="create_updates",this.type=Yi.WRITE,this.annotations=$o({title:"Create Multiple Updates",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create up to 40 updates (comments/posts) in a single call. Each entry is independent - it targets its own item, has its own body and mentions, and can reply to an existing update via parentId - so one call can post on many items, or post several replies. Use this instead of calling create_update repeatedly when posting more than one update. Each entry returns its own update_id and item_id on success or a raw error message on failure."}getInputSchema(){return mb}async executeInternal(e){this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const t="Skipped: a previous update hit a rate limit; this update was not attempted",a=new cb(this.mondayApi),i=e.updates.map(((e,t)=>async()=>{const i=await a.execute(e);return{index:t,...i.content}})),o=await f_(i,{limit:10,onSkipped:e=>({index:e,error:t,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:t,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:ub(e,t)})}),r=o.filter((e=>"error"in e)).map((e=>e._errorEntry)),n=o.map((({_errorEntry:e,...t})=>t)),s=o.length,d=r.length,p={summary:{total:s,created:s-d,failed:d},is_partial_success:d>0&&d<s,results:n};return r.length&&(p.errors=r),{content:p,...d===s?{isError:!0}:{}}}},class extends xo{constructor(){super(...arguments),this.name="delete_update",this.type=Yi.WRITE,this.annotations=$o({title:"Delete Update",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an update (comment/post) from a monday.com item."}getInputSchema(){return fb}async executeInternal(e){try{const t={id:e.id.toString()},a=await this.mondayApi.request(hb,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){o_(e,"delete update")}}},class extends xo{constructor(){super(...arguments),this.name="get_updates",this.type=Yi.READ,this.annotations=$o({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from monday.com items or a board. Pass the IDs in objectIds and set objectType: up to 25 item IDs for Item, in one call instead of calling once per item, or one board ID for Board. Filter by date range with 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, and add a date range to keep the response small. Returns update text (bodies over 2000 characters are truncated and flagged with text_body_truncated. To read one in full, call again with only that item's ID and includeFullText), creator info, timestamps, and optionally replies and assets."}getInputSchema(){return yb}async executeInternal(e){try{const t=void 0!==e.fromDate;if(t!==(void 0!==e.toDate))throw new i_("Both fromDate and toDate must be provided together for date range filtering",Jf);const a=[...new Set([...e.objectIds??[],...e.objectId?[e.objectId]:[]])];if(0===a.length)throw new i_("Provide the IDs to read in objectIds",Jf);if(a.length>25)throw new i_("objectIds takes up to 25 IDs",Jf);if(e.objectType===vb.Board&&1!==a.length)throw new i_("Board queries take exactly one board ID in objectIds",Jf);const i=e.fromDate?wb(e.fromDate):void 0,o=e.toDate?wb(e.toDate,!0):void 0,r={page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};if(e.objectType===vb.Item){const t=e.limit??(a.length>1?10:25),n=((await this.mondayApi.request(_b,{...r,limit:t,itemIds:a,itemsLimit:a.length})).items??[]).filter((e=>!!e)),s=new Set(n.map((e=>e.id))),d=a.filter((e=>!s.has(e)));return{content:{message:"Updates retrieved",items:n.map((t=>{const a=(t.updates??[]).filter((e=>function(e,t,a){if(!t||!a)return!0;const i=e?Date.parse(e):NaN;return!Number.isNaN(i)&&i>=Date.parse(t)&&i<=Date.parse(a)}(e.created_at,i,o))).map((t=>Tb(t,e)));return{item_id:t.id,url:t.url,updates:a,count:a.length}})),...d.length>0&&{not_found:d},pagination:{page:e.page??1,limit:t}}}}const[n]=a,s=e.limit??25,d=await this.mondayApi.request(gb,{...r,limit:s,boardId:n,boardUpdatesOnly:!e.includeItemUpdates,...i&&o?{fromDate:i,toDate:o}:{}}),p=d.boards?.[0],l=p?.updates;if(!l||0===l.length)return{content:`No updates found for board with id ${n}`};const c=l.map((t=>Tb(t,e)));return{content:{message:"Updates retrieved",board_id:n,url:p?.url,updates:c,pagination:{page:e.page??1,limit:s,count:c.length}}}}catch(e){o_(e,"get updates")}}},class extends xo{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=Yi.WRITE,this.annotations=$o({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 kI}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=OI.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},i=await this.mondayApi.request(nb,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} successfully created on item ${e.itemId}`,update_id:i.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){o_(e,"create update")}}},class extends xo{constructor(){super(...arguments),this.name="get_board_schema",this.type=Yi.READ,this.annotations=$o({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 Kb}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(Pf,a);return{content:{message:"Board schema retrieved",board_id:t,columns:i.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type,revision:e?.revision})))??[],groups:i.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends xo{constructor(){super(...arguments),this.name="get_board_activity",this.type=Yi.READ,this.annotations=$o({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 xb}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-u_.MONTH30Days),i=e?.fromDate||a.toISOString(),o=e?.toDate||t.toISOString(),r={boardId:e.boardId.toString(),itemIds:e.itemIds?.map(String),userIds:e.userIds?.map(String),fromDate:i,toDate:o,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},n=await this.mondayApi.request($b,r),s=n.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${o}).`};const d=n.boards?.[0],p=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:d?.name,board_url:d?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...p&&e.data?{data:e.data}:{}})))}}}},class extends xo{constructor(e,t,a){super(e,a),this.name="get_board_info",this.type=Yi.READ,this.annotations=$o({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. "+(this.isKnowledgeEnabled()?"Set includeKnowledge to true when you need to interpret the board rather than just read its configuration: for example, choosing a status, label or column value from the user's intent instead of an exact name they gave, or explaining what statuses, columns or roles mean. Not needed for structural work such as column ids, types, revisions or views. Adds latency and may be null while knowledge is still being generated. ":"")+'Set includeSubscribers to true to also return the board\'s subscribers (people and AI agents) and team subscribers. 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 Mb}async executeInternal(e){const{columnIds:t,viewIds:a,includeColumns:i,includeViews:o,unmatchedViewNames:r,availableViewNames:n}=await this.resolveFiltersAsync(e);if(e.filters?.views?.names?.length&&o&&void 0!==a&&0===a.length){const t=n.length>0?n.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:i?t:void 0,viewIds:o?a:void 0,includeColumns:i,includeViews:o,includeSubscribers:!0===e.includeSubscribers},d=this.mondayApi.request(Pb,s),p=!0===e.includeKnowledge,l=p&&this.isKnowledgeEnabled()?this.mondayApi.request(Ub,{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=i?await this.getSubItemsBoardAsync(u):null;return{content:Fb(u,h,r,m?.entity_knowledge??null,p)}}isKnowledgeEnabled(){return this.context?.deps?.flagChecker?.("mcp-get-board-info-entity-knowledge")??!0}async resolveFiltersAsync(e){const t=e.filters?.columns,a=e.filters?.views,i=Boolean(t?.only),o=Boolean(a?.only),r=void 0!==a?.ids,n=Boolean(a?.names?.length),s=!o||i,d=!i||o,p=s?t?.ids:void 0;if(!d)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(!r&&!n)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(r&&!n)return{columnIds:p,viewIds:a?.ids??[],includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};const l=await this.mondayApi.request(Lb,{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=Vb(t.name),i=a.get(e)??[];i.push(t.id),a.set(e,i)}const i=[],o=[];for(const e of t){const t=a.get(Vb(e));t?.length?i.push(...t):o.push(e)}return{viewIds:i,unmatchedViewNames:o}})(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===Uv.Subtasks));if(!t)return null;const a=t.settings.boardIds[0];if(a===e.id)return null;const i=await this.mondayApi.request(zb,{boardId:a});return i.boards?.[0]??null}},class extends xo{constructor(){super(...arguments),this.name="get_full_board_data",this.type=Yi.READ,this.annotations=$o({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 Cb}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(Nb,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=a.boards[0],o=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&o.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&o.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&&o.add(e.id)}))}}))}));const r=Array.from(o).filter((e=>!(Number(e)<0)));let n=[];if(r.length>0){const e={userIds:r},t=await this.mondayApi.request(Ob,e);n=t.users?.filter((e=>null!==e))||[]}const s=new Map(n.map((e=>[e.id,e])));return{content:{board:{id:i.id,name:i.name,columns:i.columns,items:i.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:n,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:n.length}}}}catch(e){o_(e,"get full board data")}}},class extends xo{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=Yi.READ,this.annotations=$o({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 Ny}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,o=e.teamsOnly||!1,r=e.includeTeamMembers||!1,n=!!e.name;if(e.getMe||!1){if(t||a||i||o||r||n)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(vy);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=wy(s),p=await Ay(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}if(n){if(t||a||i||o||r)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const n={name:e.name},s=await this.mondayApi.request(gy,n);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const d=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),p=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${d}`,l=await Ay(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(o&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>Iy)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>Ty)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(o||!t&&a&&!i)if(r){const t={teamIds:e.teamIds};s=await this.mondayApi.request(_y,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(fy,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:Ey};s=await this.mondayApi.request(hy,t)}else if(t){const t={userIds:e.userIds,limit:Ey};s=await this.mondayApi.request(my,t)}else{const e={userIds:void 0,limit:Ey};s=await this.mondayApi.request(uy,e)}const d=wy(s),p=await Ay(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},y_,class extends xo{constructor(){super(...arguments),this.name="update_items",this.type=Yi.WRITE,this.annotations=$o({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?I_:T_}async executeInternal(e){const t=e.updates.flatMap(((e,t)=>void 0===e.itemId?[E_(new i_("Item id is required",a_),t)]:[]));if(t.length)throw new i_(`${t.length} of ${e.updates.length} updates are missing the required itemId field`,a_,t);this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const a=this.context?.boardId??e.boardId,i=e.updates.map((e=>e.boardId??a)),o=i.map(((e,t)=>null==e?t:-1)).filter((e=>e>=0));if(o.length>0)throw new i_(`Missing boardId for update(s) at index ${o.join(", ")}. Set a boardId on each update or provide a batch-level boardId.`,a_);const r="Skipped: a previous update hit a rate limit; this update was not attempted",n=new y_(this.mondayApi),s=e.updates.map(((e,t)=>async()=>{const a=i[t],o=await n.execute({boardId:a,itemId:e.itemId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,board_id:a,...o.content}})),d=await f_(s,{limit:15,onSkipped:e=>({index:e,error:r,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:r,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:E_(e,t)})}),p=d.filter((e=>"error"in e)).map((e=>e._errorEntry)),l=d.map((({_errorEntry:e,...t})=>t)),c=d.length,m=p.length,u={summary:{total:c,updated:c-m,failed:m},is_partial_success:m>0&&m<c,results:l};return p.length&&(u.errors=p),{content:u,...m===c?{isError:!0}:{}}}},class extends xo{constructor(){super(...arguments),this.name="move_item_to_group",this.type=Yi.WRITE,this.annotations=$o({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to another group on the same monday.com board. It cannot move an item to a different board."}getInputSchema(){return Oy}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId};let a;try{a=await this.mondayApi.request(zf,t)}catch(e){o_(e,"move item to group")}return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends xo{constructor(){super(...arguments),this.name="create_board",this.type=Yi.WRITE,this.annotations=$o({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return W_}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(Uf,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 xo{constructor(){super(...arguments),this.name="use_template",this.type=Yi.WRITE,this.annotations=$o({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 Y_}async executeInternal(e){const t={templateId:e.templateId,destinationWorkspaceId:e.destinationWorkspaceId,destinationName:e.destinationName,boardKind:e.boardKind},a=await this.mondayApi.request(Qf,t),i=a.use_template?.process_id;return null==i?{content:{processId:null,message:"Failed to start template application. The request was rejected."}}:{content:{processId:i,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 xo{constructor(){super(...arguments),this.name="check_template_status",this.type=Yi.READ,this.annotations=$o({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 Q_}async executeInternal(e){const t={processId:e.processId},a=(await this.mondayApi.request(Kf,t)).template_installation_status;return a?a.status===ru.Complete?{content:{status:ru.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===ru.Failed?{content:{status:ru.Failed,board_ids:[],board_ids_map:[],message:"Template application failed. Please try again."}}:a.status===ru.Pending||a.status===ru.InProgress?{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Template application ${a.status===ru.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 xo{constructor(){super(...arguments),this.name="create_form",this.type=Yi.WRITE,this.annotations=$o({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 zg}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(_g,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends xo{constructor(){super(...arguments),this.name="update_form",this.type=Yi.WRITE,this.annotations=$o({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Dv((()=>this.mondayApi)),this.actionHandlers=new Map([[iv.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[iv.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[iv.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[iv.activate,this.helpers.activateForm.bind(this.helpers)],[iv.createTag,this.helpers.createTag.bind(this.helpers)],[iv.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[iv.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[iv.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[iv.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[iv.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[iv.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 Av}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 xo{constructor(){super(...arguments),this.name="get_form",this.type=Yi.READ,this.annotations=$o({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 Nv}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(gg,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 xo{constructor(){super(...arguments),this.name="form_questions_editor",this.type=Yi.WRITE,this.annotations=$o({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new av((()=>this.mondayApi)),this.actionHandlers=new Map([[Zg.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Zg.Update,this.helpers.updateQuestion.bind(this.helpers)],[Zg.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 tv}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends xo{constructor(){super(...arguments),this.name="create_form_submission",this.type=Yi.WRITE,this.annotations=$o({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 zv}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(e){if(e.includes("wkf.ms")){const t=(await g.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(Ov,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){o_(e,"submit form")}}},class extends xo{constructor(){super(...arguments),this.name="create_column",this.type=Yi.WRITE,this.annotations=$o({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 "${U_.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?Fv:Vv}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},i=await this.mondayApi.request(Ff,a);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends xo{constructor(){super(...arguments),this.name="update_column",this.type=Yi.WRITE,this.annotations=$o({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 "${U_.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?Mv:jv}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},i=await this.mondayApi.request(Mf,a);return{content:{message:"Column successfully updated. Use the new revision below for any subsequent update to this column.",column_id:i.update_column?.id,column_title:i.update_column?.title,revision:i.update_column?.revision}}}},class extends xo{constructor(){super(...arguments),this.name="create_group",this.type=Yi.WRITE,this.annotations=$o({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 Yv}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(Gv,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 xo{constructor(){super(...arguments),this.name="delete_column",this.type=Yi.WRITE,this.annotations=$o({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?Eb:Sb}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(Vf,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},l_,class extends l_{constructor(e,t){super(e,t),this.name="all_api_read",this.type=Yi.READ,this.annotations=$o({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=kr(e.query);this.recordGraphqlOperationCounts(t);const a=Ud(t);if(a?.operation===Ko.MUTATION)throw new i_("all_api_read only accepts read queries. Mutations are not allowed.",e_);return super.executeInternal(e)}},class extends l_{constructor(e,t){super(e,t),this.name="all_api_write",this.type=Yi.WRITE,this.annotations=$o({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=kr(e.query);this.recordGraphqlOperationCounts(t);const a=Ud(t);if(a&&a.operation!==Ko.MUTATION)throw new i_("all_api_write only accepts mutations. Read queries are not allowed.",e_);return super.executeInternal(e)}},class extends xo{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=Yi.ALL_API,this.annotations=$o({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 ay}async executeInternal(e){try{const t=await this.mondayApi.request(jf),a=e?.operationType,i=t.__schema,o="write"!==a?t.queryType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,r="read"!==a?t.mutationType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,n=i?.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!==o&&{query_fields:o},...void 0!==r&&{mutation_fields:r},types:n}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends xo{constructor(){super(...arguments),this.name="get_column_type_info",this.type=Yi.READ,this.annotations=$o({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Retrieves comprehensive information about a specific column type. Use fetchMode "${U_.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 "${U_.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 ty}async executeInternal(e){if(e.fetchMode===U_.Guidelines)return{content:{message:`Column type guidelines for ${e.columnType}`,data:{guidelines:{filter:ey(e.columnType),aggregation:`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${tp.CountItems} function. Do not use ${tp.Count} function for that purpose.\n `}},url:Xb}};const t={type:e.columnType},a=await this.mondayApi.request(Jb,t);return a?.get_column_type_schema?{content:{message:`Column type schema for ${e.columnType}`,data:{schema:a.get_column_type_schema},url:Xb}}:{content:`Information for column type "${e.columnType}" not found or not available.`}}},class extends xo{constructor(e,t){super("function"==typeof e?()=>d_(e()):d_(e),t),this.name="get_type_details",this.type=Yi.ALL_API,this.annotations=$o({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 iy}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,Nf`
|
|
2809
|
+
`,OE={};const kE=[class extends xo{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=Yi.READ,this.annotations=$o({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 OE}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(NE,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${iE} 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:`${pE} 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 i=EE(e,tE.SPRINT_TASKS);if(!i)return;const o=TE(i);if(!o)return;const r=`${e.id}:${o}`;if(a.has(r))return;const n=t.get(o);a.set(r,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(o,n,`Tasks Board ${o}`)})}processTasksBoard(e,t,a){const i=EE(e,cE);if(!i)return;const o=TE(i);if(!o)return;const r=`${o}:${e.id}`;if(a.has(r))return;const n=t.get(o);a.set(r,{sprintsBoard:this.createBoardInfo(o,n,`Sprints Board ${o}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(wE(i)&&this.processSprintsBoard(i,a,t),IE(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends xo{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=Yi.READ,this.annotations=$o({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 DE}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(AE,a),o=i.boards?.[0],r=o?.items_page?.items||[],n=this.buildSprintsMetadata(r);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:r.length,data:n}}}catch(e){return{content:`${pE} 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(Pf,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${iE} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const o=i.columns||[],r=this.validateSprintsBoardSchemaFromColumns(o);return r.isValid?{success:!0}:{success:!1,error:`${lE} ${r.errorMessage}`}}catch(e){return{success:!1,error:`${pE} 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(tE),i=bE(t,a);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((t=>{const a=(e=>mE[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=_E(e,aE.SPRINT_ACTIVATION),a=_E(e,aE.SPRINT_COMPLETION),i=gE(e,aE.SPRINT_START_DATE),o=gE(e,aE.SPRINT_END_DATE),r=((e,t)=>{const a=fE(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,aE.SPRINT_TIMELINE),n=vE(e,aE.SPRINT_SUMMARY);let s=uE.Planned;return a?s=uE.Completed:(t||i)&&(s=uE.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:r?{from:r.from,to:r.to}:null,start_date:i||null,end_date:o||null,is_completed:a,document_object_id:n||null}}))}},class extends xo{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=Yi.READ,this.annotations=$o({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 SE}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${pE} 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||`${pE} Unknown error occurred while reading document content`}}catch(e){return{content:`${pE} 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(eE,t)).items||[];if(0===a.length)return{success:!1,error:`${oE} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${oE} Sprint with ID ${e} not found.`};const o=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(tE),...t];return bE(a,i)})(i,[aE.SPRINT_SUMMARY]);if(!o.isValid)return{success:!1,error:`${lE} Sprint item is missing required columns: ${o.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const r=vE(i,aE.SPRINT_SUMMARY);return r?{success:!0,documentObjectId:r,sprintName:i.name}:{success:!1,error:`${rE} No sprint summary document found for sprint "${i.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${pE} 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(Of,t)).docs||[];if(0===a.length)return{success:!1,error:`${rE} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${nE} Document data is invalid for object ID ${e}.`};const o={docId:i.id,blockIds:[]},r=await this.mondayApi.request(Wf,o);if(!r.export_markdown_from_doc?.success)return{success:!1,error:`${dE} Failed to export markdown from document: ${r.export_markdown_from_doc?.error||"Unknown error"}`};const n=r.export_markdown_from_doc.markdown;return n?{success:!0,content:n}:{success:!1,error:`${sE} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${pE} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],RE=[class extends xo{constructor(){super(...arguments),this.name="delete_item",this.type=Yi.WRITE,this.annotations=$o({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Ab}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request($f,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends xo{constructor(){super(...arguments),this.name="get_board_items_page",this.type=Yi.READ,this.annotations=$o({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 Qb}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){r_(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 i=await this.mondayApi.request(jb,a);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:zc.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],i=a?.items_page,o=i?.items||[];return{board:{id:a?.id,name:a?.name,hierarchy_type:a?.hierarchy_type||null},items:o.map((e=>this.mapItem(e,t))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:o.length}}}mapItem(e,t){const a=e.parent_item?.id||null,i={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){i.column_values={};for(const t of e.column_values)i.column_values[t.id]=this.getColumnValueData(t)}if(t.includeGroup&&"group"in e&&e.group&&(i.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})));i.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(i.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),i}getColumnValueData(e){switch(e.type){case Uv.BoardRelation:return e.linked_items;case Uv.Formula:return e.display_value;case Uv.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(qb,t,{versionOverride:"dev",timeout:h_})).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 i=e.itemIds??[];if(0===i.length)return a;const o=new Set(i);return a.filter((e=>o.has(e)))}},Zv,class extends xo{constructor(){super(...arguments),this.name="create_items",this.type=Yi.WRITE,this.annotations=$o({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. Batch each parent's subitems into groups of up to 20. Wait for one batch to finish before starting the next batch for that parent. [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?eb:tb}async executeInternal(e){const t=e.items.flatMap(((e,t)=>void 0===e.name?[ob(new i_("Item name is required",a_),t)]:[]));if(t.length)throw new i_(`${t.length} of ${e.items.length} items are missing the required name field`,a_,t);const a=this.context?.boardId??e.boardId;this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.items.length;const i=new Zv(this.mondayApi,{boardId:a}),o="Skipped: a previous item hit a rate limit; this item was not attempted",r=e.items.map(((e,t)=>async()=>{const a=await i.execute({name:e.name,columnValues:e.columnValues,groupId:e.groupId,parentItemId:e.parentItemId,duplicateFromItemId:e.duplicateFromItemId,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,...a.content}})),n=await f_(r,{limit:15,concurrencyGroups:{getGroup:t=>e.items[t].parentItemId,limitPerGroup:5},onSkipped:e=>({index:e,error:o,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:o,path:["results",e]}}),onError:(t,a)=>({index:a,error:ib(t,e.items[a].parentItemId),_errorEntry:ob(t,a)})}),s=n.filter((e=>"error"in e)).map((e=>e._errorEntry)),d=n.map((({_errorEntry:e,...t})=>t)),p=n.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,...l===p?{isError:!0}:{}}}},cb,class extends xo{constructor(){super(...arguments),this.name="create_updates",this.type=Yi.WRITE,this.annotations=$o({title:"Create Multiple Updates",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create up to 40 updates (comments/posts) in a single call. Each entry is independent - it targets its own item, has its own body and mentions, and can reply to an existing update via parentId - so one call can post on many items, or post several replies. Use this instead of calling create_update repeatedly when posting more than one update. Each entry returns its own update_id and item_id on success or a raw error message on failure."}getInputSchema(){return mb}async executeInternal(e){this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const t="Skipped: a previous update hit a rate limit; this update was not attempted",a=new cb(this.mondayApi),i=e.updates.map(((e,t)=>async()=>{const i=await a.execute(e);return{index:t,...i.content}})),o=await f_(i,{limit:10,onSkipped:e=>({index:e,error:t,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:t,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:ub(e,t)})}),r=o.filter((e=>"error"in e)).map((e=>e._errorEntry)),n=o.map((({_errorEntry:e,...t})=>t)),s=o.length,d=r.length,p={summary:{total:s,created:s-d,failed:d},is_partial_success:d>0&&d<s,results:n};return r.length&&(p.errors=r),{content:p,...d===s?{isError:!0}:{}}}},class extends xo{constructor(){super(...arguments),this.name="delete_update",this.type=Yi.WRITE,this.annotations=$o({title:"Delete Update",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an update (comment/post) from a monday.com item."}getInputSchema(){return fb}async executeInternal(e){try{const t={id:e.id.toString()},a=await this.mondayApi.request(hb,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){o_(e,"delete update")}}},class extends xo{constructor(){super(...arguments),this.name="get_updates",this.type=Yi.READ,this.annotations=$o({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from monday.com items or a board. Pass the IDs in objectIds and set objectType: up to 25 item IDs for Item, in one call instead of calling once per item, or one board ID for Board. Filter by date range with 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, and add a date range to keep the response small. Returns update text (bodies over 2000 characters are truncated and flagged with text_body_truncated. To read one in full, call again with only that item's ID and includeFullText), creator info, timestamps, and optionally replies and assets."}getInputSchema(){return yb}async executeInternal(e){try{const t=void 0!==e.fromDate;if(t!==(void 0!==e.toDate))throw new i_("Both fromDate and toDate must be provided together for date range filtering",Jf);const a=[...new Set([...e.objectIds??[],...e.objectId?[e.objectId]:[]])];if(0===a.length)throw new i_("Provide the IDs to read in objectIds",Jf);if(a.length>25)throw new i_("objectIds takes up to 25 IDs",Jf);if(e.objectType===vb.Board&&1!==a.length)throw new i_("Board queries take exactly one board ID in objectIds",Jf);const i=e.fromDate?wb(e.fromDate):void 0,o=e.toDate?wb(e.toDate,!0):void 0,r={page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};if(e.objectType===vb.Item){const t=e.limit??(a.length>1?10:25),n=((await this.mondayApi.request(_b,{...r,limit:t,itemIds:a,itemsLimit:a.length})).items??[]).filter((e=>!!e)),s=new Set(n.map((e=>e.id))),d=a.filter((e=>!s.has(e)));return{content:{message:"Updates retrieved",items:n.map((t=>{const a=(t.updates??[]).filter((e=>function(e,t,a){if(!t||!a)return!0;const i=e?Date.parse(e):NaN;return!Number.isNaN(i)&&i>=Date.parse(t)&&i<=Date.parse(a)}(e.created_at,i,o))).map((t=>Tb(t,e)));return{item_id:t.id,url:t.url,updates:a,count:a.length}})),...d.length>0&&{not_found:d},pagination:{page:e.page??1,limit:t}}}}const[n]=a,s=e.limit??25,d=await this.mondayApi.request(gb,{...r,limit:s,boardId:n,boardUpdatesOnly:!e.includeItemUpdates,...i&&o?{fromDate:i,toDate:o}:{}}),p=d.boards?.[0],l=p?.updates;if(!l||0===l.length)return{content:`No updates found for board with id ${n}`};const c=l.map((t=>Tb(t,e)));return{content:{message:"Updates retrieved",board_id:n,url:p?.url,updates:c,pagination:{page:e.page??1,limit:s,count:c.length}}}}catch(e){o_(e,"get updates")}}},class extends xo{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=Yi.WRITE,this.annotations=$o({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 kI}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=OI.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},i=await this.mondayApi.request(nb,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} successfully created on item ${e.itemId}`,update_id:i.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){o_(e,"create update")}}},class extends xo{constructor(){super(...arguments),this.name="get_board_schema",this.type=Yi.READ,this.annotations=$o({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 Kb}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(Pf,a);return{content:{message:"Board schema retrieved",board_id:t,columns:i.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type,revision:e?.revision})))??[],groups:i.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends xo{constructor(){super(...arguments),this.name="get_board_activity",this.type=Yi.READ,this.annotations=$o({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 xb}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-u_.MONTH30Days),i=e?.fromDate||a.toISOString(),o=e?.toDate||t.toISOString(),r={boardId:e.boardId.toString(),itemIds:e.itemIds?.map(String),userIds:e.userIds?.map(String),fromDate:i,toDate:o,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},n=await this.mondayApi.request($b,r),s=n.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${o}).`};const d=n.boards?.[0],p=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:d?.name,board_url:d?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...p&&e.data?{data:e.data}:{}})))}}}},class extends xo{constructor(e,t,a){super(e,a),this.name="get_board_info",this.type=Yi.READ,this.annotations=$o({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. "+(this.isKnowledgeEnabled()?"Set includeKnowledge to true when you need to interpret the board rather than just read its configuration: for example, choosing a status, label or column value from the user's intent instead of an exact name they gave, or explaining what statuses, columns or roles mean. Not needed for structural work such as column ids, types, revisions or views. Adds latency and may be null while knowledge is still being generated. ":"")+'Set includeSubscribers to true to also return the board\'s subscribers (people and AI agents) and team subscribers. 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 Mb}async executeInternal(e){const{columnIds:t,viewIds:a,includeColumns:i,includeViews:o,unmatchedViewNames:r,availableViewNames:n}=await this.resolveFiltersAsync(e);if(e.filters?.views?.names?.length&&o&&void 0!==a&&0===a.length){const t=n.length>0?n.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:i?t:void 0,viewIds:o?a:void 0,includeColumns:i,includeViews:o,includeSubscribers:!0===e.includeSubscribers},d=this.mondayApi.request(Pb,s),p=!0===e.includeKnowledge,l=p&&this.isKnowledgeEnabled()?this.mondayApi.request(Ub,{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=i?await this.getSubItemsBoardAsync(u):null;return{content:Fb(u,h,r,m?.entity_knowledge??null,p)}}isKnowledgeEnabled(){return this.context?.deps?.flagChecker?.("mcp-get-board-info-entity-knowledge")??!0}async resolveFiltersAsync(e){const t=e.filters?.columns,a=e.filters?.views,i=Boolean(t?.only),o=Boolean(a?.only),r=void 0!==a?.ids,n=Boolean(a?.names?.length),s=!o||i,d=!i||o,p=s?t?.ids:void 0;if(!d)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(!r&&!n)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(r&&!n)return{columnIds:p,viewIds:a?.ids??[],includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};const l=await this.mondayApi.request(Lb,{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=Vb(t.name),i=a.get(e)??[];i.push(t.id),a.set(e,i)}const i=[],o=[];for(const e of t){const t=a.get(Vb(e));t?.length?i.push(...t):o.push(e)}return{viewIds:i,unmatchedViewNames:o}})(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===Uv.Subtasks));if(!t)return null;const a=t.settings.boardIds[0];if(a===e.id)return null;const i=await this.mondayApi.request(zb,{boardId:a});return i.boards?.[0]??null}},class extends xo{constructor(){super(...arguments),this.name="get_full_board_data",this.type=Yi.READ,this.annotations=$o({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 Cb}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(Nb,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=a.boards[0],o=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&o.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&o.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&&o.add(e.id)}))}}))}));const r=Array.from(o).filter((e=>!(Number(e)<0)));let n=[];if(r.length>0){const e={userIds:r},t=await this.mondayApi.request(Ob,e);n=t.users?.filter((e=>null!==e))||[]}const s=new Map(n.map((e=>[e.id,e])));return{content:{board:{id:i.id,name:i.name,columns:i.columns,items:i.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:n,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:n.length}}}}catch(e){o_(e,"get full board data")}}},class extends xo{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=Yi.READ,this.annotations=$o({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 Ny}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,o=e.teamsOnly||!1,r=e.includeTeamMembers||!1,n=!!e.name;if(e.getMe||!1){if(t||a||i||o||r||n)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(vy);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=wy(s),p=await Ay(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}if(n){if(t||a||i||o||r)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const n={name:e.name},s=await this.mondayApi.request(gy,n);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const d=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),p=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${d}`,l=await Ay(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(o&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>Iy)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>Ty)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(o||!t&&a&&!i)if(r){const t={teamIds:e.teamIds};s=await this.mondayApi.request(_y,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(fy,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:Ey};s=await this.mondayApi.request(hy,t)}else if(t){const t={userIds:e.userIds,limit:Ey};s=await this.mondayApi.request(my,t)}else{const e={userIds:void 0,limit:Ey};s=await this.mondayApi.request(uy,e)}const d=wy(s),p=await Ay(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},y_,class extends xo{constructor(){super(...arguments),this.name="update_items",this.type=Yi.WRITE,this.annotations=$o({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?I_:T_}async executeInternal(e){const t=e.updates.flatMap(((e,t)=>void 0===e.itemId?[E_(new i_("Item id is required",a_),t)]:[]));if(t.length)throw new i_(`${t.length} of ${e.updates.length} updates are missing the required itemId field`,a_,t);this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const a=this.context?.boardId??e.boardId,i=e.updates.map((e=>e.boardId??a)),o=i.map(((e,t)=>null==e?t:-1)).filter((e=>e>=0));if(o.length>0)throw new i_(`Missing boardId for update(s) at index ${o.join(", ")}. Set a boardId on each update or provide a batch-level boardId.`,a_);const r="Skipped: a previous update hit a rate limit; this update was not attempted",n=new y_(this.mondayApi),s=e.updates.map(((e,t)=>async()=>{const a=i[t],o=await n.execute({boardId:a,itemId:e.itemId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,board_id:a,...o.content}})),d=await f_(s,{limit:15,onSkipped:e=>({index:e,error:r,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:r,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:E_(e,t)})}),p=d.filter((e=>"error"in e)).map((e=>e._errorEntry)),l=d.map((({_errorEntry:e,...t})=>t)),c=d.length,m=p.length,u={summary:{total:c,updated:c-m,failed:m},is_partial_success:m>0&&m<c,results:l};return p.length&&(u.errors=p),{content:u,...m===c?{isError:!0}:{}}}},class extends xo{constructor(){super(...arguments),this.name="move_item_to_group",this.type=Yi.WRITE,this.annotations=$o({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to another group on the same monday.com board. It cannot move an item to a different board."}getInputSchema(){return Oy}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId};let a;try{a=await this.mondayApi.request(zf,t)}catch(e){o_(e,"move item to group")}return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends xo{constructor(){super(...arguments),this.name="create_board",this.type=Yi.WRITE,this.annotations=$o({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return W_}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(Uf,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 xo{constructor(){super(...arguments),this.name="use_template",this.type=Yi.WRITE,this.annotations=$o({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 Y_}async executeInternal(e){const t={templateId:e.templateId,destinationWorkspaceId:e.destinationWorkspaceId,destinationName:e.destinationName,boardKind:e.boardKind},a=await this.mondayApi.request(Qf,t),i=a.use_template?.process_id;return null==i?{content:{processId:null,message:"Failed to start template application. The request was rejected."}}:{content:{processId:i,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 xo{constructor(){super(...arguments),this.name="check_template_status",this.type=Yi.READ,this.annotations=$o({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 Q_}async executeInternal(e){const t={processId:e.processId},a=(await this.mondayApi.request(Kf,t)).template_installation_status;return a?a.status===ru.Complete?{content:{status:ru.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===ru.Failed?{content:{status:ru.Failed,board_ids:[],board_ids_map:[],message:"Template application failed. Please try again."}}:a.status===ru.Pending||a.status===ru.InProgress?{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Template application ${a.status===ru.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 xo{constructor(){super(...arguments),this.name="create_form",this.type=Yi.WRITE,this.annotations=$o({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 zg}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(_g,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends xo{constructor(){super(...arguments),this.name="update_form",this.type=Yi.WRITE,this.annotations=$o({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Dv((()=>this.mondayApi)),this.actionHandlers=new Map([[iv.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[iv.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[iv.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[iv.activate,this.helpers.activateForm.bind(this.helpers)],[iv.createTag,this.helpers.createTag.bind(this.helpers)],[iv.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[iv.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[iv.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[iv.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[iv.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[iv.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 Av}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 xo{constructor(){super(...arguments),this.name="get_form",this.type=Yi.READ,this.annotations=$o({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 Nv}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(gg,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 xo{constructor(){super(...arguments),this.name="form_questions_editor",this.type=Yi.WRITE,this.annotations=$o({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new av((()=>this.mondayApi)),this.actionHandlers=new Map([[Zg.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Zg.Update,this.helpers.updateQuestion.bind(this.helpers)],[Zg.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 tv}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends xo{constructor(){super(...arguments),this.name="create_form_submission",this.type=Yi.WRITE,this.annotations=$o({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 zv}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(e){if(e.includes("wkf.ms")){const t=(await g.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(Ov,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){o_(e,"submit form")}}},class extends xo{constructor(){super(...arguments),this.name="create_column",this.type=Yi.WRITE,this.annotations=$o({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 "${U_.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?Fv:Vv}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},i=await this.mondayApi.request(Ff,a);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends xo{constructor(){super(...arguments),this.name="update_column",this.type=Yi.WRITE,this.annotations=$o({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 "${U_.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. To turn on or change the column rollup (calculated capability, for columns on multi-level boards), set rollupFunction: numbers MIN/MAX/SUM/NONE, date MIN/MAX, timeline MIN_MAX, status COUNT_KEYS. To turn rollup off, pass rollupFunction: null (omitting it leaves rollup unchanged). rollupFunction is independent of columnSettings and can be sent alone or together with it.`}getInputSchema(){return this.context?.boardId?Mv:jv}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};void 0!==e.rollupFunction&&(a.capabilities={calculated:null===e.rollupFunction?null:{function:e.rollupFunction}});const i=await this.mondayApi.request(Mf,a);return{content:{message:"Column successfully updated. Use the new revision below for any subsequent update to this column.",column_id:i.update_column?.id,column_title:i.update_column?.title,revision:i.update_column?.revision}}}},class extends xo{constructor(){super(...arguments),this.name="create_group",this.type=Yi.WRITE,this.annotations=$o({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 Yv}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(Gv,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 xo{constructor(){super(...arguments),this.name="delete_column",this.type=Yi.WRITE,this.annotations=$o({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?Eb:Sb}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(Vf,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},l_,class extends l_{constructor(e,t){super(e,t),this.name="all_api_read",this.type=Yi.READ,this.annotations=$o({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=kr(e.query);this.recordGraphqlOperationCounts(t);const a=Ud(t);if(a?.operation===Ko.MUTATION)throw new i_("all_api_read only accepts read queries. Mutations are not allowed.",e_);return super.executeInternal(e)}},class extends l_{constructor(e,t){super(e,t),this.name="all_api_write",this.type=Yi.WRITE,this.annotations=$o({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=kr(e.query);this.recordGraphqlOperationCounts(t);const a=Ud(t);if(a&&a.operation!==Ko.MUTATION)throw new i_("all_api_write only accepts mutations. Read queries are not allowed.",e_);return super.executeInternal(e)}},class extends xo{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=Yi.ALL_API,this.annotations=$o({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 ay}async executeInternal(e){try{const t=await this.mondayApi.request(jf),a=e?.operationType,i=t.__schema,o="write"!==a?t.queryType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,r="read"!==a?t.mutationType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,n=i?.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!==o&&{query_fields:o},...void 0!==r&&{mutation_fields:r},types:n}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends xo{constructor(){super(...arguments),this.name="get_column_type_info",this.type=Yi.READ,this.annotations=$o({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Retrieves comprehensive information about a specific column type. Use fetchMode "${U_.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 "${U_.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 ty}async executeInternal(e){if(e.fetchMode===U_.Guidelines)return{content:{message:`Column type guidelines for ${e.columnType}`,data:{guidelines:{filter:ey(e.columnType),aggregation:`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${tp.CountItems} function. Do not use ${tp.Count} function for that purpose.\n `}},url:Xb}};const t={type:e.columnType},a=await this.mondayApi.request(Jb,t);return a?.get_column_type_schema?{content:{message:`Column type schema for ${e.columnType}`,data:{schema:a.get_column_type_schema},url:Xb}}:{content:`Information for column type "${e.columnType}" not found or not available.`}}},class extends xo{constructor(e,t){super("function"==typeof e?()=>d_(e()):d_(e),t),this.name="get_type_details",this.type=Yi.ALL_API,this.annotations=$o({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 iy}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,Nf`
|
|
2808
2810
|
query getTypeDetails {
|
|
2809
2811
|
__type(name: "${t}") {
|
|
2810
2812
|
name
|