@mondaydotcomorg/agent-toolkit 2.19.1 → 2.19.2

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.
@@ -1247,7 +1247,7 @@
1247
1247
  }
1248
1248
  }
1249
1249
  }
1250
- `,pA={objectType:e.z.nativeEnum(B_).describe("The type of object to move"),id:e.z.string().describe("The ID of the object to move"),position:e.z.object({object_id:e.z.string().describe("The ID of the object to position the object relative to"),object_type:e.z.nativeEnum(B_).describe("The type of object to position the object relative to"),is_after:e.z.boolean().optional().describe("Whether to position the object after the object")}).optional().describe("The new position of the object. Required if changing the position based on another object."),parentFolderId:e.z.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:e.z.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:e.z.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const dA={action:e.z.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'),toolName:e.z.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)")};class lA{constructor(){this.name="manage_tools",this.type=Zi.READ,this.enabledByDefault=!0,this.annotations={title:"Discover & Manage monday.com Tools",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}}setToolkitManager(e){this.toolkitManager=e}getDescription(){return"Discover and manage available monday.com tools. Use this tool first to see what tools are available, check which ones are active/inactive, and enable any tools you need for your tasks. When enabling a tool, you will be asked for confirmation first. Essential for understanding your monday.com toolkit capabilities."}getInputSchema(){return dA}async execute(e){if(!this.toolkitManager)throw new Error("Toolkit manager not initialized");if(!e)throw new Error("Input parameters are required");const{action:a,toolName:t}=e;switch(a){case"enable":if(!t)throw new Error("Tool name is required for enable action");if(this.toolkitManager.isToolEnabled(t))return{content:`Tool '${t}' is already enabled`};return{content:this.toolkitManager.enableTool(t)?`✅ Tool '${t}' has been enabled and is now available for use`:`❌ Failed to enable tool '${t}' (tool not found)`};case"disable":if(!t)throw new Error("Tool name is required for disable action");return{content:this.toolkitManager.disableTool(t)?`Tool '${t}' has been disabled`:`Failed to disable tool '${t}' (tool not found)`};case"status":if(t){return{content:`Tool '${t}' is ${this.toolkitManager.isToolEnabled(t)?"enabled":"disabled"}`}}{const e=this.toolkitManager.getToolsStatus();return{content:`All tools status:\n${Object.entries(e).map((([e,a])=>`${e}: ${a?"enabled":"disabled"}`)).join("\n")}`}}case"detailed":{const e=this.toolkitManager.getDetailedToolsStatus(),a=Object.entries(e).filter((([,e])=>e.enabled)),t=Object.entries(e).filter((([,e])=>!e.enabled));let i="monday.com Tools Discovery:\n\n";return a.length>0&&(i+="✅ ACTIVE TOOLS (ready to use):\n",i+=a.map((([e,a])=>` • ${e} (default: ${a.enabledByDefault?"enabled":"disabled"})`)).join("\n")),t.length>0&&(i+="\n\n⚠️ INACTIVE TOOLS (need activation):\n",i+=t.map((([e,a])=>` • ${e} (default: ${a.enabledByDefault?"enabled":"disabled"}) - use {"action": "enable", "toolName": "${e}"} to activate`)).join("\n")),{content:i}}case"reset":{if(!t)throw new Error("Tool name is required for reset action");const e=this.toolkitManager.resetToolToDefault(t),a=this.toolkitManager.isToolEnabledByDefault(t);return{content:e?`Tool '${t}' has been reset to its default state (${a?"enabled":"disabled"})`:`Failed to reset tool '${t}' (tool not found)`}}case"list":{const e=this.toolkitManager.getToolsStatus();return{content:`Available tools: ${Object.entries(e).map((([e,a])=>`${e} (${a?"enabled":"disabled"})`)).join(", ")}`}}default:throw new Error("Invalid action. Use: enable, disable, status, list, detailed, or reset")}}}const cA=[class extends fg{constructor(){super(...arguments),this.name="delete_item",this.type=Zi.WRITE,this.annotations=hg({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return JS}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(BT,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_items_page",this.type=Zi.READ,this.annotations=hg({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true.[REQUIRED PRECONDITION]: Before using this tool, if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available."}getInputSchema(){return mN}parseAndAssignJsonField(e,a,t){if(e[t]&&!e[a])try{e[a]=JSON.parse(e[t])}catch{throw new Error(`${t} is not a valid JSON`)}}async executeInternal(e){const a=!e.cursor;if(a&&e.searchTerm&&(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length))return{content:"No items found matching the specified searchTerm"};const t={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor,includeColumns:e.includeColumns,columnIds:e.columnIds};this.parseAndAssignJsonField(e,"filters","filtersStringified"),this.parseAndAssignJsonField(e,"orderBy","orderByStringified"),a&&(e.itemIds||e.filters||e.orderBy)&&(t.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(lN,t),n=this.mapResult(i,e);return{content:JSON.stringify(n,null,2)}}mapResult(e,a){const t=e.boards?.[0],i=t?.items_page,n=i?.items||[];return{board:{id:t?.id,name:t?.name},items:n.map((e=>{const t={id:e.id,name:e.name,created_at:e.created_at,updated_at:e.updated_at};return a.includeColumns&&e.column_values&&(t.column_values={},e.column_values.forEach((e=>{if(e.value)try{t.column_values[e.id]=JSON.parse(e.value)}catch{t.column_values[e.id]=e.value}else t.column_values[e.id]=e.text||null}))),t})),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}async getItemIdsFromSmartSearchAsync(e){const a={boardId:e.boardId.toString(),searchTerm:e.searchTerm},t=await this.mondayApi.request(cN,a),i=t.search_items?.results?.map((e=>Number(e.data.id)))??[],n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends fg{constructor(){super(...arguments),this.name="create_item",this.type=Zi.WRITE,this.annotations=hg({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications."}getInputSchema(){return this.context?.boardId?HS:GS}async executeInternal(e){const a=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,a):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,a)}async duplicateAndUpdateItem(e,a){try{const t={boardId:a.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(qS,t);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},r=new hI(this.mondayApi,this.apiToken,{boardId:a}),s=await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)});if(s.content.includes("Error"))throw new Error("Failed to update duplicated item: "+s.content);return{content:`Item ${i.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){this.rethrowWrapped(e,"duplicate item")}}async createSubitem(e){const a={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const t=await this.mondayApi.request(MS,a);if(!t.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:`Subitem ${t.create_subitem.id} successfully created under parent item ${e.parentItemId}`}}catch(e){this.rethrowWrapped(e,"create subitem")}}async createNewItem(e,a){try{const t={boardId:a.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(qT,t);return{content:`Item ${i.create_item?.id} successfully created`}}catch(e){this.rethrowWrapped(e,"create item")}}rethrowWrapped(e,a){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)throw new Error(`Failed to ${a}: ${t.response.errors.map((e=>e.message)).join(", ")}`)}throw new Error(`Failed to ${a}: ${t}`)}},class extends fg{constructor(){super(...arguments),this.name="create_update",this.type=Zi.WRITE,this.annotations=hg({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return QS}async executeInternal(e){let a;if(e.mentionsList)try{a=JSON.parse(e.mentionsList)}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e instanceof Error?e.message:"Unknown error"}`)}const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},i=await this.mondayApi.request(MT,t);return{content:`Update ${i.create_update?.id} successfully created on item ${e.itemId}`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_schema",this.type=Zi.READ,this.annotations=hg({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return uN}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},i=await this.mondayApi.request(HT,t);return{content:`The current schema of the board ${a} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_activity",this.type=Zi.READ,this.annotations=hg({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days)"}getInputSchema(){return iN}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-tN.MONTH30Days),i=e?.fromDate||t.toISOString(),n=e?.toDate||a.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1},r=await this.mondayApi.request(ZS,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=s.filter((e=>null!=e)).map((e=>`• ${e.created_at}: ${e.event} on ${e.entity} by user ${e.user_id}${e.data?` - Data: ${e.data}`:""}`)).join("\n");return{content:`Activity logs for board ${e.boardId} from ${i} to ${n} (${s.length} entries):\n\n${p}`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_info",this.type=Zi.READ,this.annotations=hg({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return dN}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(nN,a),i=t.boards?.[0];return i?{content:oN(i)}:{content:`Board with id ${e.boardId} not found or you don't have access to it.`}}},class extends fg{constructor(){super(...arguments),this.name="get_users_by_name",this.type=Zi.READ,this.annotations=hg({title:"Get Users",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get users, can be filtered by name or partial name"}getInputSchema(){return yN}async executeInternal(e){const a={name:e.name},t=await this.mondayApi.request(GT,a);return{content:`Relevant users:\n ${t.users?.map((e=>` id: ${e?.id}, name: ${e?.name}, title: ${e?.title}`)).join("\n")}`}}},class extends fg{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=Zi.READ,this.annotations=hg({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'PRECISION-FIRST user and team retrieval tool. AI agents MUST prioritize specific queries over broad searches.\n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs when available (userIds, teamIds) - highest precision and performance\n 2. ALWAYS use name search when you have user names but no IDs \n 3. ALWAYS use boolean getMe: true when requesting current user information\n 4. AVOID broad queries (no parameters) - use only as absolute last resort\n 5. COMBINE parameters strategically to minimize API calls\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe: true (when requesting current user) - STANDALONE ONLY\n 2. name="exact_name" (when searching by name) - STANDALONE ONLY \n 3. userIds=["id1","id2"] (when you have specific user IDs)\n 4. teamIds=["id1","id2"] + teamsOnly: true (when you have specific team IDs)\n 5. No parameters (LAST RESORT - fetches up to 1000 users, avoid unless absolutely necessary)\n\n CRITICAL USAGE RULES:\n • getMe and name parameters CANNOT be combined with any other parameters\n • userIds + teamIds requires explicit includeTeams: true flag\n • teamsOnly: true prevents user data fetching (teams-only queries)\n • includeTeamMembers: true adds detailed member data to teams\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\n OPTIMIZATION DIRECTIVES:\n • NEVER fetch all users when specific IDs are available\n • NEVER use broad queries for single user/team lookups \n • ALWAYS prefer name search over ID-less queries for individual users\n • SET includeTeamMembers: false for team lists, true only for member analysis \n • AVOID includeTeams: true unless you specifically need both users AND teams\n • AVOID broad queries for single user/team, if you have specific IDs, use them. For example getting a user\'s teams, use that user\'s ID and fetch their team using the includeTeams flag.\n\n RESPONSE CONTENT:\n • Users: id, name, email, title, permissions, contact details, team memberships\n • Teams: id, name, owners, members (when includeTeamMembers: true)\n • Current user: id, name, title, enabled, is_admin, is_guest (basic profile only)'}getInputSchema(){return VN}async executeInternal(e){const a=e.userIds&&e.userIds.length>0,t=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(a||t||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(CN);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]};return{content:$N(s)}}if(r){if(a||t||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(PN,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const p=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n");return{content:`Found ${s.users.length} user(s) matching "${e.name}":\n\n${p}`}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(a&&e.userIds&&e.userIds.length>FN)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(t&&e.teamIds&&e.teamIds.length>jN)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||!a&&t&&!i)if(o){const a={teamIds:e.teamIds};s=await this.mondayApi.request(RN,a)}else{const a={teamIds:e.teamIds};s=await this.mondayApi.request(kN,a)}else if(i){const a={userIds:e.userIds,teamIds:e.teamIds,limit:LN};s=await this.mondayApi.request(ON,a)}else if(a){const a={userIds:e.userIds,limit:LN};s=await this.mondayApi.request(AN,a)}else{const e={userIds:void 0,limit:LN};s=await this.mondayApi.request(DN,e)}return{content:$N(s)}}},hI,class extends fg{constructor(){super(...arguments),this.name="move_item_to_group",this.type=Zi.WRITE,this.annotations=hg({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return zN}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(QT,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends fg{constructor(){super(...arguments),this.name="create_board",this.type=Zi.WRITE,this.annotations=hg({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return fI}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(KT,a);return{content:`Board ${t.create_board?.id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="create_form",this.type=Zi.WRITE,this.annotations=hg({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. This will create a new form as well as a new board for which the form’s responses will be stored. The returned board_id is the ID of the board that was created while the returned formToken can be used for all future queries and mutations to continue editing the form."}getInputSchema(){return GI}async executeInternal(e){const a={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},t=await this.mondayApi.request(TI,a);return{content:`Form created successfully. Board ID: ${t.create_form?.boardId}, Token: ${t.create_form?.token}`}}},class extends fg{constructor(){super(...arguments),this.name="update_form",this.type=Zi.WRITE,this.annotations=hg({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new $S(this.mondayApi),this.actionHandlers=new Map([[mS.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[mS.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[mS.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[mS.activate,this.helpers.activateForm.bind(this.helpers)],[mS.createTag,this.helpers.createTag.bind(this.helpers)],[mS.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[mS.updateTag,this.helpers.updateTag.bind(this.helpers)],[mS.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[mS.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[mS.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[mS.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[mS.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return'Update a monday.com form. Handles the following form update actions that can only be done one at a time using the correct "action" input: \n - update form\'s feature settings with the action "updateFeatures",\n - update form\'s appearance settings with the action "updateAppearance",\n - update form\'s accessibility settings with the action "updateAccessibility",\n - update form\'s title with the action "updateFormHeader",\n - update form\'s description with the action "updateFormHeader",\n - update form\'s question order with the action "updateQuestionOrder",\n - create a new form tag with the action "createTag",\n - delete a form tag with the action "deleteTag",\n - update a form tag with the action "updateTag",\n - set or update the form\'s password with the action "setFormPassword"\n - shorten form\'s url with the action "shortenFormUrl"\n - deactivate form with the action "deactivateForm"\n - reactivate form with the action "activateForm"'}getInputSchema(){return CS}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?await a(e):{content:"Received an invalid action for the update form tool."}}},class extends fg{constructor(){super(...arguments),this.name="get_form",this.type=Zi.READ,this.annotations=hg({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token. Form tokens can be extracted from the form’s url. Given a form url, such as https://forms.monday.com/forms/abc123def456ghi789?r=use1, the token is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the token is abc123def456ghi789."}getInputSchema(){return FS}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(II,a);return t.form?{content:`The form with the token ${e.formToken} is: ${JSON.stringify(t.form,null,2)}`}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends fg{constructor(){super(...arguments),this.name="form_questions_editor",this.type=Zi.WRITE,this.annotations=hg({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new cS(this.mondayApi),this.actionHandlers=new Map([[pS.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[pS.Update,this.helpers.updateQuestion.bind(this.helpers)],[pS.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return lS}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?await a(e):{content:`Unknown action: ${e.action}`}}},class extends fg{constructor(){super(...arguments),this.name="create_column",this.type=Zi.WRITE,this.annotations=hg({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?jS:LS}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},t=await this.mondayApi.request(YT,a);return{content:`Column ${t.create_column?.id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="create_group",this.type=Zi.WRITE,this.annotations=hg({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 BS}async executeInternal(e){const a={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},t=await this.mondayApi.request(zS,a);return{content:`Group "${t.create_group?.title}" (ID: ${t.create_group?.id}) successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="delete_column",this.type=Zi.WRITE,this.annotations=hg({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?KS:YS}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},t=await this.mondayApi.request(JT,a);return{content:`Column ${t.delete_column?.id} successfully deleted`}}},cI,class extends fg{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=Zi.ALL_API,this.annotations=hg({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 vN}async executeInternal(e){try{const a=await this.mondayApi.request(XT),t=e?.operationType,i=a.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=a.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=a.__schema,r=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let s="## GraphQL Schema\n";return t&&"read"!==t||(s+=`- Query Type: ${a.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${i}\n\n`),t&&"write"!==t||(s+=`- Mutation Type: ${a.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${n}\n\n`),s+=`## Available Types\n${r}\n\n`,s+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:s}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends fg{constructor(){super(...arguments),this.name="get_column_type_info",this.type=Zi.READ,this.annotations=hg({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieves comprehensive information about a specific column type, including JSON schema definition and other metadata. Use this before creating columns with the create_column tool to understand the structure, validation rules, and available properties for column settings."}getInputSchema(){return fN}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(hN,a);if(!t?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:t.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(i,null,2)}`}}},class extends fg{constructor(){super(...arguments),this.name="get_type_details",this.type=Zi.ALL_API,this.annotations=hg({title:"Get Type Details",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get detailed information about a specific GraphQL type from the monday.com API schema"}getInputSchema(){return gN}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const t=(a=e.typeName,UT`
1250
+ `,pA={objectType:e.z.nativeEnum(B_).describe("The type of object to move"),id:e.z.string().describe("The ID of the object to move"),position:e.z.object({object_id:e.z.string().describe("The ID of the object to position the object relative to"),object_type:e.z.nativeEnum(B_).describe("The type of object to position the object relative to"),is_after:e.z.boolean().optional().describe("Whether to position the object after the object")}).optional().describe("The new position of the object. Required if changing the position based on another object."),parentFolderId:e.z.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:e.z.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:e.z.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const dA={action:e.z.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'),toolName:e.z.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)")};class lA{constructor(){this.name="manage_tools",this.type=Zi.READ,this.enabledByDefault=!0,this.annotations={title:"Discover & Manage monday.com Tools",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}}setToolkitManager(e){this.toolkitManager=e}getDescription(){return"Discover and manage available monday.com tools. Use this tool first to see what tools are available, check which ones are active/inactive, and enable any tools you need for your tasks. When enabling a tool, you will be asked for confirmation first. Essential for understanding your monday.com toolkit capabilities."}getInputSchema(){return dA}async execute(e){if(!this.toolkitManager)throw new Error("Toolkit manager not initialized");if(!e)throw new Error("Input parameters are required");const{action:a,toolName:t}=e;switch(a){case"enable":if(!t)throw new Error("Tool name is required for enable action");if(this.toolkitManager.isToolEnabled(t))return{content:`Tool '${t}' is already enabled`};return{content:this.toolkitManager.enableTool(t)?`✅ Tool '${t}' has been enabled and is now available for use`:`❌ Failed to enable tool '${t}' (tool not found)`};case"disable":if(!t)throw new Error("Tool name is required for disable action");return{content:this.toolkitManager.disableTool(t)?`Tool '${t}' has been disabled`:`Failed to disable tool '${t}' (tool not found)`};case"status":if(t){return{content:`Tool '${t}' is ${this.toolkitManager.isToolEnabled(t)?"enabled":"disabled"}`}}{const e=this.toolkitManager.getToolsStatus();return{content:`All tools status:\n${Object.entries(e).map((([e,a])=>`${e}: ${a?"enabled":"disabled"}`)).join("\n")}`}}case"detailed":{const e=this.toolkitManager.getDetailedToolsStatus(),a=Object.entries(e).filter((([,e])=>e.enabled)),t=Object.entries(e).filter((([,e])=>!e.enabled));let i="monday.com Tools Discovery:\n\n";return a.length>0&&(i+="✅ ACTIVE TOOLS (ready to use):\n",i+=a.map((([e,a])=>` • ${e} (default: ${a.enabledByDefault?"enabled":"disabled"})`)).join("\n")),t.length>0&&(i+="\n\n⚠️ INACTIVE TOOLS (need activation):\n",i+=t.map((([e,a])=>` • ${e} (default: ${a.enabledByDefault?"enabled":"disabled"}) - use {"action": "enable", "toolName": "${e}"} to activate`)).join("\n")),{content:i}}case"reset":{if(!t)throw new Error("Tool name is required for reset action");const e=this.toolkitManager.resetToolToDefault(t),a=this.toolkitManager.isToolEnabledByDefault(t);return{content:e?`Tool '${t}' has been reset to its default state (${a?"enabled":"disabled"})`:`Failed to reset tool '${t}' (tool not found)`}}case"list":{const e=this.toolkitManager.getToolsStatus();return{content:`Available tools: ${Object.entries(e).map((([e,a])=>`${e} (${a?"enabled":"disabled"})`)).join(", ")}`}}default:throw new Error("Invalid action. Use: enable, disable, status, list, detailed, or reset")}}}const cA=[class extends fg{constructor(){super(...arguments),this.name="delete_item",this.type=Zi.WRITE,this.annotations=hg({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return JS}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(BT,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_items_page",this.type=Zi.READ,this.annotations=hg({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true.[REQUIRED PRECONDITION]: Before using this tool, if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available."}getInputSchema(){return mN}parseAndAssignJsonField(e,a,t){if(e[t]&&!e[a])try{e[a]=JSON.parse(e[t])}catch{throw new Error(`${t} is not a valid JSON`)}}async executeInternal(e){const a=!e.cursor;if(a&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch{this.parseAndAssignJsonField(e,"filters","filtersStringified"),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const t={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor,includeColumns:e.includeColumns,columnIds:e.columnIds};this.parseAndAssignJsonField(e,"filters","filtersStringified"),this.parseAndAssignJsonField(e,"orderBy","orderByStringified"),a&&(e.itemIds||e.filters||e.orderBy)&&(t.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(lN,t),n=this.mapResult(i,e);return{content:JSON.stringify(n,null,2)}}rebuildFiltersWithManualSearch(e,a){return(a=(a=a??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:R_.ContainsText,compareValue:e}),a}mapResult(e,a){const t=e.boards?.[0],i=t?.items_page,n=i?.items||[];return{board:{id:t?.id,name:t?.name},items:n.map((e=>{const t={id:e.id,name:e.name,created_at:e.created_at,updated_at:e.updated_at};return a.includeColumns&&e.column_values&&(t.column_values={},e.column_values.forEach((e=>{if(e.value)try{t.column_values[e.id]=JSON.parse(e.value)}catch{t.column_values[e.id]=e.value}else t.column_values[e.id]=e.text||null}))),t})),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}async getItemIdsFromSmartSearchAsync(e){const a={boardId:e.boardId.toString(),searchTerm:e.searchTerm},t=await this.mondayApi.request(cN,a),i=t.search_items?.results?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends fg{constructor(){super(...arguments),this.name="create_item",this.type=Zi.WRITE,this.annotations=hg({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications."}getInputSchema(){return this.context?.boardId?HS:GS}async executeInternal(e){const a=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,a):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,a)}async duplicateAndUpdateItem(e,a){try{const t={boardId:a.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(qS,t);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},r=new hI(this.mondayApi,this.apiToken,{boardId:a}),s=await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)});if(s.content.includes("Error"))throw new Error("Failed to update duplicated item: "+s.content);return{content:`Item ${i.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){this.rethrowWrapped(e,"duplicate item")}}async createSubitem(e){const a={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const t=await this.mondayApi.request(MS,a);if(!t.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:`Subitem ${t.create_subitem.id} successfully created under parent item ${e.parentItemId}`}}catch(e){this.rethrowWrapped(e,"create subitem")}}async createNewItem(e,a){try{const t={boardId:a.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(qT,t);return{content:`Item ${i.create_item?.id} successfully created`}}catch(e){this.rethrowWrapped(e,"create item")}}rethrowWrapped(e,a){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)throw new Error(`Failed to ${a}: ${t.response.errors.map((e=>e.message)).join(", ")}`)}throw new Error(`Failed to ${a}: ${t}`)}},class extends fg{constructor(){super(...arguments),this.name="create_update",this.type=Zi.WRITE,this.annotations=hg({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return QS}async executeInternal(e){let a;if(e.mentionsList)try{a=JSON.parse(e.mentionsList)}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e instanceof Error?e.message:"Unknown error"}`)}const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},i=await this.mondayApi.request(MT,t);return{content:`Update ${i.create_update?.id} successfully created on item ${e.itemId}`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_schema",this.type=Zi.READ,this.annotations=hg({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return uN}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},i=await this.mondayApi.request(HT,t);return{content:`The current schema of the board ${a} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_activity",this.type=Zi.READ,this.annotations=hg({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days)"}getInputSchema(){return iN}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-tN.MONTH30Days),i=e?.fromDate||t.toISOString(),n=e?.toDate||a.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1},r=await this.mondayApi.request(ZS,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=s.filter((e=>null!=e)).map((e=>`• ${e.created_at}: ${e.event} on ${e.entity} by user ${e.user_id}${e.data?` - Data: ${e.data}`:""}`)).join("\n");return{content:`Activity logs for board ${e.boardId} from ${i} to ${n} (${s.length} entries):\n\n${p}`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_info",this.type=Zi.READ,this.annotations=hg({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return dN}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(nN,a),i=t.boards?.[0];return i?{content:oN(i)}:{content:`Board with id ${e.boardId} not found or you don't have access to it.`}}},class extends fg{constructor(){super(...arguments),this.name="get_users_by_name",this.type=Zi.READ,this.annotations=hg({title:"Get Users",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get users, can be filtered by name or partial name"}getInputSchema(){return yN}async executeInternal(e){const a={name:e.name},t=await this.mondayApi.request(GT,a);return{content:`Relevant users:\n ${t.users?.map((e=>` id: ${e?.id}, name: ${e?.name}, title: ${e?.title}`)).join("\n")}`}}},class extends fg{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=Zi.READ,this.annotations=hg({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'PRECISION-FIRST user and team retrieval tool. AI agents MUST prioritize specific queries over broad searches.\n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs when available (userIds, teamIds) - highest precision and performance\n 2. ALWAYS use name search when you have user names but no IDs \n 3. ALWAYS use boolean getMe: true when requesting current user information\n 4. AVOID broad queries (no parameters) - use only as absolute last resort\n 5. COMBINE parameters strategically to minimize API calls\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe: true (when requesting current user) - STANDALONE ONLY\n 2. name="exact_name" (when searching by name) - STANDALONE ONLY \n 3. userIds=["id1","id2"] (when you have specific user IDs)\n 4. teamIds=["id1","id2"] + teamsOnly: true (when you have specific team IDs)\n 5. No parameters (LAST RESORT - fetches up to 1000 users, avoid unless absolutely necessary)\n\n CRITICAL USAGE RULES:\n • getMe and name parameters CANNOT be combined with any other parameters\n • userIds + teamIds requires explicit includeTeams: true flag\n • teamsOnly: true prevents user data fetching (teams-only queries)\n • includeTeamMembers: true adds detailed member data to teams\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\n OPTIMIZATION DIRECTIVES:\n • NEVER fetch all users when specific IDs are available\n • NEVER use broad queries for single user/team lookups \n • ALWAYS prefer name search over ID-less queries for individual users\n • SET includeTeamMembers: false for team lists, true only for member analysis \n • AVOID includeTeams: true unless you specifically need both users AND teams\n • AVOID broad queries for single user/team, if you have specific IDs, use them. For example getting a user\'s teams, use that user\'s ID and fetch their team using the includeTeams flag.\n\n RESPONSE CONTENT:\n • Users: id, name, email, title, permissions, contact details, team memberships\n • Teams: id, name, owners, members (when includeTeamMembers: true)\n • Current user: id, name, title, enabled, is_admin, is_guest (basic profile only)'}getInputSchema(){return VN}async executeInternal(e){const a=e.userIds&&e.userIds.length>0,t=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(a||t||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(CN);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]};return{content:$N(s)}}if(r){if(a||t||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(PN,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const p=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n");return{content:`Found ${s.users.length} user(s) matching "${e.name}":\n\n${p}`}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(a&&e.userIds&&e.userIds.length>FN)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(t&&e.teamIds&&e.teamIds.length>jN)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||!a&&t&&!i)if(o){const a={teamIds:e.teamIds};s=await this.mondayApi.request(RN,a)}else{const a={teamIds:e.teamIds};s=await this.mondayApi.request(kN,a)}else if(i){const a={userIds:e.userIds,teamIds:e.teamIds,limit:LN};s=await this.mondayApi.request(ON,a)}else if(a){const a={userIds:e.userIds,limit:LN};s=await this.mondayApi.request(AN,a)}else{const e={userIds:void 0,limit:LN};s=await this.mondayApi.request(DN,e)}return{content:$N(s)}}},hI,class extends fg{constructor(){super(...arguments),this.name="move_item_to_group",this.type=Zi.WRITE,this.annotations=hg({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return zN}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(QT,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends fg{constructor(){super(...arguments),this.name="create_board",this.type=Zi.WRITE,this.annotations=hg({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return fI}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(KT,a);return{content:`Board ${t.create_board?.id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="create_form",this.type=Zi.WRITE,this.annotations=hg({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. This will create a new form as well as a new board for which the form’s responses will be stored. The returned board_id is the ID of the board that was created while the returned formToken can be used for all future queries and mutations to continue editing the form."}getInputSchema(){return GI}async executeInternal(e){const a={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},t=await this.mondayApi.request(TI,a);return{content:`Form created successfully. Board ID: ${t.create_form?.boardId}, Token: ${t.create_form?.token}`}}},class extends fg{constructor(){super(...arguments),this.name="update_form",this.type=Zi.WRITE,this.annotations=hg({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new $S(this.mondayApi),this.actionHandlers=new Map([[mS.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[mS.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[mS.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[mS.activate,this.helpers.activateForm.bind(this.helpers)],[mS.createTag,this.helpers.createTag.bind(this.helpers)],[mS.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[mS.updateTag,this.helpers.updateTag.bind(this.helpers)],[mS.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[mS.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[mS.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[mS.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[mS.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return'Update a monday.com form. Handles the following form update actions that can only be done one at a time using the correct "action" input: \n - update form\'s feature settings with the action "updateFeatures",\n - update form\'s appearance settings with the action "updateAppearance",\n - update form\'s accessibility settings with the action "updateAccessibility",\n - update form\'s title with the action "updateFormHeader",\n - update form\'s description with the action "updateFormHeader",\n - update form\'s question order with the action "updateQuestionOrder",\n - create a new form tag with the action "createTag",\n - delete a form tag with the action "deleteTag",\n - update a form tag with the action "updateTag",\n - set or update the form\'s password with the action "setFormPassword"\n - shorten form\'s url with the action "shortenFormUrl"\n - deactivate form with the action "deactivateForm"\n - reactivate form with the action "activateForm"'}getInputSchema(){return CS}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?await a(e):{content:"Received an invalid action for the update form tool."}}},class extends fg{constructor(){super(...arguments),this.name="get_form",this.type=Zi.READ,this.annotations=hg({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token. Form tokens can be extracted from the form’s url. Given a form url, such as https://forms.monday.com/forms/abc123def456ghi789?r=use1, the token is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the token is abc123def456ghi789."}getInputSchema(){return FS}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(II,a);return t.form?{content:`The form with the token ${e.formToken} is: ${JSON.stringify(t.form,null,2)}`}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends fg{constructor(){super(...arguments),this.name="form_questions_editor",this.type=Zi.WRITE,this.annotations=hg({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new cS(this.mondayApi),this.actionHandlers=new Map([[pS.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[pS.Update,this.helpers.updateQuestion.bind(this.helpers)],[pS.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return lS}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?await a(e):{content:`Unknown action: ${e.action}`}}},class extends fg{constructor(){super(...arguments),this.name="create_column",this.type=Zi.WRITE,this.annotations=hg({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?jS:LS}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},t=await this.mondayApi.request(YT,a);return{content:`Column ${t.create_column?.id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="create_group",this.type=Zi.WRITE,this.annotations=hg({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 BS}async executeInternal(e){const a={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},t=await this.mondayApi.request(zS,a);return{content:`Group "${t.create_group?.title}" (ID: ${t.create_group?.id}) successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="delete_column",this.type=Zi.WRITE,this.annotations=hg({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?KS:YS}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},t=await this.mondayApi.request(JT,a);return{content:`Column ${t.delete_column?.id} successfully deleted`}}},cI,class extends fg{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=Zi.ALL_API,this.annotations=hg({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 vN}async executeInternal(e){try{const a=await this.mondayApi.request(XT),t=e?.operationType,i=a.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=a.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=a.__schema,r=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let s="## GraphQL Schema\n";return t&&"read"!==t||(s+=`- Query Type: ${a.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${i}\n\n`),t&&"write"!==t||(s+=`- Mutation Type: ${a.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${n}\n\n`),s+=`## Available Types\n${r}\n\n`,s+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:s}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends fg{constructor(){super(...arguments),this.name="get_column_type_info",this.type=Zi.READ,this.annotations=hg({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieves comprehensive information about a specific column type, including JSON schema definition and other metadata. Use this before creating columns with the create_column tool to understand the structure, validation rules, and available properties for column settings."}getInputSchema(){return fN}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(hN,a);if(!t?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:t.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(i,null,2)}`}}},class extends fg{constructor(){super(...arguments),this.name="get_type_details",this.type=Zi.ALL_API,this.annotations=hg({title:"Get Type Details",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get detailed information about a specific GraphQL type from the monday.com API schema"}getInputSchema(){return gN}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const t=(a=e.typeName,UT`
1251
1251
  query getTypeDetails {
1252
1252
  __type(name: "${a}") {
1253
1253
  name