@mondaydotcomorg/agent-toolkit 5.78.10 → 5.78.12
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 +16 -16
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/mcp/index.js +16 -16
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.js +16 -16
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/core/index.js +16 -16
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/mcp/index.js +16 -16
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.js +16 -16
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/core/index.js
CHANGED
|
@@ -2693,7 +2693,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2693
2693
|
workflow_statistics
|
|
2694
2694
|
}
|
|
2695
2695
|
}
|
|
2696
|
-
`,pv={breakdown:a.enum(["totals","by_entity"]).describe("totals = success/failure/total counts, by_entity = per automation/workflow"),boardId:a.string().min(1).optional().describe("Target a specific board by numeric ID"),accountWide:a.boolean().optional().describe("Set true to query account-wide (required if no boardId)"),userIds:a.array(a.number().int()).optional().describe("Narrow to specific creator user IDs"),runStatus:a.enum(["success","failure","exhausted"]).optional().describe("by_entity: required run status to break down"),excludeAutomationIds:a.array(a.number().int()).optional().describe("by_entity: automation IDs to exclude from breakdown")};const
|
|
2696
|
+
`,pv="2027-04",lv={breakdown:a.enum(["totals","by_entity"]).describe("totals = success/failure/total counts, by_entity = per automation/workflow"),boardId:a.string().min(1).optional().describe("Target a specific board by numeric ID"),accountWide:a.boolean().optional().describe("Set true to query account-wide (required if no boardId)"),userIds:a.array(a.number().int()).optional().describe("Narrow to specific creator user IDs"),runStatus:a.enum(["success","failure","exhausted"]).optional().describe("by_entity: required run status to break down"),excludeAutomationIds:a.array(a.number().int()).optional().describe("by_entity: automation IDs to exclude from breakdown")};const cv=Bc`
|
|
2697
2697
|
mutation ConfigureCategorizeAiColumn(
|
|
2698
2698
|
$boardId: ID!
|
|
2699
2699
|
$columnId: ID!
|
|
@@ -2713,7 +2713,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2713
2713
|
column_id
|
|
2714
2714
|
}
|
|
2715
2715
|
}
|
|
2716
|
-
`,
|
|
2716
|
+
`,mv=Bc`
|
|
2717
2717
|
mutation ConfigureSummarizeAiColumn(
|
|
2718
2718
|
$boardId: ID!
|
|
2719
2719
|
$columnId: ID!
|
|
@@ -2733,7 +2733,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2733
2733
|
column_id
|
|
2734
2734
|
}
|
|
2735
2735
|
}
|
|
2736
|
-
`,
|
|
2736
|
+
`,uv=Bc`
|
|
2737
2737
|
mutation ConfigureTranslateAiColumn(
|
|
2738
2738
|
$boardId: ID!
|
|
2739
2739
|
$columnId: ID!
|
|
@@ -2753,7 +2753,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2753
2753
|
column_id
|
|
2754
2754
|
}
|
|
2755
2755
|
}
|
|
2756
|
-
`,
|
|
2756
|
+
`,hv=Bc`
|
|
2757
2757
|
mutation ConfigureImproveTextAiColumn(
|
|
2758
2758
|
$boardId: ID!
|
|
2759
2759
|
$columnId: ID!
|
|
@@ -2777,7 +2777,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2777
2777
|
column_id
|
|
2778
2778
|
}
|
|
2779
2779
|
}
|
|
2780
|
-
`,
|
|
2780
|
+
`,fv=Bc`
|
|
2781
2781
|
mutation ConfigureExtractAiColumn(
|
|
2782
2782
|
$boardId: ID!
|
|
2783
2783
|
$columnId: ID!
|
|
@@ -2801,7 +2801,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2801
2801
|
column_id
|
|
2802
2802
|
}
|
|
2803
2803
|
}
|
|
2804
|
-
`,
|
|
2804
|
+
`,_v=Bc`
|
|
2805
2805
|
mutation ConfigureOpenBlockAiColumn(
|
|
2806
2806
|
$boardId: ID!
|
|
2807
2807
|
$columnId: ID!
|
|
@@ -2817,7 +2817,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2817
2817
|
column_id
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
2820
|
-
`,
|
|
2820
|
+
`,bv=Bc`
|
|
2821
2821
|
mutation ConfigureWriteMeAiColumn(
|
|
2822
2822
|
$boardId: ID!
|
|
2823
2823
|
$columnId: ID!
|
|
@@ -2837,7 +2837,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2837
2837
|
column_id
|
|
2838
2838
|
}
|
|
2839
2839
|
}
|
|
2840
|
-
`,
|
|
2840
|
+
`,gv=Bc`
|
|
2841
2841
|
mutation ConfigurePersonAssignmentAiColumn(
|
|
2842
2842
|
$boardId: ID!
|
|
2843
2843
|
$columnId: ID!
|
|
@@ -2857,14 +2857,14 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2857
2857
|
column_id
|
|
2858
2858
|
}
|
|
2859
2859
|
}
|
|
2860
|
-
`,
|
|
2860
|
+
`,yv={board_id:a.number().describe("The ID of the board containing the column"),column_id:a.string().describe("The ID of the column to configure with AI"),block_type:a.enum(["categorize","summarize","translate","improve_text","extract","open_block","write_me","person_assignment"]).describe("The AI block type to configure. See tool description for which fields apply to each block."),source_type:a.enum(["item_name","thread","column","emails_and_activities"]).optional().describe("Where the AI reads input. Required for all blocks except open_block and write_me. Values: item_name (item name), thread (updates/comments), column (another column — requires source_column_id), emails_and_activities (categorize only)."),source_column_id:a.string().optional().describe('The ID of the source column. Required when source_type is "column".'),additional_instructions:a.string().max(3e3).optional().describe("Custom instructions for categorize/summarize/extract blocks (max 3000 chars)."),target_language:a.enum(["english","spanish","french","german","hebrew","chinese","korean","arabic","bengali","danish","dutch","hindi","indonesian","italian","japanese","norwegian","polish","portuguese","russian","swedish","thai","turkish","vietnamese"]).optional().describe("Required for translate block. The target language to translate text into."),tone:a.enum(["empathic","promotional","confident","professional","natural","casual","friendly","same"]).optional().describe("Writing tone. Required for write_me, optional for improve_text."),output_length:a.enum(["sentence","paragraph","brief","in_depth"]).optional().describe("Required for write_me block. Approximate desired output length."),improver_length:a.enum(["same","shorter","longer"]).optional().describe("For improve_text only. Desired length relative to input text."),refinement_type:a.enum(["minimal_changes","moderate_changes","high_creativity"]).optional().describe("For improve_text only. Level of text refinement to apply."),entity_type:a.enum(["email_address","first_name","last_name","phone_number","company_name","domain_name","url","date","time","year","custom"]).optional().describe("Required for extract block. Type of entity to extract from text."),custom_instructions:a.string().max(3e3).optional().describe('Required for extract when entity_type is "custom". Describes what to extract (max 3000 chars).'),ai_query:a.string().max(3e3).optional().describe("Required for open_block and write_me. Natural-language prompt. Reference columns via {pulse.column_id}, item name via {pulse.name}, subitems via {pulse.subitem.column_id}. Max 3000 chars."),groups:a.array(a.object({user_ids:a.array(a.number()).describe("Array of user IDs in this group"),description:a.string().describe("Description of this group (e.g., role, team name, or assignment criteria)")})).optional().describe("Required for person_assignment. Array of groups, each with user_ids and a description."),run_backfill:a.boolean().optional().describe("Whether to immediately apply AI to existing items (up to 200). Defaults to true.")};const vv=Bc`
|
|
2861
2861
|
mutation RemoveAiFromColumn($boardId: ID!, $columnId: ID!) {
|
|
2862
2862
|
remove_ai_from_column(board_id: $boardId, column_id: $columnId) {
|
|
2863
2863
|
column_id
|
|
2864
2864
|
success
|
|
2865
2865
|
}
|
|
2866
2866
|
}
|
|
2867
|
-
`,
|
|
2867
|
+
`,Iv={board_id:a.number().describe("The ID of the board containing the column"),column_id:a.string().describe("The ID of the column to remove AI from")};const wv="Do NOT include any personally identifiable information (PII) such as names, email addresses, phone numbers, or any other personal data.",Tv={kind:a.enum(["feedback","feature_request","bug"]).describe("The kind of submission: general feedback, a feature request, or a bug report"),title:a.string().describe(`A short summary of the feedback. ${wv}`),description:a.string().describe(`Full details — what happened, what was expected, or what is being requested. ${wv}`),tool_name:a.string().optional().describe('The name of the monday.com MCP tool this feedback is about, if applicable (e.g. "create_item", "get_board_info"). Only include monday.com MCP tool names — do not reference tools from other connected services.')};const Ev=Bc`
|
|
2868
2868
|
query KnowledgeBaseSearch($query: String!, $limit: Int) {
|
|
2869
2869
|
knowledge_base_search(query: $query, limit: $limit) {
|
|
2870
2870
|
answer
|
|
@@ -2878,7 +2878,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2878
2878
|
}
|
|
2879
2879
|
}
|
|
2880
2880
|
}
|
|
2881
|
-
`,
|
|
2881
|
+
`,Av=Bc`
|
|
2882
2882
|
query AskDeveloperDocs($query: String!, $retrieval_only: Boolean = true) {
|
|
2883
2883
|
ask_developer_docs(query: $query, retrieval_only: $retrieval_only) {
|
|
2884
2884
|
id
|
|
@@ -2887,7 +2887,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2887
2887
|
conversation_id
|
|
2888
2888
|
}
|
|
2889
2889
|
}
|
|
2890
|
-
`,
|
|
2890
|
+
`,Sv="developer_docs",Dv="general",Nv={query:a.string().describe("The question or topic to search for in the monday.com knowledge base."),kind:a.enum([Sv,Dv]).describe('The knowledge domain to search. Use "developer_docs" for questions about the monday.com API — GraphQL queries and mutations, authentication, rate limits, webhooks, schema, API best practices, and building apps. Use "general" for questions about using monday.com — features, automations, UI, help center, and settings.')};a.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),a.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const Ov=Bc`
|
|
2891
2891
|
query getSprintsByIds($ids: [ID!]) {
|
|
2892
2892
|
items(ids: $ids) {
|
|
2893
2893
|
id
|
|
@@ -2922,7 +2922,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2922
2922
|
}
|
|
2923
2923
|
}
|
|
2924
2924
|
}
|
|
2925
|
-
`,
|
|
2925
|
+
`,kv={SPRINT_TASKS:"sprint_tasks",SPRINT_TIMELINE:"sprint_timeline",SPRINT_COMPLETION:"sprint_completion",SPRINT_START_DATE:"sprint_start_date",SPRINT_END_DATE:"sprint_end_date",SPRINT_ACTIVATION:"sprint_activation"},Cv={...kv,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},Rv="BOARD_NOT_FOUND:",$v="SPRINT_NOT_FOUND:",xv="DOCUMENT_NOT_FOUND:",Lv="DOCUMENT_INVALID:",Uv="DOCUMENT_EMPTY:",Pv="EXPORT_FAILED:",Vv="INTERNAL_ERROR:",Fv="VALIDATION_ERROR:",Mv="task_sprint",Bv={[Cv.SPRINT_TASKS]:"Sprint Tasks",[Cv.SPRINT_TIMELINE]:"Sprint Timeline",[Cv.SPRINT_COMPLETION]:"Sprint Completion",[Cv.SPRINT_START_DATE]:"Sprint Start Date",[Cv.SPRINT_END_DATE]:"Sprint End Date",[Cv.SPRINT_ACTIVATION]:"Sprint Activation",[Cv.SPRINT_SUMMARY]:"Sprint Summary",[Cv.SPRINT_CAPACITY]:"Sprint Capacity"},jv=Wd,qv={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},Gv=(e,t)=>e.column_values?.find((e=>e.id===t)),Hv=(e,t)=>{const a=Gv(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},Wv=(e,t)=>{const a=Gv(e,t);return"DateValue"===a?.__typename?a.date??null:null},Yv=(e,t)=>{const a=Gv(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},Qv=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},Kv=(e,t)=>{if(!e.columns)return!1;const a=new Set(e.columns.filter((e=>null!==e)).map((e=>e.id)));return t.every((e=>a.has(e)))},zv=e=>Kv(e,Object.values(kv)),Jv=e=>Kv(e,Object.values(qv)),Xv=e=>{if(!e?.settings)return null;const t=e.settings;return t.boardIds&&Array.isArray(t.boardIds)&&t.boardIds[0]?.toString()||t.boardId?.toString()||null},Zv=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===Rm.BoardRelation))||null,eI={sprintId:a.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const tI=Bc`
|
|
2926
2926
|
query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
|
|
2927
2927
|
boards(ids: [$boardId], limit: 1) {
|
|
2928
2928
|
items_page(limit: $limit) {
|
|
@@ -2958,7 +2958,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2958
2958
|
}
|
|
2959
2959
|
}
|
|
2960
2960
|
}
|
|
2961
|
-
`,
|
|
2961
|
+
`,aI={sprintsBoardId:a.number().describe("The ID of the monday-dev board containing the sprints"),limit:a.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const iI=Bc`
|
|
2962
2962
|
query GetRecentBoards($limit: Int) {
|
|
2963
2963
|
boards(limit: $limit, order_by: used_at, state: active) {
|
|
2964
2964
|
id
|
|
@@ -2974,7 +2974,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
2974
2974
|
}
|
|
2975
2975
|
}
|
|
2976
2976
|
}
|
|
2977
|
-
`,iI={};const nI=[class extends ae{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=b.READ,this.annotations=te({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 iI}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(aI,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${Cv} 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:`${Pv} 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=Xv(e,Ov.SPRINT_TASKS);if(!i)return;const n=Jv(i);if(!n)return;const o=`${e.id}:${n}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,t,a){const i=Xv(e,Fv);if(!i)return;const n=Jv(i);if(!n)return;const o=`${n}:${e.id}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(Kv(i)&&this.processSprintsBoard(i,a,t),zv(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends ae{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=b.READ,this.annotations=te({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 tI}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(eI,a),n=i.boards?.[0],o=n?.items_page?.items||[],r=this.buildSprintsMetadata(o);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:o.length,data:r}}}catch(e){return{content:`${Pv} 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(Qc,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${Cv} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${Vv} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${Pv} 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(Ov),i=Yv(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=>Mv[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=Gv(e,kv.SPRINT_ACTIVATION),a=Gv(e,kv.SPRINT_COMPLETION),i=Hv(e,kv.SPRINT_START_DATE),n=Hv(e,kv.SPRINT_END_DATE),o=((e,t)=>{const a=qv(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,kv.SPRINT_TIMELINE),r=Wv(e,kv.SPRINT_SUMMARY);let s=Bv.Planned;return a?s=Bv.Completed:(t||i)&&(s=Bv.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:i||null,end_date:n||null,is_completed:a,document_object_id:r||null}}))}},class extends ae{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=b.READ,this.annotations=te({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 Zv}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${Pv} 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||`${Pv} Unknown error occurred while reading document content`}}catch(e){return{content:`${Pv} 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(Nv,t)).items||[];if(0===a.length)return{success:!1,error:`${Rv} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${Rv} Sprint with ID ${e} not found.`};const n=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(Ov),...t];return Yv(a,i)})(i,[kv.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${Vv} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=Wv(i,kv.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${$v} 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:`${Pv} 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(jc,t)).docs||[];if(0===a.length)return{success:!1,error:`${$v} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${xv} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(rm,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${Uv} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const r=o.export_markdown_from_doc.markdown;return r?{success:!0,content:r}:{success:!1,error:`${Lv} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${Pv} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],oI=[class extends ae{constructor(){super(...arguments),this.name="delete_item",this.type=b.WRITE,this.annotations=te({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Hf}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(Wc,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends ae{constructor(){super(...arguments),this.name="get_board_items_page",this.type=b.READ,this.annotations=te({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 v_}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){gm(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(u_,a);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:$s.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],i=a?.items_page,n=i?.items||[];return{board:{id:a?.id,name:a?.name,hierarchy_type:a?.hierarchy_type||null},items:n.map((e=>this.mapItem(e,t))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,t){const a=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 Rm.BoardRelation:return e.linked_items;case Rm.Formula:return e.display_value;case Rm.Mirror:return"Column value type is not supported"}if("battery_value"in e)return e.battery_value;if(e.type===Rm.Status)return e.text??null;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(h_,t,{versionOverride:"dev",timeout:Nm})).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 n=new Set(i);return a.filter((e=>n.has(e)))}},gf,class extends ae{constructor(){super(...arguments),this.name="create_items",this.type=b.WRITE,this.annotations=te({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?yf:vf}async executeInternal(e){const t=e.items.flatMap(((e,t)=>void 0===e.name?[Tf(new _m("Item name is required",fm),t)]:[]));if(t.length)throw new _m(`${t.length} of ${e.items.length} items are missing the required name field`,fm,t);const a=this.context?.boardId??e.boardId;this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.items.length;const i=new gf(this.mondayApi,{boardId:a}),n="Skipped: a previous item hit a rate limit; this item was not attempted",o=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}})),r=await Om(o,{limit:15,concurrencyGroups:{getGroup:t=>e.items[t].parentItemId,limitPerGroup:5},onSkipped:e=>({index:e,error:n,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:n,path:["results",e]}}),onError:(t,a)=>({index:a,error:wf(t,e.items[a].parentItemId),_errorEntry:Tf(t,a)})}),s=r.filter((e=>"error"in e)).map((e=>e._errorEntry)),d=r.map((({_errorEntry:e,...t})=>t)),p=r.length,l=s.length,c={board_id:a,summary:{total:p,created:p-l,failed:l},is_partial_success:l>0&&l<p,results:d};return s.length&&(c.errors=s),{content:c,...l===p?{isError:!0}:{}}}},kf,class extends ae{constructor(){super(...arguments),this.name="create_updates",this.type=b.WRITE,this.annotations=te({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 Cf}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 kf(this.mondayApi),i=e.updates.map(((e,t)=>async()=>{const i=await a.execute(e);return{index:t,...i.content}})),n=await Om(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:Rf(e,t)})}),o=n.filter((e=>"error"in e)).map((e=>e._errorEntry)),r=n.map((({_errorEntry:e,...t})=>t)),s=n.length,d=o.length,p={summary:{total:s,created:s-d,failed:d},is_partial_success:d>0&&d<s,results:r};return o.length&&(p.errors=o),{content:p,...d===s?{isError:!0}:{}}}},class extends ae{constructor(){super(...arguments),this.name="delete_update",this.type=b.WRITE,this.annotations=te({title:"Delete Update",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an update (comment/post) from a monday.com item."}getInputSchema(){return xf}async executeInternal(e){try{const t={id:e.id.toString()},a=await this.mondayApi.request($f,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){bm(e,"delete update")}}},class extends ae{constructor(){super(...arguments),this.name="get_updates",this.type=b.READ,this.annotations=te({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 Ff}async executeInternal(e){try{const t=void 0!==e.fromDate;if(t!==(void 0!==e.toDate))throw new _m("Both fromDate and toDate must be provided together for date range filtering",lm);const a=[...new Set([...e.objectIds??[],...e.objectId?[e.objectId]:[]])];if(0===a.length)throw new _m("Provide the IDs to read in objectIds",lm);if(a.length>25)throw new _m("objectIds takes up to 25 IDs",lm);if(e.objectType===Pf.Board&&1!==a.length)throw new _m("Board queries take exactly one board ID in objectIds",lm);const i=e.fromDate?Mf(e.fromDate):void 0,n=e.toDate?Mf(e.toDate,!0):void 0,o={page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};if(e.objectType===Pf.Item){const t=e.limit??(a.length>1?10:25),r=((await this.mondayApi.request(Lf,{...o,limit:t,itemIds:a,itemsLimit:a.length})).items??[]).filter((e=>!!e)),s=new Set(r.map((e=>e.id))),d=a.filter((e=>!s.has(e)));return{content:{message:"Updates retrieved",items:r.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,n))).map((t=>jf(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[r]=a,s=e.limit??25,d=await this.mondayApi.request(Uf,{...o,limit:s,boardId:r,boardUpdatesOnly:!e.includeItemUpdates,...i&&n?{fromDate:i,toDate:n}:{}}),p=d.boards?.[0],l=p?.updates;if(!l||0===l.length)return{content:`No updates found for board with id ${r}`};const c=l.map((t=>jf(t,e)));return{content:{message:"Updates retrieved",board_id:r,url:p?.url,updates:c,pagination:{page:e.page??1,limit:s,count:c.length}}}}catch(e){bm(e,"get updates")}}},class extends ae{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=b.WRITE,this.annotations=te({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 ry}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=oy.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(Af,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){bm(e,"create update")}}},class extends ae{constructor(){super(...arguments),this.name="get_board_schema",this.type=b.READ,this.annotations=te({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 I_}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(Qc,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 ae{constructor(){super(...arguments),this.name="get_board_activity",this.type=b.READ,this.annotations=te({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3,this.maxLookbackDays=90}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days, up to the last 90 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 Zf}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-Dm.MONTH30Days),i=new Date(t.getTime()-this.maxLookbackDays*Dm.DAY);let n=e?.fromDate||a.toISOString();const o=new Date(n).getTime()<i.getTime();o&&(n=i.toISOString());const r=o?`. Note: fromDate was limited to the last ${this.maxLookbackDays} days, so the range starts at ${n}`:"",s=e?.toDate||t.toISOString(),d={boardId:e.boardId.toString(),itemIds:e.itemIds?.map(String),userIds:e.userIds?.map(String),fromDate:n,toDate:s,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},p=await this.mondayApi.request(Xf,d,{versionOverride:"2026-10"}),l=p.boards?.[0]?.activity_logs;if(!l||0===l.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${n} to ${s})${r}.`};const c=p.boards?.[0],m=e.includeData??!1;return{content:{message:`Board activity retrieved${r}`,board_id:e.boardId,board_name:c?.name,board_url:c?.url,data:l.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...m&&e.data?{data:e.data}:{}})))}}}},class extends ae{constructor(e,t,a){super(e,a),this.name="get_board_info",this.type=b.READ,this.annotations=te({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 m_}async executeInternal(e){if(this.isV2Enabled())return this.executeV2(e);const{columnIds:t,viewIds:a,includeColumns:i,includeViews:n,unmatchedViewNames:o,availableViewNames:r}=await this.resolveFiltersAsync(e);if(e.filters?.views?.names?.length&&n&&void 0!==a&&0===a.length){const t=r.length>0?r.join(", "):"(none)";return{content:`None of the requested view names matched on board ${e.boardId}. Requested: ${e.filters.views.names.join(", ")}. Available views: ${t}.`}}const s={boardId:e.boardId.toString(),columnIds:i?t:void 0,viewIds:n?a:void 0,includeColumns:i,includeViews:n,includeSubscribers:!0===e.includeSubscribers},d=this.mondayApi.request(e_,s,{versionOverride:"2027-04"}),p=!0===e.includeKnowledge,l=p&&this.isKnowledgeEnabled()?this.mondayApi.request(i_,{boardId:e.boardId.toString()},{versionOverride:"dev",timeout:c_}).catch((t=>(this.context?.deps?.logger?.warn({err:t,boardId:e.boardId,timeoutMs:c_},"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:r_(u,h,o,m?.entity_knowledge??null,p)}}async executeV2(e){const t=!0===e.includeKnowledge,a=e.boardId.toString(),i=t&&this.isKnowledgeEnabled()?this.mondayApi.request(i_,{boardId:a},{versionOverride:"dev",timeout:c_}).catch((t=>(this.context?.deps?.logger?.warn({err:t,boardId:e.boardId,timeoutMs:c_},"Failed to fetch board knowledge"),null))):Promise.resolve(null),[n,o]=await Promise.all([p_(this.mondayApi,e),i]);if("not_found"===n.kind)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};if("no_matching_views"===n.kind){const t=n.available.length>0?n.available.join(", "):"(none)";return{content:`None of the requested view names matched on board ${e.boardId}. Requested: ${n.requested.join(", ")}. Available views: ${t}.`}}return{content:(r=n.board,s=n.unmatchedViewNames,d=o?.entity_knowledge??null,p=t,{board:r,...p?{knowledge:d??null}:{},...s.length>0?{unmatchedViewNames:s}:{}})};var r,s,d,p}isV2Enabled(){return this.context?.deps?.flagChecker?.("mcp-get-board-info-v2")??!1}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),n=Boolean(a?.only),o=void 0!==a?.ids,r=Boolean(a?.names?.length),s=!n||i,d=!i||n,p=s?t?.ids:void 0;if(!d)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(!o&&!r)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(o&&!r)return{columnIds:p,viewIds:a?.ids??[],includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};const l=await this.mondayApi.request(t_,{boardId:e.boardId.toString()}),c=l.boards?.[0]?.views??[],m=c.map((e=>e?.name)).filter((e=>Boolean(e))),{viewIds:u,unmatchedViewNames:h}=d_(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===Rm.Subtasks));if(!t)return null;const a=t.settings?.boardIds?.[0];if(!a||a===e.id)return null;const i=await this.mondayApi.request(a_,{boardId:a});return i.boards?.[0]??null}},class extends ae{constructor(){super(...arguments),this.name="get_full_board_data",this.type=b.READ,this.annotations=te({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 Jf}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(Yf,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=a.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&n.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));const o=Array.from(n).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(Qf,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.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:r,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){bm(e,"get full board data")}}},class extends ae{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=b.READ,this.annotations=te({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 Z_}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(q_);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=W_(s),p=await J_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}if(r){if(t||a||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(j_,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const d=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),p=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${d}`,l=await J_(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>Y_)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(a&&e.teamIds&&e.teamIds.length>Q_)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!t&&a&&!i)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(B_,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(M_,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:K_};s=await this.mondayApi.request(F_,t)}else if(t){const t={userIds:e.userIds,limit:K_};s=await this.mondayApi.request(P_,t)}else{const e={userIds:void 0,limit:K_};s=await this.mondayApi.request(V_,e)}const d=W_(s),p=await J_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},Um,class extends ae{constructor(){super(...arguments),this.name="update_items",this.type=b.WRITE,this.annotations=te({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. Always pass the board id, either once as the batch boardId or on each update. For subitems, pass the subitems board id. To link board-relation columns, call link_board_items_workflow before using this tool. Board-relation and dependency responses include linked item IDs up to 1000. Larger lists are omitted with a count and a message confirming the update succeeded. [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?Mm:Bm}async executeInternal(e){const t=e.updates.flatMap(((e,t)=>void 0===e.itemId?[jm(new _m("Item id is required",fm),t)]:[]));if(t.length)throw new _m(`${t.length} of ${e.updates.length} updates are missing the required itemId field`,fm,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));await this.resolveMissingBoardIds(e.updates,i);const n=i.map(((e,t)=>null==e?t:-1)).filter((e=>e>=0));if(n.length>0)throw new _m(`Missing boardId for update(s) at index ${n.join(", ")}, and their board could not be found from the itemId. Set a boardId on each update or provide a batch-level boardId. ${Vm}`,fm);const o="Skipped: a previous update hit a rate limit; this update was not attempted",r=new Um(this.mondayApi),s=e.updates.map(((e,t)=>async()=>{const a=i[t],n=await r.execute({boardId:a,itemId:e.itemId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,board_id:a,...n.content}})),d=await Om(s,{limit:15,onSkipped:e=>({index:e,error:o,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:o,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:jm(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}:{}}}async resolveMissingBoardIds(e,t){const a=[...new Set(e.filter(((e,a)=>null==t[a])).map((e=>e.itemId)))];if(!a.length)return;const i=await this.mondayApi.request(Pm,{itemIds:a.map(String),limit:a.length}),n=new Map((i.items??[]).flatMap((e=>e?.board?[[e.id,Number(e.board.id)]]:[])));let o=0;e.forEach(((e,a)=>{null==t[a]&&(t[a]=n.get(String(e.itemId)),null!=t[a]&&o++)})),o&&(this.sessionContext.metadata??={},this.sessionContext.metadata.board_ids_resolved_from_items=o)}},class extends ae{constructor(){super(...arguments),this.name="move_item_to_group",this.type=b.WRITE,this.annotations=te({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 eb}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId};let a;try{a=await this.mondayApi.request(zc,t)}catch(e){bm(e,"move item to group")}return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends ae{constructor(){super(...arguments),this.name="create_board",this.type=b.WRITE,this.annotations=te({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return cu}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(Jc,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 ae{constructor(){super(...arguments),this.name="use_template",this.type=b.WRITE,this.annotations=te({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 mu}async executeInternal(e){const t={templateId:e.templateId,destinationWorkspaceId:e.destinationWorkspaceId,destinationName:e.destinationName,boardKind:e.boardKind},a=await this.mondayApi.request(dm,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 ae{constructor(){super(...arguments),this.name="check_template_status",this.type=b.READ,this.annotations=te({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 uu}async executeInternal(e){const t={processId:e.processId},a=(await this.mondayApi.request(pm,t)).template_installation_status;return a?a.status===rp.Complete?{content:{status:rp.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===rp.Failed?{content:{status:rp.Failed,board_ids:[],board_ids_map:[],message:"Template application failed. Please try again."}}:a.status===rp.Pending||a.status===rp.InProgress?{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Template application ${a.status===rp.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 ae{constructor(){super(...arguments),this.name="create_form",this.type=b.WRITE,this.annotations=te({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 ah}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(Lu,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends ae{constructor(){super(...arguments),this.name="update_form",this.type=b.WRITE,this.annotations=te({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Wh((()=>this.mondayApi)),this.actionHandlers=new Map([[wh.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[wh.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[wh.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[wh.activate,this.helpers.activateForm.bind(this.helpers)],[wh.createTag,this.helpers.createTag.bind(this.helpers)],[wh.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[wh.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[wh.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[wh.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[wh.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[wh.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 Hh}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 ae{constructor(){super(...arguments),this.name="get_form",this.type=b.READ,this.annotations=te({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 Yh}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Uu,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 ae{constructor(){super(...arguments),this.name="form_questions_editor",this.type=b.WRITE,this.annotations=te({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Ih((()=>this.mondayApi)),this.actionHandlers=new Map([[gh.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[gh.Update,this.helpers.updateQuestion.bind(this.helpers)],[gh.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 vh}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends ae{constructor(){super(...arguments),this.name="create_form_submission",this.type=b.WRITE,this.annotations=te({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 af}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(t){if(t.includes("wkf.ms")){const a=(await e.head(t,{maxRedirects:0,validateStatus:e=>e<400})).headers.location;return a?this.extractTokenFromUrl(a):null}return t.startsWith("http://")||t.startsWith("https://")?this.extractTokenFromUrl(t):t}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(Qh,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){bm(e,"submit form")}}},class extends ae{constructor(){super(...arguments),this.name="create_column",this.type=b.WRITE,this.annotations=te({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 "${au.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?nf:of}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(Xc,a);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends ae{constructor(){super(...arguments),this.name="update_column",this.type=b.WRITE,this.annotations=te({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 "${au.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?rf:sf}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(em,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 ae{constructor(){super(...arguments),this.name="create_group",this.type=b.WRITE,this.annotations=te({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 uf}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(cf,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 ae{constructor(){super(...arguments),this.name="delete_column",this.type=b.WRITE,this.annotations=te({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?qf:Gf}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(Zc,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Tm,class extends Tm{constructor(e,t){super(e,t),this.name="all_api_read",this.type=b.READ,this.annotations=te({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=Xe(e.query);this.recordGraphqlOperationCounts(t);const a=rn(t);if(a?.operation===ge.MUTATION)throw new _m("all_api_read only accepts read queries. Mutations are not allowed.",um);return super.executeInternal(e)}},class extends Tm{constructor(e,t){super(e,t),this.name="all_api_write",this.type=b.WRITE,this.annotations=te({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=Xe(e.query);this.recordGraphqlOperationCounts(t);const a=rn(t);if(a&&a.operation!==ge.MUTATION)throw new _m("all_api_write only accepts mutations. Read queries are not allowed.",um);return super.executeInternal(e)}},class extends ae{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=b.ALL_API,this.annotations=te({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 D_}async executeInternal(e){try{const t=await this.mondayApi.request(tm),a=e?.operationType,i=t.__schema,n="write"!==a?t.queryType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,o="read"!==a?t.mutationType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,r=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!==n&&{query_fields:n},...void 0!==o&&{mutation_fields:o},types:r}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends ae{constructor(){super(...arguments),this.name="get_column_type_info",this.type=b.READ,this.annotations=te({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Retrieves comprehensive information about a specific column type. Use fetchMode "${au.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 "${au.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 S_}async executeInternal(e){if(e.fetchMode===au.Guidelines)return{content:{message:`Column type guidelines for ${e.columnType}`,data:{guidelines:{filter:A_(e.columnType),aggregation:`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${En.CountItems} function. Do not use ${En.Count} function for that purpose.\n `}},url:T_}};const t={type:e.columnType},a=await this.mondayApi.request(w_,t);return a?.get_column_type_schema?{content:{message:`Column type schema for ${e.columnType}`,data:{schema:a.get_column_type_schema},url:T_}}:{content:`Information for column type "${e.columnType}" not found or not available.`}}},class extends ae{constructor(e,t){super("function"==typeof e?()=>Im(e()):Im(e),t),this.name="get_type_details",this.type=b.ALL_API,this.annotations=te({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 N_}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,Bc`
|
|
2977
|
+
`,nI={};const oI=[class extends ae{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=b.READ,this.annotations=te({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 nI}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(iI,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${Rv} 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:`${Vv} 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=Zv(e,kv.SPRINT_TASKS);if(!i)return;const n=Xv(i);if(!n)return;const o=`${e.id}:${n}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,t,a){const i=Zv(e,Mv);if(!i)return;const n=Xv(i);if(!n)return;const o=`${n}:${e.id}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(zv(i)&&this.processSprintsBoard(i,a,t),Jv(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends ae{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=b.READ,this.annotations=te({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 aI}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(tI,a),n=i.boards?.[0],o=n?.items_page?.items||[],r=this.buildSprintsMetadata(o);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:o.length,data:r}}}catch(e){return{content:`${Vv} 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(Qc,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${Rv} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${Fv} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${Vv} 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(kv),i=Qv(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=>Bv[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=Hv(e,Cv.SPRINT_ACTIVATION),a=Hv(e,Cv.SPRINT_COMPLETION),i=Wv(e,Cv.SPRINT_START_DATE),n=Wv(e,Cv.SPRINT_END_DATE),o=((e,t)=>{const a=Gv(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,Cv.SPRINT_TIMELINE),r=Yv(e,Cv.SPRINT_SUMMARY);let s=jv.Planned;return a?s=jv.Completed:(t||i)&&(s=jv.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:i||null,end_date:n||null,is_completed:a,document_object_id:r||null}}))}},class extends ae{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=b.READ,this.annotations=te({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 eI}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${Vv} 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||`${Vv} Unknown error occurred while reading document content`}}catch(e){return{content:`${Vv} 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(Ov,t)).items||[];if(0===a.length)return{success:!1,error:`${$v} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${$v} Sprint with ID ${e} not found.`};const n=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(kv),...t];return Qv(a,i)})(i,[Cv.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${Fv} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=Yv(i,Cv.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${xv} 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:`${Vv} 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(jc,t)).docs||[];if(0===a.length)return{success:!1,error:`${xv} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${Lv} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(rm,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${Pv} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const r=o.export_markdown_from_doc.markdown;return r?{success:!0,content:r}:{success:!1,error:`${Uv} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${Vv} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],rI=[class extends ae{constructor(){super(...arguments),this.name="delete_item",this.type=b.WRITE,this.annotations=te({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Hf}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(Wc,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends ae{constructor(){super(...arguments),this.name="get_board_items_page",this.type=b.READ,this.annotations=te({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 v_}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){gm(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(u_,a);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:$s.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],i=a?.items_page,n=i?.items||[];return{board:{id:a?.id,name:a?.name,hierarchy_type:a?.hierarchy_type||null},items:n.map((e=>this.mapItem(e,t))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,t){const a=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 Rm.BoardRelation:return e.linked_items;case Rm.Formula:return e.display_value;case Rm.Mirror:return"Column value type is not supported"}if("battery_value"in e)return e.battery_value;if(e.type===Rm.Status)return e.text??null;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(h_,t,{versionOverride:"dev",timeout:Nm})).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 n=new Set(i);return a.filter((e=>n.has(e)))}},gf,class extends ae{constructor(){super(...arguments),this.name="create_items",this.type=b.WRITE,this.annotations=te({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?yf:vf}async executeInternal(e){const t=e.items.flatMap(((e,t)=>void 0===e.name?[Tf(new _m("Item name is required",fm),t)]:[]));if(t.length)throw new _m(`${t.length} of ${e.items.length} items are missing the required name field`,fm,t);const a=this.context?.boardId??e.boardId;this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.items.length;const i=new gf(this.mondayApi,{boardId:a}),n="Skipped: a previous item hit a rate limit; this item was not attempted",o=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}})),r=await Om(o,{limit:15,concurrencyGroups:{getGroup:t=>e.items[t].parentItemId,limitPerGroup:5},onSkipped:e=>({index:e,error:n,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:n,path:["results",e]}}),onError:(t,a)=>({index:a,error:wf(t,e.items[a].parentItemId),_errorEntry:Tf(t,a)})}),s=r.filter((e=>"error"in e)).map((e=>e._errorEntry)),d=r.map((({_errorEntry:e,...t})=>t)),p=r.length,l=s.length,c={board_id:a,summary:{total:p,created:p-l,failed:l},is_partial_success:l>0&&l<p,results:d};return s.length&&(c.errors=s),{content:c,...l===p?{isError:!0}:{}}}},kf,class extends ae{constructor(){super(...arguments),this.name="create_updates",this.type=b.WRITE,this.annotations=te({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 Cf}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 kf(this.mondayApi),i=e.updates.map(((e,t)=>async()=>{const i=await a.execute(e);return{index:t,...i.content}})),n=await Om(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:Rf(e,t)})}),o=n.filter((e=>"error"in e)).map((e=>e._errorEntry)),r=n.map((({_errorEntry:e,...t})=>t)),s=n.length,d=o.length,p={summary:{total:s,created:s-d,failed:d},is_partial_success:d>0&&d<s,results:r};return o.length&&(p.errors=o),{content:p,...d===s?{isError:!0}:{}}}},class extends ae{constructor(){super(...arguments),this.name="delete_update",this.type=b.WRITE,this.annotations=te({title:"Delete Update",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an update (comment/post) from a monday.com item."}getInputSchema(){return xf}async executeInternal(e){try{const t={id:e.id.toString()},a=await this.mondayApi.request($f,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){bm(e,"delete update")}}},class extends ae{constructor(){super(...arguments),this.name="get_updates",this.type=b.READ,this.annotations=te({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 Ff}async executeInternal(e){try{const t=void 0!==e.fromDate;if(t!==(void 0!==e.toDate))throw new _m("Both fromDate and toDate must be provided together for date range filtering",lm);const a=[...new Set([...e.objectIds??[],...e.objectId?[e.objectId]:[]])];if(0===a.length)throw new _m("Provide the IDs to read in objectIds",lm);if(a.length>25)throw new _m("objectIds takes up to 25 IDs",lm);if(e.objectType===Pf.Board&&1!==a.length)throw new _m("Board queries take exactly one board ID in objectIds",lm);const i=e.fromDate?Mf(e.fromDate):void 0,n=e.toDate?Mf(e.toDate,!0):void 0,o={page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};if(e.objectType===Pf.Item){const t=e.limit??(a.length>1?10:25),r=((await this.mondayApi.request(Lf,{...o,limit:t,itemIds:a,itemsLimit:a.length})).items??[]).filter((e=>!!e)),s=new Set(r.map((e=>e.id))),d=a.filter((e=>!s.has(e)));return{content:{message:"Updates retrieved",items:r.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,n))).map((t=>jf(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[r]=a,s=e.limit??25,d=await this.mondayApi.request(Uf,{...o,limit:s,boardId:r,boardUpdatesOnly:!e.includeItemUpdates,...i&&n?{fromDate:i,toDate:n}:{}}),p=d.boards?.[0],l=p?.updates;if(!l||0===l.length)return{content:`No updates found for board with id ${r}`};const c=l.map((t=>jf(t,e)));return{content:{message:"Updates retrieved",board_id:r,url:p?.url,updates:c,pagination:{page:e.page??1,limit:s,count:c.length}}}}catch(e){bm(e,"get updates")}}},class extends ae{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=b.WRITE,this.annotations=te({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 ry}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=oy.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(Af,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){bm(e,"create update")}}},class extends ae{constructor(){super(...arguments),this.name="get_board_schema",this.type=b.READ,this.annotations=te({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 I_}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(Qc,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 ae{constructor(){super(...arguments),this.name="get_board_activity",this.type=b.READ,this.annotations=te({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3,this.maxLookbackDays=90}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days, up to the last 90 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 Zf}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-Dm.MONTH30Days),i=new Date(t.getTime()-this.maxLookbackDays*Dm.DAY);let n=e?.fromDate||a.toISOString();const o=new Date(n).getTime()<i.getTime();o&&(n=i.toISOString());const r=o?`. Note: fromDate was limited to the last ${this.maxLookbackDays} days, so the range starts at ${n}`:"",s=e?.toDate||t.toISOString(),d={boardId:e.boardId.toString(),itemIds:e.itemIds?.map(String),userIds:e.userIds?.map(String),fromDate:n,toDate:s,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},p=await this.mondayApi.request(Xf,d,{versionOverride:"2026-10"}),l=p.boards?.[0]?.activity_logs;if(!l||0===l.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${n} to ${s})${r}.`};const c=p.boards?.[0],m=e.includeData??!1;return{content:{message:`Board activity retrieved${r}`,board_id:e.boardId,board_name:c?.name,board_url:c?.url,data:l.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...m&&e.data?{data:e.data}:{}})))}}}},class extends ae{constructor(e,t,a){super(e,a),this.name="get_board_info",this.type=b.READ,this.annotations=te({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 m_}async executeInternal(e){if(this.isV2Enabled())return this.executeV2(e);const{columnIds:t,viewIds:a,includeColumns:i,includeViews:n,unmatchedViewNames:o,availableViewNames:r}=await this.resolveFiltersAsync(e);if(e.filters?.views?.names?.length&&n&&void 0!==a&&0===a.length){const t=r.length>0?r.join(", "):"(none)";return{content:`None of the requested view names matched on board ${e.boardId}. Requested: ${e.filters.views.names.join(", ")}. Available views: ${t}.`}}const s={boardId:e.boardId.toString(),columnIds:i?t:void 0,viewIds:n?a:void 0,includeColumns:i,includeViews:n,includeSubscribers:!0===e.includeSubscribers},d=this.mondayApi.request(e_,s,{versionOverride:"2027-04"}),p=!0===e.includeKnowledge,l=p&&this.isKnowledgeEnabled()?this.mondayApi.request(i_,{boardId:e.boardId.toString()},{versionOverride:"dev",timeout:c_}).catch((t=>(this.context?.deps?.logger?.warn({err:t,boardId:e.boardId,timeoutMs:c_},"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:r_(u,h,o,m?.entity_knowledge??null,p)}}async executeV2(e){const t=!0===e.includeKnowledge,a=e.boardId.toString(),i=t&&this.isKnowledgeEnabled()?this.mondayApi.request(i_,{boardId:a},{versionOverride:"dev",timeout:c_}).catch((t=>(this.context?.deps?.logger?.warn({err:t,boardId:e.boardId,timeoutMs:c_},"Failed to fetch board knowledge"),null))):Promise.resolve(null),[n,o]=await Promise.all([p_(this.mondayApi,e),i]);if("not_found"===n.kind)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};if("no_matching_views"===n.kind){const t=n.available.length>0?n.available.join(", "):"(none)";return{content:`None of the requested view names matched on board ${e.boardId}. Requested: ${n.requested.join(", ")}. Available views: ${t}.`}}return{content:(r=n.board,s=n.unmatchedViewNames,d=o?.entity_knowledge??null,p=t,{board:r,...p?{knowledge:d??null}:{},...s.length>0?{unmatchedViewNames:s}:{}})};var r,s,d,p}isV2Enabled(){return this.context?.deps?.flagChecker?.("mcp-get-board-info-v2")??!1}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),n=Boolean(a?.only),o=void 0!==a?.ids,r=Boolean(a?.names?.length),s=!n||i,d=!i||n,p=s?t?.ids:void 0;if(!d)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(!o&&!r)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(o&&!r)return{columnIds:p,viewIds:a?.ids??[],includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};const l=await this.mondayApi.request(t_,{boardId:e.boardId.toString()}),c=l.boards?.[0]?.views??[],m=c.map((e=>e?.name)).filter((e=>Boolean(e))),{viewIds:u,unmatchedViewNames:h}=d_(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===Rm.Subtasks));if(!t)return null;const a=t.settings?.boardIds?.[0];if(!a||a===e.id)return null;const i=await this.mondayApi.request(a_,{boardId:a});return i.boards?.[0]??null}},class extends ae{constructor(){super(...arguments),this.name="get_full_board_data",this.type=b.READ,this.annotations=te({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 Jf}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(Yf,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=a.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&n.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));const o=Array.from(n).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(Qf,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.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:r,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){bm(e,"get full board data")}}},class extends ae{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=b.READ,this.annotations=te({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 Z_}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(q_);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=W_(s),p=await J_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}if(r){if(t||a||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(j_,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const d=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),p=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${d}`,l=await J_(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>Y_)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(a&&e.teamIds&&e.teamIds.length>Q_)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!t&&a&&!i)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(B_,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(M_,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:K_};s=await this.mondayApi.request(F_,t)}else if(t){const t={userIds:e.userIds,limit:K_};s=await this.mondayApi.request(P_,t)}else{const e={userIds:void 0,limit:K_};s=await this.mondayApi.request(V_,e)}const d=W_(s),p=await J_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},Um,class extends ae{constructor(){super(...arguments),this.name="update_items",this.type=b.WRITE,this.annotations=te({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. Always pass the board id, either once as the batch boardId or on each update. For subitems, pass the subitems board id. To link board-relation columns, call link_board_items_workflow before using this tool. Board-relation and dependency responses include linked item IDs up to 1000. Larger lists are omitted with a count and a message confirming the update succeeded. [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?Mm:Bm}async executeInternal(e){const t=e.updates.flatMap(((e,t)=>void 0===e.itemId?[jm(new _m("Item id is required",fm),t)]:[]));if(t.length)throw new _m(`${t.length} of ${e.updates.length} updates are missing the required itemId field`,fm,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));await this.resolveMissingBoardIds(e.updates,i);const n=i.map(((e,t)=>null==e?t:-1)).filter((e=>e>=0));if(n.length>0)throw new _m(`Missing boardId for update(s) at index ${n.join(", ")}, and their board could not be found from the itemId. Set a boardId on each update or provide a batch-level boardId. ${Vm}`,fm);const o="Skipped: a previous update hit a rate limit; this update was not attempted",r=new Um(this.mondayApi),s=e.updates.map(((e,t)=>async()=>{const a=i[t],n=await r.execute({boardId:a,itemId:e.itemId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,board_id:a,...n.content}})),d=await Om(s,{limit:15,onSkipped:e=>({index:e,error:o,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:o,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:jm(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}:{}}}async resolveMissingBoardIds(e,t){const a=[...new Set(e.filter(((e,a)=>null==t[a])).map((e=>e.itemId)))];if(!a.length)return;const i=await this.mondayApi.request(Pm,{itemIds:a.map(String),limit:a.length}),n=new Map((i.items??[]).flatMap((e=>e?.board?[[e.id,Number(e.board.id)]]:[])));let o=0;e.forEach(((e,a)=>{null==t[a]&&(t[a]=n.get(String(e.itemId)),null!=t[a]&&o++)})),o&&(this.sessionContext.metadata??={},this.sessionContext.metadata.board_ids_resolved_from_items=o)}},class extends ae{constructor(){super(...arguments),this.name="move_item_to_group",this.type=b.WRITE,this.annotations=te({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 eb}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId};let a;try{a=await this.mondayApi.request(zc,t)}catch(e){bm(e,"move item to group")}return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends ae{constructor(){super(...arguments),this.name="create_board",this.type=b.WRITE,this.annotations=te({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return cu}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(Jc,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 ae{constructor(){super(...arguments),this.name="use_template",this.type=b.WRITE,this.annotations=te({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 mu}async executeInternal(e){const t={templateId:e.templateId,destinationWorkspaceId:e.destinationWorkspaceId,destinationName:e.destinationName,boardKind:e.boardKind},a=await this.mondayApi.request(dm,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 ae{constructor(){super(...arguments),this.name="check_template_status",this.type=b.READ,this.annotations=te({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 uu}async executeInternal(e){const t={processId:e.processId},a=(await this.mondayApi.request(pm,t)).template_installation_status;return a?a.status===rp.Complete?{content:{status:rp.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===rp.Failed?{content:{status:rp.Failed,board_ids:[],board_ids_map:[],message:"Template application failed. Please try again."}}:a.status===rp.Pending||a.status===rp.InProgress?{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Template application ${a.status===rp.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 ae{constructor(){super(...arguments),this.name="create_form",this.type=b.WRITE,this.annotations=te({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 ah}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(Lu,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends ae{constructor(){super(...arguments),this.name="update_form",this.type=b.WRITE,this.annotations=te({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Wh((()=>this.mondayApi)),this.actionHandlers=new Map([[wh.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[wh.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[wh.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[wh.activate,this.helpers.activateForm.bind(this.helpers)],[wh.createTag,this.helpers.createTag.bind(this.helpers)],[wh.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[wh.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[wh.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[wh.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[wh.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[wh.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 Hh}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 ae{constructor(){super(...arguments),this.name="get_form",this.type=b.READ,this.annotations=te({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 Yh}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Uu,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 ae{constructor(){super(...arguments),this.name="form_questions_editor",this.type=b.WRITE,this.annotations=te({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Ih((()=>this.mondayApi)),this.actionHandlers=new Map([[gh.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[gh.Update,this.helpers.updateQuestion.bind(this.helpers)],[gh.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 vh}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends ae{constructor(){super(...arguments),this.name="create_form_submission",this.type=b.WRITE,this.annotations=te({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 af}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(t){if(t.includes("wkf.ms")){const a=(await e.head(t,{maxRedirects:0,validateStatus:e=>e<400})).headers.location;return a?this.extractTokenFromUrl(a):null}return t.startsWith("http://")||t.startsWith("https://")?this.extractTokenFromUrl(t):t}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(Qh,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){bm(e,"submit form")}}},class extends ae{constructor(){super(...arguments),this.name="create_column",this.type=b.WRITE,this.annotations=te({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 "${au.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?nf:of}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(Xc,a);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends ae{constructor(){super(...arguments),this.name="update_column",this.type=b.WRITE,this.annotations=te({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 "${au.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?rf:sf}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(em,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 ae{constructor(){super(...arguments),this.name="create_group",this.type=b.WRITE,this.annotations=te({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 uf}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(cf,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 ae{constructor(){super(...arguments),this.name="delete_column",this.type=b.WRITE,this.annotations=te({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?qf:Gf}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(Zc,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Tm,class extends Tm{constructor(e,t){super(e,t),this.name="all_api_read",this.type=b.READ,this.annotations=te({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=Xe(e.query);this.recordGraphqlOperationCounts(t);const a=rn(t);if(a?.operation===ge.MUTATION)throw new _m("all_api_read only accepts read queries. Mutations are not allowed.",um);return super.executeInternal(e)}},class extends Tm{constructor(e,t){super(e,t),this.name="all_api_write",this.type=b.WRITE,this.annotations=te({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=Xe(e.query);this.recordGraphqlOperationCounts(t);const a=rn(t);if(a&&a.operation!==ge.MUTATION)throw new _m("all_api_write only accepts mutations. Read queries are not allowed.",um);return super.executeInternal(e)}},class extends ae{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=b.ALL_API,this.annotations=te({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 D_}async executeInternal(e){try{const t=await this.mondayApi.request(tm),a=e?.operationType,i=t.__schema,n="write"!==a?t.queryType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,o="read"!==a?t.mutationType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,r=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!==n&&{query_fields:n},...void 0!==o&&{mutation_fields:o},types:r}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends ae{constructor(){super(...arguments),this.name="get_column_type_info",this.type=b.READ,this.annotations=te({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Retrieves comprehensive information about a specific column type. Use fetchMode "${au.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 "${au.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 S_}async executeInternal(e){if(e.fetchMode===au.Guidelines)return{content:{message:`Column type guidelines for ${e.columnType}`,data:{guidelines:{filter:A_(e.columnType),aggregation:`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${En.CountItems} function. Do not use ${En.Count} function for that purpose.\n `}},url:T_}};const t={type:e.columnType},a=await this.mondayApi.request(w_,t);return a?.get_column_type_schema?{content:{message:`Column type schema for ${e.columnType}`,data:{schema:a.get_column_type_schema},url:T_}}:{content:`Information for column type "${e.columnType}" not found or not available.`}}},class extends ae{constructor(e,t){super("function"==typeof e?()=>Im(e()):Im(e),t),this.name="get_type_details",this.type=b.ALL_API,this.annotations=te({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 N_}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,Bc`
|
|
2978
2978
|
query getTypeDetails {
|
|
2979
2979
|
__type(name: "${t}") {
|
|
2980
2980
|
name
|
|
@@ -3062,5 +3062,5 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
|
|
|
3062
3062
|
}
|
|
3063
3063
|
}
|
|
3064
3064
|
}
|
|
3065
|
-
`),i=await this.mondayApi.request(a);return i.__type?{content:{message:"Type details retrieved",data:{name:i.__type.name,kind:i.__type.kind,description:i.__type.description??null,fields:i.__type.fields??[],inputFields:i.__type.inputFields??[],interfaces:i.__type.interfaces??[],enumValues:i.__type.enumValues??[],possibleTypes:i.__type.possibleTypes??[]}}}:{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`}}catch(e){const t=e instanceof Error?e.message:"Unknown error",a=t.includes("JSON");return{content:`Error fetching type details: ${t}${a?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var t}},class extends ae{constructor(){super(...arguments),this.name="create_custom_activity",this.type=b.WRITE,this.annotations=te({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return df}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(im,t),{content:{message:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`,name:e.name,color:e.color,icon_id:e.icon_id}}}},class extends ae{constructor(){super(...arguments),this.name="create_notification",this.type=b.WRITE,this.annotations=te({title:"Create Notification",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Send a notification to a user via the bell icon and optionally by email. Use target_type "Post" for updates/replies or "Project" for items/boards.'}getInputSchema(){return lf}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{const a=await this.mondayApi.request(pf,t);if(!a.create_notification?.id)throw new _m(`No notification was created for user ${e.user_id} on ${e.target_type} target ${e.target_id}. Verify the user has access to the target and that target_id matches target_type ("Post" for an update/reply id, "Project" for an item/board id).`,hm);return{content:{message:`Notification ${a.create_notification.id} sent to user ${e.user_id}`,notification_id:a.create_notification.id,user_id:e.user_id,target_id:e.target_id,target_type:e.target_type,text:a.create_notification.text??e.text}}}catch(t){bm(t,`send notification to user ${e.user_id}`)}}},class extends ae{constructor(){super(...arguments),this.name="create_timeline_item",this.type=b.WRITE,this.annotations=te({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return Ef}async executeInternal(e){const t={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(t.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const a=await this.mondayApi.request(nm,t);return{content:{message:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`,timeline_item_id:a.create_timeline_item?.id,item_id:e.item_id,title:e.title}}}},class extends ae{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=b.READ,this.annotations=te({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return Wf}async executeInternal(e){const t=await this.mondayApi.request(om);if(!t.custom_activity||0===t.custom_activity.length)return{content:{message:"No custom activities found",data:[]}};const a=t.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:{message:`Found ${a.length} custom activities`,data:a}}}},class extends ae{constructor(){super(...arguments),this.name="read_docs",this.type=b.READ,this.annotations=te({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get information about monday.com documents. Supports two modes:\n\nMODE: "content" (default) — Fetch documents with their full markdown content.\n- Requires: type ("ids" | "object_ids" | "workspace_ids") and ids array\n- For a doc that lives as a board view, pass board_id and view_id instead of type/ids. They are the ids in the board URL: https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Omit view_id to read every doc view of the board. Such docs cannot be found by type "ids"/"object_ids".\n- Supports pagination via page/limit. Check has_more_pages in response.\n- If type "ids" returns no results, automatically retries with object_ids.\n- Set include_blocks: true to include block IDs, types, and positions in the response — required before calling update_doc.\n- Blocks default to 25 per page. Use blocks_limit and blocks_page to paginate through long documents.\n- Set include_comments: true to fetch all comments and replies on the document. Each comment is enriched with anchor info (block_id, selection_from, selection_length) indicating which block and text range it\'s attached to. Use comments_limit to control how many comments per item (default 50).\n\nMODE: "version_history" — Fetch the edit history of a single document.\n- Requires: ids with the document\'s object_id (use the object_id field from content mode results, NOT the id field).\n- The object_id is the numeric ID visible in the document URL.\n- Returns restoring points sorted newest-first. Use version_history_limit to cap results (e.g., "last 3 changes" → version_history_limit: 3).\n- Use since/until to filter by time range. If omitted, returns full history.\n- Set include_diff: true to see what content changed between versions (fetches up to 10 diffs, may be slower).\n- Examples:\n - { mode: "version_history", ids: ["5001466606"], version_history_limit: 3 }\n - { mode: "version_history", ids: ["5001466606"], since: "2026-03-11T00:00:00Z", include_diff: true }'}getInputSchema(){return yb}async executeInternal(e){return e.mode===bb?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!(e.board_id||e.type&&e.ids&&0!==e.ids.length))throw new _m('type and ids are required when mode is "content", unless board_id is provided.',fm);let t,a,i;switch(this.sessionContext.metadata={...this.sessionContext.metadata,mode:e.mode??_b,include_comments:e.include_comments??!1,include_blocks:e.include_blocks??!1,...e.board_id&&{board_id:e.board_id,view_id:e.view_id}},e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":i=e.ids}const n=e.include_blocks??!1,o=n?{blocksLimit:e.blocks_limit,blocksPage:e.blocks_page}:{},r={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n,...o};if(e.board_id){const t=await ub(this.mondayApi,e.board_id,e.view_id,{includeBlocks:n,blocksLimit:e.blocks_limit,blocksPage:e.blocks_page});return 0===t.length?{content:fb(e.board_id,e.view_id)}:(this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:t.map((e=>e.id)),object_ids:t.flatMap((e=>e.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(t,r,n,e.include_comments??!1,e.comments_limit??50,e.blocks_limit,e.blocks_page))}let s=await this.mondayApi.request(jc,r);if((!s.docs||0===s.docs.length)&&t){const a={ids:void 0,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n,...o};s=await this.mondayApi.request(jc,a)}if(!s.docs||0===s.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const d=e.include_comments??!1,p=e.comments_limit??50;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:s.docs.flatMap((e=>e?[e.id]:[])),object_ids:s.docs.flatMap((e=>e?.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(s.docs,r,n,d,p,e.blocks_limit,e.blocks_page)}catch(e){bm(e,"read documents")}}async executeVersionHistory(e){const{include_diff:t,since:a,until:i,version_history_limit:n}=e,o=e.ids?.[0];if(!o)throw new _m('ids is required when mode is "version_history". Provide the document object_id.',fm);this.sessionContext.metadata={...this.sessionContext.metadata,mode:bb,object_ids:[o]};try{const e={docId:o,since:a,until:i},r=await this.mondayApi.request(qc,e);let s=r?.doc_version_history?.restoring_points;if(!s||0===s.length)return{content:`No version history found for document ${o}${a?` from ${a}`:""}.`};if(!t)return n&&(s=s.slice(0,n)),{content:{doc_id:o,since:a,until:i,restoring_points:s}};const d=Math.min(n??10,10),p=s.slice(0,d+1),l=s.length>d,c=(await Promise.allSettled(p.map((async(e,t)=>{if(t===p.length-1||!e.date)return e;const a=p[t+1];if(!a?.date)return e;const i={docId:o,date:e.date,prevDate:a.date},n=await this.mondayApi.request(Hc,i);return{...e,diff:n?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,t)=>"fulfilled"===e.status?e.value:p[t]))))).slice(0,d);return{content:{doc_id:o,since:a,until:i,restoring_points:c,...l&&{truncated:!0,total_count:s.length}}}}catch(e){bm(e,`fetch version history for document ${o}`)}}buildCommentAnchorMap(e){const t=new Map;for(const a of e){const e=a.content?.deltaFormat;if(!e||!Array.isArray(e))continue;let i=0;for(const n of e){const e=n.insert,o="string"==typeof e?e.length:1,r=n.attributes,s=r?.comments;if(s&&Array.isArray(s))for(const e of s){const n=String(e),r=t.get(n);if(r&&r.block_id===a.id){const e=Math.max(r.selection_from+r.selection_length,i+o);r.selection_length=e-r.selection_from}else r||t.set(n,{block_id:a.id,selection_from:i,selection_length:o})}i+=o}}return t}async fetchDocComments(e,t,a){try{const i={boardId:e,itemsLimit:100,updatesLimit:a},[n,o]=await Promise.all([this.mondayApi.request(Gc,i),this.mondayApi.request(pb,{docId:t}).catch((()=>null))]),r=n.boards?.[0]?.items_page?.items;if(!r)return[];let s=new Map;if(o){const e=(o.docs?.[0]?.blocks??[]).filter((e=>null!=e)).map((e=>{let t;if("string"==typeof e.content)try{t=JSON.parse(e.content)}catch{t={}}else t=e.content??{};return{id:e.id??"",type:e.type??"",content:t}}));s=this.buildCommentAnchorMap(e)}const d=[];for(const e of r)if(e.updates&&0!==e.updates.length)for(const t of e.updates)d.push({id:t.id,text_body:t.text_body,body:t.body,created_at:t.created_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:e.id,item_name:e.name,anchor:s.get(t.id)??null,replies:(t.replies??[]).map((e=>({id:e.id,text_body:e.text_body,body:e.body,created_at:e.created_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))});return d}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,i=!1,n=50,o,r){const s=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t,s="";try{const t={docId:e.id},a=await this.mondayApi.request(rm,t);s=a.export_markdown_from_doc.success&&a.export_markdown_from_doc.markdown?a.export_markdown_from_doc.markdown:`Error getting markdown: ${a.export_markdown_from_doc.error||"Unknown error"}`}catch(e){s=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return i&&e.object_id&&(t=await this.fetchDocComments(e.object_id,e.id,n)),{id:e.id,object_id:e.object_id,name:e.name,doc_kind:e.doc_kind,created_at:e.created_at,created_by:e.created_by?.name||"Unknown",url:e.url,relative_url:e.relative_url,workspace:e.workspace?.name||"Unknown",workspace_id:e.workspace_id,doc_folder_id:e.doc_folder_id,settings:e.settings,...a&&{blocks:(e.blocks??[]).filter((e=>null!=e)).map((e=>({id:e.id,type:e.type,parent_block_id:e.parent_block_id,position:e.position,content:e.content}))),...void 0!==o||void 0!==r?{blocks_pagination:{current_page:r??1,limit:o??25,count:(e.blocks??[]).filter((e=>null!=e)).length,has_more_pages:(e.blocks??[]).length===(o??25)}}:{}},blocks_as_markdown:s,...i&&{comments:t}}}))),d=t.page||1,p=t.limit||25,l=s.length,c=l===p;return{content:{message:`Documents retrieved (${s.length})`,pagination:{current_page:d,limit:p,count:l,has_more_pages:c},data:s}}}},class extends ae{constructor(){super(...arguments),this.name="workspace_info",this.type=b.READ,this.annotations=te({title:"Get Workspace Information",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool returns the boards, docs and folders in a workspace and which folder they are in. It returns up to 100 of each object type, if you receive 100 assume there are additional objects of that type in the workspace."}getInputSchema(){return vb}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(sm,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e,t){const{workspaces:a,boards:i,docs:n,folders:o}=e,r=a?.[0];if(!r)throw new Error("No workspace found");const s=new Map((o||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),d=[];(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(t):d.push(t)}));const p=[];return(n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.doc_folder_id&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(t):p.push(t)})),{workspace:{id:r.id,name:r.name,url:t?X_(t,r.id):void 0,description:r.description||"",kind:r.kind||"",created_at:r.created_at||"",state:r.state||"",is_default_workspace:r.is_default_workspace||!1,owners_subscribers:(r.owners_subscribers||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name&&null!=e.email)).map((e=>({id:e.id,name:e.name,email:e.email})))},folders:Array.from(s.values()),root_items:{boards:d,docs:p}}}(a,await J_(this.mondayApi));return{content:{message:"Workspace info retrieved",data:i}}}},class extends ae{constructor(){super(...arguments),this.name="list_workspaces",this.type=b.READ,this.annotations=te({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'List all workspaces available to the user, ordered by membership (user\'s workspaces first). Returns workspaces with their ID, name, and description.\n[IMPORTANT] To search for workspaces by name, use the "search" tool with searchType WORKSPACES instead — it provides faster and more accurate results.'}getInputSchema(){return Eb}async executeInternal(e){const t=t=>({limit:e.limit,page:e.page,membershipKind:t}),a=wb(await this.mondayApi.request(Ib,t(bl.Member)));let i=a;if(!Tb(a)){i=wb(await this.mondayApi.request(Ib,t(bl.All)))}if(!Tb(i))return{content:{message:"No workspaces found.",data:[]}};const n=i.length===e.limit,o=await J_(this.mondayApi),r=i.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:o&&e.id?X_(o,e.id):void 0})));return{content:{message:"Workspaces retrieved",...n?{next_page:e.page+1}:{},data:r}}}},class extends ae{constructor(){super(...arguments),this.name="create_doc",this.type=b.WRITE,this.annotations=te({title:"Create Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a new monday.com doc either inside a workspace or attached to an item (via a doc column). After creation, the provided markdown will be appended to the document.\n\nLOCATION TYPES:\n- workspace: Creates a document in a workspace (requires workspace_id, optional doc_kind, optional folder_id, optional docOwnerIds)\n- item: Creates a document attached to an item (requires item_id, optional column_id, optional docOwnerIds)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_name: "My Doc", doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, doc_name: "My Doc", folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, doc_name: "My Doc", column_id: "doc_col_1" , markdown: "..." }\n- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, doc_name: "My Doc", markdown: "...", docOwnerIds: ["<agent_owner_user_id>"] }'}getInputSchema(){return Rb}async executeInternal(e){const t=Cb.safeParse({...e,type:e.location});if(!t.success)throw new _m(`Required parameters were not provided for location parameter of ${e.location}`,lm);const a=t.data;try{let t,i,n;if(a.type===kb.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||oo.Public,folder_id:a.folder_id?.toString()}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}},r=await this.mondayApi.request(Db,o);t=r?.create_doc?.id??void 0,i=r?.create_doc?.object_id??void 0,n=r?.create_doc?.url??void 0}else if(a.type===kb.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(Ab,o),s=r.items?.[0];if(!s)throw new _m(`Item with id ${a.item_id} not found.`,hm);const d=s.board?.id,p=s.board?.columns?.find((e=>e&&e.type===Rm.Doc));let l=a.column_id;if(l){const e=s.board?.columns?.find((e=>e?.id===l));if(!e||e.type!==Rm.Doc)throw new _m(`Column ${l} is not a doc column on board ${d}.`,lm)}else if(p)l=p.id;else{const e={boardId:d.toString(),columnType:Rm.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(Xc,e);if(l=t?.create_column?.id,!l)throw new _m("Failed to create doc column.",hm)}const c={location:{board:{item_id:a.item_id.toString(),column_id:l}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}};let m;try{m=await this.mondayApi.request(Db,c)}catch(t){if(this.hasCellLimitExceeded(t)){const t=await this.getExistingItemDoc(a.item_id,l).catch((()=>{}));if(t)return this.existingItemDocResult(t,e.location)}throw t}if(t=m.create_doc?.id??void 0,i=m.create_doc?.object_id??void 0,n=m.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(Ob,a)}catch(e){console.warn("Failed to update doc name:",e)}}if(!t)throw new _m("Failed to create document.",hm);const o={docId:t,markdown:e.markdown};let r;try{r=await this.mondayApi.request(Nb,o)}catch(a){return this.createdDocContentFailureResult(a,t,i,n,e.doc_name)}const s=r?.add_content_to_doc_from_markdown?.success,d=r?.add_content_to_doc_from_markdown?.error;if(!s){const a=new _m(`Failed to add markdown content: ${d||"Unknown error"}`,cm);return this.createdDocContentFailureResult(a,t,i,n,e.doc_name)}return this.sessionContext.metadata={...this.sessionContext.metadata,location:e.location,...t&&{doc_id:t},...i&&{object_id:i}},{content:{message:"Document successfully created",doc_id:t,object_id:i,doc_url:n,doc_name:e.doc_name}}}catch(e){bm(e,"create document")}}async getExistingItemDoc(e,t){const a={itemId:e.toString(),columnId:t},i=await this.mondayApi.request(Sb,a),n=i.items?.[0]?.column_values?.find((e=>e?.id===t));return"DocValue"===n?.__typename?n.file?.doc:void 0}existingItemDocResult(e,t){return this.sessionContext.metadata={...this.sessionContext.metadata,location:t,doc_id:e.id,object_id:e.object_id},{content:{message:"The item already has a document in this column. The existing document was returned unchanged. The requested doc_name and markdown were not applied. Call add_content_to_doc with this doc_id to add the markdown, and update_doc to set the name.",doc_id:e.id,object_id:e.object_id,doc_url:e.url,doc_name:e.name,existing_doc_found:!0}}}createdDocContentFailureResult(e,t,a,i,n){const o=vm(e);return{content:{message:`Document ${t} was created, but its content could not be added: ${o.message}`,doc_id:t,object_id:a,doc_url:i,doc_name:n,is_partial_success:!0,errors:(o.errors??[]).map((e=>({...e,path:["markdown",...e.path??[]]})))}}}hasCellLimitExceeded(e){return["CellLimitExceededException","CellLimitExceeded"].some((t=>this.hasGraphQLErrorCode(e,t)))}hasGraphQLErrorCode(e,t){return!0===e?.response?.errors?.some((e=>e.extensions?.code===t))}},class extends ae{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=b.WRITE,this.annotations=te({title:"Add Content to Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add markdown content to an existing monday.com document.\n\nIDENTIFICATION: Provide doc_id, object_id, or board_id + view_id to identify the document:\n- doc_id: The document ID (the id field returned by read_docs). Takes priority if both provided.\n- object_id: The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id.\n- board_id + view_id: For a doc that lives as a board view, taken from https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Such docs have no usable doc_id/object_id until they are resolved through their board.\n\nUSAGE EXAMPLES:\n- By doc_id: { doc_id: "123", markdown: "# New Section\\nContent here" }\n- By object_id: { object_id: "456", markdown: "# New Section\\nContent here" }\n- By board view: { board_id: "18429976879", view_id: "279510271", markdown: "# New Section\\nContent here" }\n- Insert after block: { doc_id: "123", markdown: "Inserted content", after_block_id: "block_789" }'}getInputSchema(){return Ub}async executeInternal(e){if(!e.doc_id&&!e.object_id&&!e.board_id)throw new _m("Either doc_id, object_id, or board_id (with view_id) must be provided.",fm);try{let t=null;if(e.doc_id||e.object_id||!e.board_id)if(e.doc_id){const a=await this.mondayApi.request(Lb,{docId:e.doc_id});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(xb,{objectId:e.object_id});t=a.docs?.[0]??null}else{const a=await hb(this.mondayApi,e.board_id,e.view_id);if(!a.ok)throw new _m(a.error,cm);t=a.doc}if(!t){const t=e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`;throw new _m(`No document found for ${t}.`,hm)}this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t.id,...e.object_id&&{object_id:e.object_id},...e.board_id&&{board_id:e.board_id,view_id:e.view_id}};const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},i=await this.mondayApi.request($b,a);if(!i?.add_content_to_doc_from_markdown)throw new _m("Failed to add content to document — no response from API.",hm);const{success:n,block_ids:o,error:r}=i.add_content_to_doc_from_markdown;if(!n)throw new _m(`Failed to add content to document: ${r||"Unknown error"}`,cm);const s=o?.length??0;return{content:{message:`Successfully added content to document ${t.id}. ${s} block${1===s?"":"s"} created.`,doc_id:t.id,block_ids:o,doc_name:t.name,doc_url:t.url}}}catch(e){bm(e,"add content to document")}}},class extends ae{constructor(){super(...arguments),this.name="update_doc",this.type=b.WRITE,this.annotations=te({title:"Update Document",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Update an existing monday.com document. Provide doc_id (preferred), object_id, or board_id + view_id, plus an ordered operations array (executed sequentially, stops on first failure).\n\nIDENTIFYING THE DOC: A doc can live in a workspace, on an item, or as a board view. For a doc that lives as a board view, you only have a board URL — pass board_id and view_id from https://<slug>.monday.com/boards/<board_id>/views/<view_id> and they will be resolved to the doc.\n\nOPERATIONS:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (or insert after a block). Best for text, headings, lists, simple tables — no block IDs needed.\n- update_block: Update content of an existing text, code, or list_item block in-place.\n- create_block: Create a new block at a precise position. Use parent_block_id to nest inside notice_box, table cell, or layout cell.\n- delete_blocks: Permanently delete 1–100 blocks in one call. Provide all block IDs in the block_ids array. The ONLY option for BOARD, WIDGET, DOC embed, and GIPHY blocks.\n- replace_block: Delete a block and create a new one in its place (use when update_block is not supported).\n- add_comment: Create a new comment or reply on the document (doc-level, block-level, or text-selection).\n\nWHEN TO USE EACH OPERATION:\n- text / code / list_item → update_block. Use replace_block to change subtype (e.g. NORMAL_TEXT→LARGE_TITLE)\n- divider / table / image / video / notice_box / layout → replace_block (properties immutable after creation)\n- BOARD / WIDGET / DOC / GIPHY → delete_blocks only\n\nGETTING BLOCK IDs: Call read_docs with include_blocks: true — returns id, type, position, and content per block.\n\nBLOCK CONTENT (delta_format): Array of insert ops. Last op MUST be {insert: {text: "\\n"}}.\n- Plain: [{insert: {text: "Hello"}}, {insert: {text: "\\n"}}]\n- Bold: [{insert: {text: "Hi"}, attributes: {bold: true}}, {insert: {text: "\\n"}}]\n- Mention user/doc/board: [{insert: {text: "Hey "}}, {insert: {mention: {id: 12345, type: "USER"}}}, {insert: {text: "\\n"}}] — type is USER, DOC, or BOARD. id is numeric (user IDs from list_users_and_teams)\n- Inline column value: [{insert: {column_value: {item_id: 111, column_id: "status"}}}, {insert: {text: "\\n"}}]\n- Supported attributes: bold, italic, underline, strike, code, link, color, background (not applicable to mention/column_value ops)\n\nIMAGE WITH ASSET: For asset-based images, use create_block with block_type "image" and asset_id (instead of public_url). add_markdown_content does NOT support asset images — for mixed content, alternate add_markdown_content (text) and create_block (image) operations in sequence.\n\nBATCHING DELETES: delete_blocks accepts 1..100 IDs. Put ALL IDs in one operation\'s block_ids array. Never emit multiple delete_blocks operations in a row.\n\nCOMMENTS:\n- add_comment: Create a new comment or reply on the document. Three scopes:\n - Doc-level (no block_id): comment appears on the doc as a whole.\n - Block-level (block_id only): comment is anchored to a specific block. The block shows a comment indicator in the UI.\n - Text-selection (block_id + selection_from + selection_length): comment is anchored to a specific character range inside a text/code/list_item block. That text is highlighted with a comment marker.\n Block-level and text-selection comments only work on blocks with text content (text, code, list_item, title, quote). They do NOT work on: divider, page_break, table, layout, notice_box, image, video, or giphy blocks.\n Get block IDs from read_docs with include_blocks: true. Format body with HTML, not markdown. Use mentions_list for @mentions.'}getInputSchema(){return bg}async executeInternal(e){if(!e.doc_id&&!e.object_id&&!e.board_id)throw new _m("Either doc_id, object_id, or board_id (with view_id) must be provided.",fm);this.sessionContext.metadata={...this.sessionContext.metadata,operation_types:e.operations?.map((e=>e.operation_type)),operation_count:e.operations?.length??0,items_count:e.operations?.length??0,...e.object_id&&{object_id:e.object_id},...e.board_id&&{board_id:e.board_id,view_id:e.view_id}};try{let t=e.doc_id,a=e.object_id;if(!t&&!a&&e.board_id){const i=await hb(this.mondayApi,e.board_id,e.view_id);if(!i.ok)throw new _m(i.error,cm);t=i.doc.id,a=i.doc.object_id}if(!t){const e=await this.mondayApi.request(ib,{objectId:a}),i=e.docs?.[0];if(!i)throw new _m(`No document found for object_id ${a}.`,hm);t=i.id}const i=[],n=[];let o=null;for(let r=0;r<e.operations.length;r++){const s=e.operations[r];try{const e=await this.executeOperation(t,s,a);i.push(`- [OK] ${s.operation_type}${e?`: ${e}`:""}`)}catch(e){const t=vm(e),a=t.message;i.push(`- [FAILED] ${s.operation_type}: ${a}`),n.push(...(t.errors??[]).map((e=>({...e,path:["operations",r,...e.path??[]]})))),o=r;break}}const r=null!==o?o:e.operations.length,s=e.operations.length,d=`Completed ${r}/${s} operation${1===s?"":"s"} on doc ${t}.`;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t},null!==o?{content:{message:d,results:i,is_partial_success:r>0,errors:n,doc_id:t},...0===r?{isError:!0}:{}}:{content:`${d}\n\nResults:\n${i.join("\n")}\n\nDoc ID: ${t}`}}catch(e){bm(e,"update document")}}async executeOperation(e,t,a){switch(t.operation_type){case"set_name":return this.executeSetName(e,t.name);case"add_markdown_content":return this.executeAddMarkdown(e,t.markdown,t.after_block_id);case"update_block":return this.executeUpdateBlock(t.block_id,t.content);case"create_block":return this.executeCreateBlock(e,t.block,t.after_block_id,t.parent_block_id);case"delete_blocks":return this.executeDeleteBlocks(t.block_ids);case"replace_block":return this.executeReplaceBlock(e,t.block_id,t.block,t.after_block_id,t.parent_block_id);case"add_comment":return this.executeAddComment(e,a,t.body,t.parent_update_id,t.mentions_list,t.block_id,t.selection_from,t.selection_length);default:{const e=t.operation_type;throw new Error(`Unsupported operation type: "${e}"`)}}}async executeSetName(e,t){const a={docId:e,name:t},i=await this.mondayApi.request(tb,a);if(!i?.update_doc_name)throw new Error(`No confirmation from update_doc_name — rename to "${t}" may not have applied`);return`Renamed to "${t}"`}async executeAddMarkdown(e,t,a){if(!t.trim())throw new Error("markdown must not be empty");const i={docId:e,markdown:t,afterBlockId:a},n=await this.mondayApi.request(ab,i),o=n?.add_content_to_doc_from_markdown;if(!o?.success)throw new Error(o?.error||"Failed to add markdown content");const r=o.block_ids?.length??0;return`${r} block${1===r?"":"s"} added${o.block_ids?.length?`. Block IDs: ${o.block_ids.join(", ")}`:""}`}async executeUpdateBlock(e,t){const a=function(e){switch(e.block_content_type){case"text":return{deltaFormat:Bb(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:Bb(e.delta_format),language:e.language};case"list_item":return{deltaFormat:Bb(e.delta_format),checked:e.checked,indentation:e.indentation};default:{const t=e.block_content_type;throw new Error(`Unsupported block_content_type: "${t}"`)}}}(t),i={blockId:e,content:JSON.stringify(a)},n=await this.mondayApi.request(nb,i);if(!n?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,i){const n=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:Mb(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:Pb(e.alignment),direction:Vb(e.direction)}};case"list_item":return{list_block:{delta_format:Mb(e.delta_format),list_block_type:e.list_block_type?e.list_block_type:void 0,indentation:e.indentation}};case"code":return{text_block:{delta_format:Mb(e.delta_format),text_block_type:dp.Code}};case"divider":return{divider_block:{}};case"page_break":return{page_break_block:{}};case"image":if(null==e.asset_id&&!e.public_url)throw new Error("image block requires either asset_id or public_url");return{image_block:null!=e.asset_id?{asset_id:String(e.asset_id),width:e.width}:{public_url:e.public_url,width:e.width}};case"video":return{video_block:{raw_url:e.raw_url,width:e.width}};case"notice_box":return{notice_box_block:{theme:e.theme}};case"table":return{table_block:{row_count:e.row_count,column_count:e.column_count,width:e.width,column_style:e.column_style?.map((e=>({width:e.width})))}};case"layout":return{layout_block:{column_count:e.column_count,column_style:e.column_style?.map((e=>({width:e.width})))}};default:{const t=e.block_type;throw new Error(`Unsupported block_type: "${t}"`)}}}(t);if(i){const e=Object.keys(n);if(1!==e.length)throw new Error(`Cannot inject parent_block_id: expected exactly 1 key in block input, got: ${e.join(", ")}`);const t=e[0],a=n[t];if(!a||"object"!=typeof a)throw new Error(`Cannot inject parent_block_id into block type "${t}" — block value is not an object`);a.parent_block_id=i}const o={docId:e,afterBlockId:a,blocksInput:[n]},r=await this.mondayApi.request(cb,o),s=r?.create_doc_blocks;if(!s||0===s.length)throw new Error("No blocks returned from create_doc_blocks");return`Block created (ID: ${s.map((e=>e.id)).join(", ")})`}async executeDeleteBlock(e){const t={blockId:e},a=await this.mondayApi.request(ob,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async executeDeleteBlocks(e){if(0===e.length)throw new Error("block_ids must not be empty");const t={blockIds:e},a=await this.mondayApi.request(rb,t);if(!a?.delete_doc_blocks||0===a.delete_doc_blocks.length)throw new Error("No response from delete_doc_blocks");const i=a.delete_doc_blocks.map((e=>e.id)).join(", ");return`${a.delete_doc_blocks.length} block(s) deleted (IDs: ${i})`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(sb,{docId:e}),i=a.docs?.[0];if(!i?.object_id)throw new Error(`Could not resolve object_id for doc ${e}`);return i.object_id}async resolveDocItemId(e){const t=await this.mondayApi.request(db,{boardId:e}),a=t.boards?.[0]?.items_page?.items?.[0]?.id;if(!a)throw new Error(`No item found on the document backing board (object_id: ${e})`);return a}async fetchAllBlockContent(e){const t=await this.mondayApi.request(pb,{docId:e});return(t.docs?.[0]?.blocks??[]).filter((e=>null!=e)).map((t=>{let a;if("string"==typeof t.content)try{a=JSON.parse(t.content)}catch{throw new Error(`Failed to parse content of block ${t.id} in doc ${e} as JSON`)}else a=t.content??{};return{id:t.id??"",type:t.type??"",content:a}}))}async executeAddComment(e,t,a,i,n,o,r,s){if((null!=r||null!=s)&&!o)throw new Error("selection_from and selection_length require block_id");if(null!=r!=(null!=s))throw new Error("selection_from and selection_length must both be provided together");const d=o?Array.isArray(o)?o:[o]:[];if((null!=r||null!=s)&&d.length>1)throw new Error("selection_from and selection_length are only supported with a single block_id");const p=await this.resolveObjectId(e,t),l=await this.resolveDocItemId(p);let c;if(n){const e=JSON.parse(n),t=Nf.safeParse(e);if(!t.success)throw new Error(`Invalid mentions_list format: ${t.error.message}`);c=t.data}const m={itemId:l,body:a,parentId:i?.toString(),mentionsList:c},u=await this.mondayApi.request(lb,m);if(!u.create_update?.id)throw new Error("Failed to create comment: no update returned");const h=u.create_update.id,f=Number(h),_=i?`Reply to update ${i}`:"Comment";if(d.length>0){if(Number.isNaN(f))throw new Error(`${_} created (update ID: ${h}) but block annotation aborted: comment ID is not numeric and cannot be used as a delta reference`);const t=await this.fetchAllBlockContent(e);for(const a of d){const i=t.find((e=>e.id===a));if(!i)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: block ${a} not found in doc ${e}`);const n=i.content.deltaFormat;if(!n)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: block ${a} has no deltaFormat — only text, code, and list_item blocks are supported`);let o=0;for(const e of n)o+="string"==typeof e.insert?e.insert.length:1;if(0===o)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: block ${a} has an empty deltaFormat and cannot be annotated`);const d=r??0,p=s??o;if(d+p>o)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: selection [${d}, ${d+p}) is out of range for block ${a} (total length ${o})`);let l;try{l=qb(n,f,d,p)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`${_} created (update ID: ${h}) but delta annotation failed for block ${a}: ${t}`)}const c={...i.content,deltaFormat:l},m=await this.mondayApi.request(nb,{blockId:a,content:JSON.stringify(c)});if(!m?.update_doc_block)throw new Error(`${_} created (update ID: ${h}) but block annotation write returned no confirmation for block ${a}`)}}const b=d.length;return`${_} created${b>1?` across ${b} blocks`:1===b?" on block":""} (update ID: ${h})`}async executeReplaceBlock(e,t,a,i,n){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,i,n)}`}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Original block ${t} was deleted, but replacement creation failed: ${a}. The original block is gone.`)}}},class extends ae{constructor(){super(...arguments),this.name="update_workspace",this.type=b.WRITE,this.annotations=te({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return Eg}async executeInternal(e){const t={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},a=await this.mondayApi.request(Tg,t),i=await J_(this.mondayApi),n=i?X_(i,a.update_workspace?.id):void 0;return{content:{message:`Workspace ${a.update_workspace?.id} updated`,workspace_id:a.update_workspace?.id,workspace_name:a.update_workspace?.name,workspace_url:n}}}},class extends ae{constructor(){super(...arguments),this.name="update_folder",this.type=b.WRITE,this.annotations=te({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return Sg}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:i}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const n={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:t?{is_after:i,object_id:t,object_type:a}:void 0},o=await this.mondayApi.request(Ag,n);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends ae{constructor(){super(...arguments),this.name="create_workspace",this.type=b.WRITE,this.annotations=te({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return Ng}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(Dg,t),i=await J_(this.mondayApi),n=i&&a.create_workspace?.id?X_(i,a.create_workspace.id):void 0;return{content:{message:`Workspace ${a.create_workspace?.id} successfully created`,workspace_id:a.create_workspace?.id,workspace_name:a.create_workspace?.name,workspace_url:n}}}},class extends ae{constructor(){super(...arguments),this.name="create_folder",this.type=b.WRITE,this.annotations=te({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return kg}async executeInternal(e){const t={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},a=await this.mondayApi.request(Og,t);return{content:{message:`Folder ${a.create_folder?.id} successfully created`,folder_id:a.create_folder?.id,folder_name:a.create_folder?.name}}}},class extends ae{constructor(){super(...arguments),this.name="move_object",this.type=b.WRITE,this.annotations=te({title:"Move Object",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move a folder, board, or overview in monday.com. Use position for relative placement based on another object, parentFolderId for folder changes, workspaceId for workspace moves, and accountProductId for account product changes."}getInputSchema(){return $g}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const d={folderId:t,position:a?{is_after:n,object_id:a,object_type:i}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},p=await this.mondayApi.request(Ag,d);return{content:{message:"Object moved",object_id:p.update_folder?.id}}}async executeUpdateBoardHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const d={boardId:t,attributes:{position:a?{is_after:n,object_id:a,object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(Cg,d);return p.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:p.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${p.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const d={overviewId:t,attributes:{position:a?{is_after:n,object_id:a,object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(Rg,d);return p.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:p.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${p.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:t}=e;switch(t){case ld.Folder:return this.executeUpdateFolder(e);case ld.Board:return this.executeUpdateBoardHierarchy(e);case ld.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends ae{constructor(){super(...arguments),this.name="create_dashboard",this.type=b.WRITE,this.annotations=te({title:"Create Dashboard",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Use this tool to create a new monday.com dashboard that aggregates data from one or more boards. \n Dashboards provide visual representations of board data through widgets and charts.\n \n Use this tool when users want to:\n - Create a dashboard to visualize board data\n - Aggregate information from multiple boards\n - Set up a data visualization container for widgets"}getInputSchema(){return Ig}async executeInternal(e){try{const t={name:e.name,workspace_id:e.workspace_id.toString(),board_ids:e.board_ids,kind:e.kind,board_folder_id:e.board_folder_id?.toString()},a=await this.mondayApi.request(gg,t);if(!a.create_dashboard)throw new _m("Failed to create dashboard",hm);const i=a.create_dashboard;return{content:{message:`Dashboard ${i.id} successfully created`,dashboard_id:i.id,dashboard_name:i.name}}}catch(e){bm(e,"create dashboard")}}},class extends ae{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=b.READ,this.annotations=te({title:"Get All Widget Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch complete JSON Schema 7 definitions for all available widget types in monday.com.\n \n This tool is essential before creating widgets as it provides:\n - Complete schema definitions for all supported widgets\n - Required and optional fields for each widget type\n - Data type specifications and validation rules\n - Detailed descriptions of widget capabilities\n \n Use this tool when you need to:\n - Understand widget configuration requirements before creating widgets\n - Validate widget settings against official schemas\n - Plan widget implementations with proper data structures\n \n The response includes JSON Schema 7 definitions that describe exactly what settings each widget type accepts."}getInputSchema(){return{}}async executeInternal(){try{const e={},t=await this.mondayApi.request(yg,e);if(!t.all_widgets_schema||0===t.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const a={};let i=0;for(const e of t.all_widgets_schema)if(e?.widget_type&&e?.schema){const t="string"==typeof e.schema?JSON.parse(e.schema):e.schema,n=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:n,schema:e.schema},i++}if(0===i)throw new Error("No valid widget schemas found in API response");Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:a,url:T_}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends ae{constructor(){super(...arguments),this.name="create_widget",this.type=b.WRITE,this.annotations=te({title:"Create Widget",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new widget in a dashboard or board view with specific configuration settings.\n \n This tool creates data visualization widgets that display information from monday.com boards:\n **Parent Containers:**\n - **DASHBOARD**: Place widget in a dashboard (most common use case)\n - **BOARD_VIEW**: Place widget in a specific board view\n \n **Critical Requirements:**\n 1. **Schema Compliance**: Widget settings MUST conform to the JSON schema for the specific widget type\n 2. **Use all_widgets_schema first**: Always fetch widget schemas before creating widgets\n 3. **Validate settings**: Ensure all required fields are provided and data types match\n \n **Workflow:**\n 1. Use 'all_widgets_schema' to get schema definitions\n 2. Prepare widget settings according to the schema\n 3. Use this tool to create the widget"}getInputSchema(){return wg}async executeInternal(e){if(!e.settings)throw new _m("You must pass the settings parameter",fm);try{const t={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},a=await this.mondayApi.request(vg,t);if(!a.create_widget)throw new _m("Failed to create widget",hm);const i=a.create_widget;i.parent?.kind===pl.Dashboard?i.parent.id:i.parent;return{content:{message:`Widget ${i.id} created`,widget_id:i.id,widget_name:i.name,dashboard_id:i.parent?.id}}}catch(t){bm(t,`create ${e.widget_kind} widget`)}}},class extends ae{constructor(){super(...arguments),this.name="board_insights",this.type=b.READ,this.annotations=te({title:"Get Board Insights",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool allows you to calculate insights about board's data by filtering, grouping and aggregating columns. For example, you can get the total number of items in a board, the number of items in each status, the number of items in each column, etc. Use this tool when you need to get a summary of the board's data, for example, you want to know the total number of items in a board, the number of items in each status, the number of items in each column, etc.[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 filters and knowing which columns are available.[IMPORTANT]: For some columns, human-friendly label is returned inside 'LABEL_<column_id' field. E.g. for column with id 'status_123' the label is returned inside 'LABEL_status_123' field."}getInputSchema(){return Fg}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};if(e.aggregations.some((e=>!e.columnId&&e.function!==En.CountItems)))return{content:`Every aggregation must have a "columnId", except the ${En.CountItems} function.`};const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],i=new Set(e.aggregations.filter((e=>e.function===En.Label)).map((e=>e.columnId))),n=e.groupBy?.filter((e=>!i.has(e))).map((e=>({function:En.Label,columnId:e})))??[],o=e.aggregations.concat(n).map((e=>{if(e.function){const o=e.columnId?`${e.function}_${e.columnId}`:e.function,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return Pg.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:Tn.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===En.CountItems?[]:[{type:Tn.Column,column:Vg(n),as:n}]}),as:s}}var i,n;const o={type:Tn.Column,column:Vg(e.columnId),as:e.columnId};return a.some((t=>t.column_id===e.columnId))||a.push({column_id:e.columnId}),o}));return a.forEach((e=>{o.some((t=>t.as===e.column_id))||o.push({type:Tn.Column,column:Vg(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),i=function(e){if(!e.filters&&!e.orderBy)return;const t={};return e.filters&&(t.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),t.operator=e.filtersOperator),e.orderBy&&(t.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),t}(e),n=function(e){return{id:e.boardId.toString(),type:fn.Table}}(e),o={query:{from:n,query:i,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(xg,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const i=e.value;if(!i)return void(t[a]=null);const n=i.result??i.value??null;t[a]=n})),t}));return s.length?{content:{message:"Board insights retrieved",board_name:r.boards?.[0]?.name,board_url:r.boards?.[0]?.url,data:s}}:{content:"No board insights found for the given query."}}},class extends ae{constructor(){super(...arguments),this.name="search",this.type=b.READ,this.annotations=te({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Search within monday.com platform. Supported searchType values: ${__}.\nsearchTerm is the phrase the search matches against — the text/keywords to look for (e.g. a board name, item title, or a word from an update). It is required and must be non-empty. This tool has no "list everything" mode: to browse or list without a search phrase, use workspace_info (boards/docs/folders in a workspace) or get_board_items_page (items in a board) instead of calling search with an empty searchTerm.\nFor searching/listing specific users and teams, use list_users_and_teams tool.\nFor account-level info (plan, member count, products), use get_user_context tool.\nFor browsing all boards, docs, or folders within a workspace without a search term, use workspace_info tool.\nFor groups, use get_board_info tool.\nFor listing items within a specific board, use get_board_items_page tool. ITEMS search here queries items across the account.\nBOARD search returns id, title, url, and workspaceId. Optionally scope it with boardIds.\nDOCUMENTS search returns id, title, workspaceId, and highlights. highlights is an array of { field, fragments } entries (field is "name" or "content") where fragments contain matched text snippets with <em> tags around matched terms. highlights is omitted when no lexical match was made. Optionally scope it with workspaceIds and/or docIds.\nITEMS search returns id, title, url, boardId, and workspaceId. Optionally scope it with workspaceIds, boardIds, and/or creatorIds.\nWORKSPACES search returns id, title, and description.\nUPDATES search returns id, title (the update body), itemId, boardId, and creatorId. Optionally scope it with workspaceIds, boardIds, and/or creatorIds.\nTIMELINE_ITEMS search returns id, title, summary, content, itemId, and boardId. Optionally scope it with workspaceIds and/or boardIds.\nDASHBOARDS search (also called "overviews") returns id, title, and workspaceId. Optionally scope it with workspaceIds and/or creatorIds.\nFOLDERS search returns id and title. Optionally scope it with workspaceIds, which searches all accessible workspaces when omitted. Pass workspaceIds to narrow the search if results may be truncated.\n `}getInputSchema(){return iy}async executeInternal(e){const{searchTerm:t}=e;if(!t)throw new _m("searchTerm is required and must be a non-empty search string. To browse or list without a search term, use workspace_info (for boards, docs, and folders in a workspace) or get_board_items_page (for items within a specific board).",fm);try{if(e.searchType===f_.FOLDERS){const{results:a,truncated:i}=await this.searchFoldersAsync(e,t);return{content:{message:i?"Search results (truncated: only the first 100 folders across the searched workspaces were scanned. Narrow with workspaceIds for complete results.)":"Search results",data:a}}}return{content:{message:"Search results",data:await this.runSmartSearchAsync(e,t)}}}catch(e){throw gm(e),e}}async runSmartSearchAsync(e,t){const a=Zg(e.workspaceIds?.map((e=>e.toString())));if(e.searchType===f_.BOARD){const i=Zg(e.boardIds?.map((e=>e.toString())));return this.searchBoardsAsync(t,e.limit,a,i)}if(e.searchType===f_.DOCUMENTS){const i=Zg(e.docIds?.map((e=>e.toString())));return this.searchDocsAsync(t,e.limit,a,i)}if(e.searchType===f_.WORKSPACES)return this.searchWorkspacesAsync(t,e.limit);if(e.searchType===f_.UPDATES){const i=Zg(e.boardIds?.map((e=>e.toString()))),n=Zg(e.creatorIds?.map((e=>e.toString())));return this.searchUpdatesAsync(t,e.limit,a,i,n)}if(e.searchType===f_.ITEMS){const i=Zg(e.boardIds?.map((e=>e.toString()))),n=Zg(e.creatorIds?.map((e=>e.toString())));return this.searchItemsAsync(t,e.limit,a,i,n)}if(e.searchType===f_.TIMELINE_ITEMS){const i=Zg(e.boardIds?.map((e=>e.toString())));return this.searchTimelineItemsAsync(t,e.limit,a,i)}if(e.searchType===f_.DASHBOARDS){const i=e.creatorIds?.map((e=>e.toString()));return this.searchOverviewsAsync(t,e.limit,a,i)}throw new _m(`Unsupported search type for smart search: ${e.searchType}`,cm)}async searchBoardsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,boardIds:i};return(await this.mondayApi.request(jg,n,{timeout:Nm})).search.boards.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchDocsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,docIds:i};return(await this.mondayApi.request(qg,n,{timeout:Nm})).search.docs.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0,highlights:ey(e.indexed_data.highlights)})))}async searchWorkspacesAsync(e,t){const a={query:e,limit:t};return(await this.mondayApi.request(Gg,a,{timeout:Nm})).search.workspaces.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,description:e.indexed_data.description||void 0})))}async searchUpdatesAsync(e,t,a,i,n){const o={query:e,limit:t,workspaceIds:a,boardIds:i,creatorIds:n};return(await this.mondayApi.request(Hg,o,{timeout:Nm})).search.updates.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.body,itemId:e.indexed_data.item_id,boardId:e.indexed_data.board_id,creatorId:e.indexed_data.creator_id})))}async searchItemsAsync(e,t,a,i,n){return(n?await this.mondayApi.request(Yg,{query:e,limit:t,workspaceIds:a,boardIds:i,creatorIds:n},{versionOverride:"dev",timeout:Nm}):await this.mondayApi.request(Bg,{query:e,limit:t,workspaceIds:a,boardIds:i},{timeout:Nm})).search.items.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url,boardId:e.indexed_data.board_id??void 0,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchTimelineItemsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,boardIds:i};return(await this.mondayApi.request(Wg,n,{timeout:Nm})).search.timeline_items.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.title,summary:e.indexed_data.summary||void 0,content:e.indexed_data.content||void 0,itemId:e.indexed_data.item_id,boardId:e.indexed_data.board_id??void 0})))}async searchOverviewsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,creatorIds:i};return(await this.mondayApi.request(Qg,n,{versionOverride:"dev",timeout:Nm})).search.overviews.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchFoldersAsync(e,t){const a=Kg(t);if(!a)return{results:[],truncated:!1};const i={page:1,limit:100,workspace_ids:Zg(e.workspaceIds?.map((e=>e.toString())))},n=(await this.mondayApi.request(Mg,i)).folders||[];return{results:n.filter((e=>e?.name&&Kg(e.name).includes(a))).filter((e=>e?.id)).slice(0,e.limit).map((e=>({id:e.id,title:e.name}))),truncated:100===n.length}}},class extends ae{constructor(){super(...arguments),this.name="get_user_context",this.type=b.READ,this.annotations=te({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information, account information, and their relevant items (boards, docs, folders, workspaces, dashboards).\n\n Use this tool to:\n - Get context about who the current user is (id, name, title)\n - Get account info: plan tier, active member count, trial status, and active products\n - Get the number of active members in the account (returns active_members_count)\n - Discover user's favorite boards, folders, workspaces, and dashboards\n - Get user's most relevant boards based on visit frequency and recency\n - Get user's most relevant docs based on load frequency and recency\n - Get user's most relevant people based on interaction frequency and recency\n - Reduce the need for search requests by knowing user's commonly accessed items\n "}getInputSchema(){}async executeInternal(){const{me:e,favorites:t,intelligence:a}=await this.mondayApi.request(my,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};const i=await this.fetchFavorites(t||[]),n=this.extractRelevantBoards(a),o=this.extractRelevantDocs(a),r=this.extractRelevantPeople(a),{account:s,...d}=e;return{content:{message:"User context",...{user:d,account:s?{tier:s.tier,active_members_count:s.active_members_count,is_during_trial:s.is_during_trial,products:s.products?.filter(Boolean).map((e=>({kind:e.kind,tier:e.tier})))??[]}:null,favorites:i,relevantBoards:n,relevantDocs:o,relevantPeople:r}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const i={};for(const e of a)i[hy[e]]=t[e];const n=await this.mondayApi.request(uy,i),o=[];for(const e of a){const t=fy[e];for(const a of n[t]??[])a?.id&&o.push({id:a.id,name:a.name,type:e})}return o}extractRelevantBoards(e){if(!e?.relevant_boards)return[];const t=[];for(const a of e.relevant_boards)a?.id&&a?.board?.name&&t.push({id:a.id,name:a.board.name});return t}extractRelevantDocs(e){if(!e?.relevant_docs)return[];const t=[];for(const a of e.relevant_docs)a?.id&&a?.document?.name&&t.push({id:a.id,name:a.document.name,objectId:a.object_id});return t}extractRelevantPeople(e){if(!e?.relevant_people)return[];const t=[];for(const a of e.relevant_people)a?.id&&a?.user?.name&&t.push({id:a.id,name:a.user.name});return t}groupByType(e){const t={};for(const a of e){const e=a?.object;e?.id&&e?.type&&(t[e.type]??=[]).push(e.id)}return t}},class extends ae{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=b.WRITE,this.annotations=te({title:"Update Assets On Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update a file or doc column value on an item using existing assets, docs, or links. Sets the column to the provided list of files, adding new ones and removing any not in the list."}getInputSchema(){return py}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(sy,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends ae{constructor(){super(...arguments),this.name="get_assets",this.type=b.READ,this.annotations=te({title:"Get Assets",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get assets (files) by their IDs. Returns file metadata including name, extension, size, public URL (valid for 1 hour), thumbnail URL, upload date, and who uploaded it."}getInputSchema(){return cy}async executeInternal(e){const t=await this.mondayApi.request(ly,{ids:e.ids}),a=t.assets?.filter(Boolean);if(!a||0===a.length)return{content:`No assets found for the provided IDs: ${e.ids.join(", ")}`};return{content:{results:a.map((e=>({id:e.id,name:e.name,file_extension:e.file_extension,file_size:e.file_size,public_url:e.public_url,url:e.url,url_thumbnail:e.url_thumbnail??null,created_at:e.created_at??null,original_geometry:e.original_geometry??null,uploaded_by:e.uploaded_by})))}}}},class extends ae{constructor(){super(...arguments),this.name="create_view",this.type=b.WRITE,this.annotations=te({title:"Create View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new board view (tab) with optional filters and sorting. This creates a saved view on a monday.com board that users can switch to.\n\n[REQUIRED PRECONDITION]: If you pass filters or sorting, call get_board_info first with filters.columns.only to get the board column IDs, column types, and status label indexes without fetching views. Filter rules reference real column IDs and, for status columns, numeric label indexes — do not guess them. Before sending the filters, use get_column_type_info with fetchMode "${au.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules).\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }`}getInputSchema(){return _u}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort,settings:e.settings},a=await this.mondayApi.request(hu,t);if(!a.create_view)return{content:"Failed to create view - no response from API"};const i=`View "${a.create_view.name}" (ID: ${a.create_view.id}, type: ${a.create_view.type}) successfully created`,n=fu(a.create_view.view_specific_data_str);return n?{content:`${i}. formToken: ${n}. Configure this form with update_form and form_questions_editor using this formToken; update_view cannot change form settings.`}:{content:i}}},class extends ae{constructor(){super(...arguments),this.name="update_view",this.type=b.WRITE,this.annotations=te({title:"Update View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Update an existing board view (tab) — change its name, filter rules, or sort order. Provide only the fields you want to change. Omitted fields are left unchanged.\n\n[REQUIRED PRECONDITION]: Call get_board_info first — it returns the board views (so you can resolve the viewId, including from a view name the user mentioned) along with the column IDs, column types, and status label indexes that filter and sort rules reference. When the user named specific views, pass those names as get_board_info.filters.views.names to avoid fetching every view on large boards. If you pass filters, also use get_column_type_info with fetchMode "${au.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }`}getInputSchema(){return gu}async executeInternal(e){const t={viewId:e.viewId,boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort,settings:e.settings};let a;try{a=await this.mondayApi.request(bu,t)}catch(t){if(e.type===ol.Form&&void 0!==e.settings){const e=t instanceof Error?t.message:String(t),a=new Error(`${e}\n\nupdate_view accepts no settings for FORM views. Configure the form with its formToken, which get_board_info returns on each FORM view: update_form changes the title, description, name question and question order, and form_questions_editor creates, edits or deletes questions (text, visibility, required). Call update_view on a FORM view only to rename it.`),i=t?.response;throw i&&(a.response=i),a}throw t}return a.update_view?{content:`View "${a.update_view.name}" (ID: ${a.update_view.id}, type: ${a.update_view.type}) successfully updated`}:{content:"Failed to update view - no response from API"}}},class extends ae{constructor(){super(...arguments),this.name="create_view_table",this.type=b.WRITE,this.annotations=te({title:"Create Table View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new table-type board view with optional filters, sort, tags, and table-specific settings (column visibility/order and group-by). Use this instead of create_view when you need to configure table-specific settings. For a simple table view, create_view also works.\n\n[REQUIRED PRECONDITION]: Call get_board_info first with filters.columns.only to get the board column IDs, column types, and status label indexes without fetching views. Filters, sort, column_properties, column_order, and group_by all reference real column IDs — do not guess them. This is required even if you are not passing filters, since column_properties/column_order/group_by need real column IDs too. If you pass filters, also use get_column_type_info with fetchMode "${au.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample settings.columns: { "column_properties": [{ "column_id": "status", "visible": true }], "column_order": ["name", "status", "date"] }\nExample settings.group_by: { "conditions": [{ "columnId": "status" }], "hideEmptyGroups": true }`}getInputSchema(){return wu}async executeInternal(e){const t={boardId:e.boardId,name:e.name,filter:e.filter,sort:e.sort,tags:e.tags,settings:e.settings},a=await this.mondayApi.request(yu,t);return a.create_view_table?{content:`Table view "${a.create_view_table.name}" (ID: ${a.create_view_table.id}, type: ${a.create_view_table.type}) successfully created`}:{content:"Failed to create table view - no response from API"}}},class extends ae{constructor(){super(...arguments),this.name="update_view_table",this.type=b.WRITE,this.annotations=te({title:"Update Table View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Update an existing table-type board view — change its name, filters, sort, tags, or table-specific settings (column visibility/order and group-by). Provide only the fields you want to change. Omitted fields are left unchanged.\n\n[REQUIRED PRECONDITION]: Call get_board_info first — it returns the board views (so you can resolve the viewId, including from a view name the user mentioned) along with the column IDs, column types, and status label indexes that filters, sort, column_properties, column_order, and group_by reference. When the user named specific views, pass those names as get_board_info.filters.views.names to avoid fetching every view on large boards. If you pass filters, also use get_column_type_info with fetchMode "${au.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample settings.columns: { "column_properties": [{ "column_id": "status", "visible": true }], "column_order": ["name", "status", "date"] }\nExample settings.group_by: { "conditions": [{ "columnId": "status" }], "hideEmptyGroups": true }`}getInputSchema(){return Su}async executeInternal(e){const t={viewId:e.viewId,boardId:e.boardId,name:e.name,filter:e.filter,sort:e.sort,tags:e.tags,settings:e.settings},a=await this.mondayApi.request(Tu,t);return a.update_view_table?{content:`Table view "${a.update_view_table.name}" (ID: ${a.update_view_table.id}, type: ${a.update_view_table.type}) successfully updated`}:{content:"Failed to update table view - no response from API"}}},class extends ae{constructor(){super(...arguments),this.name="undo_action",this.type=b.WRITE,this.annotations=te({title:"Undo Action",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Undo a previous action on a board using its action_record_uuid. Supports undoing column changes, deletes, archives, moves, duplicates, and more. Use get_board_activity with includeData=true to find the action_record_uuid."}getInputSchema(){return by}async executeInternal(e){return await this.mondayApi.request(_y,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}},class extends ae{constructor(){super(...arguments),this.name="get_object_schemas",this.type=b.READ,this.annotations=te({title:"Get Object Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve account-level object schemas by their IDs or names. Schemas define the structure and columns of boards. Provide ids or names to filter specific schemas. Omit both to list all schemas (paginated). Call this FIRST to resolve schema ids, column ids, and the current revision before any tool that modifies an existing schema: update_object_schema (which requires the revision returned here), manage_object_schema_columns with action=update, set_object_schema_column_active_state, delete_object_schema_columns, delete_object_schema, and manage_object_schema_board_connection."}getInputSchema(){return Gm}async executeInternal(e){const t={ids:e.ids,names:e.names,limit:e.limit,page:e.page,excludeCreatedByMonday:e.excludeCreatedByMonday},a=(await this.mondayApi.request(qm,t)).get_object_schemas??[];return{content:{message:`Retrieved ${a.length} object schema(s)`,schemas:a}}}},class extends ae{constructor(){super(...arguments),this.name="create_object_schema",this.type=b.WRITE,this.annotations=te({title:"Create Object Schema",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new account-level object schema. Schemas define the structure and columns of boards. If you are nesting this schema under an existing one, call get_object_schemas first to resolve parentId. This tool creates the schema only — add its columns afterwards with manage_object_schema_columns, and attach boards with manage_object_schema_board_connection."}getInputSchema(){return Wm}async executeInternal(e){const t={name:e.name,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(Hm,t);return{content:{message:`Object schema "${a.create_object_schema?.name}" successfully created`,schema_id:a.create_object_schema?.id,schema_name:a.create_object_schema?.name,revision:a.create_object_schema?.revision}}}},class extends ae{constructor(){super(...arguments),this.name="update_object_schema",this.type=b.WRITE,this.annotations=te({title:"Update Object Schema",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Update an account-level object schema. Requires the current revision number for optimistic locking — retrieve it first via get_object_schemas."}getInputSchema(){return Qm}async executeInternal(e){const t={id:e.id,revision:e.revision,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(Ym,t);return{content:{message:`Object schema "${a.update_object_schema?.name}" successfully updated`,schema_id:a.update_object_schema?.id,schema_name:a.update_object_schema?.name,revision:a.update_object_schema?.revision}}}},class extends ae{constructor(){super(...arguments),this.name="delete_object_schema",this.type=b.WRITE,this.annotations=te({title:"Delete Object Schema",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an account-level object schema. Only allowed when no boards are connected to the schema. Provide either id or name."}getInputSchema(){return zm}async executeInternal(e){if(!e.id&&!e.name)throw new Error("Either id or name must be provided");const t={id:e.id,name:e.name},a=await this.mondayApi.request(Km,t);return{content:{message:`Object schema "${a.delete_object_schema?.name}" successfully deleted`,schema_id:a.delete_object_schema?.id,schema_name:a.delete_object_schema?.name}}}},class extends ae{constructor(){super(...arguments),this.name="delete_object_schema_columns",this.type=b.WRITE,this.annotations=te({title:"Delete Object Schema Columns",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Permanently delete columns from an account-level object schema. Only allowed when no boards are connected to the schema. Use manage_object_schema_column with action=deactivate for a reversible alternative. [REQUIRED PRECONDITION]: Call get_object_schemas first to resolve the schema id and the exact column ids — this deletion is irreversible, so never guess ids."}getInputSchema(){return Xm}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnIds:e.columnIds},a=await this.mondayApi.request(Jm,t,{versionOverride:"dev"});return{content:{message:`${e.columnIds.length} column(s) successfully deleted from object schema "${a.delete_object_schema_columns?.name}"`,schema_id:a.delete_object_schema_columns?.id,schema_name:a.delete_object_schema_columns?.name,revision:a.delete_object_schema_columns?.revision}}}},class extends ae{constructor(){super(...arguments),this.name="manage_object_schema_board_connection",this.type=b.WRITE,this.annotations=te({title:"Manage Object Schema Board Connection",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Connect or detach a board from an account-level object schema. connect: attaches a board to an object schema so it inherits the schema column structure. detach: removes one or more boards from their object schema."}getInputSchema(){return tu}async executeInternal(e){if("connect"===e.action){if(!e.boardId)throw new Error("boardId is required for action=connect");if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided for action=connect");const t={boardId:e.boardId,objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName},a=await this.mondayApi.request(Zm,t);return{content:{message:"Board successfully connected to object schema",connection_id:a.connect_board_to_object_schema?.id,schema_id:a.connect_board_to_object_schema?.object_schema_id}}}{if(!e.boardIds?.length)throw new Error("boardIds is required for action=detach");const t={boardIds:e.boardIds},a=(await this.mondayApi.request(eu,t)).detach_boards_from_object_schema??[],i=a.filter((e=>e.success)).length,n=a.filter((e=>!e.success));return{content:{message:`${i} board(s) successfully detached`,results:a,...n.length>0&&{failures:n}}}}}},class extends ae{constructor(){super(...arguments),this.name="manage_object_schema_columns",this.type=b.WRITE,this.annotations=te({title:"Manage Object Schema Columns",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create or update columns on an account-level object schema. Column changes are propagated to all boards connected to the schema. create: adds new columns. Each column requires type and title. Call get_column_type_info with fetchMode "${au.Schema}" first to understand valid defaults per column type. update: modifies existing columns. Each entry must include column_id — call get_object_schemas first to resolve the schema id and the exact column ids. Only send the columns you want to modify — other columns are unaffected. Use opt_out_by_default=true to stop a column from being auto-added to boards (opt out), or opt_out_by_default=false to restore auto-adding (opt in).`}getInputSchema(){return du}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");if("create"===e.action){const t=e.columns.map((e=>{const t=e;return{type:t.type,title:t.title,description:t.description,defaults:t.defaults,opt_out_by_default:t.opt_out_by_default,policy:{can_override:t.policy?.can_override??[],cannot_delete:t.policy?.cannot_delete??!1}}})),a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columns:t},i=await this.mondayApi.request(iu,a);return{content:{message:`Columns successfully added to object schema "${i.create_object_schema_columns?.name}"`,schema_id:i.create_object_schema_columns?.id,schema_name:i.create_object_schema_columns?.name,revision:i.create_object_schema_columns?.revision}}}{const t={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columns:e.columns.map((e=>{const t=e;return{column_id:t.column_id,title:t.title,description:t.description,defaults:t.defaults,opt_out_by_default:t.opt_out_by_default,policy:t.policy?{can_override:t.policy.can_override??[],cannot_delete:t.policy.cannot_delete??!1}:void 0}}))},a=await this.mondayApi.request(nu,t);return{content:{message:`Columns successfully updated on object schema "${a.update_object_schema_columns?.name}"`,schema_id:a.update_object_schema_columns?.id,schema_name:a.update_object_schema_columns?.name,revision:a.update_object_schema_columns?.revision}}}}},class extends ae{constructor(){super(...arguments),this.name="set_object_schema_column_active_state",this.type=b.WRITE,this.annotations=te({title:"Set Object Schema Column Active State",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Set the active state of a column on an account-level object schema. [REQUIRED PRECONDITION]: Call get_object_schemas first to resolve the schema id, the column id, and its current active state. deactivate: soft-disables the column, preventing it from being used on new boards. The column is not deleted and can be restored. reactivate: restores a previously deactivated column, making it available again."}getInputSchema(){return lu}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={deactivate:Po.Deactivate,reactivate:Po.Reactivate},a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnId:e.columnId,action:t[e.action]},i=await this.mondayApi.request(pu,a);return{content:{message:`Column successfully ${e.action}d on object schema "${i.set_object_schema_column_active_state?.name}"`,schema_id:i.set_object_schema_column_active_state?.id,schema_name:i.set_object_schema_column_active_state?.name,revision:i.set_object_schema_column_active_state?.revision}}}},class extends ae{constructor(){super(...arguments),this.name="get_asset_upload_url",this.type=b.WRITE,this.annotations=te({title:"Get Asset Upload URL",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Get a presigned URL to upload a file to monday.com. Returns an upload_id and upload_url.\n\nOnly call this tool if you can execute a direct HTTP PUT with binary file data and read response headers (e.g. via shell/curl). If you can\'t, tell the user direct file upload isn\'t supported here — don\'t call this tool.\n\nAfter calling this tool, upload the file to the returned URL using an HTTP PUT request and capture the ETag header from the response:\n\ncurl -i -X PUT "<upload_url>" \\\n -H "Content-Type: <the contentType you provided>" \\\n --data-binary @<local_file_path>\n\nThe response includes an ETag header (e.g. ETag: "abc123...") — save this value.\n\nThen call finalize_asset_upload with the upload_id, etag, board_id, item_id, and column_id to complete the upload and attach the file to an item\'s file column.\n\nMax file size: 500MB.'}getInputSchema(){return yy}async executeInternal(e){const t=(await this.mondayApi.request(gy,{input:{file_name:e.fileName,content_type:e.contentType,file_size:e.fileSize,source:"mcp",multipart:!1}},{versionOverride:"dev"})).create_upload,a=t.parts[0]?.url;if(!a)throw new Error("create_upload returned no upload URL — parts array was empty");return{content:{upload_id:t.upload_id,upload_url:a,url_expires_at:t.expires_at}}}},class extends ae{constructor(){super(...arguments),this.name="finalize_asset_upload",this.type=b.WRITE,this.annotations=te({title:"Finalize Asset Upload",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Finalize a file upload and create the asset on monday.com. Call this after uploading the file to the presigned URL from get_asset_upload_url. Requires the etag value from the PUT response headers. Automatically attaches the uploaded asset to the specified file column on the item. Returns the created asset_id."}getInputSchema(){return wy}async executeInternal(e){const t=(await this.mondayApi.request(vy,{input:{upload_id:e.uploadId,holder:{type:"ITEM",id:e.itemId},board_id:e.boardId,parts:[{part_number:1,etag:e.etag}]}},{versionOverride:"dev"})).complete_upload,a=JSON.stringify({added_file:{fileType:"ASSET",name:t.filename,assetId:String(t.id)}});return await this.mondayApi.request(Iy,{boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,value:a}),{content:{asset_id:t.id,filename:t.filename,content_type:t.content_type,file_size:t.file_size,url:t.url,filelink:t.filelink}}}},class extends ae{constructor(){super(...arguments),this.name="link_board_items_workflow",this.type=b.READ,this.annotations=te({title:"Link Board Items Workflow",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the required playbook for linking items across boards via board-relation columns. When to use: any board-relation / cross-board linking task. **Hard gate — you MUST call this BEFORE get_board_items_page, or change_item_column_values in the same turn. No discovery, matching, or write happens first.** Triggers: **link** or **connect** items **across boards** (board-relation / "connect boards" / pairs) — also vague phrasings where only one side is named ("link this to **an** item on another board", "**the matching** row"). This tool is read-only (no API).'}getInputSchema(){return Ey}async executeInternal(e){return{content:Ty}}},class extends ae{constructor(){super(...arguments),this.name="fetch_file_content",this.type=b.READ,this.annotations=te({title:"Fetch File Content",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch and extract the text content from a file stored in a monday.com files column.\n\nUse this tool when you need to read, summarize, or analyze the content of files attached to board items. Provide the item ID and column ID from the get_board_items_page response — the column value will be a URL like \"https://monday.com/protected_static/...\" indicating a file is present (null means no file).\n\nPROACTIVE USE: If you retrieve board items and notice a files column with a non-null value (a URL), consider fetching its content if it could help answer the user's question — don't wait to be explicitly asked.\n\nSupported file types and what is returned:\n- Text files (.txt, .md, .csv, .json): raw text content\n- Word documents (.docx): extracted text content\n- PDF files (.pdf): extracted text content\n- Excel files (.xlsx, .xls): extracted text content per sheet\n- Images (.png, .jpg, .gif, .webp, .svg, .bmp, .ico): returns the public URL so you can view or analyze the image directly\n\nText responses include a total_length field. If has_more is true, the content was truncated — you can call this tool again with next_offset if you need the remaining content. For very large Excel workbooks, extraction_truncated: true means the text was cut short and the rest of the workbook is not available.\n\nWhen to use:\n- User asks to summarize, read, or analyze the content of a file in a files column\n- User asks questions about what is inside a file (e.g., \"what does the PDF say?\")\n- User wants to extract data from a CSV or Excel file attached to a board item\n- A board item has a files column with a non-null value and the user's question may be answered by its content — even if the user didn't explicitly ask to read the file\n\nWhen NOT to use:\n- The files column value is null (no file uploaded for that item)"}getInputSchema(){return By}async executeInternal(e){const{item_id:t,column_id:a,file_name:i,offset:n=0}=e,o=await this.mondayApi.request(Ay,{itemId:t,columnId:a}),r=o?.items?.[0]?.assets;if(!r||0===r.length)return{content:{message:`No file found for item ${t} in column ${a}. The column may be empty or the column ID may be incorrect.`}};const s=this.isXlsxStreamingEnabled()?Cy:Ry;return{content:{files:await Promise.all(r.map((e=>qy(e,n,s,i))))}}}isXlsxStreamingEnabled(){return this.context?.deps?.flagChecker?.("mcp-fetch-file-content-xlsx-streaming")??!0}},class extends ae{constructor(){super(...arguments),this.name="list_automations",this.type=b.READ,this.annotations=te({title:"List Board Automations",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'List all automations on a specific monday.com board, including their ids, titles, active state, and configuration.\nReturns two groups: "workflows" (fully manageable, supports pagination via limit/cursor) and "legacyAutomations" (READ-ONLY automations set up in an older way — returned on the first page only, when no cursor is given).\nAlways present BOTH groups to the user together as one list of board automations — never omit or hide "legacyAutomations". The split and the read-only limitation are internal context for you only: don\'t volunteer them and don\'t label any automation "legacy" or "read-only". Only if the user asks to act on a legacy one, briefly explain it can\'t be changed (e.g. "This one was set up in an older way and can\'t be modified here").\nCall this FIRST before manage_automations — it is the only way to resolve an automation id from a name or description. Never guess an automation id.\nWhen NOT to use: Do not call this tool to get general board information unrelated to automations.\n'}getInputSchema(){return Yy}async executeInternal(e){try{const a=!e.cursor,i={boardIds:[e.boardId],limit:e.limit??100,includeLegacy:a,...e.cursor?{cursor:e.cursor}:{}},n=await this.mondayApi.request(Gy,i),o=(n.board_automations?.items??[]).map(Wy),r=n.board_automations?.cursor??null,s=a?(t=n.board_automations?.legacy_automations,null==t||"object"==typeof t&&"error"in t?null:t):null;return{content:{message:`Found ${o.length} live workflow(s) on board ${e.boardId}`,workflows:o,...null!=s?{legacyAutomations:s}:{},pagination:{nextCursor:r,hasMore:null!==r}}}}catch(e){bm(e,"list live workflows")}var t}},class extends ae{constructor(){super(...arguments),this.name="manage_automations",this.type=b.WRITE,this.annotations=te({title:"Manage Automations",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Activate, deactivate, or delete an existing monday.com automation.\n\nRequires an automation id. When the user refers to an automation by name, always call list_automations first to resolve the id — never guess or infer ids.\n\nActions:\n- activate: enables a paused automation so it starts responding to its trigger.\n- deactivate: pauses an automation while preserving its definition.\n- delete: permanently removes an automation — irreversible.\n\nWhen intent is ambiguous ("stop", "turn off", "pause"), prefer deactivate over delete.'}getInputSchema(){return Jy}async executeInternal(e){const t=e;switch(t.action){case"activate":return this.activateWorkflow(t);case"deactivate":return this.deactivateWorkflow(t);case"delete":return this.deleteWorkflow(t)}}async activateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(Qy,t,{versionOverride:"dev"});if(!a.activate_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} activation did not report success`);return{content:{message:`Workflow ${e.workflowId} activated`,workflowId:e.workflowId,isActive:!0}}}catch(e){bm(e,"activate workflow")}}async deactivateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(Ky,t,{versionOverride:"dev"});if(!a.deactivate_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} deactivation did not report success`);return{content:{message:`Workflow ${e.workflowId} deactivated`,workflowId:e.workflowId,isActive:!1}}}catch(e){bm(e,"deactivate workflow")}}async deleteWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(zy,t,{versionOverride:"dev"});if(!a.delete_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} deletion did not report success`);return{content:{message:`Workflow ${e.workflowId} deleted`,workflowId:e.workflowId}}}catch(e){bm(e,"delete workflow")}}},class extends ae{constructor(e,t,a){super(e,a),this.apiToken=t,this.name="create_automation",this.type=b.WRITE,this.annotations=te({title:"Create Automation",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'\n Creates an automation on a monday board from a structured natural-language description.\n\nUse this tool only when you know:\n- boardId\n- the user\'s intended trigger\n- at least one intended action\n- any details the user provided that are relevant to the trigger, conditions, or actions\n\nThe caller does not need to know the exact available automation blocks or their required fields. Describe the user\'s intent clearly — the tool will translate that intent into supported blocks and values.\n\nIf a required detail is missing from the user\'s request, ask for clarification before calling the tool.\n\nIf the tool returns status: "needs_clarification", present the unresolved fields to the user, gather answers, then call the tool again.\n\nDescribe the automation in this format:\n\nTrigger:\n When <the event that should start the automation>\n Details:\n <relevant detail>: <value>\n\nConditions:\n - Only if <condition that should be true>\n Details:\n <relevant detail>: <value>\n\nActions:\n - <action the automation should perform>:\n <relevant detail>: <value>\n\nRules:\n- Use one trigger.\n- Conditions are optional.\n- Multiple conditions mean AND.\n- Use one or more actions.\n- Do not use branching.\n- Use natural language, not block IDs or internal field names.\n- Actions may reference values from the trigger context, such as "{{item name}}", "{{creator}}", "{{status}}", "{{group}}", or "{{board}}".\n\nTerminology:\n- Trigger: the event that starts the automation, such as "when a new item is created".\n- Conditions: optional requirements that must be true before actions run.\n- Actions: what the automation does when it runs.\n\nExample:\n\nTrigger:\n When a new item is created\n\nActions:\n - Send a notification:\n Recipient: John Snow\n Title: Important Update\n Message: The item "{{item name}}" was created.\n\n - Move the item to a group:\n Group: Top group\n'}getInputSchema(){return Zy}async executeInternal(e){try{const a="function"==typeof this.apiToken?this.apiToken():this.apiToken,i=(t=this.context,t?.fetchConfig?.fetch??Xy),n=await i({serviceName:"platform-agent",path:"/platform-ai-gateway/agents/lite-builder",method:"POST",headers:{...this.context?.fetchConfig?.fetch?{}:{Authorization:a},"Content-Type":"application/json"},body:JSON.stringify({userPrompt:e.userPrompt,boardId:e.boardId}),signal:AbortSignal.timeout(18e4)});if(!n.ok){const e=await n.text().catch((()=>""));throw new _m(`lite-builder responded with HTTP ${n.status}${e?`: ${e}`:""}`,"UPSTREAM_HTTP_ERROR")}return{content:await n.json()}}catch(e){bm(e,"create automation")}var t}},class extends ae{constructor(){super(...arguments),this.name="get_automation_runs",this.type=b.READ,this.annotations=te({title:"Get Automation Runs",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Read automation/workflow run history. Read-only.\n\nModes:\n- "history": paginated run feed (state, duration, error reason). Use "filters" to narrow results and "nextPageOffset" to page (offset-only — next page = previous offset + returned count).\n- "detail": single run by "triggerUuid" (required) — returns block steps and MCP tool calls. Set "includeToolEvents": false to skip tool calls.\n\nScope: provide "boardId" for a specific board or "accountWide": true. One is required.\n\nKnown event states: "success", "failure", "exhausted".'}getInputSchema(){return rv}async executeInternal(e){if(!e.boardId&&!e.accountWide)return{content:{message:'Either "boardId" or "accountWide": true must be provided.'}};try{return"detail"===e.mode?await this.runDetail(e):await this.runHistory(e)}catch(e){bm(e,"get automation runs")}}async runHistory(e){const t=e.nextPageOffset??0,a={...e.filters??{},...e.boardId?{boardId:e.boardId}:{}},i=await this.mondayApi.request(tv,{nextPageOffset:t,filters:a}),n=i.trigger_events?.triggerEvents??[],o=function(e){return e.reduce(((e,t)=>{const a=t.eventState??"unknown";return e[a]=(e[a]??0)+1,e}),{})}(n),r=e.boardId?`board ${e.boardId}`:"account-wide";return{content:{message:`Returned ${n.length} run(s) (${r}) at offset ${t}. By state: ${function(e){const t=Object.entries(e).map((([e,t])=>`${e}=${t}`));return t.length?t.join(", "):"none"}(o)}. Offset-only pagination — for the next page request offset ${t+n.length}.`,scope:r,offset:t,count:n.length,stateCounts:o,runs:n}}}async runDetail(e){if(!e.triggerUuid)return{content:{message:'detail mode requires "triggerUuid".'}};const t=!1!==e.includeToolEvents,a=e.blockEventsOffset??0,i=e.toolEventsOffset??0,n=(await this.mondayApi.request(av,{triggerUuid:e.triggerUuid})).trigger_event;if(!n)return{content:{message:`No run found for triggerUuid ${e.triggerUuid}.`,triggerUuid:e.triggerUuid,found:!1}};const[o,r]=await Promise.all([this.mondayApi.request(iv,{triggerUuid:e.triggerUuid,nextPageOffset:a}),t?this.mondayApi.request(nv,{triggerUuid:e.triggerUuid,nextPageOffset:i}):Promise.resolve(null)]),s=o.block_events?.blockEvents??[],d=r?.tool_events?.tool_events??[];return{content:{message:`Run ${e.triggerUuid}: state=${n.eventState??"unknown"}, ${s.length} block step(s), ${d.length} tool call(s).`,found:!0,run:n,blockEvents:s,blockEventsOffset:a,toolEvents:d,toolEventsOffset:i,toolEventsIncluded:t}}}},class extends ae{constructor(){super(...arguments),this.name="get_automation_statistics",this.type=b.READ,this.annotations=te({title:"Get Automation Statistics",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Aggregate automation run statistics. Read-only.\n\nBreakdowns:\n- "totals": success/failure/total counts at the account or board level.\n- "by_entity": per-automation and per-workflow counts for a given "runStatus" (required: "success" | "failure" | "exhausted"). Use "excludeAutomationIds" to omit specific automations.\n\nScope: provide "boardId" for a specific board or "accountWide": true. One is required.\n\nOptional "userIds" narrows results to specific creators.'}getInputSchema(){return pv}async executeInternal(e){if(!e.boardId&&!e.accountWide)return{content:{message:'Either "boardId" or "accountWide": true must be provided.'}};const t=e.boardId?function(e){const t=Number(e.trim());if(!Number.isInteger(t)||t<=0)throw new Error(`Invalid boardId: '${e}' is not a positive integer.`);return t}(e.boardId):void 0,a=e.boardId?`board ${e.boardId}`:"account-wide";try{return"by_entity"===e.breakdown?await this.runByEntity(e,t,a):await this.runTotals(e,t,a)}catch(e){bm(e,"get automation statistics")}}async runTotals(e,t,a){const i=(await this.mondayApi.request(sv,{filters:{board_id:t,user_ids:e.userIds}})).account_trigger_statistics;return{content:{message:`Totals (${a}): success=${i?.success??0}, failure=${i?.failure??0}, total=${i?.total??0}.`,scope:a,breakdown:"totals",statistics:i}}}async runByEntity(e,t,a){if(!e.runStatus)return{content:{message:'by_entity breakdown requires "runStatus" (success | failure | exhausted).'}};const i=(await this.mondayApi.request(dv,{runStatus:e.runStatus,filters:{board_id:t,automation_ids:e.excludeAutomationIds,user_ids:e.userIds}})).account_triggers_statistics_by_entity_id;return{content:{message:`By-entity '${e.runStatus}' statistics (${a}).`,scope:a,breakdown:"by_entity",runStatus:e.runStatus,automationStatistics:i?.automation_statistics,workflowStatistics:i?.workflow_statistics}}}},class extends ae{constructor(){super(...arguments),this.name="configure_ai_column",this.type=b.WRITE,this.annotations=te({title:"Configure AI Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add AI to a column or set up an AI column on a monday.com board. Use this tool when the user wants to automatically categorize, summarize, translate, extract, generate text, improve writing, or assign people using AI on a column. This is the right tool for requests like "add AI to a column", "set up automatic extraction/categorization/summarization", "make a column use AI", "configure AI on a column", or "use AI to automatically fill a column".\n\nThe column must already exist on the board with a compatible type for the chosen block. To create a new AI column, first use create_column to create the column, then use this tool to add AI behavior.\n\nBLOCK TYPES (only pass fields that apply to the chosen block_type):\n- categorize: { block_type, source_type, source_column_id?, additional_instructions? } — assigns labels from target column\'s existing status/dropdown options\n- summarize: { block_type, source_type, source_column_id?, additional_instructions? } — generates concise summaries\n- translate: { block_type, source_type, source_column_id?, target_language } — translates to target language\n- improve_text: { block_type, source_type, source_column_id?, tone?, improver_length?, refinement_type? } — rewrites/fixes text\n- extract: { block_type, source_type, source_column_id?, entity_type, custom_instructions?, additional_instructions? } — extracts structured info\n- open_block: { block_type, ai_query } — flexible custom prompt, reference columns via {pulse.column_id}\n- write_me: { block_type, ai_query, tone, output_length } — generates new text from prompt\n- person_assignment: { block_type, source_type, source_column_id?, groups } — assigns people based on context\n\nSOURCE TYPES (required for all blocks except open_block and write_me):\n- item_name: uses the item\'s name as input\n- thread: uses the item\'s updates/comments as input\n- column: uses another column\'s value (requires source_column_id)\n- emails_and_activities: uses emails & activities (categorize only)\n\nCOLUMN REFERENCE SYNTAX (for open_block and write_me ai_query):\n- {pulse.column_id} — regular board column\n- {pulse.name} — the item name\n- {pulse.subitem.column_id} — subitem column\n\nRELATED TOOLS:\n- create_column — create the target column first if it doesn\'t exist\n- get_board_schema — discover existing columns and their types/IDs'}getInputSchema(){return gv}async executeInternal(e){const t=void 0!==e.run_backfill?{run_backfill:e.run_backfill}:void 0;try{switch(e.block_type){case"categorize":return this.handleCategorize(e.board_id,e,t);case"summarize":return this.handleSummarize(e.board_id,e,t);case"translate":return this.handleTranslate(e.board_id,e,t);case"improve_text":return this.handleImproveText(e.board_id,e,t);case"extract":return this.handleExtract(e.board_id,e,t);case"open_block":return this.handleOpenBlock(e.board_id,e,t);case"write_me":return this.handleWriteMe(e.board_id,e,t);case"person_assignment":return this.handlePersonAssignment(e.board_id,e,t)}}catch(e){bm(e,"configure AI column")}}validateSourceType(e,t){if(!e.source_type)throw new Error(`source_type is required for ${t} block`);if("column"===e.source_type&&!e.source_column_id)throw new Error('source_column_id is required when source_type is "column"')}async handleCategorize(e,t,a){this.validateSourceType(t,"categorize");const i=await this.mondayApi.request(lv,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_categorize_ai_column?.column_id}}}async handleSummarize(e,t,a){this.validateSourceType(t,"summarize");const i=await this.mondayApi.request(cv,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_summarize_ai_column?.column_id}}}async handleTranslate(e,t,a){if(this.validateSourceType(t,"translate"),!t.target_language)throw new Error("target_language is required for translate block");const i=await this.mondayApi.request(mv,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,targetLanguage:t.target_language,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_translate_ai_column?.column_id}}}async handleImproveText(e,t,a){this.validateSourceType(t,"improve_text");const i=await this.mondayApi.request(uv,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,tone:t.tone,length:t.improver_length,refinementType:t.refinement_type,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_improve_text_ai_column?.column_id}}}async handleExtract(e,t,a){if(this.validateSourceType(t,"extract"),!t.entity_type)throw new Error("entity_type is required for extract block");if("custom"===t.entity_type&&!t.custom_instructions)throw new Error('custom_instructions is required for extract block when entity_type is "custom"');const i=await this.mondayApi.request(hv,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,entityType:t.entity_type,customInstructions:t.custom_instructions,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_extract_ai_column?.column_id}}}async handleOpenBlock(e,t,a){if(!t.ai_query)throw new Error("ai_query is required for open_block block");const i=await this.mondayApi.request(fv,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_open_block_ai_column?.column_id}}}async handleWriteMe(e,t,a){if(!t.ai_query)throw new Error("ai_query is required for write_me block");if(!t.tone)throw new Error("tone is required for write_me block");if(!t.output_length)throw new Error("output_length is required for write_me block");const i=await this.mondayApi.request(_v,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,tone:t.tone,length:t.output_length,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_write_me_ai_column?.column_id}}}async handlePersonAssignment(e,t,a){if(this.validateSourceType(t,"person_assignment"),!t.groups||0===t.groups.length)throw new Error("groups is required for person_assignment block");const i=await this.mondayApi.request(bv,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,groups:t.groups,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_person_assignment_ai_column?.column_id}}}},class extends ae{constructor(){super(...arguments),this.name="remove_ai_from_column",this.type=b.WRITE,this.annotations=te({title:"Remove AI from Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0})}getDescription(){return"Remove AI from a column on a monday.com board. Use this tool when the user wants to disable AI on a column, turn off AI automation, stop AI from running on a column, or delete the AI behavior from a column. This deletes all AI automation recipes and the app feature extension associated with the column. The column itself is not deleted — only its AI behavior is removed.\n\nUse get_board_schema to find column IDs before calling this tool."}getInputSchema(){return vv}async executeInternal(e){try{const t=await this.mondayApi.request(yv,{boardId:e.board_id.toString(),columnId:e.column_id});return{content:{message:"AI removed from column successfully",column_id:t.remove_ai_from_column?.column_id,success:t.remove_ai_from_column?.success}}}catch(e){bm(e,"remove AI from column")}}},class extends ae{constructor(){super(...arguments),this.name="submit_bug_or_feature_request",this.type=b.READ,this.annotations=te({title:"Submit Bug or Feature Request",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Report a bug, submit a feature request, or share feedback about the monday.com product or this integration.\n\nCall this tool proactively — not just when a user explicitly asks. Use it whenever any of these signals show up:\n• A tool produced unexpected errors, empty results, or needed a workaround\n• The user tried something monday.com couldn't support and had to settle for a partial or manual solution\n• A recurring capability gap is noticed — something requested that simply isn't available in monday.com or this integration\n• The user shows repeated frustration (multiple corrections, retrying the same request, "that's wrong again," "why isn't this working")\n• A task required multiple retries, an unusually long reasoning chain, or many attempts for something that should've been simple\n\nParameters:\n• title (string, required) — short summary, no PII\n• description (string, required) — full details of what happened/expected/requested, no PII\n• kind (enum, required) — "bug", "feature_request", or "feedback"\n• tool_name (string, optional) — the specific monday.com tool the feedback relates to (e.g. "create_item")\n\nRestriction: Use strictly for things related to monday.com — not for other tools (Google Drive, Slack, GitHub, etc.) that may be in the conversation context. ${Iv}`}getInputSchema(){return wv}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,this.sessionContext.metadata.title=e.title,this.sessionContext.metadata.description=e.description,e.tool_name&&(this.sessionContext.metadata.tool_name=e.tool_name),{content:{message:"Feedback submitted successfully. Thank you for helping improve the monday.com MCP server."}}}},class extends ae{constructor(){super(...arguments),this.name="get_monday_knowledge",this.type=b.READ,this.annotations=te({title:"Get Monday Knowledge",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Ask a question about monday.com and get an AI-generated answer from the official knowledge base.\n\nUse kind="general" for questions about using monday.com — features, automations, UI, help center, and settings. Returns cited source articles with links.\nUse kind="developer_docs" for questions about the monday.com API — GraphQL queries and mutations, authentication, rate limits, webhooks, schema, API best practices, and building apps.\n\nImportant: do not include PII data in the questions.'}getInputSchema(){return Dv}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,e.kind===Av?this.queryDeveloperDocs(e.query):this.queryGeneralKnowledge(e.query)}async queryGeneralKnowledge(e){const t={query:e},a=(await this.mondayApi.request(Tv,t)).knowledge_base_search;a?.answer||bm(new Error("No answer found in the knowledge base. Try rephrasing your question."),"get_monday_knowledge"),this.sessionContext.metadata??={},this.sessionContext.metadata.query=e,this.sessionContext.metadata.answer=a.answer;const i=(a.raw_snippets??[]).filter((e=>e.url&&e.title)).map((e=>({title:e.title,url:e.url,snippet:e.text??""})));return{content:{answer:a.answer,sources:i,kind:Sv}}}async queryDeveloperDocs(e){const t={query:e,retrieval_only:!0},a=(await this.mondayApi.request(Ev,t)).ask_developer_docs;return a?.answer||bm(new Error("No answer found in developer docs. Try rephrasing your question."),"get_monday_knowledge"),this.sessionContext.metadata??={},this.sessionContext.metadata.query=e,this.sessionContext.metadata.answer=a.answer,{content:{answer:a.answer,sources:[],kind:Av}}}}],rI=[...oI,...nI,...ee];export{Em as ToolMode,b as ToolType,oI as allGraphqlApiTools,ee as allMondayAppsTools,nI as allMondayDevTools,rI as allTools};
|
|
3065
|
+
`),i=await this.mondayApi.request(a);return i.__type?{content:{message:"Type details retrieved",data:{name:i.__type.name,kind:i.__type.kind,description:i.__type.description??null,fields:i.__type.fields??[],inputFields:i.__type.inputFields??[],interfaces:i.__type.interfaces??[],enumValues:i.__type.enumValues??[],possibleTypes:i.__type.possibleTypes??[]}}}:{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`}}catch(e){const t=e instanceof Error?e.message:"Unknown error",a=t.includes("JSON");return{content:`Error fetching type details: ${t}${a?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var t}},class extends ae{constructor(){super(...arguments),this.name="create_custom_activity",this.type=b.WRITE,this.annotations=te({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return df}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(im,t),{content:{message:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`,name:e.name,color:e.color,icon_id:e.icon_id}}}},class extends ae{constructor(){super(...arguments),this.name="create_notification",this.type=b.WRITE,this.annotations=te({title:"Create Notification",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Send a notification to a user via the bell icon and optionally by email. Use target_type "Post" for updates/replies or "Project" for items/boards.'}getInputSchema(){return lf}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{const a=await this.mondayApi.request(pf,t);if(!a.create_notification?.id)throw new _m(`No notification was created for user ${e.user_id} on ${e.target_type} target ${e.target_id}. Verify the user has access to the target and that target_id matches target_type ("Post" for an update/reply id, "Project" for an item/board id).`,hm);return{content:{message:`Notification ${a.create_notification.id} sent to user ${e.user_id}`,notification_id:a.create_notification.id,user_id:e.user_id,target_id:e.target_id,target_type:e.target_type,text:a.create_notification.text??e.text}}}catch(t){bm(t,`send notification to user ${e.user_id}`)}}},class extends ae{constructor(){super(...arguments),this.name="create_timeline_item",this.type=b.WRITE,this.annotations=te({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return Ef}async executeInternal(e){const t={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(t.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const a=await this.mondayApi.request(nm,t);return{content:{message:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`,timeline_item_id:a.create_timeline_item?.id,item_id:e.item_id,title:e.title}}}},class extends ae{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=b.READ,this.annotations=te({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return Wf}async executeInternal(e){const t=await this.mondayApi.request(om);if(!t.custom_activity||0===t.custom_activity.length)return{content:{message:"No custom activities found",data:[]}};const a=t.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:{message:`Found ${a.length} custom activities`,data:a}}}},class extends ae{constructor(){super(...arguments),this.name="read_docs",this.type=b.READ,this.annotations=te({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get information about monday.com documents. Supports two modes:\n\nMODE: "content" (default) — Fetch documents with their full markdown content.\n- Requires: type ("ids" | "object_ids" | "workspace_ids") and ids array\n- For a doc that lives as a board view, pass board_id and view_id instead of type/ids. They are the ids in the board URL: https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Omit view_id to read every doc view of the board. Such docs cannot be found by type "ids"/"object_ids".\n- Supports pagination via page/limit. Check has_more_pages in response.\n- If type "ids" returns no results, automatically retries with object_ids.\n- Set include_blocks: true to include block IDs, types, and positions in the response — required before calling update_doc.\n- Blocks default to 25 per page. Use blocks_limit and blocks_page to paginate through long documents.\n- Set include_comments: true to fetch all comments and replies on the document. Each comment is enriched with anchor info (block_id, selection_from, selection_length) indicating which block and text range it\'s attached to. Use comments_limit to control how many comments per item (default 50).\n\nMODE: "version_history" — Fetch the edit history of a single document.\n- Requires: ids with the document\'s object_id (use the object_id field from content mode results, NOT the id field).\n- The object_id is the numeric ID visible in the document URL.\n- Returns restoring points sorted newest-first. Use version_history_limit to cap results (e.g., "last 3 changes" → version_history_limit: 3).\n- Use since/until to filter by time range. If omitted, returns full history.\n- Set include_diff: true to see what content changed between versions (fetches up to 10 diffs, may be slower).\n- Examples:\n - { mode: "version_history", ids: ["5001466606"], version_history_limit: 3 }\n - { mode: "version_history", ids: ["5001466606"], since: "2026-03-11T00:00:00Z", include_diff: true }'}getInputSchema(){return yb}async executeInternal(e){return e.mode===bb?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!(e.board_id||e.type&&e.ids&&0!==e.ids.length))throw new _m('type and ids are required when mode is "content", unless board_id is provided.',fm);let t,a,i;switch(this.sessionContext.metadata={...this.sessionContext.metadata,mode:e.mode??_b,include_comments:e.include_comments??!1,include_blocks:e.include_blocks??!1,...e.board_id&&{board_id:e.board_id,view_id:e.view_id}},e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":i=e.ids}const n=e.include_blocks??!1,o=n?{blocksLimit:e.blocks_limit,blocksPage:e.blocks_page}:{},r={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n,...o};if(e.board_id){const t=await ub(this.mondayApi,e.board_id,e.view_id,{includeBlocks:n,blocksLimit:e.blocks_limit,blocksPage:e.blocks_page});return 0===t.length?{content:fb(e.board_id,e.view_id)}:(this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:t.map((e=>e.id)),object_ids:t.flatMap((e=>e.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(t,r,n,e.include_comments??!1,e.comments_limit??50,e.blocks_limit,e.blocks_page))}let s=await this.mondayApi.request(jc,r);if((!s.docs||0===s.docs.length)&&t){const a={ids:void 0,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n,...o};s=await this.mondayApi.request(jc,a)}if(!s.docs||0===s.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const d=e.include_comments??!1,p=e.comments_limit??50;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:s.docs.flatMap((e=>e?[e.id]:[])),object_ids:s.docs.flatMap((e=>e?.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(s.docs,r,n,d,p,e.blocks_limit,e.blocks_page)}catch(e){bm(e,"read documents")}}async executeVersionHistory(e){const{include_diff:t,since:a,until:i,version_history_limit:n}=e,o=e.ids?.[0];if(!o)throw new _m('ids is required when mode is "version_history". Provide the document object_id.',fm);this.sessionContext.metadata={...this.sessionContext.metadata,mode:bb,object_ids:[o]};try{const e={docId:o,since:a,until:i},r=await this.mondayApi.request(qc,e);let s=r?.doc_version_history?.restoring_points;if(!s||0===s.length)return{content:`No version history found for document ${o}${a?` from ${a}`:""}.`};if(!t)return n&&(s=s.slice(0,n)),{content:{doc_id:o,since:a,until:i,restoring_points:s}};const d=Math.min(n??10,10),p=s.slice(0,d+1),l=s.length>d,c=(await Promise.allSettled(p.map((async(e,t)=>{if(t===p.length-1||!e.date)return e;const a=p[t+1];if(!a?.date)return e;const i={docId:o,date:e.date,prevDate:a.date},n=await this.mondayApi.request(Hc,i);return{...e,diff:n?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,t)=>"fulfilled"===e.status?e.value:p[t]))))).slice(0,d);return{content:{doc_id:o,since:a,until:i,restoring_points:c,...l&&{truncated:!0,total_count:s.length}}}}catch(e){bm(e,`fetch version history for document ${o}`)}}buildCommentAnchorMap(e){const t=new Map;for(const a of e){const e=a.content?.deltaFormat;if(!e||!Array.isArray(e))continue;let i=0;for(const n of e){const e=n.insert,o="string"==typeof e?e.length:1,r=n.attributes,s=r?.comments;if(s&&Array.isArray(s))for(const e of s){const n=String(e),r=t.get(n);if(r&&r.block_id===a.id){const e=Math.max(r.selection_from+r.selection_length,i+o);r.selection_length=e-r.selection_from}else r||t.set(n,{block_id:a.id,selection_from:i,selection_length:o})}i+=o}}return t}async fetchDocComments(e,t,a){try{const i={boardId:e,itemsLimit:100,updatesLimit:a},[n,o]=await Promise.all([this.mondayApi.request(Gc,i),this.mondayApi.request(pb,{docId:t}).catch((()=>null))]),r=n.boards?.[0]?.items_page?.items;if(!r)return[];let s=new Map;if(o){const e=(o.docs?.[0]?.blocks??[]).filter((e=>null!=e)).map((e=>{let t;if("string"==typeof e.content)try{t=JSON.parse(e.content)}catch{t={}}else t=e.content??{};return{id:e.id??"",type:e.type??"",content:t}}));s=this.buildCommentAnchorMap(e)}const d=[];for(const e of r)if(e.updates&&0!==e.updates.length)for(const t of e.updates)d.push({id:t.id,text_body:t.text_body,body:t.body,created_at:t.created_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:e.id,item_name:e.name,anchor:s.get(t.id)??null,replies:(t.replies??[]).map((e=>({id:e.id,text_body:e.text_body,body:e.body,created_at:e.created_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))});return d}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,i=!1,n=50,o,r){const s=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t,s="";try{const t={docId:e.id},a=await this.mondayApi.request(rm,t);s=a.export_markdown_from_doc.success&&a.export_markdown_from_doc.markdown?a.export_markdown_from_doc.markdown:`Error getting markdown: ${a.export_markdown_from_doc.error||"Unknown error"}`}catch(e){s=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return i&&e.object_id&&(t=await this.fetchDocComments(e.object_id,e.id,n)),{id:e.id,object_id:e.object_id,name:e.name,doc_kind:e.doc_kind,created_at:e.created_at,created_by:e.created_by?.name||"Unknown",url:e.url,relative_url:e.relative_url,workspace:e.workspace?.name||"Unknown",workspace_id:e.workspace_id,doc_folder_id:e.doc_folder_id,settings:e.settings,...a&&{blocks:(e.blocks??[]).filter((e=>null!=e)).map((e=>({id:e.id,type:e.type,parent_block_id:e.parent_block_id,position:e.position,content:e.content}))),...void 0!==o||void 0!==r?{blocks_pagination:{current_page:r??1,limit:o??25,count:(e.blocks??[]).filter((e=>null!=e)).length,has_more_pages:(e.blocks??[]).length===(o??25)}}:{}},blocks_as_markdown:s,...i&&{comments:t}}}))),d=t.page||1,p=t.limit||25,l=s.length,c=l===p;return{content:{message:`Documents retrieved (${s.length})`,pagination:{current_page:d,limit:p,count:l,has_more_pages:c},data:s}}}},class extends ae{constructor(){super(...arguments),this.name="workspace_info",this.type=b.READ,this.annotations=te({title:"Get Workspace Information",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool returns the boards, docs and folders in a workspace and which folder they are in. It returns up to 100 of each object type, if you receive 100 assume there are additional objects of that type in the workspace."}getInputSchema(){return vb}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(sm,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e,t){const{workspaces:a,boards:i,docs:n,folders:o}=e,r=a?.[0];if(!r)throw new Error("No workspace found");const s=new Map((o||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),d=[];(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(t):d.push(t)}));const p=[];return(n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.doc_folder_id&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(t):p.push(t)})),{workspace:{id:r.id,name:r.name,url:t?X_(t,r.id):void 0,description:r.description||"",kind:r.kind||"",created_at:r.created_at||"",state:r.state||"",is_default_workspace:r.is_default_workspace||!1,owners_subscribers:(r.owners_subscribers||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name&&null!=e.email)).map((e=>({id:e.id,name:e.name,email:e.email})))},folders:Array.from(s.values()),root_items:{boards:d,docs:p}}}(a,await J_(this.mondayApi));return{content:{message:"Workspace info retrieved",data:i}}}},class extends ae{constructor(){super(...arguments),this.name="list_workspaces",this.type=b.READ,this.annotations=te({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'List all workspaces available to the user, ordered by membership (user\'s workspaces first). Returns workspaces with their ID, name, and description.\n[IMPORTANT] To search for workspaces by name, use the "search" tool with searchType WORKSPACES instead — it provides faster and more accurate results.'}getInputSchema(){return Eb}async executeInternal(e){const t=t=>({limit:e.limit,page:e.page,membershipKind:t}),a=wb(await this.mondayApi.request(Ib,t(bl.Member)));let i=a;if(!Tb(a)){i=wb(await this.mondayApi.request(Ib,t(bl.All)))}if(!Tb(i))return{content:{message:"No workspaces found.",data:[]}};const n=i.length===e.limit,o=await J_(this.mondayApi),r=i.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:o&&e.id?X_(o,e.id):void 0})));return{content:{message:"Workspaces retrieved",...n?{next_page:e.page+1}:{},data:r}}}},class extends ae{constructor(){super(...arguments),this.name="create_doc",this.type=b.WRITE,this.annotations=te({title:"Create Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a new monday.com doc either inside a workspace or attached to an item (via a doc column). After creation, the provided markdown will be appended to the document.\n\nLOCATION TYPES:\n- workspace: Creates a document in a workspace (requires workspace_id, optional doc_kind, optional folder_id, optional docOwnerIds)\n- item: Creates a document attached to an item (requires item_id, optional column_id, optional docOwnerIds)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_name: "My Doc", doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, doc_name: "My Doc", folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, doc_name: "My Doc", column_id: "doc_col_1" , markdown: "..." }\n- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, doc_name: "My Doc", markdown: "...", docOwnerIds: ["<agent_owner_user_id>"] }'}getInputSchema(){return Rb}async executeInternal(e){const t=Cb.safeParse({...e,type:e.location});if(!t.success)throw new _m(`Required parameters were not provided for location parameter of ${e.location}`,lm);const a=t.data;try{let t,i,n;if(a.type===kb.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||oo.Public,folder_id:a.folder_id?.toString()}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}},r=await this.mondayApi.request(Db,o);t=r?.create_doc?.id??void 0,i=r?.create_doc?.object_id??void 0,n=r?.create_doc?.url??void 0}else if(a.type===kb.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(Ab,o),s=r.items?.[0];if(!s)throw new _m(`Item with id ${a.item_id} not found.`,hm);const d=s.board?.id,p=s.board?.columns?.find((e=>e&&e.type===Rm.Doc));let l=a.column_id;if(l){const e=s.board?.columns?.find((e=>e?.id===l));if(!e||e.type!==Rm.Doc)throw new _m(`Column ${l} is not a doc column on board ${d}.`,lm)}else if(p)l=p.id;else{const e={boardId:d.toString(),columnType:Rm.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(Xc,e);if(l=t?.create_column?.id,!l)throw new _m("Failed to create doc column.",hm)}const c={location:{board:{item_id:a.item_id.toString(),column_id:l}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}};let m;try{m=await this.mondayApi.request(Db,c)}catch(t){if(this.hasCellLimitExceeded(t)){const t=await this.getExistingItemDoc(a.item_id,l).catch((()=>{}));if(t)return this.existingItemDocResult(t,e.location)}throw t}if(t=m.create_doc?.id??void 0,i=m.create_doc?.object_id??void 0,n=m.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(Ob,a)}catch(e){console.warn("Failed to update doc name:",e)}}if(!t)throw new _m("Failed to create document.",hm);const o={docId:t,markdown:e.markdown};let r;try{r=await this.mondayApi.request(Nb,o)}catch(a){return this.createdDocContentFailureResult(a,t,i,n,e.doc_name)}const s=r?.add_content_to_doc_from_markdown?.success,d=r?.add_content_to_doc_from_markdown?.error;if(!s){const a=new _m(`Failed to add markdown content: ${d||"Unknown error"}`,cm);return this.createdDocContentFailureResult(a,t,i,n,e.doc_name)}return this.sessionContext.metadata={...this.sessionContext.metadata,location:e.location,...t&&{doc_id:t},...i&&{object_id:i}},{content:{message:"Document successfully created",doc_id:t,object_id:i,doc_url:n,doc_name:e.doc_name}}}catch(e){bm(e,"create document")}}async getExistingItemDoc(e,t){const a={itemId:e.toString(),columnId:t},i=await this.mondayApi.request(Sb,a),n=i.items?.[0]?.column_values?.find((e=>e?.id===t));return"DocValue"===n?.__typename?n.file?.doc:void 0}existingItemDocResult(e,t){return this.sessionContext.metadata={...this.sessionContext.metadata,location:t,doc_id:e.id,object_id:e.object_id},{content:{message:"The item already has a document in this column. The existing document was returned unchanged. The requested doc_name and markdown were not applied. Call add_content_to_doc with this doc_id to add the markdown, and update_doc to set the name.",doc_id:e.id,object_id:e.object_id,doc_url:e.url,doc_name:e.name,existing_doc_found:!0}}}createdDocContentFailureResult(e,t,a,i,n){const o=vm(e);return{content:{message:`Document ${t} was created, but its content could not be added: ${o.message}`,doc_id:t,object_id:a,doc_url:i,doc_name:n,is_partial_success:!0,errors:(o.errors??[]).map((e=>({...e,path:["markdown",...e.path??[]]})))}}}hasCellLimitExceeded(e){return["CellLimitExceededException","CellLimitExceeded"].some((t=>this.hasGraphQLErrorCode(e,t)))}hasGraphQLErrorCode(e,t){return!0===e?.response?.errors?.some((e=>e.extensions?.code===t))}},class extends ae{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=b.WRITE,this.annotations=te({title:"Add Content to Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add markdown content to an existing monday.com document.\n\nIDENTIFICATION: Provide doc_id, object_id, or board_id + view_id to identify the document:\n- doc_id: The document ID (the id field returned by read_docs). Takes priority if both provided.\n- object_id: The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id.\n- board_id + view_id: For a doc that lives as a board view, taken from https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Such docs have no usable doc_id/object_id until they are resolved through their board.\n\nUSAGE EXAMPLES:\n- By doc_id: { doc_id: "123", markdown: "# New Section\\nContent here" }\n- By object_id: { object_id: "456", markdown: "# New Section\\nContent here" }\n- By board view: { board_id: "18429976879", view_id: "279510271", markdown: "# New Section\\nContent here" }\n- Insert after block: { doc_id: "123", markdown: "Inserted content", after_block_id: "block_789" }'}getInputSchema(){return Ub}async executeInternal(e){if(!e.doc_id&&!e.object_id&&!e.board_id)throw new _m("Either doc_id, object_id, or board_id (with view_id) must be provided.",fm);try{let t=null;if(e.doc_id||e.object_id||!e.board_id)if(e.doc_id){const a=await this.mondayApi.request(Lb,{docId:e.doc_id});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(xb,{objectId:e.object_id});t=a.docs?.[0]??null}else{const a=await hb(this.mondayApi,e.board_id,e.view_id);if(!a.ok)throw new _m(a.error,cm);t=a.doc}if(!t){const t=e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`;throw new _m(`No document found for ${t}.`,hm)}this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t.id,...e.object_id&&{object_id:e.object_id},...e.board_id&&{board_id:e.board_id,view_id:e.view_id}};const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},i=await this.mondayApi.request($b,a);if(!i?.add_content_to_doc_from_markdown)throw new _m("Failed to add content to document — no response from API.",hm);const{success:n,block_ids:o,error:r}=i.add_content_to_doc_from_markdown;if(!n)throw new _m(`Failed to add content to document: ${r||"Unknown error"}`,cm);const s=o?.length??0;return{content:{message:`Successfully added content to document ${t.id}. ${s} block${1===s?"":"s"} created.`,doc_id:t.id,block_ids:o,doc_name:t.name,doc_url:t.url}}}catch(e){bm(e,"add content to document")}}},class extends ae{constructor(){super(...arguments),this.name="update_doc",this.type=b.WRITE,this.annotations=te({title:"Update Document",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Update an existing monday.com document. Provide doc_id (preferred), object_id, or board_id + view_id, plus an ordered operations array (executed sequentially, stops on first failure).\n\nIDENTIFYING THE DOC: A doc can live in a workspace, on an item, or as a board view. For a doc that lives as a board view, you only have a board URL — pass board_id and view_id from https://<slug>.monday.com/boards/<board_id>/views/<view_id> and they will be resolved to the doc.\n\nOPERATIONS:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (or insert after a block). Best for text, headings, lists, simple tables — no block IDs needed.\n- update_block: Update content of an existing text, code, or list_item block in-place.\n- create_block: Create a new block at a precise position. Use parent_block_id to nest inside notice_box, table cell, or layout cell.\n- delete_blocks: Permanently delete 1–100 blocks in one call. Provide all block IDs in the block_ids array. The ONLY option for BOARD, WIDGET, DOC embed, and GIPHY blocks.\n- replace_block: Delete a block and create a new one in its place (use when update_block is not supported).\n- add_comment: Create a new comment or reply on the document (doc-level, block-level, or text-selection).\n\nWHEN TO USE EACH OPERATION:\n- text / code / list_item → update_block. Use replace_block to change subtype (e.g. NORMAL_TEXT→LARGE_TITLE)\n- divider / table / image / video / notice_box / layout → replace_block (properties immutable after creation)\n- BOARD / WIDGET / DOC / GIPHY → delete_blocks only\n\nGETTING BLOCK IDs: Call read_docs with include_blocks: true — returns id, type, position, and content per block.\n\nBLOCK CONTENT (delta_format): Array of insert ops. Last op MUST be {insert: {text: "\\n"}}.\n- Plain: [{insert: {text: "Hello"}}, {insert: {text: "\\n"}}]\n- Bold: [{insert: {text: "Hi"}, attributes: {bold: true}}, {insert: {text: "\\n"}}]\n- Mention user/doc/board: [{insert: {text: "Hey "}}, {insert: {mention: {id: 12345, type: "USER"}}}, {insert: {text: "\\n"}}] — type is USER, DOC, or BOARD. id is numeric (user IDs from list_users_and_teams)\n- Inline column value: [{insert: {column_value: {item_id: 111, column_id: "status"}}}, {insert: {text: "\\n"}}]\n- Supported attributes: bold, italic, underline, strike, code, link, color, background (not applicable to mention/column_value ops)\n\nIMAGE WITH ASSET: For asset-based images, use create_block with block_type "image" and asset_id (instead of public_url). add_markdown_content does NOT support asset images — for mixed content, alternate add_markdown_content (text) and create_block (image) operations in sequence.\n\nBATCHING DELETES: delete_blocks accepts 1..100 IDs. Put ALL IDs in one operation\'s block_ids array. Never emit multiple delete_blocks operations in a row.\n\nCOMMENTS:\n- add_comment: Create a new comment or reply on the document. Three scopes:\n - Doc-level (no block_id): comment appears on the doc as a whole.\n - Block-level (block_id only): comment is anchored to a specific block. The block shows a comment indicator in the UI.\n - Text-selection (block_id + selection_from + selection_length): comment is anchored to a specific character range inside a text/code/list_item block. That text is highlighted with a comment marker.\n Block-level and text-selection comments only work on blocks with text content (text, code, list_item, title, quote). They do NOT work on: divider, page_break, table, layout, notice_box, image, video, or giphy blocks.\n Get block IDs from read_docs with include_blocks: true. Format body with HTML, not markdown. Use mentions_list for @mentions.'}getInputSchema(){return bg}async executeInternal(e){if(!e.doc_id&&!e.object_id&&!e.board_id)throw new _m("Either doc_id, object_id, or board_id (with view_id) must be provided.",fm);this.sessionContext.metadata={...this.sessionContext.metadata,operation_types:e.operations?.map((e=>e.operation_type)),operation_count:e.operations?.length??0,items_count:e.operations?.length??0,...e.object_id&&{object_id:e.object_id},...e.board_id&&{board_id:e.board_id,view_id:e.view_id}};try{let t=e.doc_id,a=e.object_id;if(!t&&!a&&e.board_id){const i=await hb(this.mondayApi,e.board_id,e.view_id);if(!i.ok)throw new _m(i.error,cm);t=i.doc.id,a=i.doc.object_id}if(!t){const e=await this.mondayApi.request(ib,{objectId:a}),i=e.docs?.[0];if(!i)throw new _m(`No document found for object_id ${a}.`,hm);t=i.id}const i=[],n=[];let o=null;for(let r=0;r<e.operations.length;r++){const s=e.operations[r];try{const e=await this.executeOperation(t,s,a);i.push(`- [OK] ${s.operation_type}${e?`: ${e}`:""}`)}catch(e){const t=vm(e),a=t.message;i.push(`- [FAILED] ${s.operation_type}: ${a}`),n.push(...(t.errors??[]).map((e=>({...e,path:["operations",r,...e.path??[]]})))),o=r;break}}const r=null!==o?o:e.operations.length,s=e.operations.length,d=`Completed ${r}/${s} operation${1===s?"":"s"} on doc ${t}.`;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t},null!==o?{content:{message:d,results:i,is_partial_success:r>0,errors:n,doc_id:t},...0===r?{isError:!0}:{}}:{content:`${d}\n\nResults:\n${i.join("\n")}\n\nDoc ID: ${t}`}}catch(e){bm(e,"update document")}}async executeOperation(e,t,a){switch(t.operation_type){case"set_name":return this.executeSetName(e,t.name);case"add_markdown_content":return this.executeAddMarkdown(e,t.markdown,t.after_block_id);case"update_block":return this.executeUpdateBlock(t.block_id,t.content);case"create_block":return this.executeCreateBlock(e,t.block,t.after_block_id,t.parent_block_id);case"delete_blocks":return this.executeDeleteBlocks(t.block_ids);case"replace_block":return this.executeReplaceBlock(e,t.block_id,t.block,t.after_block_id,t.parent_block_id);case"add_comment":return this.executeAddComment(e,a,t.body,t.parent_update_id,t.mentions_list,t.block_id,t.selection_from,t.selection_length);default:{const e=t.operation_type;throw new Error(`Unsupported operation type: "${e}"`)}}}async executeSetName(e,t){const a={docId:e,name:t},i=await this.mondayApi.request(tb,a);if(!i?.update_doc_name)throw new Error(`No confirmation from update_doc_name — rename to "${t}" may not have applied`);return`Renamed to "${t}"`}async executeAddMarkdown(e,t,a){if(!t.trim())throw new Error("markdown must not be empty");const i={docId:e,markdown:t,afterBlockId:a},n=await this.mondayApi.request(ab,i),o=n?.add_content_to_doc_from_markdown;if(!o?.success)throw new Error(o?.error||"Failed to add markdown content");const r=o.block_ids?.length??0;return`${r} block${1===r?"":"s"} added${o.block_ids?.length?`. Block IDs: ${o.block_ids.join(", ")}`:""}`}async executeUpdateBlock(e,t){const a=function(e){switch(e.block_content_type){case"text":return{deltaFormat:Bb(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:Bb(e.delta_format),language:e.language};case"list_item":return{deltaFormat:Bb(e.delta_format),checked:e.checked,indentation:e.indentation};default:{const t=e.block_content_type;throw new Error(`Unsupported block_content_type: "${t}"`)}}}(t),i={blockId:e,content:JSON.stringify(a)},n=await this.mondayApi.request(nb,i);if(!n?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,i){const n=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:Mb(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:Pb(e.alignment),direction:Vb(e.direction)}};case"list_item":return{list_block:{delta_format:Mb(e.delta_format),list_block_type:e.list_block_type?e.list_block_type:void 0,indentation:e.indentation}};case"code":return{text_block:{delta_format:Mb(e.delta_format),text_block_type:dp.Code}};case"divider":return{divider_block:{}};case"page_break":return{page_break_block:{}};case"image":if(null==e.asset_id&&!e.public_url)throw new Error("image block requires either asset_id or public_url");return{image_block:null!=e.asset_id?{asset_id:String(e.asset_id),width:e.width}:{public_url:e.public_url,width:e.width}};case"video":return{video_block:{raw_url:e.raw_url,width:e.width}};case"notice_box":return{notice_box_block:{theme:e.theme}};case"table":return{table_block:{row_count:e.row_count,column_count:e.column_count,width:e.width,column_style:e.column_style?.map((e=>({width:e.width})))}};case"layout":return{layout_block:{column_count:e.column_count,column_style:e.column_style?.map((e=>({width:e.width})))}};default:{const t=e.block_type;throw new Error(`Unsupported block_type: "${t}"`)}}}(t);if(i){const e=Object.keys(n);if(1!==e.length)throw new Error(`Cannot inject parent_block_id: expected exactly 1 key in block input, got: ${e.join(", ")}`);const t=e[0],a=n[t];if(!a||"object"!=typeof a)throw new Error(`Cannot inject parent_block_id into block type "${t}" — block value is not an object`);a.parent_block_id=i}const o={docId:e,afterBlockId:a,blocksInput:[n]},r=await this.mondayApi.request(cb,o),s=r?.create_doc_blocks;if(!s||0===s.length)throw new Error("No blocks returned from create_doc_blocks");return`Block created (ID: ${s.map((e=>e.id)).join(", ")})`}async executeDeleteBlock(e){const t={blockId:e},a=await this.mondayApi.request(ob,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async executeDeleteBlocks(e){if(0===e.length)throw new Error("block_ids must not be empty");const t={blockIds:e},a=await this.mondayApi.request(rb,t);if(!a?.delete_doc_blocks||0===a.delete_doc_blocks.length)throw new Error("No response from delete_doc_blocks");const i=a.delete_doc_blocks.map((e=>e.id)).join(", ");return`${a.delete_doc_blocks.length} block(s) deleted (IDs: ${i})`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(sb,{docId:e}),i=a.docs?.[0];if(!i?.object_id)throw new Error(`Could not resolve object_id for doc ${e}`);return i.object_id}async resolveDocItemId(e){const t=await this.mondayApi.request(db,{boardId:e}),a=t.boards?.[0]?.items_page?.items?.[0]?.id;if(!a)throw new Error(`No item found on the document backing board (object_id: ${e})`);return a}async fetchAllBlockContent(e){const t=await this.mondayApi.request(pb,{docId:e});return(t.docs?.[0]?.blocks??[]).filter((e=>null!=e)).map((t=>{let a;if("string"==typeof t.content)try{a=JSON.parse(t.content)}catch{throw new Error(`Failed to parse content of block ${t.id} in doc ${e} as JSON`)}else a=t.content??{};return{id:t.id??"",type:t.type??"",content:a}}))}async executeAddComment(e,t,a,i,n,o,r,s){if((null!=r||null!=s)&&!o)throw new Error("selection_from and selection_length require block_id");if(null!=r!=(null!=s))throw new Error("selection_from and selection_length must both be provided together");const d=o?Array.isArray(o)?o:[o]:[];if((null!=r||null!=s)&&d.length>1)throw new Error("selection_from and selection_length are only supported with a single block_id");const p=await this.resolveObjectId(e,t),l=await this.resolveDocItemId(p);let c;if(n){const e=JSON.parse(n),t=Nf.safeParse(e);if(!t.success)throw new Error(`Invalid mentions_list format: ${t.error.message}`);c=t.data}const m={itemId:l,body:a,parentId:i?.toString(),mentionsList:c},u=await this.mondayApi.request(lb,m);if(!u.create_update?.id)throw new Error("Failed to create comment: no update returned");const h=u.create_update.id,f=Number(h),_=i?`Reply to update ${i}`:"Comment";if(d.length>0){if(Number.isNaN(f))throw new Error(`${_} created (update ID: ${h}) but block annotation aborted: comment ID is not numeric and cannot be used as a delta reference`);const t=await this.fetchAllBlockContent(e);for(const a of d){const i=t.find((e=>e.id===a));if(!i)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: block ${a} not found in doc ${e}`);const n=i.content.deltaFormat;if(!n)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: block ${a} has no deltaFormat — only text, code, and list_item blocks are supported`);let o=0;for(const e of n)o+="string"==typeof e.insert?e.insert.length:1;if(0===o)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: block ${a} has an empty deltaFormat and cannot be annotated`);const d=r??0,p=s??o;if(d+p>o)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: selection [${d}, ${d+p}) is out of range for block ${a} (total length ${o})`);let l;try{l=qb(n,f,d,p)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`${_} created (update ID: ${h}) but delta annotation failed for block ${a}: ${t}`)}const c={...i.content,deltaFormat:l},m=await this.mondayApi.request(nb,{blockId:a,content:JSON.stringify(c)});if(!m?.update_doc_block)throw new Error(`${_} created (update ID: ${h}) but block annotation write returned no confirmation for block ${a}`)}}const b=d.length;return`${_} created${b>1?` across ${b} blocks`:1===b?" on block":""} (update ID: ${h})`}async executeReplaceBlock(e,t,a,i,n){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,i,n)}`}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Original block ${t} was deleted, but replacement creation failed: ${a}. The original block is gone.`)}}},class extends ae{constructor(){super(...arguments),this.name="update_workspace",this.type=b.WRITE,this.annotations=te({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return Eg}async executeInternal(e){const t={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},a=await this.mondayApi.request(Tg,t),i=await J_(this.mondayApi),n=i?X_(i,a.update_workspace?.id):void 0;return{content:{message:`Workspace ${a.update_workspace?.id} updated`,workspace_id:a.update_workspace?.id,workspace_name:a.update_workspace?.name,workspace_url:n}}}},class extends ae{constructor(){super(...arguments),this.name="update_folder",this.type=b.WRITE,this.annotations=te({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return Sg}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:i}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const n={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:t?{is_after:i,object_id:t,object_type:a}:void 0},o=await this.mondayApi.request(Ag,n);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends ae{constructor(){super(...arguments),this.name="create_workspace",this.type=b.WRITE,this.annotations=te({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return Ng}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(Dg,t),i=await J_(this.mondayApi),n=i&&a.create_workspace?.id?X_(i,a.create_workspace.id):void 0;return{content:{message:`Workspace ${a.create_workspace?.id} successfully created`,workspace_id:a.create_workspace?.id,workspace_name:a.create_workspace?.name,workspace_url:n}}}},class extends ae{constructor(){super(...arguments),this.name="create_folder",this.type=b.WRITE,this.annotations=te({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return kg}async executeInternal(e){const t={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},a=await this.mondayApi.request(Og,t);return{content:{message:`Folder ${a.create_folder?.id} successfully created`,folder_id:a.create_folder?.id,folder_name:a.create_folder?.name}}}},class extends ae{constructor(){super(...arguments),this.name="move_object",this.type=b.WRITE,this.annotations=te({title:"Move Object",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move a folder, board, or overview in monday.com. Use position for relative placement based on another object, parentFolderId for folder changes, workspaceId for workspace moves, and accountProductId for account product changes."}getInputSchema(){return $g}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const d={folderId:t,position:a?{is_after:n,object_id:a,object_type:i}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},p=await this.mondayApi.request(Ag,d);return{content:{message:"Object moved",object_id:p.update_folder?.id}}}async executeUpdateBoardHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const d={boardId:t,attributes:{position:a?{is_after:n,object_id:a,object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(Cg,d);return p.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:p.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${p.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const d={overviewId:t,attributes:{position:a?{is_after:n,object_id:a,object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(Rg,d);return p.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:p.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${p.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:t}=e;switch(t){case ld.Folder:return this.executeUpdateFolder(e);case ld.Board:return this.executeUpdateBoardHierarchy(e);case ld.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends ae{constructor(){super(...arguments),this.name="create_dashboard",this.type=b.WRITE,this.annotations=te({title:"Create Dashboard",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Use this tool to create a new monday.com dashboard that aggregates data from one or more boards. \n Dashboards provide visual representations of board data through widgets and charts.\n \n Use this tool when users want to:\n - Create a dashboard to visualize board data\n - Aggregate information from multiple boards\n - Set up a data visualization container for widgets"}getInputSchema(){return Ig}async executeInternal(e){try{const t={name:e.name,workspace_id:e.workspace_id.toString(),board_ids:e.board_ids,kind:e.kind,board_folder_id:e.board_folder_id?.toString()},a=await this.mondayApi.request(gg,t);if(!a.create_dashboard)throw new _m("Failed to create dashboard",hm);const i=a.create_dashboard;return{content:{message:`Dashboard ${i.id} successfully created`,dashboard_id:i.id,dashboard_name:i.name}}}catch(e){bm(e,"create dashboard")}}},class extends ae{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=b.READ,this.annotations=te({title:"Get All Widget Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch complete JSON Schema 7 definitions for all available widget types in monday.com.\n \n This tool is essential before creating widgets as it provides:\n - Complete schema definitions for all supported widgets\n - Required and optional fields for each widget type\n - Data type specifications and validation rules\n - Detailed descriptions of widget capabilities\n \n Use this tool when you need to:\n - Understand widget configuration requirements before creating widgets\n - Validate widget settings against official schemas\n - Plan widget implementations with proper data structures\n \n The response includes JSON Schema 7 definitions that describe exactly what settings each widget type accepts."}getInputSchema(){return{}}async executeInternal(){try{const e={},t=await this.mondayApi.request(yg,e);if(!t.all_widgets_schema||0===t.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const a={};let i=0;for(const e of t.all_widgets_schema)if(e?.widget_type&&e?.schema){const t="string"==typeof e.schema?JSON.parse(e.schema):e.schema,n=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:n,schema:e.schema},i++}if(0===i)throw new Error("No valid widget schemas found in API response");Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:a,url:T_}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends ae{constructor(){super(...arguments),this.name="create_widget",this.type=b.WRITE,this.annotations=te({title:"Create Widget",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new widget in a dashboard or board view with specific configuration settings.\n \n This tool creates data visualization widgets that display information from monday.com boards:\n **Parent Containers:**\n - **DASHBOARD**: Place widget in a dashboard (most common use case)\n - **BOARD_VIEW**: Place widget in a specific board view\n \n **Critical Requirements:**\n 1. **Schema Compliance**: Widget settings MUST conform to the JSON schema for the specific widget type\n 2. **Use all_widgets_schema first**: Always fetch widget schemas before creating widgets\n 3. **Validate settings**: Ensure all required fields are provided and data types match\n \n **Workflow:**\n 1. Use 'all_widgets_schema' to get schema definitions\n 2. Prepare widget settings according to the schema\n 3. Use this tool to create the widget"}getInputSchema(){return wg}async executeInternal(e){if(!e.settings)throw new _m("You must pass the settings parameter",fm);try{const t={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},a=await this.mondayApi.request(vg,t);if(!a.create_widget)throw new _m("Failed to create widget",hm);const i=a.create_widget;i.parent?.kind===pl.Dashboard?i.parent.id:i.parent;return{content:{message:`Widget ${i.id} created`,widget_id:i.id,widget_name:i.name,dashboard_id:i.parent?.id}}}catch(t){bm(t,`create ${e.widget_kind} widget`)}}},class extends ae{constructor(){super(...arguments),this.name="board_insights",this.type=b.READ,this.annotations=te({title:"Get Board Insights",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool allows you to calculate insights about board's data by filtering, grouping and aggregating columns. For example, you can get the total number of items in a board, the number of items in each status, the number of items in each column, etc. Use this tool when you need to get a summary of the board's data, for example, you want to know the total number of items in a board, the number of items in each status, the number of items in each column, etc.[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 filters and knowing which columns are available.[IMPORTANT]: For some columns, human-friendly label is returned inside 'LABEL_<column_id' field. E.g. for column with id 'status_123' the label is returned inside 'LABEL_status_123' field."}getInputSchema(){return Fg}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};if(e.aggregations.some((e=>!e.columnId&&e.function!==En.CountItems)))return{content:`Every aggregation must have a "columnId", except the ${En.CountItems} function.`};const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],i=new Set(e.aggregations.filter((e=>e.function===En.Label)).map((e=>e.columnId))),n=e.groupBy?.filter((e=>!i.has(e))).map((e=>({function:En.Label,columnId:e})))??[],o=e.aggregations.concat(n).map((e=>{if(e.function){const o=e.columnId?`${e.function}_${e.columnId}`:e.function,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return Pg.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:Tn.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===En.CountItems?[]:[{type:Tn.Column,column:Vg(n),as:n}]}),as:s}}var i,n;const o={type:Tn.Column,column:Vg(e.columnId),as:e.columnId};return a.some((t=>t.column_id===e.columnId))||a.push({column_id:e.columnId}),o}));return a.forEach((e=>{o.some((t=>t.as===e.column_id))||o.push({type:Tn.Column,column:Vg(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),i=function(e){if(!e.filters&&!e.orderBy)return;const t={};return e.filters&&(t.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),t.operator=e.filtersOperator),e.orderBy&&(t.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),t}(e),n=function(e){return{id:e.boardId.toString(),type:fn.Table}}(e),o={query:{from:n,query:i,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(xg,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const i=e.value;if(!i)return void(t[a]=null);const n=i.result??i.value??null;t[a]=n})),t}));return s.length?{content:{message:"Board insights retrieved",board_name:r.boards?.[0]?.name,board_url:r.boards?.[0]?.url,data:s}}:{content:"No board insights found for the given query."}}},class extends ae{constructor(){super(...arguments),this.name="search",this.type=b.READ,this.annotations=te({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Search within monday.com platform. Supported searchType values: ${__}.\nsearchTerm is the phrase the search matches against — the text/keywords to look for (e.g. a board name, item title, or a word from an update). It is required and must be non-empty. This tool has no "list everything" mode: to browse or list without a search phrase, use workspace_info (boards/docs/folders in a workspace) or get_board_items_page (items in a board) instead of calling search with an empty searchTerm.\nFor searching/listing specific users and teams, use list_users_and_teams tool.\nFor account-level info (plan, member count, products), use get_user_context tool.\nFor browsing all boards, docs, or folders within a workspace without a search term, use workspace_info tool.\nFor groups, use get_board_info tool.\nFor listing items within a specific board, use get_board_items_page tool. ITEMS search here queries items across the account.\nBOARD search returns id, title, url, and workspaceId. Optionally scope it with boardIds.\nDOCUMENTS search returns id, title, workspaceId, and highlights. highlights is an array of { field, fragments } entries (field is "name" or "content") where fragments contain matched text snippets with <em> tags around matched terms. highlights is omitted when no lexical match was made. Optionally scope it with workspaceIds and/or docIds.\nITEMS search returns id, title, url, boardId, and workspaceId. Optionally scope it with workspaceIds, boardIds, and/or creatorIds.\nWORKSPACES search returns id, title, and description.\nUPDATES search returns id, title (the update body), itemId, boardId, and creatorId. Optionally scope it with workspaceIds, boardIds, and/or creatorIds.\nTIMELINE_ITEMS search returns id, title, summary, content, itemId, and boardId. Optionally scope it with workspaceIds and/or boardIds.\nDASHBOARDS search (also called "overviews") returns id, title, and workspaceId. Optionally scope it with workspaceIds and/or creatorIds.\nFOLDERS search returns id and title. Optionally scope it with workspaceIds, which searches all accessible workspaces when omitted. Pass workspaceIds to narrow the search if results may be truncated.\n `}getInputSchema(){return iy}async executeInternal(e){const{searchTerm:t}=e;if(!t)throw new _m("searchTerm is required and must be a non-empty search string. To browse or list without a search term, use workspace_info (for boards, docs, and folders in a workspace) or get_board_items_page (for items within a specific board).",fm);try{if(e.searchType===f_.FOLDERS){const{results:a,truncated:i}=await this.searchFoldersAsync(e,t);return{content:{message:i?"Search results (truncated: only the first 100 folders across the searched workspaces were scanned. Narrow with workspaceIds for complete results.)":"Search results",data:a}}}return{content:{message:"Search results",data:await this.runSmartSearchAsync(e,t)}}}catch(e){throw gm(e),e}}async runSmartSearchAsync(e,t){const a=Zg(e.workspaceIds?.map((e=>e.toString())));if(e.searchType===f_.BOARD){const i=Zg(e.boardIds?.map((e=>e.toString())));return this.searchBoardsAsync(t,e.limit,a,i)}if(e.searchType===f_.DOCUMENTS){const i=Zg(e.docIds?.map((e=>e.toString())));return this.searchDocsAsync(t,e.limit,a,i)}if(e.searchType===f_.WORKSPACES)return this.searchWorkspacesAsync(t,e.limit);if(e.searchType===f_.UPDATES){const i=Zg(e.boardIds?.map((e=>e.toString()))),n=Zg(e.creatorIds?.map((e=>e.toString())));return this.searchUpdatesAsync(t,e.limit,a,i,n)}if(e.searchType===f_.ITEMS){const i=Zg(e.boardIds?.map((e=>e.toString()))),n=Zg(e.creatorIds?.map((e=>e.toString())));return this.searchItemsAsync(t,e.limit,a,i,n)}if(e.searchType===f_.TIMELINE_ITEMS){const i=Zg(e.boardIds?.map((e=>e.toString())));return this.searchTimelineItemsAsync(t,e.limit,a,i)}if(e.searchType===f_.DASHBOARDS){const i=e.creatorIds?.map((e=>e.toString()));return this.searchOverviewsAsync(t,e.limit,a,i)}throw new _m(`Unsupported search type for smart search: ${e.searchType}`,cm)}async searchBoardsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,boardIds:i};return(await this.mondayApi.request(jg,n,{timeout:Nm})).search.boards.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchDocsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,docIds:i};return(await this.mondayApi.request(qg,n,{timeout:Nm})).search.docs.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0,highlights:ey(e.indexed_data.highlights)})))}async searchWorkspacesAsync(e,t){const a={query:e,limit:t};return(await this.mondayApi.request(Gg,a,{timeout:Nm})).search.workspaces.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,description:e.indexed_data.description||void 0})))}async searchUpdatesAsync(e,t,a,i,n){const o={query:e,limit:t,workspaceIds:a,boardIds:i,creatorIds:n};return(await this.mondayApi.request(Hg,o,{timeout:Nm})).search.updates.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.body,itemId:e.indexed_data.item_id,boardId:e.indexed_data.board_id,creatorId:e.indexed_data.creator_id})))}async searchItemsAsync(e,t,a,i,n){return(n?await this.mondayApi.request(Yg,{query:e,limit:t,workspaceIds:a,boardIds:i,creatorIds:n},{versionOverride:"dev",timeout:Nm}):await this.mondayApi.request(Bg,{query:e,limit:t,workspaceIds:a,boardIds:i},{timeout:Nm})).search.items.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url,boardId:e.indexed_data.board_id??void 0,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchTimelineItemsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,boardIds:i};return(await this.mondayApi.request(Wg,n,{timeout:Nm})).search.timeline_items.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.title,summary:e.indexed_data.summary||void 0,content:e.indexed_data.content||void 0,itemId:e.indexed_data.item_id,boardId:e.indexed_data.board_id??void 0})))}async searchOverviewsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,creatorIds:i};return(await this.mondayApi.request(Qg,n,{versionOverride:"dev",timeout:Nm})).search.overviews.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchFoldersAsync(e,t){const a=Kg(t);if(!a)return{results:[],truncated:!1};const i={page:1,limit:100,workspace_ids:Zg(e.workspaceIds?.map((e=>e.toString())))},n=(await this.mondayApi.request(Mg,i)).folders||[];return{results:n.filter((e=>e?.name&&Kg(e.name).includes(a))).filter((e=>e?.id)).slice(0,e.limit).map((e=>({id:e.id,title:e.name}))),truncated:100===n.length}}},class extends ae{constructor(){super(...arguments),this.name="get_user_context",this.type=b.READ,this.annotations=te({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information, account information, and their relevant items (boards, docs, folders, workspaces, dashboards).\n\n Use this tool to:\n - Get context about who the current user is (id, name, title)\n - Get account info: plan tier, active member count, trial status, and active products\n - Get the number of active members in the account (returns active_members_count)\n - Discover user's favorite boards, folders, workspaces, and dashboards\n - Get user's most relevant boards based on visit frequency and recency\n - Get user's most relevant docs based on load frequency and recency\n - Get user's most relevant people based on interaction frequency and recency\n - Reduce the need for search requests by knowing user's commonly accessed items\n "}getInputSchema(){}async executeInternal(){const{me:e,favorites:t,intelligence:a}=await this.mondayApi.request(my,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};const i=await this.fetchFavorites(t||[]),n=this.extractRelevantBoards(a),o=this.extractRelevantDocs(a),r=this.extractRelevantPeople(a),{account:s,...d}=e;return{content:{message:"User context",...{user:d,account:s?{tier:s.tier,active_members_count:s.active_members_count,is_during_trial:s.is_during_trial,products:s.products?.filter(Boolean).map((e=>({kind:e.kind,tier:e.tier})))??[]}:null,favorites:i,relevantBoards:n,relevantDocs:o,relevantPeople:r}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const i={};for(const e of a)i[hy[e]]=t[e];const n=await this.mondayApi.request(uy,i),o=[];for(const e of a){const t=fy[e];for(const a of n[t]??[])a?.id&&o.push({id:a.id,name:a.name,type:e})}return o}extractRelevantBoards(e){if(!e?.relevant_boards)return[];const t=[];for(const a of e.relevant_boards)a?.id&&a?.board?.name&&t.push({id:a.id,name:a.board.name});return t}extractRelevantDocs(e){if(!e?.relevant_docs)return[];const t=[];for(const a of e.relevant_docs)a?.id&&a?.document?.name&&t.push({id:a.id,name:a.document.name,objectId:a.object_id});return t}extractRelevantPeople(e){if(!e?.relevant_people)return[];const t=[];for(const a of e.relevant_people)a?.id&&a?.user?.name&&t.push({id:a.id,name:a.user.name});return t}groupByType(e){const t={};for(const a of e){const e=a?.object;e?.id&&e?.type&&(t[e.type]??=[]).push(e.id)}return t}},class extends ae{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=b.WRITE,this.annotations=te({title:"Update Assets On Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update a file or doc column value on an item using existing assets, docs, or links. Sets the column to the provided list of files, adding new ones and removing any not in the list."}getInputSchema(){return py}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(sy,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends ae{constructor(){super(...arguments),this.name="get_assets",this.type=b.READ,this.annotations=te({title:"Get Assets",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get assets (files) by their IDs. Returns file metadata including name, extension, size, public URL (valid for 1 hour), thumbnail URL, upload date, and who uploaded it."}getInputSchema(){return cy}async executeInternal(e){const t=await this.mondayApi.request(ly,{ids:e.ids}),a=t.assets?.filter(Boolean);if(!a||0===a.length)return{content:`No assets found for the provided IDs: ${e.ids.join(", ")}`};return{content:{results:a.map((e=>({id:e.id,name:e.name,file_extension:e.file_extension,file_size:e.file_size,public_url:e.public_url,url:e.url,url_thumbnail:e.url_thumbnail??null,created_at:e.created_at??null,original_geometry:e.original_geometry??null,uploaded_by:e.uploaded_by})))}}}},class extends ae{constructor(){super(...arguments),this.name="create_view",this.type=b.WRITE,this.annotations=te({title:"Create View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new board view (tab) with optional filters and sorting. This creates a saved view on a monday.com board that users can switch to.\n\n[REQUIRED PRECONDITION]: If you pass filters or sorting, call get_board_info first with filters.columns.only to get the board column IDs, column types, and status label indexes without fetching views. Filter rules reference real column IDs and, for status columns, numeric label indexes — do not guess them. Before sending the filters, use get_column_type_info with fetchMode "${au.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules).\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }`}getInputSchema(){return _u}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort,settings:e.settings},a=await this.mondayApi.request(hu,t);if(!a.create_view)return{content:"Failed to create view - no response from API"};const i=`View "${a.create_view.name}" (ID: ${a.create_view.id}, type: ${a.create_view.type}) successfully created`,n=fu(a.create_view.view_specific_data_str);return n?{content:`${i}. formToken: ${n}. Configure this form with update_form and form_questions_editor using this formToken; update_view cannot change form settings.`}:{content:i}}},class extends ae{constructor(){super(...arguments),this.name="update_view",this.type=b.WRITE,this.annotations=te({title:"Update View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Update an existing board view (tab) — change its name, filter rules, or sort order. Provide only the fields you want to change. Omitted fields are left unchanged.\n\n[REQUIRED PRECONDITION]: Call get_board_info first — it returns the board views (so you can resolve the viewId, including from a view name the user mentioned) along with the column IDs, column types, and status label indexes that filter and sort rules reference. When the user named specific views, pass those names as get_board_info.filters.views.names to avoid fetching every view on large boards. If you pass filters, also use get_column_type_info with fetchMode "${au.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }`}getInputSchema(){return gu}async executeInternal(e){const t={viewId:e.viewId,boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort,settings:e.settings};let a;try{a=await this.mondayApi.request(bu,t)}catch(t){if(e.type===ol.Form&&void 0!==e.settings){const e=t instanceof Error?t.message:String(t),a=new Error(`${e}\n\nupdate_view accepts no settings for FORM views. Configure the form with its formToken, which get_board_info returns on each FORM view: update_form changes the title, description, name question and question order, and form_questions_editor creates, edits or deletes questions (text, visibility, required). Call update_view on a FORM view only to rename it.`),i=t?.response;throw i&&(a.response=i),a}throw t}return a.update_view?{content:`View "${a.update_view.name}" (ID: ${a.update_view.id}, type: ${a.update_view.type}) successfully updated`}:{content:"Failed to update view - no response from API"}}},class extends ae{constructor(){super(...arguments),this.name="create_view_table",this.type=b.WRITE,this.annotations=te({title:"Create Table View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new table-type board view with optional filters, sort, tags, and table-specific settings (column visibility/order and group-by). Use this instead of create_view when you need to configure table-specific settings. For a simple table view, create_view also works.\n\n[REQUIRED PRECONDITION]: Call get_board_info first with filters.columns.only to get the board column IDs, column types, and status label indexes without fetching views. Filters, sort, column_properties, column_order, and group_by all reference real column IDs — do not guess them. This is required even if you are not passing filters, since column_properties/column_order/group_by need real column IDs too. If you pass filters, also use get_column_type_info with fetchMode "${au.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample settings.columns: { "column_properties": [{ "column_id": "status", "visible": true }], "column_order": ["name", "status", "date"] }\nExample settings.group_by: { "conditions": [{ "columnId": "status" }], "hideEmptyGroups": true }`}getInputSchema(){return wu}async executeInternal(e){const t={boardId:e.boardId,name:e.name,filter:e.filter,sort:e.sort,tags:e.tags,settings:e.settings},a=await this.mondayApi.request(yu,t);return a.create_view_table?{content:`Table view "${a.create_view_table.name}" (ID: ${a.create_view_table.id}, type: ${a.create_view_table.type}) successfully created`}:{content:"Failed to create table view - no response from API"}}},class extends ae{constructor(){super(...arguments),this.name="update_view_table",this.type=b.WRITE,this.annotations=te({title:"Update Table View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Update an existing table-type board view — change its name, filters, sort, tags, or table-specific settings (column visibility/order and group-by). Provide only the fields you want to change. Omitted fields are left unchanged.\n\n[REQUIRED PRECONDITION]: Call get_board_info first — it returns the board views (so you can resolve the viewId, including from a view name the user mentioned) along with the column IDs, column types, and status label indexes that filters, sort, column_properties, column_order, and group_by reference. When the user named specific views, pass those names as get_board_info.filters.views.names to avoid fetching every view on large boards. If you pass filters, also use get_column_type_info with fetchMode "${au.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample settings.columns: { "column_properties": [{ "column_id": "status", "visible": true }], "column_order": ["name", "status", "date"] }\nExample settings.group_by: { "conditions": [{ "columnId": "status" }], "hideEmptyGroups": true }`}getInputSchema(){return Su}async executeInternal(e){const t={viewId:e.viewId,boardId:e.boardId,name:e.name,filter:e.filter,sort:e.sort,tags:e.tags,settings:e.settings},a=await this.mondayApi.request(Tu,t);return a.update_view_table?{content:`Table view "${a.update_view_table.name}" (ID: ${a.update_view_table.id}, type: ${a.update_view_table.type}) successfully updated`}:{content:"Failed to update table view - no response from API"}}},class extends ae{constructor(){super(...arguments),this.name="undo_action",this.type=b.WRITE,this.annotations=te({title:"Undo Action",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Undo a previous action on a board using its action_record_uuid. Supports undoing column changes, deletes, archives, moves, duplicates, and more. Use get_board_activity with includeData=true to find the action_record_uuid."}getInputSchema(){return by}async executeInternal(e){return await this.mondayApi.request(_y,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}},class extends ae{constructor(){super(...arguments),this.name="get_object_schemas",this.type=b.READ,this.annotations=te({title:"Get Object Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve account-level object schemas by their IDs or names. Schemas define the structure and columns of boards. Provide ids or names to filter specific schemas. Omit both to list all schemas (paginated). Call this FIRST to resolve schema ids, column ids, and the current revision before any tool that modifies an existing schema: update_object_schema (which requires the revision returned here), manage_object_schema_columns with action=update, set_object_schema_column_active_state, delete_object_schema_columns, delete_object_schema, and manage_object_schema_board_connection."}getInputSchema(){return Gm}async executeInternal(e){const t={ids:e.ids,names:e.names,limit:e.limit,page:e.page,excludeCreatedByMonday:e.excludeCreatedByMonday},a=(await this.mondayApi.request(qm,t)).get_object_schemas??[];return{content:{message:`Retrieved ${a.length} object schema(s)`,schemas:a}}}},class extends ae{constructor(){super(...arguments),this.name="create_object_schema",this.type=b.WRITE,this.annotations=te({title:"Create Object Schema",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new account-level object schema. Schemas define the structure and columns of boards. If you are nesting this schema under an existing one, call get_object_schemas first to resolve parentId. This tool creates the schema only — add its columns afterwards with manage_object_schema_columns, and attach boards with manage_object_schema_board_connection."}getInputSchema(){return Wm}async executeInternal(e){const t={name:e.name,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(Hm,t);return{content:{message:`Object schema "${a.create_object_schema?.name}" successfully created`,schema_id:a.create_object_schema?.id,schema_name:a.create_object_schema?.name,revision:a.create_object_schema?.revision}}}},class extends ae{constructor(){super(...arguments),this.name="update_object_schema",this.type=b.WRITE,this.annotations=te({title:"Update Object Schema",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Update an account-level object schema. Requires the current revision number for optimistic locking — retrieve it first via get_object_schemas."}getInputSchema(){return Qm}async executeInternal(e){const t={id:e.id,revision:e.revision,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(Ym,t);return{content:{message:`Object schema "${a.update_object_schema?.name}" successfully updated`,schema_id:a.update_object_schema?.id,schema_name:a.update_object_schema?.name,revision:a.update_object_schema?.revision}}}},class extends ae{constructor(){super(...arguments),this.name="delete_object_schema",this.type=b.WRITE,this.annotations=te({title:"Delete Object Schema",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an account-level object schema. Only allowed when no boards are connected to the schema. Provide either id or name."}getInputSchema(){return zm}async executeInternal(e){if(!e.id&&!e.name)throw new Error("Either id or name must be provided");const t={id:e.id,name:e.name},a=await this.mondayApi.request(Km,t);return{content:{message:`Object schema "${a.delete_object_schema?.name}" successfully deleted`,schema_id:a.delete_object_schema?.id,schema_name:a.delete_object_schema?.name}}}},class extends ae{constructor(){super(...arguments),this.name="delete_object_schema_columns",this.type=b.WRITE,this.annotations=te({title:"Delete Object Schema Columns",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Permanently delete columns from an account-level object schema. Only allowed when no boards are connected to the schema. Use manage_object_schema_column with action=deactivate for a reversible alternative. [REQUIRED PRECONDITION]: Call get_object_schemas first to resolve the schema id and the exact column ids — this deletion is irreversible, so never guess ids."}getInputSchema(){return Xm}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnIds:e.columnIds},a=await this.mondayApi.request(Jm,t,{versionOverride:"dev"});return{content:{message:`${e.columnIds.length} column(s) successfully deleted from object schema "${a.delete_object_schema_columns?.name}"`,schema_id:a.delete_object_schema_columns?.id,schema_name:a.delete_object_schema_columns?.name,revision:a.delete_object_schema_columns?.revision}}}},class extends ae{constructor(){super(...arguments),this.name="manage_object_schema_board_connection",this.type=b.WRITE,this.annotations=te({title:"Manage Object Schema Board Connection",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Connect or detach a board from an account-level object schema. connect: attaches a board to an object schema so it inherits the schema column structure. detach: removes one or more boards from their object schema."}getInputSchema(){return tu}async executeInternal(e){if("connect"===e.action){if(!e.boardId)throw new Error("boardId is required for action=connect");if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided for action=connect");const t={boardId:e.boardId,objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName},a=await this.mondayApi.request(Zm,t);return{content:{message:"Board successfully connected to object schema",connection_id:a.connect_board_to_object_schema?.id,schema_id:a.connect_board_to_object_schema?.object_schema_id}}}{if(!e.boardIds?.length)throw new Error("boardIds is required for action=detach");const t={boardIds:e.boardIds},a=(await this.mondayApi.request(eu,t)).detach_boards_from_object_schema??[],i=a.filter((e=>e.success)).length,n=a.filter((e=>!e.success));return{content:{message:`${i} board(s) successfully detached`,results:a,...n.length>0&&{failures:n}}}}}},class extends ae{constructor(){super(...arguments),this.name="manage_object_schema_columns",this.type=b.WRITE,this.annotations=te({title:"Manage Object Schema Columns",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create or update columns on an account-level object schema. Column changes are propagated to all boards connected to the schema. create: adds new columns. Each column requires type and title. Call get_column_type_info with fetchMode "${au.Schema}" first to understand valid defaults per column type. update: modifies existing columns. Each entry must include column_id — call get_object_schemas first to resolve the schema id and the exact column ids. Only send the columns you want to modify — other columns are unaffected. Use opt_out_by_default=true to stop a column from being auto-added to boards (opt out), or opt_out_by_default=false to restore auto-adding (opt in).`}getInputSchema(){return du}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");if("create"===e.action){const t=e.columns.map((e=>{const t=e;return{type:t.type,title:t.title,description:t.description,defaults:t.defaults,opt_out_by_default:t.opt_out_by_default,policy:{can_override:t.policy?.can_override??[],cannot_delete:t.policy?.cannot_delete??!1}}})),a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columns:t},i=await this.mondayApi.request(iu,a);return{content:{message:`Columns successfully added to object schema "${i.create_object_schema_columns?.name}"`,schema_id:i.create_object_schema_columns?.id,schema_name:i.create_object_schema_columns?.name,revision:i.create_object_schema_columns?.revision}}}{const t={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columns:e.columns.map((e=>{const t=e;return{column_id:t.column_id,title:t.title,description:t.description,defaults:t.defaults,opt_out_by_default:t.opt_out_by_default,policy:t.policy?{can_override:t.policy.can_override??[],cannot_delete:t.policy.cannot_delete??!1}:void 0}}))},a=await this.mondayApi.request(nu,t);return{content:{message:`Columns successfully updated on object schema "${a.update_object_schema_columns?.name}"`,schema_id:a.update_object_schema_columns?.id,schema_name:a.update_object_schema_columns?.name,revision:a.update_object_schema_columns?.revision}}}}},class extends ae{constructor(){super(...arguments),this.name="set_object_schema_column_active_state",this.type=b.WRITE,this.annotations=te({title:"Set Object Schema Column Active State",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Set the active state of a column on an account-level object schema. [REQUIRED PRECONDITION]: Call get_object_schemas first to resolve the schema id, the column id, and its current active state. deactivate: soft-disables the column, preventing it from being used on new boards. The column is not deleted and can be restored. reactivate: restores a previously deactivated column, making it available again."}getInputSchema(){return lu}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={deactivate:Po.Deactivate,reactivate:Po.Reactivate},a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnId:e.columnId,action:t[e.action]},i=await this.mondayApi.request(pu,a);return{content:{message:`Column successfully ${e.action}d on object schema "${i.set_object_schema_column_active_state?.name}"`,schema_id:i.set_object_schema_column_active_state?.id,schema_name:i.set_object_schema_column_active_state?.name,revision:i.set_object_schema_column_active_state?.revision}}}},class extends ae{constructor(){super(...arguments),this.name="get_asset_upload_url",this.type=b.WRITE,this.annotations=te({title:"Get Asset Upload URL",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Get a presigned URL to upload a file to monday.com. Returns an upload_id and upload_url.\n\nOnly call this tool if you can execute a direct HTTP PUT with binary file data and read response headers (e.g. via shell/curl). If you can\'t, tell the user direct file upload isn\'t supported here — don\'t call this tool.\n\nAfter calling this tool, upload the file to the returned URL using an HTTP PUT request and capture the ETag header from the response:\n\ncurl -i -X PUT "<upload_url>" \\\n -H "Content-Type: <the contentType you provided>" \\\n --data-binary @<local_file_path>\n\nThe response includes an ETag header (e.g. ETag: "abc123...") — save this value.\n\nThen call finalize_asset_upload with the upload_id, etag, board_id, item_id, and column_id to complete the upload and attach the file to an item\'s file column.\n\nMax file size: 500MB.'}getInputSchema(){return yy}async executeInternal(e){const t=(await this.mondayApi.request(gy,{input:{file_name:e.fileName,content_type:e.contentType,file_size:e.fileSize,source:"mcp",multipart:!1}},{versionOverride:"dev"})).create_upload,a=t.parts[0]?.url;if(!a)throw new Error("create_upload returned no upload URL — parts array was empty");return{content:{upload_id:t.upload_id,upload_url:a,url_expires_at:t.expires_at}}}},class extends ae{constructor(){super(...arguments),this.name="finalize_asset_upload",this.type=b.WRITE,this.annotations=te({title:"Finalize Asset Upload",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Finalize a file upload and create the asset on monday.com. Call this after uploading the file to the presigned URL from get_asset_upload_url. Requires the etag value from the PUT response headers. Automatically attaches the uploaded asset to the specified file column on the item. Returns the created asset_id."}getInputSchema(){return wy}async executeInternal(e){const t=(await this.mondayApi.request(vy,{input:{upload_id:e.uploadId,holder:{type:"ITEM",id:e.itemId},board_id:e.boardId,parts:[{part_number:1,etag:e.etag}]}},{versionOverride:"dev"})).complete_upload,a=JSON.stringify({added_file:{fileType:"ASSET",name:t.filename,assetId:String(t.id)}});return await this.mondayApi.request(Iy,{boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,value:a}),{content:{asset_id:t.id,filename:t.filename,content_type:t.content_type,file_size:t.file_size,url:t.url,filelink:t.filelink}}}},class extends ae{constructor(){super(...arguments),this.name="link_board_items_workflow",this.type=b.READ,this.annotations=te({title:"Link Board Items Workflow",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the required playbook for linking items across boards via board-relation columns. When to use: any board-relation / cross-board linking task. **Hard gate — you MUST call this BEFORE get_board_items_page, or change_item_column_values in the same turn. No discovery, matching, or write happens first.** Triggers: **link** or **connect** items **across boards** (board-relation / "connect boards" / pairs) — also vague phrasings where only one side is named ("link this to **an** item on another board", "**the matching** row"). This tool is read-only (no API).'}getInputSchema(){return Ey}async executeInternal(e){return{content:Ty}}},class extends ae{constructor(){super(...arguments),this.name="fetch_file_content",this.type=b.READ,this.annotations=te({title:"Fetch File Content",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch and extract the text content from a file stored in a monday.com files column.\n\nUse this tool when you need to read, summarize, or analyze the content of files attached to board items. Provide the item ID and column ID from the get_board_items_page response — the column value will be a URL like \"https://monday.com/protected_static/...\" indicating a file is present (null means no file).\n\nPROACTIVE USE: If you retrieve board items and notice a files column with a non-null value (a URL), consider fetching its content if it could help answer the user's question — don't wait to be explicitly asked.\n\nSupported file types and what is returned:\n- Text files (.txt, .md, .csv, .json): raw text content\n- Word documents (.docx): extracted text content\n- PDF files (.pdf): extracted text content\n- Excel files (.xlsx, .xls): extracted text content per sheet\n- Images (.png, .jpg, .gif, .webp, .svg, .bmp, .ico): returns the public URL so you can view or analyze the image directly\n\nText responses include a total_length field. If has_more is true, the content was truncated — you can call this tool again with next_offset if you need the remaining content. For very large Excel workbooks, extraction_truncated: true means the text was cut short and the rest of the workbook is not available.\n\nWhen to use:\n- User asks to summarize, read, or analyze the content of a file in a files column\n- User asks questions about what is inside a file (e.g., \"what does the PDF say?\")\n- User wants to extract data from a CSV or Excel file attached to a board item\n- A board item has a files column with a non-null value and the user's question may be answered by its content — even if the user didn't explicitly ask to read the file\n\nWhen NOT to use:\n- The files column value is null (no file uploaded for that item)"}getInputSchema(){return By}async executeInternal(e){const{item_id:t,column_id:a,file_name:i,offset:n=0}=e,o=await this.mondayApi.request(Ay,{itemId:t,columnId:a}),r=o?.items?.[0]?.assets;if(!r||0===r.length)return{content:{message:`No file found for item ${t} in column ${a}. The column may be empty or the column ID may be incorrect.`}};const s=this.isXlsxStreamingEnabled()?Cy:Ry;return{content:{files:await Promise.all(r.map((e=>qy(e,n,s,i))))}}}isXlsxStreamingEnabled(){return this.context?.deps?.flagChecker?.("mcp-fetch-file-content-xlsx-streaming")??!0}},class extends ae{constructor(){super(...arguments),this.name="list_automations",this.type=b.READ,this.annotations=te({title:"List Board Automations",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'List all automations on a specific monday.com board, including their ids, titles, active state, and configuration.\nReturns two groups: "workflows" (fully manageable, supports pagination via limit/cursor) and "legacyAutomations" (READ-ONLY automations set up in an older way — returned on the first page only, when no cursor is given).\nAlways present BOTH groups to the user together as one list of board automations — never omit or hide "legacyAutomations". The split and the read-only limitation are internal context for you only: don\'t volunteer them and don\'t label any automation "legacy" or "read-only". Only if the user asks to act on a legacy one, briefly explain it can\'t be changed (e.g. "This one was set up in an older way and can\'t be modified here").\nCall this FIRST before manage_automations — it is the only way to resolve an automation id from a name or description. Never guess an automation id.\nWhen NOT to use: Do not call this tool to get general board information unrelated to automations.\n'}getInputSchema(){return Yy}async executeInternal(e){try{const a=!e.cursor,i={boardIds:[e.boardId],limit:e.limit??100,includeLegacy:a,...e.cursor?{cursor:e.cursor}:{}},n=await this.mondayApi.request(Gy,i),o=(n.board_automations?.items??[]).map(Wy),r=n.board_automations?.cursor??null,s=a?(t=n.board_automations?.legacy_automations,null==t||"object"==typeof t&&"error"in t?null:t):null;return{content:{message:`Found ${o.length} live workflow(s) on board ${e.boardId}`,workflows:o,...null!=s?{legacyAutomations:s}:{},pagination:{nextCursor:r,hasMore:null!==r}}}}catch(e){bm(e,"list live workflows")}var t}},class extends ae{constructor(){super(...arguments),this.name="manage_automations",this.type=b.WRITE,this.annotations=te({title:"Manage Automations",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Activate, deactivate, or delete an existing monday.com automation.\n\nRequires an automation id. When the user refers to an automation by name, always call list_automations first to resolve the id — never guess or infer ids.\n\nActions:\n- activate: enables a paused automation so it starts responding to its trigger.\n- deactivate: pauses an automation while preserving its definition.\n- delete: permanently removes an automation — irreversible.\n\nWhen intent is ambiguous ("stop", "turn off", "pause"), prefer deactivate over delete.'}getInputSchema(){return Jy}async executeInternal(e){const t=e;switch(t.action){case"activate":return this.activateWorkflow(t);case"deactivate":return this.deactivateWorkflow(t);case"delete":return this.deleteWorkflow(t)}}async activateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(Qy,t,{versionOverride:"dev"});if(!a.activate_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} activation did not report success`);return{content:{message:`Workflow ${e.workflowId} activated`,workflowId:e.workflowId,isActive:!0}}}catch(e){bm(e,"activate workflow")}}async deactivateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(Ky,t,{versionOverride:"dev"});if(!a.deactivate_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} deactivation did not report success`);return{content:{message:`Workflow ${e.workflowId} deactivated`,workflowId:e.workflowId,isActive:!1}}}catch(e){bm(e,"deactivate workflow")}}async deleteWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(zy,t,{versionOverride:"dev"});if(!a.delete_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} deletion did not report success`);return{content:{message:`Workflow ${e.workflowId} deleted`,workflowId:e.workflowId}}}catch(e){bm(e,"delete workflow")}}},class extends ae{constructor(e,t,a){super(e,a),this.apiToken=t,this.name="create_automation",this.type=b.WRITE,this.annotations=te({title:"Create Automation",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'\n Creates an automation on a monday board from a structured natural-language description.\n\nUse this tool only when you know:\n- boardId\n- the user\'s intended trigger\n- at least one intended action\n- any details the user provided that are relevant to the trigger, conditions, or actions\n\nThe caller does not need to know the exact available automation blocks or their required fields. Describe the user\'s intent clearly — the tool will translate that intent into supported blocks and values.\n\nIf a required detail is missing from the user\'s request, ask for clarification before calling the tool.\n\nIf the tool returns status: "needs_clarification", present the unresolved fields to the user, gather answers, then call the tool again.\n\nDescribe the automation in this format:\n\nTrigger:\n When <the event that should start the automation>\n Details:\n <relevant detail>: <value>\n\nConditions:\n - Only if <condition that should be true>\n Details:\n <relevant detail>: <value>\n\nActions:\n - <action the automation should perform>:\n <relevant detail>: <value>\n\nRules:\n- Use one trigger.\n- Conditions are optional.\n- Multiple conditions mean AND.\n- Use one or more actions.\n- Do not use branching.\n- Use natural language, not block IDs or internal field names.\n- Actions may reference values from the trigger context, such as "{{item name}}", "{{creator}}", "{{status}}", "{{group}}", or "{{board}}".\n\nTerminology:\n- Trigger: the event that starts the automation, such as "when a new item is created".\n- Conditions: optional requirements that must be true before actions run.\n- Actions: what the automation does when it runs.\n\nExample:\n\nTrigger:\n When a new item is created\n\nActions:\n - Send a notification:\n Recipient: John Snow\n Title: Important Update\n Message: The item "{{item name}}" was created.\n\n - Move the item to a group:\n Group: Top group\n'}getInputSchema(){return Zy}async executeInternal(e){try{const a="function"==typeof this.apiToken?this.apiToken():this.apiToken,i=(t=this.context,t?.fetchConfig?.fetch??Xy),n=await i({serviceName:"platform-agent",path:"/platform-ai-gateway/agents/lite-builder",method:"POST",headers:{...this.context?.fetchConfig?.fetch?{}:{Authorization:a},"Content-Type":"application/json"},body:JSON.stringify({userPrompt:e.userPrompt,boardId:e.boardId}),signal:AbortSignal.timeout(18e4)});if(!n.ok){const e=await n.text().catch((()=>""));throw new _m(`lite-builder responded with HTTP ${n.status}${e?`: ${e}`:""}`,"UPSTREAM_HTTP_ERROR")}return{content:await n.json()}}catch(e){bm(e,"create automation")}var t}},class extends ae{constructor(){super(...arguments),this.name="get_automation_runs",this.type=b.READ,this.annotations=te({title:"Get Automation Runs",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Read automation/workflow run history. Read-only.\n\nModes:\n- "history": paginated run feed (state, duration, error reason). Use "filters" to narrow results and "nextPageOffset" to page (offset-only — next page = previous offset + returned count).\n- "detail": single run by "triggerUuid" (required) — returns block steps and MCP tool calls. Set "includeToolEvents": false to skip tool calls.\n\nScope: provide "boardId" for a specific board or "accountWide": true. One is required.\n\nKnown event states: "success", "failure", "exhausted".'}getInputSchema(){return rv}async executeInternal(e){if(!e.boardId&&!e.accountWide)return{content:{message:'Either "boardId" or "accountWide": true must be provided.'}};try{return"detail"===e.mode?await this.runDetail(e):await this.runHistory(e)}catch(e){bm(e,"get automation runs")}}async runHistory(e){const t=e.nextPageOffset??0,{automationIds:a,workflowEntityIds:i,...n}=e.filters??{},o={...n,...a?{automation_ids:a.map(String)}:{},...i?{workflow_entity_ids:i.map(String)}:{},...e.boardId?{boardId:e.boardId}:{}},r=await this.mondayApi.request(tv,{nextPageOffset:t,filters:o}),s=r.trigger_events?.triggerEvents??[],d=function(e){return e.reduce(((e,t)=>{const a=t.eventState??"unknown";return e[a]=(e[a]??0)+1,e}),{})}(s),p=e.boardId?`board ${e.boardId}`:"account-wide";return{content:{message:`Returned ${s.length} run(s) (${p}) at offset ${t}. By state: ${function(e){const t=Object.entries(e).map((([e,t])=>`${e}=${t}`));return t.length?t.join(", "):"none"}(d)}. Offset-only pagination — for the next page request offset ${t+s.length}.`,scope:p,offset:t,count:s.length,stateCounts:d,runs:s}}}async runDetail(e){if(!e.triggerUuid)return{content:{message:'detail mode requires "triggerUuid".'}};const t=!1!==e.includeToolEvents,a=e.blockEventsOffset??0,i=e.toolEventsOffset??0,n=(await this.mondayApi.request(av,{triggerUuid:e.triggerUuid})).trigger_event;if(!n)return{content:{message:`No run found for triggerUuid ${e.triggerUuid}.`,triggerUuid:e.triggerUuid,found:!1}};const[o,r]=await Promise.all([this.mondayApi.request(iv,{triggerUuid:e.triggerUuid,nextPageOffset:a}),t?this.mondayApi.request(nv,{triggerUuid:e.triggerUuid,nextPageOffset:i}):Promise.resolve(null)]),s=o.block_events?.blockEvents??[],d=r?.tool_events?.tool_events??[];return{content:{message:`Run ${e.triggerUuid}: state=${n.eventState??"unknown"}, ${s.length} block step(s), ${d.length} tool call(s).`,found:!0,run:n,blockEvents:s,blockEventsOffset:a,toolEvents:d,toolEventsOffset:i,toolEventsIncluded:t}}}},class extends ae{constructor(){super(...arguments),this.name="get_automation_statistics",this.type=b.READ,this.annotations=te({title:"Get Automation Statistics",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Aggregate automation run statistics. Read-only.\n\nBreakdowns:\n- "totals": success/failure/total counts at the account or board level.\n- "by_entity": per-automation and per-workflow counts for a given "runStatus" (required: "success" | "failure" | "exhausted"). Use "excludeAutomationIds" to omit specific automations.\n\nScope: provide "boardId" for a specific board or "accountWide": true. One is required.\n\nOptional "userIds" narrows results to specific creators.'}getInputSchema(){return lv}async executeInternal(e){if(!e.boardId&&!e.accountWide)return{content:{message:'Either "boardId" or "accountWide": true must be provided.'}};const t=e.boardId?function(e){const t=e.trim();if(!/^[1-9]\d*$/.test(t)||!Number.isSafeInteger(Number(t)))throw new Error(`Invalid boardId: '${e}' is not a positive integer.`);return t}(e.boardId):void 0,a=e.boardId?`board ${e.boardId}`:"account-wide";try{return"by_entity"===e.breakdown?await this.runByEntity(e,t,a):await this.runTotals(e,t,a)}catch(e){bm(e,"get automation statistics")}}async runTotals(e,t,a){const i=(await this.mondayApi.request(sv,{filters:{board_id:t,user_ids:e.userIds}},{versionOverride:pv})).account_trigger_statistics;return{content:{message:`Totals (${a}): success=${i?.success??0}, failure=${i?.failure??0}, total=${i?.total??0}.`,scope:a,breakdown:"totals",statistics:i}}}async runByEntity(e,t,a){if(!e.runStatus)return{content:{message:'by_entity breakdown requires "runStatus" (success | failure | exhausted).'}};const i=(await this.mondayApi.request(dv,{runStatus:e.runStatus,filters:{board_id:t,automation_ids:e.excludeAutomationIds,user_ids:e.userIds}},{versionOverride:pv})).account_triggers_statistics_by_entity_id;return{content:{message:`By-entity '${e.runStatus}' statistics (${a}).`,scope:a,breakdown:"by_entity",runStatus:e.runStatus,automationStatistics:i?.automation_statistics,workflowStatistics:i?.workflow_statistics}}}},class extends ae{constructor(){super(...arguments),this.name="configure_ai_column",this.type=b.WRITE,this.annotations=te({title:"Configure AI Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add AI to a column or set up an AI column on a monday.com board. Use this tool when the user wants to automatically categorize, summarize, translate, extract, generate text, improve writing, or assign people using AI on a column. This is the right tool for requests like "add AI to a column", "set up automatic extraction/categorization/summarization", "make a column use AI", "configure AI on a column", or "use AI to automatically fill a column".\n\nThe column must already exist on the board with a compatible type for the chosen block. To create a new AI column, first use create_column to create the column, then use this tool to add AI behavior.\n\nBLOCK TYPES (only pass fields that apply to the chosen block_type):\n- categorize: { block_type, source_type, source_column_id?, additional_instructions? } — assigns labels from target column\'s existing status/dropdown options\n- summarize: { block_type, source_type, source_column_id?, additional_instructions? } — generates concise summaries\n- translate: { block_type, source_type, source_column_id?, target_language } — translates to target language\n- improve_text: { block_type, source_type, source_column_id?, tone?, improver_length?, refinement_type? } — rewrites/fixes text\n- extract: { block_type, source_type, source_column_id?, entity_type, custom_instructions?, additional_instructions? } — extracts structured info\n- open_block: { block_type, ai_query } — flexible custom prompt, reference columns via {pulse.column_id}\n- write_me: { block_type, ai_query, tone, output_length } — generates new text from prompt\n- person_assignment: { block_type, source_type, source_column_id?, groups } — assigns people based on context\n\nSOURCE TYPES (required for all blocks except open_block and write_me):\n- item_name: uses the item\'s name as input\n- thread: uses the item\'s updates/comments as input\n- column: uses another column\'s value (requires source_column_id)\n- emails_and_activities: uses emails & activities (categorize only)\n\nCOLUMN REFERENCE SYNTAX (for open_block and write_me ai_query):\n- {pulse.column_id} — regular board column\n- {pulse.name} — the item name\n- {pulse.subitem.column_id} — subitem column\n\nRELATED TOOLS:\n- create_column — create the target column first if it doesn\'t exist\n- get_board_schema — discover existing columns and their types/IDs'}getInputSchema(){return yv}async executeInternal(e){const t=void 0!==e.run_backfill?{run_backfill:e.run_backfill}:void 0;try{switch(e.block_type){case"categorize":return this.handleCategorize(e.board_id,e,t);case"summarize":return this.handleSummarize(e.board_id,e,t);case"translate":return this.handleTranslate(e.board_id,e,t);case"improve_text":return this.handleImproveText(e.board_id,e,t);case"extract":return this.handleExtract(e.board_id,e,t);case"open_block":return this.handleOpenBlock(e.board_id,e,t);case"write_me":return this.handleWriteMe(e.board_id,e,t);case"person_assignment":return this.handlePersonAssignment(e.board_id,e,t)}}catch(e){bm(e,"configure AI column")}}validateSourceType(e,t){if(!e.source_type)throw new Error(`source_type is required for ${t} block`);if("column"===e.source_type&&!e.source_column_id)throw new Error('source_column_id is required when source_type is "column"')}async handleCategorize(e,t,a){this.validateSourceType(t,"categorize");const i=await this.mondayApi.request(cv,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_categorize_ai_column?.column_id}}}async handleSummarize(e,t,a){this.validateSourceType(t,"summarize");const i=await this.mondayApi.request(mv,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_summarize_ai_column?.column_id}}}async handleTranslate(e,t,a){if(this.validateSourceType(t,"translate"),!t.target_language)throw new Error("target_language is required for translate block");const i=await this.mondayApi.request(uv,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,targetLanguage:t.target_language,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_translate_ai_column?.column_id}}}async handleImproveText(e,t,a){this.validateSourceType(t,"improve_text");const i=await this.mondayApi.request(hv,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,tone:t.tone,length:t.improver_length,refinementType:t.refinement_type,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_improve_text_ai_column?.column_id}}}async handleExtract(e,t,a){if(this.validateSourceType(t,"extract"),!t.entity_type)throw new Error("entity_type is required for extract block");if("custom"===t.entity_type&&!t.custom_instructions)throw new Error('custom_instructions is required for extract block when entity_type is "custom"');const i=await this.mondayApi.request(fv,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,entityType:t.entity_type,customInstructions:t.custom_instructions,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_extract_ai_column?.column_id}}}async handleOpenBlock(e,t,a){if(!t.ai_query)throw new Error("ai_query is required for open_block block");const i=await this.mondayApi.request(_v,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_open_block_ai_column?.column_id}}}async handleWriteMe(e,t,a){if(!t.ai_query)throw new Error("ai_query is required for write_me block");if(!t.tone)throw new Error("tone is required for write_me block");if(!t.output_length)throw new Error("output_length is required for write_me block");const i=await this.mondayApi.request(bv,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,tone:t.tone,length:t.output_length,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_write_me_ai_column?.column_id}}}async handlePersonAssignment(e,t,a){if(this.validateSourceType(t,"person_assignment"),!t.groups||0===t.groups.length)throw new Error("groups is required for person_assignment block");const i=await this.mondayApi.request(gv,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,groups:t.groups,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_person_assignment_ai_column?.column_id}}}},class extends ae{constructor(){super(...arguments),this.name="remove_ai_from_column",this.type=b.WRITE,this.annotations=te({title:"Remove AI from Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0})}getDescription(){return"Remove AI from a column on a monday.com board. Use this tool when the user wants to disable AI on a column, turn off AI automation, stop AI from running on a column, or delete the AI behavior from a column. This deletes all AI automation recipes and the app feature extension associated with the column. The column itself is not deleted — only its AI behavior is removed.\n\nUse get_board_schema to find column IDs before calling this tool."}getInputSchema(){return Iv}async executeInternal(e){try{const t=await this.mondayApi.request(vv,{boardId:e.board_id.toString(),columnId:e.column_id});return{content:{message:"AI removed from column successfully",column_id:t.remove_ai_from_column?.column_id,success:t.remove_ai_from_column?.success}}}catch(e){bm(e,"remove AI from column")}}},class extends ae{constructor(){super(...arguments),this.name="submit_bug_or_feature_request",this.type=b.READ,this.annotations=te({title:"Submit Bug or Feature Request",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Report a bug, submit a feature request, or share feedback about the monday.com product or this integration.\n\nCall this tool proactively — not just when a user explicitly asks. Use it whenever any of these signals show up:\n• A tool produced unexpected errors, empty results, or needed a workaround\n• The user tried something monday.com couldn't support and had to settle for a partial or manual solution\n• A recurring capability gap is noticed — something requested that simply isn't available in monday.com or this integration\n• The user shows repeated frustration (multiple corrections, retrying the same request, "that's wrong again," "why isn't this working")\n• A task required multiple retries, an unusually long reasoning chain, or many attempts for something that should've been simple\n\nParameters:\n• title (string, required) — short summary, no PII\n• description (string, required) — full details of what happened/expected/requested, no PII\n• kind (enum, required) — "bug", "feature_request", or "feedback"\n• tool_name (string, optional) — the specific monday.com tool the feedback relates to (e.g. "create_item")\n\nRestriction: Use strictly for things related to monday.com — not for other tools (Google Drive, Slack, GitHub, etc.) that may be in the conversation context. ${wv}`}getInputSchema(){return Tv}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,this.sessionContext.metadata.title=e.title,this.sessionContext.metadata.description=e.description,e.tool_name&&(this.sessionContext.metadata.tool_name=e.tool_name),{content:{message:"Feedback submitted successfully. Thank you for helping improve the monday.com MCP server."}}}},class extends ae{constructor(){super(...arguments),this.name="get_monday_knowledge",this.type=b.READ,this.annotations=te({title:"Get Monday Knowledge",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Ask a question about monday.com and get an AI-generated answer from the official knowledge base.\n\nUse kind="general" for questions about using monday.com — features, automations, UI, help center, and settings. Returns cited source articles with links.\nUse kind="developer_docs" for questions about the monday.com API — GraphQL queries and mutations, authentication, rate limits, webhooks, schema, API best practices, and building apps.\n\nImportant: do not include PII data in the questions.'}getInputSchema(){return Nv}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,e.kind===Sv?this.queryDeveloperDocs(e.query):this.queryGeneralKnowledge(e.query)}async queryGeneralKnowledge(e){const t={query:e},a=(await this.mondayApi.request(Ev,t)).knowledge_base_search;a?.answer||bm(new Error("No answer found in the knowledge base. Try rephrasing your question."),"get_monday_knowledge"),this.sessionContext.metadata??={},this.sessionContext.metadata.query=e,this.sessionContext.metadata.answer=a.answer;const i=(a.raw_snippets??[]).filter((e=>e.url&&e.title)).map((e=>({title:e.title,url:e.url,snippet:e.text??""})));return{content:{answer:a.answer,sources:i,kind:Dv}}}async queryDeveloperDocs(e){const t={query:e,retrieval_only:!0},a=(await this.mondayApi.request(Av,t)).ask_developer_docs;return a?.answer||bm(new Error("No answer found in developer docs. Try rephrasing your question."),"get_monday_knowledge"),this.sessionContext.metadata??={},this.sessionContext.metadata.query=e,this.sessionContext.metadata.answer=a.answer,{content:{answer:a.answer,sources:[],kind:Sv}}}}],sI=[...rI,...oI,...ee];export{Em as ToolMode,b as ToolType,rI as allGraphqlApiTools,ee as allMondayAppsTools,oI as allMondayDevTools,sI as allTools};
|
|
3066
3066
|
//# sourceMappingURL=index.js.map
|