@mondaydotcomorg/agent-toolkit 5.1.3 → 5.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -791,13 +791,31 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
791
791
  description
792
792
  }
793
793
  }
794
- `,fx={formToken:"The unique identifier token for the form. Required for all form-specific operations.",questionId:"The unique identifier for the question. Used to target specific questions within a form."},hx={operations:{createForm:"Create a new form with specified configuration. Returns the created form with its unique token.",updateForm:{action:"The type of update action to perform on the form. Can be one of the following: activate, deactivate, shortenFormUrl, setFormPassword, createTag, deleteTag, updateTag, updateForm, updateAppearance, updateAccessibility, updateFeatures, updateQuestionOrder, updateFormHeader."},activateForm:"Activate a form to make it visible to users and accept new submissions.",deactivateForm:"Deactivate a form to hide it from users and stop accepting submissions. Form data is preserved."},properties:{id:"The unique identifier for the form. Auto-generated upon creation.",token:"The unique token used to access and identify the form. Used in public URLs and API calls.",boardId:"The board ID connected to the form. Used to store form responses as items.",title:"The display title shown to users at the top of the form.",description:"Optional detailed description explaining the form purpose, displayed below the title.",active:"Boolean indicating if the form is currently accepting responses and visible to users.",ownerId:"The ID of the user who created and owns this form. Determines permissions.",createWithAI:"Boolean indicating if this form was initially created using AI assistance.",builtWithAI:"Boolean indicating if this form was built or modified using AI functionality.",questions:"Array of question objects that make up the form content, in display order.",isSuspicious:"Boolean flag indicating if the form has been flagged for review due to suspicious content or activity.",isAnonymous:"Boolean indicating if responses are collected without identifying the submitter.",type:"The category or classification of the form for organizational purposes.",features:"Object containing feature toggles and settings like password protection, response limits, etc.",appearance:"Object containing visual styling settings including colors, fonts, layout, and branding.",accessibility:"Object containing accessibility settings such as language, alt text, and reading direction.",tags:{description:"Array of tracking tags for categorization and analytics (e.g., UTM parameters for marketing tracking).",id:"The unique identifier for the tag. This will get auto generated when creating a tag and can’t be updated. This is required when updating or deleting a tag.",name:"The name of the tag. This can only be created, not updated. This is required when creating a tag.",value:"The value of the tag. This value is required when creating or updating a tag.",columnId:"The ID of the column this tag is associated with. This will get auto generated when creating a tag and can’t be updated."}},inputs:{title:"The title text for the form. Must be at least 1 character long. Can only be updated if the update action is updateFormHeader.",description:"Optional description text providing context about the form purpose. Can only be updated if the update action is updateFormHeader.",input:"Complete form configuration object containing properties to create or update.",questions:"Ordered array of dehydrated questions, object only including each question ID, for reordering. Must include all existing question IDs. Required if the update action is updateQuestionOrder.",questionId:"The unique identifier for the question. Used to target specific questions within a form. Required when deleting or updating a question.",tag:"The tag data to create, update or delete. If deleting a tag, only provide the id of the tag to delete. If creating a tag, provide the name and value, the id and columnId are auto generated. If updating a tag, provide the id and new value, name and columnId are not changeable.",form:{describe:"The form data to update. Required if updating the appearance, accessibility, features, question order, or form header.",appearance:"The appearance data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateAppearance.",accessibility:"The accessibility data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateAccessibility.",features:"The features data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateFeatures.",questionOrder:"The question order data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateQuestionOrder.",formHeader:"The form header data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateFormHeader."}},args:{formToken:"The unique form token identifying which form to operate on.",destinationWorkspaceId:"The workspace in which the form will be created in.",destinationFolderId:"The folder in which the form will be created under.",destinationFolderName:"The name of the folder in which the form will be created in.",boardKind:"The board kind to create for the board in which the form will create items in.",destinationName:"The name of the board that will be created to store the form responses in.",boardOwnerIds:"Array of user IDs who will have owner permissions on the board in which the form will create items in.",boardOwnerTeamIds:"Array of team IDs whose members will have owner permissions on the board in which the form will create items in.",boardSubscriberIds:"Array of user IDs who will receive notifications about board activity for the board in which the form will create items in.",boardSubscriberTeamsIds:"Array of team IDs whose members will receive notifications about board activity for the board in which the form will create items in."}},vx={operations:{updateFormSettings:"Update form configuration including features, appearance, and accessibility options.",setFormPassword:'Set a password on a form to restrict access. This will enable password protection for the form. Required for the action "setFormPassword" in the update form tool.',shortenUrl:"Shorten a URL for a form and store it in the form settings. Returns the shortened link object."},properties:{features:"Object containing form features including but not limited to password protection, response limits, login requirements, etc. Required when updating the features of the form.",appearance:"Object containing visual styling including colors, layout, fonts, and branding elements. Required when updating the appearance of the form.",accessibility:"Object containing accessibility options such as language, alt text, etc. Required when updating the accessibility of the form.",isInternal:"Boolean indicating if the form is restricted to internal users only.",reCaptchaChallenge:"Boolean enabling reCAPTCHA verification to prevent spam submissions.",password:"Object containing password protection configuration for the form.",passwordEnabled:"Boolean disabling password protection. Can only be updated to false. In order to enable password protection use the setFormPassword action instead.",requireLogin:"Object containing login requirement settings for form access.",requireLoginEnabled:"Boolean requiring users to be logged in before submitting responses.",redirectToLogin:"Boolean automatically redirecting unauthenticated users to the login page.",shortenedLink:"Object containing shortened URL configuration for easy form sharing.",shortenedLinkEnabled:"Boolean enabling generation of shortened URLs for the form.",shortenedLinkUrl:"The generated shortened URL for form access. Only available when shortened links are enabled.",draftSubmission:"Object containing draft saving configuration allowing users to save progress.",draftSubmissionEnabled:"Boolean allowing users to save incomplete responses as drafts.",aiTranslate:"Object containing AI translation configuration for the form.",aiTranslateEnabled:"Boolean enabling AI translation for the form.",responseLimit:"Object containing response limitation settings to control submission volume.",responseLimitEnabled:"Boolean enabling response count limits for the form.",responseLimitValue:"Integer specifying the maximum number of responses allowed.",closeDate:"Object containing automatic form closure configuration.",closeDateEnabled:"Boolean enabling automatic form closure at a specified date and time.",closeDateValue:"ISO timestamp when the form will automatically stop accepting responses.",allowResubmit:"Boolean allowing users to submit multiple responses to the same form.",allowEditSubmission:"Boolean allowing users to modify their submitted responses after submission.",allowViewSubmission:"Boolean allowing users to view their submitted responses.",preSubmissionView:"Object containing welcome screen configuration displayed before the form.",preSubmissionEnabled:"Boolean showing a welcome/introduction screen before the form begins.",preSubmissionTitle:"Text displayed as the title on the welcome screen.",preSubmissionDescription:"Text providing context or instructions on the welcome screen.",startButton:"Object containing start button configuration for the welcome screen.",startButtonText:"Custom text for the button that begins the form experience.",afterSubmissionView:"Object containing settings for the post-submission user experience.",postSubmissionTitle:"Text displayed as the title after successful form submission.",postSubmissionDescription:"Text shown to users after they complete the form.",showSuccessImage:"Boolean displaying a success image after form completion.",redirectAfterSubmission:"Object containing redirect configuration after form submission.",redirectAfterSubmissionEnabled:"Boolean enabling automatic redirect after form completion to a specified URL.",redirectUrl:"The URL where users will be redirected after successfully submitting the form.",monday:"Object containing board settings for response handling.",itemGroupId:"The board group ID where new items from form responses will be created.",includeNameQuestion:"Boolean adding a name question to the form. This is a special question type that represents the name column from the associated monday board",includeUpdateQuestion:"Boolean adding an update/comment field to the form. This is a special question type that represents the updates from the associated item of the submission on the monday board. ",syncQuestionAndColumnsTitles:"Boolean synchronizing form question titles with board column names. When true, the form question titles will be synchronized with the board column names.",hideBranding:"Boolean hiding monday branding from the form display.",showProgressBar:"Boolean displaying a progress indicator showing form completion progress bar.",primaryColor:"Hex color code for the primary theme color used throughout the form.",layout:"Object containing form structure and presentation settings.",format:"String specifying the form display format. Can be a step by step form or a classic one page form.",alignment:"String controlling text and content alignment.",direction:"String setting reading direction.",background:"Object containing background appearance configuration for the form.",backgroundType:"String specifying background style.",backgroundValue:"String containing the background value. The value will depend on the background type. If the background type is color, the value will be a hex color code. If the background type is image, the value will be an image URL.",text:"Object containing typography and text styling configuration.",font:"String specifying the font family used throughout the form.",textColor:"Hex color code for the text color in the form.",fontSize:"String or number specifying the base font size for form text.",logo:"Object containing logo display configuration for form branding.",logoPosition:'String specifying logo placement ("top", "bottom", "header").',logoUrl:"URL pointing to the logo image file for display on the form.",logoSize:'String specifying logo size ("small", "medium", "large") for the logo that appears on the header of the form.',logoAltText:"Alternative text description for the logo image for accessibility.",submitButton:"Object containing submit button styling and text configuration.",submitButtonText:"Custom text displayed on the form submission button.",language:'Language code for form localization and interface text (e.g., "en", "es", "fr").'},inputs:{settings:"Complete form settings object containing all configuration options.",features:"Form features configuration including security, limits, and access controls.",appearance:"Visual styling configuration including colors, layout, and branding.",accessibility:"Accessibility configuration including language and reading direction.",password:"Password configuration for the form. Only setting enabled to false is supported. To enable a form to be password protected, please use the set_form_password mutation instead.",passwordValue:"The password to set for the form. Must be at least 1 character long."}},bx={actions:{type:"The type of operation to perform on the question. Can delete, update, or create. When updating or deleting a question, the questionId is required. When creating or updating a question, the question object is required. When updating, the question is a patch object, meaning that only the fields that are provided will be updated.",question:"The question object containing all properties for creation or update. When creating a question, the title is required."},properties:{title:"The question text displayed to respondents. Must be at least 1 character long and clearly indicate the expected response.",type:'The question type determining input behavior and validation (e.g., "text", "email", "single_select", "multi_select").',visible:"Boolean controlling question visibility to respondents. Hidden questions remain in form structure but are not displayed.",required:"Boolean indicating if the question must be answered before form submission.",position:"Integer specifying the display order of the question within the form (zero-based).",description:"Optional explanatory text providing additional context, instructions, or examples for the question.",placeholder:"Optional placeholder text shown in input fields to guide user input.",createdAt:"ISO timestamp when the question was created.",updatedAt:"ISO timestamp when the question was last modified.",selectOptions:"Array of option objects for choice-based questions (single_select, multi_select). Supported on both create and update. When updating, the provided array replaces all existing options (PUT semantics). SingleSelect: max 40 options. MultiSelect: max 500 options. Cannot remove options that are already used in board items (existing submissions) — those options must be preserved and must include their value field.",selectOptionsLabel:"Display label for the option shown to respondents.",selectOptionsValue:"Internal identifier for the option. Required when updating options that are already assigned to board items — omitting it will cause those options to be removed.",selectOptionsVisible:"Whether the option is visible to respondents. Defaults to true.",blockType:"The kind of block to create. Includes all question types and content block types.",insertAfterQuestionId:"Insert the new question after this question ID. Omit to append at the end. Pass null to place it first in the form.",pageBlockId:"Page block this question belongs to. Required for questions inside a page block. Pass null to remove the page block association.",existingColumnId:"Link to an existing board column instead of creating a new one."},inputs:{question:"Complete question object containing all properties for creation or update.",questionData:"Question configuration including type, title, and type-specific settings.",position:"Integer position where the question should be placed in the form sequence."}},gx={properties:{validation:"Validation rules applied to the question response",prefill:"Configuration for automatically populating question values from various data sources such as user account information or URL query parameters.",prefillEnabled:"Whether prefill functionality is enabled for this question. When true, the question will attempt to auto-populate values from the specified source.",prefillSource:"The data source to use for prefilling the question value. Check the PrefillSources for available options.",prefillLookup:'The specific field or parameter name to lookup from the prefill source. For account sources, this would be a user property like "name" or "email". For query parameters, this would be the parameter name that would be set in the URL.',prefixAutofilled:"Phone questions only: Automatically detect and fill the phone country prefix based on the user's geographic location or browser settings.",prefixPredefined:"Phone questions only: Configuration for setting a specific predefined phone country prefix that will be pre-selected for users.",prefixPredefinedEnabled:"Whether a predefined phone prefix is enabled for phone number questions. When true, the specified prefix will be pre-selected.",prefixPredefinedPrefix:'The predefined phone country prefix to use as country code in capital letters (e.g., "US", "UK", "IL"). Only used when enabled is true.',checkedByDefault:"Boolean/checkbox questions only: Whether the checkbox should be checked by default when the form loads.",defaultCurrentDate:"Date based questions only: Automatically set the current date as the default value when the form loads.",includeTime:"Date questions only: Whether to include time selection (hours and minutes) in addition to the date picker. When false, only date selection is available.",display:"Single/Multi Select questions only: Controls how the selection options are visually presented to users.",optionsOrder:"Single/Multi Select questions only: Determines the ordering of selection options.",locationAutofilled:"Location questions only: Automatically detect and fill the user's current location using browser geolocation services, requiring user permission.",limit:"Rating questions only: Maximum rating value that users can select.",skipValidation:"Link/URL questions only: Whether to skip URL format validation, allowing any text input.",labelLimitCount:"Multi Select questions only: Maximum number of options a respondent can select. Must be set together with labelLimitCountEnabled to take effect.",labelLimitCountEnabled:"Multi Select questions only: Whether to enforce an option selection limit. Set labelLimitCount to specify the limit.",defaultAnswer:"ShortText, LongText, Name, and Link questions only: Pre-filled default value shown to respondents when the form loads. Respondents can clear or change it before submitting."},inputs:{settings:"Question-specific configuration object that varies by question type.",validationRules:"Validation constraints and rules",choiceOptions:"List of available choices for selection questions",fileSettings:"File upload constraints and settings"}},yx={destination_workspace_id:y.string().describe(hx.args.destinationWorkspaceId),destination_folder_id:y.string().optional().describe(hx.args.destinationFolderId),destination_folder_name:y.string().optional().describe(hx.args.destinationFolderName),board_kind:y.nativeEnum(Wb).optional().describe(hx.args.boardKind),destination_name:y.string().optional().describe(hx.args.destinationName),board_owner_ids:y.array(y.string()).optional().describe(hx.args.boardOwnerIds),board_owner_team_ids:y.array(y.string()).optional().describe(hx.args.boardOwnerTeamIds),board_subscriber_ids:y.array(y.string()).optional().describe(hx.args.boardSubscriberIds),board_subscriber_teams_ids:y.array(y.string()).optional().describe(hx.args.boardSubscriberTeamsIds)};var _x,wx,xx,Tx,Ex,Ix,Sx,Nx,Ax,Dx,kx,Ox,Rx,Cx,$x,Lx;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(_x||(_x={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(wx||(wx={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(xx||(xx={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(Tx||(Tx={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(Ex||(Ex={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(Ix||(Ix={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(Sx||(Sx={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(Nx||(Nx={})),function(e){e.Boolean="Boolean",e.ConnectedBoards="ConnectedBoards",e.Country="Country",e.Date="Date",e.DateRange="DateRange",e.Email="Email",e.File="File",e.Link="Link",e.Location="Location",e.LongText="LongText",e.MultiSelect="MultiSelect",e.Name="Name",e.Number="Number",e.People="People",e.Phone="Phone",e.Rating="Rating",e.ShortText="ShortText",e.Signature="Signature",e.SingleSelect="SingleSelect",e.Subitems="Subitems",e.Updates="Updates"}(Ax||(Ax={})),function(e){e.Account="account",e.QueryParam="queryParam"}(Dx||(Dx={})),function(e){e.Email="email",e.Name="name",e.Title="title",e.Phone="phone",e.FirstName="first_name",e.LastName="last_name",e.Location="location",e.Timezone="time_zone",e.ManagerName="manager_display_name"}(kx||(kx={})),function(e){e.And="AND",e.Or="OR"}(Ox||(Ox={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(Rx||(Rx={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(Cx||(Cx={})),function(e){e.MultiSelect="multi-select",e.SingleSelect="single-select",e.People="people",e.Location="location",e.CountryCode="country-code",e.Country="country",e.ConnectedBoards="connected_boards"}($x||($x={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(Lx||(Lx={}));const Fx=y.object({type:y.nativeEnum(Vg).describe(bx.properties.type),block_type:y.nativeEnum(kg).describe(bx.properties.blockType).optional(),title:y.string().describe(bx.properties.title).optional(),description:y.string().describe(bx.properties.description).optional(),visible:y.boolean().describe(bx.properties.visible).optional(),required:y.boolean().describe(bx.properties.required).optional(),insert_after_question_id:y.string().nullish().describe(bx.properties.insertAfterQuestionId),page_block_id:y.string().nullish().describe(bx.properties.pageBlockId),existing_column_id:y.string().describe(bx.properties.existingColumnId).optional(),options:y.array(y.object({label:y.string().describe(bx.properties.selectOptionsLabel),value:y.string().optional().describe(bx.properties.selectOptionsValue),visible:y.boolean().optional().describe(bx.properties.selectOptionsVisible)})).describe(bx.properties.selectOptions).optional(),settings:y.object({checkedByDefault:y.boolean().describe(gx.properties.checkedByDefault).optional(),defaultCurrentDate:y.boolean().describe(gx.properties.defaultCurrentDate).optional(),display:y.nativeEnum(jg).describe(gx.properties.display).optional(),includeTime:y.boolean().describe(gx.properties.includeTime).optional(),locationAutofilled:y.boolean().describe(gx.properties.locationAutofilled).optional(),optionsOrder:y.nativeEnum(Ug).describe(gx.properties.optionsOrder).optional(),prefixAutofilled:y.boolean().describe(gx.properties.prefixAutofilled).optional(),prefixPredefined:y.object({enabled:y.boolean().describe(gx.properties.prefixPredefinedEnabled),prefix:y.string().describe(gx.properties.prefixPredefinedPrefix).optional()}).describe(gx.properties.prefixPredefined).optional(),skipValidation:y.boolean().describe(gx.properties.skipValidation).optional(),labelLimitCount:y.number().int().describe(gx.properties.labelLimitCount).optional(),label_limit_count_enabled:y.boolean().describe(gx.properties.labelLimitCountEnabled).optional(),default_answer:y.string().describe(gx.properties.defaultAnswer).optional(),prefill:y.object({enabled:y.boolean().describe(gx.properties.prefillEnabled),lookup:y.string().describe(gx.properties.prefillLookup).optional(),source:y.nativeEnum(Pg).describe(gx.properties.prefillSource).optional()}).describe(gx.properties.prefill).optional()}).optional()}),Px={action:y.nativeEnum(Lx).describe(bx.actions.type),formToken:y.string().describe(fx.formToken),questionId:y.string().describe(fx.questionId).optional(),question:Fx.describe(bx.actions.question).optional()};class jx{constructor(e){this.mondayApi=e}async deleteQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when deleting a question."};const a={formToken:e.formToken,questionId:t};return await this.mondayApi.request(Zw,a),{content:{message:"Question deleted",question_id:t,action_name:"delete"}}}async updateQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when updating a question."};const a=e.question;if(!a)return{content:"Must provide updated patch props for the question when updating."};const i={formToken:e.formToken,questionId:t,question:a};return await this.mondayApi.request(tx,i),{content:{message:"Question updated",question_id:t,action_name:"update"}}}async createQuestion(e){const t=e.question;if(!t)return{content:"Must provide a full question payload when creating a question."};if(!t.title)return{content:"Must provide a title for the question when creating a question."};const a={formToken:e.formToken,question:{...t,title:t.title}},i=await this.mondayApi.request(ex,a);return{content:{message:"Question created",question_id:i.create_form_question?.id,action_name:"create"}}}}var Ux;!function(e){e.activate="activate",e.deactivate="deactivate",e.shortenFormUrl="shortenFormUrl",e.setFormPassword="setFormPassword",e.createTag="createTag",e.deleteTag="deleteTag",e.updateTag="updateTag",e.updateAppearance="updateAppearance",e.updateAccessibility="updateAccessibility",e.updateFeatures="updateFeatures",e.updateQuestionOrder="updateQuestionOrder",e.updateFormHeader="updateFormHeader"}(Ux||(Ux={}));const Vx=y.object({id:y.string().describe(hx.properties.tags.id).optional(),name:y.string().describe(hx.properties.tags.name).optional(),value:y.string().describe(hx.properties.tags.value).optional(),columnId:y.string().describe(hx.properties.tags.columnId).optional()}),Bx=y.object({type:y.nativeEnum(Tx).describe(vx.properties.backgroundType).optional(),value:y.string().describe(vx.properties.backgroundValue).optional()}),Mx=y.object({format:y.nativeEnum(Ix).describe(vx.properties.format).optional(),alignment:y.nativeEnum(Sx).describe(vx.properties.alignment).optional(),direction:y.nativeEnum(Ex).describe(vx.properties.direction).optional()}),qx=y.object({position:y.nativeEnum(xx).describe(vx.properties.logoPosition).optional(),size:y.nativeEnum(wx).describe(vx.properties.logoSize).optional()}),Gx=y.object({text:y.string().describe(vx.properties.submitButtonText).optional()}),Hx=y.object({font:y.string().describe(vx.properties.font).optional(),color:y.string().describe(vx.properties.textColor).optional(),size:y.nativeEnum(Nx).describe(vx.properties.fontSize).optional()}),Wx=y.object({enabled:y.boolean().describe(vx.properties.redirectAfterSubmissionEnabled).optional(),redirectUrl:y.string().describe(vx.properties.redirectUrl).optional()}),zx=y.object({allowEditSubmission:y.boolean().describe(vx.properties.allowEditSubmission).optional(),allowResubmit:y.boolean().describe(vx.properties.allowResubmit).optional(),allowViewSubmission:y.boolean().describe(vx.properties.allowViewSubmission).optional(),description:y.string().describe(vx.properties.postSubmissionDescription).optional(),redirectAfterSubmission:Wx.describe(vx.properties.redirectAfterSubmission).optional(),showSuccessImage:y.boolean().describe(vx.properties.showSuccessImage).optional(),title:y.string().describe(vx.properties.postSubmissionTitle).optional()}),Yx=y.object({enabled:y.boolean().describe(vx.properties.closeDateEnabled).optional(),date:y.string().describe(vx.properties.closeDateValue).optional()}),Kx=y.object({enabled:y.boolean().describe(vx.properties.draftSubmissionEnabled).optional()}),Qx=y.object({itemGroupId:y.string().describe(vx.properties.itemGroupId).optional(),includeNameQuestion:y.boolean().describe(vx.properties.includeNameQuestion).optional(),includeUpdateQuestion:y.boolean().describe(vx.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:y.boolean().describe(vx.properties.syncQuestionAndColumnsTitles).optional()}),Jx=y.object({enabled:y.boolean().describe(vx.properties.passwordEnabled).optional()}),Xx=y.object({text:y.string().describe(vx.properties.startButtonText).optional()}),Zx=y.object({enabled:y.boolean().describe(vx.properties.preSubmissionEnabled).optional(),title:y.string().describe(vx.properties.preSubmissionTitle).optional(),description:y.string().describe(vx.properties.preSubmissionDescription).optional(),startButton:Xx.describe(vx.properties.startButton).optional()}),eT=y.object({enabled:y.boolean().describe(vx.properties.requireLoginEnabled).optional(),redirectToLogin:y.boolean().describe(vx.properties.redirectToLogin).optional()}),tT=y.object({enabled:y.boolean().describe(vx.properties.responseLimitEnabled).optional(),limit:y.number().describe(vx.properties.responseLimitValue).optional()}),aT=y.object({background:Bx.describe(vx.properties.background).optional(),hideBranding:y.boolean().describe(vx.properties.hideBranding).optional(),layout:Mx.describe(vx.properties.layout).optional(),logo:qx.describe(vx.properties.logo).optional(),primaryColor:y.string().describe(vx.properties.primaryColor).optional(),showProgressBar:y.boolean().describe(vx.properties.showProgressBar).optional(),submitButton:Gx.describe(vx.properties.submitButton).optional(),text:Hx.describe(vx.properties.text).optional()}),iT=y.object({language:y.string().describe(vx.properties.language).optional(),logoAltText:y.string().describe(vx.properties.logoAltText).optional()}),nT=y.object({afterSubmissionView:zx.describe(vx.properties.afterSubmissionView).optional(),closeDate:Yx.describe(vx.properties.closeDate).optional(),draftSubmission:Kx.describe(vx.properties.draftSubmission).optional(),monday:Qx.describe(vx.properties.monday).optional(),password:Jx.describe(vx.properties.password).optional(),preSubmissionView:Zx.describe(vx.properties.preSubmissionView).optional(),reCaptchaChallenge:y.boolean().describe(vx.properties.reCaptchaChallenge).optional(),requireLogin:eT.describe(vx.properties.requireLogin).optional(),responseLimit:tT.describe(vx.properties.responseLimit).optional()}),oT=y.object({id:y.string().describe(hx.inputs.questionId),page_block_id:y.string().describe(bx.properties.pageBlockId).optional()}),rT=y.object({appearance:aT.describe(hx.inputs.form.appearance).optional(),accessibility:iT.describe(hx.inputs.form.accessibility).optional(),features:nT.describe(hx.inputs.form.features).optional(),title:y.string().describe(hx.inputs.title).optional(),description:y.string().describe(hx.inputs.description).optional(),questions:y.array(oT).describe(hx.inputs.questions).optional()}),sT={formToken:y.string().describe(fx.formToken),action:y.nativeEnum(Ux).describe(hx.operations.updateForm.action),formPassword:y.string().describe(vx.operations.setFormPassword).optional(),tag:Vx.describe(hx.inputs.tag).optional(),form:rT.describe(hx.inputs.form.describe).optional()};class pT{constructor(e){this.mondayApi=e}async setFormPassword(e){if(!e.formPassword)return{content:'formPassword is required for the action "setFormPassword" in the update form tool.'};const t={formToken:e.formToken,input:{password:e.formPassword}};return await this.mondayApi.request(ax,t),{content:{message:"Form password successfully set",form_token:e.formToken,action_name:"setFormPassword"}}}async shortenFormUrl(e){const t={formToken:e.formToken};return await this.mondayApi.request(ix,t),{content:{message:"Form URL successfully shortened",form_token:e.formToken,action_name:"shortenFormUrl"}}}async deactivateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(nx,t),{content:{message:"Form successfully deactivated",form_token:e.formToken,action_name:"deactivateForm"}}}async activateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(ox,t),{content:{message:"Form successfully activated",form_token:e.formToken,action_name:"activateForm"}}}async createTag(e){if(!e.tag)return{content:'Tag is required for the action "createTag" in the update form tool.'};if(!e.tag.name)return{content:'Tag name is required for the action "createTag" in the update form tool.'};const t={formToken:e.formToken,tag:{name:e.tag.name,value:e.tag.value}},a=await this.mondayApi.request(sx,t);return{content:{message:"Tag successfully added",form_token:e.formToken,action_name:"createTag",data:a.create_form_tag}}}async deleteTag(e){if(!e.tag)return{content:'Tag is required for the action "deleteTag" in the update form tool.'};if(!e.tag.id)return{content:'Tag id is required for the action "deleteTag" in the update form tool.'};const t={formToken:e.formToken,tagId:e.tag.id};return await this.mondayApi.request(rx,t),{content:{message:"Tag deleted",form_token:e.formToken,tag_id:e.tag.id,action_name:"deleteTag"}}}async updateTag(e){if(!e.tag)return{content:'Tag is required for the action "updateTag" in the update form tool.'};if(!e.tag.id||!e.tag.value)return{content:'Tag id and value are required for the action "updateTag" in the update form tool.'};const t={formToken:e.formToken,tagId:e.tag.id,tag:{value:e.tag.value}};return(await this.mondayApi.request(px,t)).update_form_tag?{content:{message:"Tag updated",form_token:e.formToken,tag_id:e.tag.id,action_name:"updateTag"}}:{content:`Unable to update tag with id: ${e.tag.id}.`}}async updateAppearance(e){if(!e.form?.appearance)return{content:'Appearance is required for the action "updateAppearance" in the update form tool.'};const t={formToken:e.formToken,appearance:e.form.appearance},a=await this.mondayApi.request(dx,t);return{content:{message:"Appearance successfully updated",form_token:e.formToken,action_name:"updateAppearance",data:a.update_form_settings?.appearance}}}async updateAccessibility(e){if(!e.form?.accessibility)return{content:'Accessibility is required for the action "updateAccessibility" in the update form tool.'};const t={formToken:e.formToken,accessibility:e.form.accessibility},a=await this.mondayApi.request(cx,t);return{content:{message:"Accessibility successfully updated",form_token:e.formToken,action_name:"updateAccessibility",data:a.update_form_settings?.accessibility}}}async updateFeatures(e){if(!e.form?.features)return{content:'Features is required for the action "updateFeatures" in the update form tool.'};const t={formToken:e.formToken,features:e.form.features},a=await this.mondayApi.request(lx,t);return{content:{message:"Features successfully updated",form_token:e.formToken,action_name:"updateFeatures",data:a.update_form_settings?.features}}}async updateQuestionOrder(e){if(!e.form?.questions)return{content:'List of dehydrated questions is required for the action "updateQuestionOrder" in the update form tool.'};const t={formToken:e.formToken,questions:e.form.questions},a=await this.mondayApi.request(mx,t);return{content:{message:"Question order successfully updated",form_token:e.formToken,action_name:"updateQuestionOrder",data:a.update_form?.questions}}}async updateFormHeader(e){if(!e.form?.title&&!e.form?.description)return{content:'Title or description is required for the action "updateFormHeader" in the update form tool.'};const t={formToken:e.formToken,title:e.form.title,description:e.form.description},a=await this.mondayApi.request(ux,t);return{content:{message:"Form header updated",form_token:e.formToken,action_name:"updateFormHeader",data:a.update_form}}}}const dT={formToken:y.string().describe(fx.formToken)};const cT=Object.fromEntries(Object.entries(rg).filter((([e])=>"Person"!==e))),lT={columnType:y.nativeEnum(cT).describe("The type of the column to be created"),columnTitle:y.string().describe("The title of the column to be created"),columnDescription:y.string().optional().describe("The description of the column to be created"),columnSettings:y.string().optional().describe("Column-specific configuration settings as a JSON string. Use the get_column_type_info tool to fetch the JSON schema for the given column type.")},mT={boardId:y.number().describe("The id of the board to which the new column will be added"),...lT};const uT={color:y.nativeEnum(sg).describe("The color of the custom activity"),icon_id:y.nativeEnum(pg).describe("The icon ID of the custom activity"),name:y.string().describe("The name of the custom activity")};const fT=hw`
794
+ `,fx={formToken:"The unique identifier token for the form. Required for all form-specific operations.",questionId:"The unique identifier for the question. Used to target specific questions within a form."},hx={operations:{createForm:"Create a new form with specified configuration. Returns the created form with its unique token.",updateForm:{action:"The type of update action to perform on the form. Can be one of the following: activate, deactivate, shortenFormUrl, setFormPassword, createTag, deleteTag, updateTag, updateForm, updateAppearance, updateAccessibility, updateFeatures, updateQuestionOrder, updateFormHeader."},activateForm:"Activate a form to make it visible to users and accept new submissions.",deactivateForm:"Deactivate a form to hide it from users and stop accepting submissions. Form data is preserved."},properties:{id:"The unique identifier for the form. Auto-generated upon creation.",token:"The unique token used to access and identify the form. Used in public URLs and API calls.",boardId:"The board ID connected to the form. Used to store form responses as items.",title:"The display title shown to users at the top of the form.",description:"Optional detailed description explaining the form purpose, displayed below the title.",active:"Boolean indicating if the form is currently accepting responses and visible to users.",ownerId:"The ID of the user who created and owns this form. Determines permissions.",createWithAI:"Boolean indicating if this form was initially created using AI assistance.",builtWithAI:"Boolean indicating if this form was built or modified using AI functionality.",questions:"Array of question objects that make up the form content, in display order.",isSuspicious:"Boolean flag indicating if the form has been flagged for review due to suspicious content or activity.",isAnonymous:"Boolean indicating if responses are collected without identifying the submitter.",type:"The category or classification of the form for organizational purposes.",features:"Object containing feature toggles and settings like password protection, response limits, etc.",appearance:"Object containing visual styling settings including colors, fonts, layout, and branding.",accessibility:"Object containing accessibility settings such as language, alt text, and reading direction.",tags:{description:"Array of tracking tags for categorization and analytics (e.g., UTM parameters for marketing tracking).",id:"The unique identifier for the tag. This will get auto generated when creating a tag and can’t be updated. This is required when updating or deleting a tag.",name:"The name of the tag. This can only be created, not updated. This is required when creating a tag.",value:"The value of the tag. This value is required when creating or updating a tag.",columnId:"The ID of the column this tag is associated with. This will get auto generated when creating a tag and can’t be updated."}},inputs:{title:"The title text for the form. Must be at least 1 character long. Can only be updated if the update action is updateFormHeader.",description:"Optional description text providing context about the form purpose. Can only be updated if the update action is updateFormHeader.",input:"Complete form configuration object containing properties to create or update.",questions:"Ordered array of dehydrated questions, object only including each question ID, for reordering. Must include all existing question IDs. Required if the update action is updateQuestionOrder.",questionId:"The unique identifier for the question. Used to target specific questions within a form. Required when deleting or updating a question.",tag:"The tag data to create, update or delete. If deleting a tag, only provide the id of the tag to delete. If creating a tag, provide the name and value, the id and columnId are auto generated. If updating a tag, provide the id and new value, name and columnId are not changeable.",form:{describe:"The form data to update. Required if updating the appearance, accessibility, features, question order, or form header.",appearance:"The appearance data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateAppearance.",accessibility:"The accessibility data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateAccessibility.",features:"The features data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateFeatures.",questionOrder:"The question order data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateQuestionOrder.",formHeader:"The form header data to update. Acts as a patch object, meaning that only the fields that are provided will be updated. Required if the update action is updateFormHeader."}},args:{formToken:"The unique form token identifying which form to operate on.",destinationWorkspaceId:"The workspace in which the form will be created in.",destinationFolderId:"The folder in which the form will be created under.",destinationFolderName:"The name of the folder in which the form will be created in.",boardKind:"The board kind to create for the board in which the form will create items in.",destinationName:"The name of the board that will be created to store the form responses in.",boardOwnerIds:"Array of user IDs who will have owner permissions on the board in which the form will create items in.",boardOwnerTeamIds:"Array of team IDs whose members will have owner permissions on the board in which the form will create items in.",boardSubscriberIds:"Array of user IDs who will receive notifications about board activity for the board in which the form will create items in.",boardSubscriberTeamsIds:"Array of team IDs whose members will receive notifications about board activity for the board in which the form will create items in."}},vx={operations:{updateFormSettings:"Update form configuration including features, appearance, and accessibility options.",setFormPassword:'Set a password on a form to restrict access. This will enable password protection for the form. Required for the action "setFormPassword" in the update form tool.',shortenUrl:"Shorten a URL for a form and store it in the form settings. Returns the shortened link object."},properties:{features:"Object containing form features including but not limited to password protection, response limits, login requirements, etc. Required when updating the features of the form.",appearance:"Object containing visual styling including colors, layout, fonts, and branding elements. Required when updating the appearance of the form.",accessibility:"Object containing accessibility options such as language, alt text, etc. Required when updating the accessibility of the form.",isInternal:"Boolean indicating if the form is restricted to internal users only.",reCaptchaChallenge:"Boolean enabling reCAPTCHA verification to prevent spam submissions.",password:"Object containing password protection configuration for the form.",passwordEnabled:"Boolean disabling password protection. Can only be updated to false. In order to enable password protection use the setFormPassword action instead.",requireLogin:"Object containing login requirement settings for form access.",requireLoginEnabled:"Boolean requiring users to be logged in before submitting responses.",redirectToLogin:"Boolean automatically redirecting unauthenticated users to the login page.",shortenedLink:"Object containing shortened URL configuration for easy form sharing.",shortenedLinkEnabled:"Boolean enabling generation of shortened URLs for the form.",shortenedLinkUrl:"The generated shortened URL for form access. Only available when shortened links are enabled.",draftSubmission:"Object containing draft saving configuration allowing users to save progress.",draftSubmissionEnabled:"Boolean allowing users to save incomplete responses as drafts.",aiTranslate:"Object containing AI translation configuration for the form.",aiTranslateEnabled:"Boolean enabling AI translation for the form.",responseLimit:"Object containing response limitation settings to control submission volume.",responseLimitEnabled:"Boolean enabling response count limits for the form.",responseLimitValue:"Integer specifying the maximum number of responses allowed.",closeDate:"Object containing automatic form closure configuration.",closeDateEnabled:"Boolean enabling automatic form closure at a specified date and time.",closeDateValue:"ISO timestamp when the form will automatically stop accepting responses.",allowResubmit:"Boolean allowing users to submit multiple responses to the same form.",allowEditSubmission:"Boolean allowing users to modify their submitted responses after submission.",allowViewSubmission:"Boolean allowing users to view their submitted responses.",preSubmissionView:"Object containing welcome screen configuration displayed before the form.",preSubmissionEnabled:"Boolean showing a welcome/introduction screen before the form begins.",preSubmissionTitle:"Text displayed as the title on the welcome screen.",preSubmissionDescription:"Text providing context or instructions on the welcome screen.",startButton:"Object containing start button configuration for the welcome screen.",startButtonText:"Custom text for the button that begins the form experience.",afterSubmissionView:"Object containing settings for the post-submission user experience.",postSubmissionTitle:"Text displayed as the title after successful form submission.",postSubmissionDescription:"Text shown to users after they complete the form.",showSuccessImage:"Boolean displaying a success image after form completion.",redirectAfterSubmission:"Object containing redirect configuration after form submission.",redirectAfterSubmissionEnabled:"Boolean enabling automatic redirect after form completion to a specified URL.",redirectUrl:"The URL where users will be redirected after successfully submitting the form.",monday:"Object containing board settings for response handling.",itemGroupId:"The board group ID where new items from form responses will be created.",includeNameQuestion:"Boolean adding a name question to the form. This is a special question type that represents the name column from the associated monday board",includeUpdateQuestion:"Boolean adding an update/comment field to the form. This is a special question type that represents the updates from the associated item of the submission on the monday board. ",syncQuestionAndColumnsTitles:"Boolean synchronizing form question titles with board column names. When true, the form question titles will be synchronized with the board column names.",hideBranding:"Boolean hiding monday branding from the form display.",showProgressBar:"Boolean displaying a progress indicator showing form completion progress bar.",primaryColor:"Hex color code for the primary theme color used throughout the form.",layout:"Object containing form structure and presentation settings.",format:"String specifying the form display format. Can be a step by step form or a classic one page form.",alignment:"String controlling text and content alignment.",direction:"String setting reading direction.",background:"Object containing background appearance configuration for the form.",backgroundType:"String specifying background style.",backgroundValue:"String containing the background value. The value will depend on the background type. If the background type is color, the value will be a hex color code. If the background type is image, the value will be an image URL.",text:"Object containing typography and text styling configuration.",font:"String specifying the font family used throughout the form.",textColor:"Hex color code for the text color in the form.",fontSize:"String or number specifying the base font size for form text.",logo:"Object containing logo display configuration for form branding.",logoPosition:'String specifying logo placement ("top", "bottom", "header").',logoUrl:"URL pointing to the logo image file for display on the form.",logoSize:'String specifying logo size ("small", "medium", "large") for the logo that appears on the header of the form.',logoAltText:"Alternative text description for the logo image for accessibility.",submitButton:"Object containing submit button styling and text configuration.",submitButtonText:"Custom text displayed on the form submission button.",language:'Language code for form localization and interface text (e.g., "en", "es", "fr").'},inputs:{settings:"Complete form settings object containing all configuration options.",features:"Form features configuration including security, limits, and access controls.",appearance:"Visual styling configuration including colors, layout, and branding.",accessibility:"Accessibility configuration including language and reading direction.",password:"Password configuration for the form. Only setting enabled to false is supported. To enable a form to be password protected, please use the set_form_password mutation instead.",passwordValue:"The password to set for the form. Must be at least 1 character long."}},bx={actions:{type:"The type of operation to perform on the question. Can delete, update, or create. When updating or deleting a question, the questionId is required. When creating or updating a question, the question object is required. When updating, the question is a patch object, meaning that only the fields that are provided will be updated.",question:"The question object containing all properties for creation or update. When creating a question, the title is required."},properties:{title:"The question text displayed to respondents. Must be at least 1 character long and clearly indicate the expected response.",type:'The question type determining input behavior and validation (e.g., "text", "email", "single_select", "multi_select").',visible:"Boolean controlling question visibility to respondents. Hidden questions remain in form structure but are not displayed.",required:"Boolean indicating if the question must be answered before form submission.",position:"Integer specifying the display order of the question within the form (zero-based).",description:"Optional explanatory text providing additional context, instructions, or examples for the question.",placeholder:"Optional placeholder text shown in input fields to guide user input.",createdAt:"ISO timestamp when the question was created.",updatedAt:"ISO timestamp when the question was last modified.",selectOptions:"Array of option objects for choice-based questions (single_select, multi_select). Supported on both create and update. When updating, the provided array replaces all existing options (PUT semantics). SingleSelect: max 40 options. MultiSelect: max 500 options. Cannot remove options that are already used in board items (existing submissions) — those options must be preserved and must include their value field.",selectOptionsLabel:"Display label for the option shown to respondents.",selectOptionsValue:"Internal identifier for the option. Required when updating options that are already assigned to board items — omitting it will cause those options to be removed.",selectOptionsVisible:"Whether the option is visible to respondents. Defaults to true.",blockType:"The kind of block to create. Includes all question types and content block types.",insertAfterQuestionId:"Insert the new question after this question ID. Omit to append at the end. Pass null to place it first in the form.",pageBlockId:"Page block this question belongs to. Required for questions inside a page block. Pass null to remove the page block association.",existingColumnId:"Link to an existing board column instead of creating a new one."},inputs:{question:"Complete question object containing all properties for creation or update.",questionData:"Question configuration including type, title, and type-specific settings.",position:"Integer position where the question should be placed in the form sequence."}},gx={properties:{validation:"Validation rules applied to the question response",prefill:"Configuration for automatically populating question values from various data sources such as user account information or URL query parameters.",prefillEnabled:"Whether prefill functionality is enabled for this question. When true, the question will attempt to auto-populate values from the specified source.",prefillSource:"The data source to use for prefilling the question value. Check the PrefillSources for available options.",prefillLookup:'The specific field or parameter name to lookup from the prefill source. For account sources, this would be a user property like "name" or "email". For query parameters, this would be the parameter name that would be set in the URL.',prefixAutofilled:"Phone questions only: Automatically detect and fill the phone country prefix based on the user's geographic location or browser settings.",prefixPredefined:"Phone questions only: Configuration for setting a specific predefined phone country prefix that will be pre-selected for users.",prefixPredefinedEnabled:"Whether a predefined phone prefix is enabled for phone number questions. When true, the specified prefix will be pre-selected.",prefixPredefinedPrefix:'The predefined phone country prefix to use as country code in capital letters (e.g., "US", "UK", "IL"). Only used when enabled is true.',checkedByDefault:"Boolean/checkbox questions only: Whether the checkbox should be checked by default when the form loads.",defaultCurrentDate:"Date based questions only: Automatically set the current date as the default value when the form loads.",includeTime:"Date questions only: Whether to include time selection (hours and minutes) in addition to the date picker. When false, only date selection is available.",display:"Single/Multi Select questions only: Controls how the selection options are visually presented to users.",optionsOrder:"Single/Multi Select questions only: Determines the ordering of selection options.",locationAutofilled:"Location questions only: Automatically detect and fill the user's current location using browser geolocation services, requiring user permission.",limit:"Rating questions only: Maximum rating value that users can select.",skipValidation:"Link/URL questions only: Whether to skip URL format validation, allowing any text input.",labelLimitCount:"Multi Select questions only: Maximum number of options a respondent can select. Must be set together with labelLimitCountEnabled to take effect.",labelLimitCountEnabled:"Multi Select questions only: Whether to enforce an option selection limit. Set labelLimitCount to specify the limit.",defaultAnswer:"ShortText, LongText, Name, and Link questions only: Pre-filled default value shown to respondents when the form loads. Respondents can clear or change it before submitting."},inputs:{settings:"Question-specific configuration object that varies by question type.",validationRules:"Validation constraints and rules",choiceOptions:"List of available choices for selection questions",fileSettings:"File upload constraints and settings"}},yx={destination_workspace_id:y.string().describe(hx.args.destinationWorkspaceId),destination_folder_id:y.string().optional().describe(hx.args.destinationFolderId),destination_folder_name:y.string().optional().describe(hx.args.destinationFolderName),board_kind:y.nativeEnum(Wb).optional().describe(hx.args.boardKind),destination_name:y.string().optional().describe(hx.args.destinationName),board_owner_ids:y.array(y.string()).optional().describe(hx.args.boardOwnerIds),board_owner_team_ids:y.array(y.string()).optional().describe(hx.args.boardOwnerTeamIds),board_subscriber_ids:y.array(y.string()).optional().describe(hx.args.boardSubscriberIds),board_subscriber_teams_ids:y.array(y.string()).optional().describe(hx.args.boardSubscriberTeamsIds)};var _x,wx,xx,Tx,Ex,Ix,Sx,Nx,Ax,Dx,kx,Ox,Rx,Cx,$x,Lx;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(_x||(_x={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(wx||(wx={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(xx||(xx={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(Tx||(Tx={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(Ex||(Ex={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(Ix||(Ix={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(Sx||(Sx={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(Nx||(Nx={})),function(e){e.Boolean="Boolean",e.ConnectedBoards="ConnectedBoards",e.Country="Country",e.Date="Date",e.DateRange="DateRange",e.Email="Email",e.File="File",e.Link="Link",e.Location="Location",e.LongText="LongText",e.MultiSelect="MultiSelect",e.Name="Name",e.Number="Number",e.People="People",e.Phone="Phone",e.Rating="Rating",e.ShortText="ShortText",e.Signature="Signature",e.SingleSelect="SingleSelect",e.Subitems="Subitems",e.Updates="Updates"}(Ax||(Ax={})),function(e){e.Account="account",e.QueryParam="queryParam"}(Dx||(Dx={})),function(e){e.Email="email",e.Name="name",e.Title="title",e.Phone="phone",e.FirstName="first_name",e.LastName="last_name",e.Location="location",e.Timezone="time_zone",e.ManagerName="manager_display_name"}(kx||(kx={})),function(e){e.And="AND",e.Or="OR"}(Ox||(Ox={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(Rx||(Rx={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(Cx||(Cx={})),function(e){e.MultiSelect="multi-select",e.SingleSelect="single-select",e.People="people",e.Location="location",e.CountryCode="country-code",e.Country="country",e.ConnectedBoards="connected_boards"}($x||($x={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(Lx||(Lx={}));const Fx=y.object({type:y.nativeEnum(Vg).describe(bx.properties.type),block_type:y.nativeEnum(kg).describe(bx.properties.blockType).optional(),title:y.string().describe(bx.properties.title).optional(),description:y.string().describe(bx.properties.description).optional(),visible:y.boolean().describe(bx.properties.visible).optional(),required:y.boolean().describe(bx.properties.required).optional(),insert_after_question_id:y.string().nullish().describe(bx.properties.insertAfterQuestionId),page_block_id:y.string().nullish().describe(bx.properties.pageBlockId),existing_column_id:y.string().describe(bx.properties.existingColumnId).optional(),options:y.array(y.object({label:y.string().describe(bx.properties.selectOptionsLabel),value:y.string().optional().describe(bx.properties.selectOptionsValue),visible:y.boolean().optional().describe(bx.properties.selectOptionsVisible)})).describe(bx.properties.selectOptions).optional(),settings:y.object({checkedByDefault:y.boolean().describe(gx.properties.checkedByDefault).optional(),defaultCurrentDate:y.boolean().describe(gx.properties.defaultCurrentDate).optional(),display:y.nativeEnum(jg).describe(gx.properties.display).optional(),includeTime:y.boolean().describe(gx.properties.includeTime).optional(),locationAutofilled:y.boolean().describe(gx.properties.locationAutofilled).optional(),optionsOrder:y.nativeEnum(Ug).describe(gx.properties.optionsOrder).optional(),prefixAutofilled:y.boolean().describe(gx.properties.prefixAutofilled).optional(),prefixPredefined:y.object({enabled:y.boolean().describe(gx.properties.prefixPredefinedEnabled),prefix:y.string().describe(gx.properties.prefixPredefinedPrefix).optional()}).describe(gx.properties.prefixPredefined).optional(),skipValidation:y.boolean().describe(gx.properties.skipValidation).optional(),labelLimitCount:y.number().int().describe(gx.properties.labelLimitCount).optional(),label_limit_count_enabled:y.boolean().describe(gx.properties.labelLimitCountEnabled).optional(),default_answer:y.string().describe(gx.properties.defaultAnswer).optional(),prefill:y.object({enabled:y.boolean().describe(gx.properties.prefillEnabled),lookup:y.string().describe(gx.properties.prefillLookup).optional(),source:y.nativeEnum(Pg).describe(gx.properties.prefillSource).optional()}).describe(gx.properties.prefill).optional()}).optional()}),Px={action:y.nativeEnum(Lx).describe(bx.actions.type),formToken:y.string().describe(fx.formToken),questionId:y.string().describe(fx.questionId).optional(),question:Fx.describe(bx.actions.question).optional()};class jx{constructor(e){this.mondayApi=e}async deleteQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when deleting a question."};const a={formToken:e.formToken,questionId:t};return await this.mondayApi.request(Zw,a),{content:{message:"Question deleted",question_id:t,action_name:"delete"}}}async updateQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when updating a question."};const a=e.question;if(!a)return{content:"Must provide updated patch props for the question when updating."};const i={formToken:e.formToken,questionId:t,question:a};return await this.mondayApi.request(tx,i),{content:{message:"Question updated",question_id:t,action_name:"update"}}}async createQuestion(e){const t=e.question;if(!t)return{content:"Must provide a full question payload when creating a question."};if(!t.title)return{content:"Must provide a title for the question when creating a question."};const a={formToken:e.formToken,question:{...t,title:t.title}},i=await this.mondayApi.request(ex,a);return{content:{message:"Question created",question_id:i.create_form_question?.id,action_name:"create"}}}}var Ux;!function(e){e.activate="activate",e.deactivate="deactivate",e.shortenFormUrl="shortenFormUrl",e.setFormPassword="setFormPassword",e.createTag="createTag",e.deleteTag="deleteTag",e.updateTag="updateTag",e.updateAppearance="updateAppearance",e.updateAccessibility="updateAccessibility",e.updateFeatures="updateFeatures",e.updateQuestionOrder="updateQuestionOrder",e.updateFormHeader="updateFormHeader"}(Ux||(Ux={}));const Vx=y.object({id:y.string().describe(hx.properties.tags.id).optional(),name:y.string().describe(hx.properties.tags.name).optional(),value:y.string().describe(hx.properties.tags.value).optional(),columnId:y.string().describe(hx.properties.tags.columnId).optional()}),Bx=y.object({type:y.nativeEnum(Tx).describe(vx.properties.backgroundType).optional(),value:y.string().describe(vx.properties.backgroundValue).optional()}),Mx=y.object({format:y.nativeEnum(Ix).describe(vx.properties.format).optional(),alignment:y.nativeEnum(Sx).describe(vx.properties.alignment).optional(),direction:y.nativeEnum(Ex).describe(vx.properties.direction).optional()}),qx=y.object({position:y.nativeEnum(xx).describe(vx.properties.logoPosition).optional(),size:y.nativeEnum(wx).describe(vx.properties.logoSize).optional()}),Gx=y.object({text:y.string().describe(vx.properties.submitButtonText).optional()}),Hx=y.object({font:y.string().describe(vx.properties.font).optional(),color:y.string().describe(vx.properties.textColor).optional(),size:y.nativeEnum(Nx).describe(vx.properties.fontSize).optional()}),Wx=y.object({enabled:y.boolean().describe(vx.properties.redirectAfterSubmissionEnabled).optional(),redirectUrl:y.string().describe(vx.properties.redirectUrl).optional()}),zx=y.object({allowEditSubmission:y.boolean().describe(vx.properties.allowEditSubmission).optional(),allowResubmit:y.boolean().describe(vx.properties.allowResubmit).optional(),allowViewSubmission:y.boolean().describe(vx.properties.allowViewSubmission).optional(),description:y.string().describe(vx.properties.postSubmissionDescription).optional(),redirectAfterSubmission:Wx.describe(vx.properties.redirectAfterSubmission).optional(),showSuccessImage:y.boolean().describe(vx.properties.showSuccessImage).optional(),title:y.string().describe(vx.properties.postSubmissionTitle).optional()}),Yx=y.object({enabled:y.boolean().describe(vx.properties.closeDateEnabled).optional(),date:y.string().describe(vx.properties.closeDateValue).optional()}),Kx=y.object({enabled:y.boolean().describe(vx.properties.draftSubmissionEnabled).optional()}),Qx=y.object({itemGroupId:y.string().describe(vx.properties.itemGroupId).optional(),includeNameQuestion:y.boolean().describe(vx.properties.includeNameQuestion).optional(),includeUpdateQuestion:y.boolean().describe(vx.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:y.boolean().describe(vx.properties.syncQuestionAndColumnsTitles).optional()}),Jx=y.object({enabled:y.boolean().describe(vx.properties.passwordEnabled).optional()}),Xx=y.object({text:y.string().describe(vx.properties.startButtonText).optional()}),Zx=y.object({enabled:y.boolean().describe(vx.properties.preSubmissionEnabled).optional(),title:y.string().describe(vx.properties.preSubmissionTitle).optional(),description:y.string().describe(vx.properties.preSubmissionDescription).optional(),startButton:Xx.describe(vx.properties.startButton).optional()}),eT=y.object({enabled:y.boolean().describe(vx.properties.requireLoginEnabled).optional(),redirectToLogin:y.boolean().describe(vx.properties.redirectToLogin).optional()}),tT=y.object({enabled:y.boolean().describe(vx.properties.responseLimitEnabled).optional(),limit:y.number().describe(vx.properties.responseLimitValue).optional()}),aT=y.object({background:Bx.describe(vx.properties.background).optional(),hideBranding:y.boolean().describe(vx.properties.hideBranding).optional(),layout:Mx.describe(vx.properties.layout).optional(),logo:qx.describe(vx.properties.logo).optional(),primaryColor:y.string().describe(vx.properties.primaryColor).optional(),showProgressBar:y.boolean().describe(vx.properties.showProgressBar).optional(),submitButton:Gx.describe(vx.properties.submitButton).optional(),text:Hx.describe(vx.properties.text).optional()}),iT=y.object({language:y.string().describe(vx.properties.language).optional(),logoAltText:y.string().describe(vx.properties.logoAltText).optional()}),nT=y.object({afterSubmissionView:zx.describe(vx.properties.afterSubmissionView).optional(),closeDate:Yx.describe(vx.properties.closeDate).optional(),draftSubmission:Kx.describe(vx.properties.draftSubmission).optional(),monday:Qx.describe(vx.properties.monday).optional(),password:Jx.describe(vx.properties.password).optional(),preSubmissionView:Zx.describe(vx.properties.preSubmissionView).optional(),reCaptchaChallenge:y.boolean().describe(vx.properties.reCaptchaChallenge).optional(),requireLogin:eT.describe(vx.properties.requireLogin).optional(),responseLimit:tT.describe(vx.properties.responseLimit).optional()}),oT=y.object({id:y.string().describe(hx.inputs.questionId),page_block_id:y.string().describe(bx.properties.pageBlockId).optional()}),rT=y.object({appearance:aT.describe(hx.inputs.form.appearance).optional(),accessibility:iT.describe(hx.inputs.form.accessibility).optional(),features:nT.describe(hx.inputs.form.features).optional(),title:y.string().describe(hx.inputs.title).optional(),description:y.string().describe(hx.inputs.description).optional(),questions:y.array(oT).describe(hx.inputs.questions).optional()}),sT={formToken:y.string().describe(fx.formToken),action:y.nativeEnum(Ux).describe(hx.operations.updateForm.action),formPassword:y.string().describe(vx.operations.setFormPassword).optional(),tag:Vx.describe(hx.inputs.tag).optional(),form:rT.describe(hx.inputs.form.describe).optional()};class pT{constructor(e){this.mondayApi=e}async setFormPassword(e){if(!e.formPassword)return{content:'formPassword is required for the action "setFormPassword" in the update form tool.'};const t={formToken:e.formToken,input:{password:e.formPassword}};return await this.mondayApi.request(ax,t),{content:{message:"Form password successfully set",form_token:e.formToken,action_name:"setFormPassword"}}}async shortenFormUrl(e){const t={formToken:e.formToken};return await this.mondayApi.request(ix,t),{content:{message:"Form URL successfully shortened",form_token:e.formToken,action_name:"shortenFormUrl"}}}async deactivateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(nx,t),{content:{message:"Form successfully deactivated",form_token:e.formToken,action_name:"deactivateForm"}}}async activateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(ox,t),{content:{message:"Form successfully activated",form_token:e.formToken,action_name:"activateForm"}}}async createTag(e){if(!e.tag)return{content:'Tag is required for the action "createTag" in the update form tool.'};if(!e.tag.name)return{content:'Tag name is required for the action "createTag" in the update form tool.'};const t={formToken:e.formToken,tag:{name:e.tag.name,value:e.tag.value}},a=await this.mondayApi.request(sx,t);return{content:{message:"Tag successfully added",form_token:e.formToken,action_name:"createTag",data:a.create_form_tag}}}async deleteTag(e){if(!e.tag)return{content:'Tag is required for the action "deleteTag" in the update form tool.'};if(!e.tag.id)return{content:'Tag id is required for the action "deleteTag" in the update form tool.'};const t={formToken:e.formToken,tagId:e.tag.id};return await this.mondayApi.request(rx,t),{content:{message:"Tag deleted",form_token:e.formToken,tag_id:e.tag.id,action_name:"deleteTag"}}}async updateTag(e){if(!e.tag)return{content:'Tag is required for the action "updateTag" in the update form tool.'};if(!e.tag.id||!e.tag.value)return{content:'Tag id and value are required for the action "updateTag" in the update form tool.'};const t={formToken:e.formToken,tagId:e.tag.id,tag:{value:e.tag.value}};return(await this.mondayApi.request(px,t)).update_form_tag?{content:{message:"Tag updated",form_token:e.formToken,tag_id:e.tag.id,action_name:"updateTag"}}:{content:`Unable to update tag with id: ${e.tag.id}.`}}async updateAppearance(e){if(!e.form?.appearance)return{content:'Appearance is required for the action "updateAppearance" in the update form tool.'};const t={formToken:e.formToken,appearance:e.form.appearance},a=await this.mondayApi.request(dx,t);return{content:{message:"Appearance successfully updated",form_token:e.formToken,action_name:"updateAppearance",data:a.update_form_settings?.appearance}}}async updateAccessibility(e){if(!e.form?.accessibility)return{content:'Accessibility is required for the action "updateAccessibility" in the update form tool.'};const t={formToken:e.formToken,accessibility:e.form.accessibility},a=await this.mondayApi.request(cx,t);return{content:{message:"Accessibility successfully updated",form_token:e.formToken,action_name:"updateAccessibility",data:a.update_form_settings?.accessibility}}}async updateFeatures(e){if(!e.form?.features)return{content:'Features is required for the action "updateFeatures" in the update form tool.'};const t={formToken:e.formToken,features:e.form.features},a=await this.mondayApi.request(lx,t);return{content:{message:"Features successfully updated",form_token:e.formToken,action_name:"updateFeatures",data:a.update_form_settings?.features}}}async updateQuestionOrder(e){if(!e.form?.questions)return{content:'List of dehydrated questions is required for the action "updateQuestionOrder" in the update form tool.'};const t={formToken:e.formToken,questions:e.form.questions},a=await this.mondayApi.request(mx,t);return{content:{message:"Question order successfully updated",form_token:e.formToken,action_name:"updateQuestionOrder",data:a.update_form?.questions}}}async updateFormHeader(e){if(!e.form?.title&&!e.form?.description)return{content:'Title or description is required for the action "updateFormHeader" in the update form tool.'};const t={formToken:e.formToken,title:e.form.title,description:e.form.description},a=await this.mondayApi.request(ux,t);return{content:{message:"Form header updated",form_token:e.formToken,action_name:"updateFormHeader",data:a.update_form}}}}const dT={formToken:y.string().describe(fx.formToken)};const cT=1e3;var lT,mT;!function(e){e[e.YEAR=31536e3]="YEAR",e[e.MONTH31Days=2678400]="MONTH31Days",e[e.MONTH30Days=2592e3]="MONTH30Days",e[e.MONTH29Days=2505600]="MONTH29Days",e[e.MONTH28Days=2419200]="MONTH28Days",e[e.WEEK=604800]="WEEK",e[e.DAY=86400]="DAY",e[e.HOUR=3600]="HOUR",e[e.MINUTE=60]="MINUTE"}(lT||(lT={})),function(e){e[e.YEAR=31536e6]="YEAR",e[e.MONTH31Days=26784e5]="MONTH31Days",e[e.MONTH30Days=2592e6]="MONTH30Days",e[e.MONTH29Days=25056e5]="MONTH29Days",e[e.MONTH28Days=24192e5]="MONTH28Days",e[e.DAY=864e5]="DAY",e[e.HOUR=36e5]="HOUR",e[e.MINUTE=6e4]="MINUTE",e[e.SECOND=cT]="SECOND"}(mT||(mT={}));const uT=10*mT.SECOND;function fT(e,t){const a=e?.response?.errors?.map((e=>e.message))?.join(", ");if(a)throw new Error(`Failed to ${t}: ${a}`);const i=e instanceof Error?e.message:"Unknown error";throw new Error(`Failed to ${t}: ${i}`)}function hT(e){if(e instanceof Error&&"AbortError"===e.name)throw new Error("Search has timed out, try providing alternative search term")}const vT=hw`
795
+ mutation CreateFormSubmission(
796
+ $form_token: String!
797
+ $answers: [FormAnswerInput!]!
798
+ $form_timezone_offset: Int!
799
+ $password: String
800
+ $tags: [TagInput!]
801
+ ) {
802
+ create_form_submission(
803
+ form_token: $form_token
804
+ answers: $answers
805
+ form_timezone_offset: $form_timezone_offset
806
+ password: $password
807
+ tags: $tags
808
+ ) {
809
+ id
810
+ }
811
+ }
812
+ `,bT=y.object({phone:y.string().describe("The phone number."),country_short_name:y.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),gT=y.object({country_name:y.string().describe('The full country name (e.g. "United States").'),country_code:y.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),yT=y.object({date:y.string().describe("The date in YYYY-MM-DD format."),zone_diff:y.number().int().optional().describe("UTC offset in minutes.")}),_T=y.object({from:y.string().describe("Start date in YYYY-MM-DD format."),to:y.string().describe("End date in YYYY-MM-DD format.")}),wT=y.object({lat:y.number().describe("Latitude."),lng:y.number().describe("Longitude."),place_id:y.string().describe("Google Maps place ID."),address:y.string().describe("Full formatted address."),country:y.object({long_name:y.string().describe("Full country name."),short_name:y.string().describe("ISO 3166-1 alpha-2 country code.")}),city:y.object({long_name:y.string().describe("Full city name."),short_name:y.string().describe("Abbreviated city name.")}),street:y.object({long_name:y.string().describe("Full street name."),short_name:y.string().describe("Abbreviated street name.")}),street_number:y.object({long_name:y.string().describe("Full street number."),short_name:y.string().describe("Abbreviated street number.")})}),xT=y.object({id:y.string().describe("The file ID returned by the workforms upload endpoint."),name:y.string().describe('Original file name (e.g. "image.png").'),extension:y.string().optional().describe('File extension (e.g. "pdf", "png").'),is_image:y.boolean().optional().describe("Whether the file is an image.")}),TT=y.object({question_id:y.string().describe("The ID of the question being answered."),name:y.string().optional().describe("Answer for name questions."),email:y.string().optional().describe("Answer for email questions."),short_text:y.string().optional().describe("Answer for short text questions."),long_text:y.string().optional().describe("Answer for long text questions."),link:y.string().optional().describe("Answer for link questions."),updates:y.string().optional().describe("Answer for updates questions."),boolean:y.boolean().optional().describe("Answer for boolean questions."),number:y.number().optional().describe("Answer for number questions."),rating:y.number().positive().optional().describe("Answer for rating questions. Must be a positive number within the question's configured limit."),single_select:y.string().optional().describe("Answer for single-select questions — the selected option ID."),multi_select:y.array(y.number()).optional().describe("Answer for multi-select questions — list of selected option IDs."),people:y.array(y.string()).optional().describe("Answer for people questions — list of user IDs. Obtain user IDs via the list_users_and_teams tool."),connected_boards:y.array(y.string()).optional().describe("Answer for connected boards questions — list of connected item IDs."),phone:bT.optional().describe("Answer for phone questions."),country:gT.optional().describe("Answer for country questions."),date:yT.optional().describe("Answer for date questions."),date_range:_T.optional().describe("Answer for date range questions."),location:wT.optional().describe("Answer for location questions. Requires a Google Maps place ID and structured address components."),file:y.array(xT).optional().describe("Answer for file questions. Each file must be uploaded first to obtain a file ID. Up to the question's configured limit."),signature:xT.optional().describe("Answer for signature questions. The file must be uploaded first to obtain a file ID.")}).describe("An answer for a single form question. Set question_id and exactly one answer field matching the question type. Subitems questions are not supported."),ET={form_token:y.string().describe("The unique token identifying the WorkForm. Can be a bare token, a full WorkForm URL (e.g. https://forms.monday.com/forms/abc123?r=use1), or a shortened wkf.ms URL (e.g. https://wkf.ms/4tqP28t). Shortened URLs are automatically resolved by following the redirect."),answers:y.array(TT).describe("Array of answers to submit. Each answer specifies a question_id and the value for that question type."),form_timezone_offset:y.number().int().min(-840).max(840).describe("The timezone offset of the submitter in minutes (e.g. -120 for UTC-2, 0 for UTC)."),password:y.string().optional().describe("The password for the WorkForm. Only required if the WorkForm has password protection enabled (check features.password.enabled from get_form). If required, ask the user for the password before submitting."),tags:y.array(y.object({column_id:y.string().describe("The column ID this tag maps to."),value:y.string().describe("The tag value to submit.")})).optional().describe("Tags to attach to the submission — each tag maps a value to a specific board column.")};const IT=Object.fromEntries(Object.entries(rg).filter((([e])=>"Person"!==e))),ST={columnType:y.nativeEnum(IT).describe("The type of the column to be created"),columnTitle:y.string().describe("The title of the column to be created"),columnDescription:y.string().optional().describe("The description of the column to be created"),columnSettings:y.string().optional().describe("Column-specific configuration settings as a JSON string. Use the get_column_type_info tool to fetch the JSON schema for the given column type.")},NT={boardId:y.number().describe("The id of the board to which the new column will be added"),...ST};const AT={color:y.nativeEnum(sg).describe("The color of the custom activity"),icon_id:y.nativeEnum(pg).describe("The icon ID of the custom activity"),name:y.string().describe("The name of the custom activity")};const DT=hw`
795
813
  mutation createNotification($user_id: ID!, $target_id: ID!, $text: String!, $target_type: NotificationTargetType!) {
796
814
  create_notification(user_id: $user_id, target_id: $target_id, text: $text, target_type: $target_type) {
797
815
  text
798
816
  }
799
817
  }
800
- `,hT={user_id:y.string().describe("The user ID to send the notification to"),target_id:y.string().describe("The target ID (update/reply ID for Post type, item/board ID for Project type)"),text:y.string().describe("The notification text"),target_type:y.nativeEnum(iy).describe("The target type (Post for update/reply, Project for item/board)")};const vT=hw`
818
+ `,kT={user_id:y.string().describe("The user ID to send the notification to"),target_id:y.string().describe("The target ID (update/reply ID for Post type, item/board ID for Project type)"),text:y.string().describe("The notification text"),target_type:y.nativeEnum(iy).describe("The target type (Post for update/reply, Project for item/board)")};const OT=hw`
801
819
  mutation createGroup(
802
820
  $boardId: ID!
803
821
  $groupName: String!
@@ -816,7 +834,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
816
834
  title
817
835
  }
818
836
  }
819
- `,bT=["#037f4c","#00c875","#9cd326","#cab641","#ffcb00","#784bd1","#9d50dd","#007eb5","#579bfc","#66ccff","#bb3354","#df2f4a","#ff007f","#ff5ac4","#ff642e","#fdab3d","#7f5347","#c4c4c4","#757575"],gT={boardId:y.string().describe("The ID of the board to create the group in"),groupName:y.string().max(255).describe("The name of the new group (maximum 255 characters)"),groupColor:y.enum(bT).optional().describe(`The color for the group. Must be one of the predefined Monday.com group colors: ${bT.join(", ")}`),relativeTo:y.string().optional().describe("The ID of the group to position this new group relative to"),positionRelativeMethod:y.nativeEnum(dy).optional().describe("Whether to position the new group before or after the relativeTo group")};const yT=hw`
837
+ `,RT=["#037f4c","#00c875","#9cd326","#cab641","#ffcb00","#784bd1","#9d50dd","#007eb5","#579bfc","#66ccff","#bb3354","#df2f4a","#ff007f","#ff5ac4","#ff642e","#fdab3d","#7f5347","#c4c4c4","#757575"],CT={boardId:y.string().describe("The ID of the board to create the group in"),groupName:y.string().max(255).describe("The name of the new group (maximum 255 characters)"),groupColor:y.enum(RT).optional().describe(`The color for the group. Must be one of the predefined Monday.com group colors: ${RT.join(", ")}`),relativeTo:y.string().optional().describe("The ID of the group to position this new group relative to"),positionRelativeMethod:y.nativeEnum(dy).optional().describe("Whether to position the new group before or after the relativeTo group")};const $T=hw`
820
838
  mutation duplicateItem($boardId: ID!, $itemId: ID!, $withUpdates: Boolean) {
821
839
  duplicate_item(board_id: $boardId, item_id: $itemId, with_updates: $withUpdates) {
822
840
  id
@@ -824,7 +842,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
824
842
  url
825
843
  }
826
844
  }
827
- `,_T=hw`
845
+ `,LT=hw`
828
846
  mutation createSubitem($parentItemId: ID!, $itemName: String!, $columnValues: JSON) {
829
847
  create_subitem(parent_item_id: $parentItemId, item_name: $itemName, column_values: $columnValues) {
830
848
  id
@@ -835,7 +853,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
835
853
  }
836
854
  }
837
855
  }
838
- `,wT=1e3;var xT,TT;!function(e){e[e.YEAR=31536e3]="YEAR",e[e.MONTH31Days=2678400]="MONTH31Days",e[e.MONTH30Days=2592e3]="MONTH30Days",e[e.MONTH29Days=2505600]="MONTH29Days",e[e.MONTH28Days=2419200]="MONTH28Days",e[e.WEEK=604800]="WEEK",e[e.DAY=86400]="DAY",e[e.HOUR=3600]="HOUR",e[e.MINUTE=60]="MINUTE"}(xT||(xT={})),function(e){e[e.YEAR=31536e6]="YEAR",e[e.MONTH31Days=26784e5]="MONTH31Days",e[e.MONTH30Days=2592e6]="MONTH30Days",e[e.MONTH29Days=25056e5]="MONTH29Days",e[e.MONTH28Days=24192e5]="MONTH28Days",e[e.DAY=864e5]="DAY",e[e.HOUR=36e5]="HOUR",e[e.MINUTE=6e4]="MINUTE",e[e.SECOND=wT]="SECOND"}(TT||(TT={}));const ET=10*TT.SECOND;function IT(e,t){const a=e?.response?.errors?.map((e=>e.message))?.join(", ");if(a)throw new Error(`Failed to ${t}: ${a}`);const i=e instanceof Error?e.message:"Unknown error";throw new Error(`Failed to ${t}: ${i}`)}function ST(e){if(e instanceof Error&&"AbortError"===e.name)throw new Error("Search has timed out, try providing alternative search term")}const NT={name:y.string().describe("The name of the new item to be created, must be relevant to the user's request"),groupId:y.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:y.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"},\\"dropdown_id\\":\\"value\\", \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"'),parentItemId:y.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:y.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},AT={boardId:y.number().describe("The id of the board to which the new item will be added"),...NT};const DT={item_id:y.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:y.string().describe("The ID of the custom activity for the timeline item"),title:y.string().describe("The title of the new timeline item"),summary:y.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:y.string().optional().describe("The content of the new timeline item"),timestamp:y.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:y.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:y.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:y.string().optional().describe("The location to add to the new timeline item"),phone:y.string().optional().describe("The phone number to add to the new timeline item"),url:y.string().optional().describe("The URL to add to the new timeline item")};const kT=hw`
856
+ `,FT={name:y.string().describe("The name of the new item to be created, must be relevant to the user's request"),groupId:y.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:y.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"},\\"dropdown_id\\":\\"value\\", \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"'),parentItemId:y.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:y.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},PT={boardId:y.number().describe("The id of the board to which the new item will be added"),...FT};const jT={item_id:y.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:y.string().describe("The ID of the custom activity for the timeline item"),title:y.string().describe("The title of the new timeline item"),summary:y.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:y.string().optional().describe("The content of the new timeline item"),timestamp:y.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:y.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:y.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:y.string().optional().describe("The location to add to the new timeline item"),phone:y.string().optional().describe("The phone number to add to the new timeline item"),url:y.string().optional().describe("The URL to add to the new timeline item")};const UT=hw`
839
857
  mutation createUpdate($itemId: ID!, $body: String!, $mentionsList: [UpdateMention], $parentId: ID) {
840
858
  create_update(body: $body, item_id: $itemId, mentions_list: $mentionsList, parent_id: $parentId) {
841
859
  id
@@ -846,7 +864,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
846
864
  }
847
865
  }
848
866
  }
849
- `,OT=y.object({id:y.string().describe("The ID of the entity to mention"),type:y.nativeEnum(ty).describe("The type of mention: User, Team, Board, or Project")}),RT=y.array(OT),CT={itemId:y.number().describe("The id of the item to which the update will be added"),body:y.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead. use html tags to format the text, dont use markdown."),mentionsList:y.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project'),parentId:y.number().optional().describe("The ID of the update to reply to. Use this parameter when you want to reply on an existing update leave it empty if you want to create a new update")};const $T=hw`
867
+ `,VT=y.object({id:y.string().describe("The ID of the entity to mention"),type:y.nativeEnum(ty).describe("The type of mention: User, Team, Board, or Project")}),BT=y.array(VT),MT={itemId:y.number().describe("The id of the item to which the update will be added"),body:y.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead. use html tags to format the text, dont use markdown."),mentionsList:y.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project'),parentId:y.number().optional().describe("The ID of the update to reply to. Use this parameter when you want to reply on an existing update leave it empty if you want to create a new update")};const qT=hw`
850
868
  query GetItemUpdates($itemId: ID!, $limit: Int, $page: Int, $includeReplies: Boolean!, $includeAssets: Boolean!) {
851
869
  items(ids: [$itemId]) {
852
870
  id
@@ -882,7 +900,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
882
900
  }
883
901
  }
884
902
  }
885
- `,LT=hw`
903
+ `,GT=hw`
886
904
  query GetBoardUpdates($boardId: ID!, $limit: Int, $page: Int, $includeReplies: Boolean!, $includeAssets: Boolean!, $fromDate: ISO8601DateTime, $toDate: ISO8601DateTime, $boardUpdatesOnly: Boolean) {
887
905
  boards(ids: [$boardId]) {
888
906
  id
@@ -918,7 +936,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
918
936
  }
919
937
  }
920
938
  }
921
- `;var FT;!function(e){e.Item="Item",e.Board="Board"}(FT||(FT={}));const PT={objectId:y.string().describe("The ID of the item or board to get updates from"),objectType:y.enum([FT.Item,FT.Board]).describe("Type of object for which objectId was provided"),limit:y.number().min(1).max(100).optional().default(25).describe("Number of updates per page (default: 25, max: 100)"),page:y.number().min(1).optional().default(1).describe("Page number for pagination (default: 1)"),includeReplies:y.boolean().optional().default(!1).describe("Include update replies in the response"),includeAssets:y.boolean().optional().default(!1).describe("Include file attachments in the response"),fromDate:y.string().optional().describe('Start of date range filter (e.g. "2025-01-01" or "2025-01-01T00:00:00Z"). Must be used together with toDate. Only supported for Board objectType.'),toDate:y.string().optional().describe('End of date range filter (e.g. "2025-06-01" or "2025-06-01T23:59:59Z"). Must be used together with fromDate. Only supported for Board objectType.'),includeItemUpdates:y.boolean().optional().default(!1).describe("When objectType is Board, also include updates on individual items. Defaults to false, returning only board discussion. Set to true to retrieve all updates on a board, including updates on individual items.")};function jT(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e}const UT={columnId:y.string().describe("The id of the column to be deleted")},VT={boardId:y.number().describe("The id of the board to which the new column will be added"),...UT};const BT={itemId:y.number()};const MT={};const qT=hw`
939
+ `;var HT;!function(e){e.Item="Item",e.Board="Board"}(HT||(HT={}));const WT={objectId:y.string().describe("The ID of the item or board to get updates from"),objectType:y.enum([HT.Item,HT.Board]).describe("Type of object for which objectId was provided"),limit:y.number().min(1).max(100).optional().default(25).describe("Number of updates per page (default: 25, max: 100)"),page:y.number().min(1).optional().default(1).describe("Page number for pagination (default: 1)"),includeReplies:y.boolean().optional().default(!1).describe("Include update replies in the response"),includeAssets:y.boolean().optional().default(!1).describe("Include file attachments in the response"),fromDate:y.string().optional().describe('Start of date range filter (e.g. "2025-01-01" or "2025-01-01T00:00:00Z"). Must be used together with toDate. Only supported for Board objectType.'),toDate:y.string().optional().describe('End of date range filter (e.g. "2025-06-01" or "2025-06-01T23:59:59Z"). Must be used together with fromDate. Only supported for Board objectType.'),includeItemUpdates:y.boolean().optional().default(!1).describe("When objectType is Board, also include updates on individual items. Defaults to false, returning only board discussion. Set to true to retrieve all updates on a board, including updates on individual items.")};function zT(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e}const YT={columnId:y.string().describe("The id of the column to be deleted")},KT={boardId:y.number().describe("The id of the board to which the new column will be added"),...YT};const QT={itemId:y.number()};const JT={};const XT=hw`
922
940
  query getBoardData($boardId: ID!, $itemsLimit: Int!, $queryParams: ItemsQuery) {
923
941
  boards(ids: [$boardId]) {
924
942
  id
@@ -961,7 +979,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
961
979
  }
962
980
  }
963
981
  }
964
- `,GT=hw`
982
+ `,ZT=hw`
965
983
  query getUsersByIds($userIds: [ID!]!) {
966
984
  users(ids: $userIds) {
967
985
  id
@@ -969,7 +987,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
969
987
  photo_tiny
970
988
  }
971
989
  }
972
- `,HT=y.array(y.object({columnId:y.string().describe("The id of the column to filter by"),compareAttribute:y.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:y.union([y.string(),y.number(),y.boolean(),y.array(y.union([y.string(),y.number()]))]).describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:y.nativeEnum(Yg).optional().default(Yg.AnyOf).describe("The operator to use for the filter")})).optional().describe('The configuration of filters to apply on the items. Before sending the filters, use get_board_info tool to check "filteringGuidelines" key for filtering by the column.'),WT=y.nativeEnum(zg).optional().default(zg.And).describe("The operator to use for the filters"),zT={boardId:y.string().describe("The ID of the board to fetch complete data for"),filters:HT,filtersOperator:WT};const YT=hw`
990
+ `,eE=y.array(y.object({columnId:y.string().describe("The id of the column to filter by"),compareAttribute:y.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:y.union([y.string(),y.number(),y.boolean(),y.array(y.union([y.string(),y.number()]))]).describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:y.nativeEnum(Yg).optional().default(Yg.AnyOf).describe("The operator to use for the filter")})).optional().describe('The configuration of filters to apply on the items. Before sending the filters, use get_board_info tool to check "filteringGuidelines" key for filtering by the column.'),tE=y.nativeEnum(zg).optional().default(zg.And).describe("The operator to use for the filters"),aE={boardId:y.string().describe("The ID of the board to fetch complete data for"),filters:eE,filtersOperator:tE};const iE=hw`
973
991
  query GetBoardAllActivity(
974
992
  $boardId: ID!
975
993
  $fromDate: ISO8601DateTime!
@@ -990,7 +1008,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
990
1008
  }
991
1009
  }
992
1010
  }
993
- `,KT={boardId:y.number().describe("The id of the board to get activity for"),fromDate:y.string().optional().describe("Start date for activity range (ISO8601DateTime format). Defaults to 30 days ago"),toDate:y.string().optional().describe("End date for activity range (ISO8601DateTime format). Defaults to now"),includeData:y.boolean().optional().default(!1).describe("Whether to include the raw data payload for each activity entry. The data field contains the full before/after state of changes and can be very large. Only set to true when you need the detailed change data.")};const QT=hw`
1011
+ `,nE={boardId:y.number().describe("The id of the board to get activity for"),fromDate:y.string().optional().describe("Start date for activity range (ISO8601DateTime format). Defaults to 30 days ago"),toDate:y.string().optional().describe("End date for activity range (ISO8601DateTime format). Defaults to now"),includeData:y.boolean().optional().default(!1).describe("Whether to include the raw data payload for each activity entry. The data field contains the full before/after state of changes and can be very large. Only set to true when you need the detailed change data.")};const oE=hw`
994
1012
  query GetBoardInfo($boardId: ID!) {
995
1013
  boards(ids: [$boardId]) {
996
1014
  # Basic Board Metadata
@@ -1077,7 +1095,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1077
1095
  }
1078
1096
  }
1079
1097
  }
1080
- `,JT=hw`
1098
+ `,rE=hw`
1081
1099
  query GetBoardInfoJustColumns($boardId: ID!) {
1082
1100
  boards(ids: [$boardId]) {
1083
1101
  columns {
@@ -1089,7 +1107,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1089
1107
  }
1090
1108
  }
1091
1109
  }
1092
- `,XT=(e,t)=>({board:{...e,subItemColumns:t?.columns??void 0},filteringGuidelines:aE(e.columns.filter(ZT)),aggregationGuidelines:tE()});function ZT(e){return!!e&&["id","type"].every((t=>t in e))}const eE={last_updated:'Supported operators: any_of, not_any_of. CompareValue should be either:\n - "TODAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "YESTERDAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\nEXAMPLES:\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // using TODAY with correct compareAttribute\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "UPDATED_AT"} // using THIS_WEEK with not_any_of\n ❌ Wrong: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of"} // missing required compareAttribute\n ❌ Wrong: {"columnId": "last_updated", "compareValue": "TODAY", "operator": "any_of", "compareAttribute": "UPDATED_AT"} // not using array for any_of operator',date:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue should be either:\n - Date in "YYYY-MM-DD" format must be passed along with "EXACT" string e.g. compareValue:["2025-01-01", "EXACT"]\n - "TODAY" - Item with today\'s date\n - "TOMORROW" - Item with tomorrow\'s date\n - "THIS_WEEK" - Item with this week\'s date\n - "ONE_WEEK_AGO" - Item with one week ago\'s date\nEXAMPLES:\n ✅ Correct: {"columnId": "date", "compareValue": ["2025-01-01", "EXACT"], "operator": "any_of"} // using exact date format with EXACT\n ✅ Correct: {"columnId": "date", "compareValue": "TODAY", "operator": "greater_than"} // using TODAY with greater_than\n ❌ Wrong: {"columnId": "date", "compareValue": "2025-01-01", "operator": "any_of"} // missing EXACT string for exact date\n ❌ Wrong: {"columnId": "date", "compareValue": ["TODAY"], "operator": "greater_than"} // using array with single value operator',email:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be:\n - empty string "" when searching for blank values\n - whole email address when searching for specific email\n - partial email when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "email", "compareValue": ["john@example.com"], "operator": "any_of"} // using array with any_of for specific email\n ✅ Correct: {"columnId": "email", "compareValue": "gmail", "operator": "contains_text"} // using partial email with contains_text\n ❌ Wrong: {"columnId": "email", "compareValue": "john@example.com", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "email", "compareValue": ["gmail"], "operator": "contains_text"} // using array with single value operator',long_text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "long_text", "compareValue": ["Complete project description"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "long_text", "compareValue": "urgent", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "long_text", "compareValue": "Complete project description", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "long_text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "text", "compareValue": ["Task Name"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "text", "compareValue": "bug", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "text", "compareValue": "Task Name", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',numbers:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue is a number or "$$$blank$$$" when searching for blank values\nEXAMPLES:\n ✅ Correct: {"columnId": "numbers", "compareValue": [100, 200], "operator": "any_of"} // using array with any_of for multiple numbers\n ✅ Correct: {"columnId": "numbers", "compareValue": 50, "operator": "greater_than"} // using single number with greater_than\n ❌ Wrong: {"columnId": "numbers", "compareValue": 100, "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "numbers", "compareValue": ["50"], "operator": "greater_than"} // using array with single value operator',name:'Supported operators: "contains_text", "not_contains_text". CompareValue can be full or partial text\nEXAMPLES:\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "contains_text"} // using string with contains_text\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "not_contains_text"} // using string with not_contains_text',status:'Supported operators: any_of, not_any_of, contains_terms. CompareValue should be either:\n - id of label from column settings - when used with any_of, not_any_of operators\n - label\'s text - when use with contains_terms\nEXAMPLES:\n ✅ Correct: {"columnId": "status", "compareValue": [0, 1], "operator": "any_of"} // Using id values\n ✅ Correct: {"columnId": "status", "compareValue": "Done", "operator": "contains_terms"} // Using label text\n ❌ Wrong: {"columnId": "status", "compareValue": "Done", "operator": "any_of"} // Using label text with wrong operator\n ❌ Wrong: {"columnId": "status", "compareValue": [0, 1], "operator": "contains_terms"} // Using id with wrong operator',checkbox:'Supported operators: is_empty, is_not_empty. Compare value must be an empty array\nEXAMPLES:\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": null, "operator": "is_empty"} // not using empty array with is_empty operator',people:'Supported operators: any_of, not_any_of, is_empty, is_not_empty. **CRITICAL**: CompareValue MUST be in one of following:\n - "assigned_to_me" - when searching for current user\n - "person-123" - when searching for specific person with id 123\n - "team-456" - when searching for specific team with id 456\n - empty array when using is_empty, is_not_empty operators\nEXAMPLES: \n ❌ Wrong: {"columnId": "column_id", "compareValue": ["person—123"], "operator": "any_of"} // Using long hyphen \'—\' instead of short hyphen \'-\'\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ✅ Correct: {"columnId": "column_id", "compareValue": ["person-80120403"], "operator": "any_of"} // using person prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["team-9000"], "operator": "any_of"} // using team prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["assigned_to_me"], "operator": "any_of"} // using assigned_to_me value\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "is_empty"} // using id with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "any_of"} // not using person or team prefix'},tE=()=>`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${Db.CountItems} function. Do not use ${Db.Count} function for that purpose.\n `,aE=e=>{const t=e.reduce(((e,t)=>eE[t.type]?(e[t.type]||(e[t.type]=[]),e[t.type].push(t.id),e):e),{});return 0===Object.keys(t).length?"":`\n[MEMORY] Remember the filtering guidelines for subsequent requests for the same board.\n# Filtering Guidelines\n\n## [IMPORTANT] Operator Guidelines\nSpecific operators expect specific compareValue types:\n- CompareValue MUST BE SENT AS AN ARRAY WHEN USED WITH any_of, not_any_of, between operators\n- CompareValue MUST BE SENT AS AN EMPTY ARRAY WHEN USED WITH is_empty, is_not_empty\n- CompareValue MUST BE SENT AS EITHER SINGLE STRING OR SINGLE NUMBER WHEN USED WITH greater_than, greater_than_or_equals, lower_than, lower_than_or_equal\n- CompareValue MUST BE SENT AS SINGLE STRING WHEN USED WITH contains_terms, not_contains_text, contains_text, starts_with, ends_with operators\n\n## [IMPORTANT] Column type Guidelines\n${Object.entries(t).map((([e,t])=>`- Column Type: ${e} (Column IDs: ${t.join(", ")}) - ${eE[e]}`)).join("\n\n")}\n\n## [IMPORTANT] Sub Items Columns MUST NOT BE USED FOR FILTERING.\n `},iE={boardId:y.number().describe("The id of the board to get information for")};const nE=hw`
1110
+ `,sE=(e,t)=>({board:{...e,subItemColumns:t?.columns??void 0},filteringGuidelines:lE(e.columns.filter(pE)),aggregationGuidelines:cE()});function pE(e){return!!e&&["id","type"].every((t=>t in e))}const dE={last_updated:'Supported operators: any_of, not_any_of. CompareValue should be either:\n - "TODAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "YESTERDAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\nEXAMPLES:\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // using TODAY with correct compareAttribute\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "UPDATED_AT"} // using THIS_WEEK with not_any_of\n ❌ Wrong: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of"} // missing required compareAttribute\n ❌ Wrong: {"columnId": "last_updated", "compareValue": "TODAY", "operator": "any_of", "compareAttribute": "UPDATED_AT"} // not using array for any_of operator',date:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue should be either:\n - Date in "YYYY-MM-DD" format must be passed along with "EXACT" string e.g. compareValue:["2025-01-01", "EXACT"]\n - "TODAY" - Item with today\'s date\n - "TOMORROW" - Item with tomorrow\'s date\n - "THIS_WEEK" - Item with this week\'s date\n - "ONE_WEEK_AGO" - Item with one week ago\'s date\nEXAMPLES:\n ✅ Correct: {"columnId": "date", "compareValue": ["2025-01-01", "EXACT"], "operator": "any_of"} // using exact date format with EXACT\n ✅ Correct: {"columnId": "date", "compareValue": "TODAY", "operator": "greater_than"} // using TODAY with greater_than\n ❌ Wrong: {"columnId": "date", "compareValue": "2025-01-01", "operator": "any_of"} // missing EXACT string for exact date\n ❌ Wrong: {"columnId": "date", "compareValue": ["TODAY"], "operator": "greater_than"} // using array with single value operator',email:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be:\n - empty string "" when searching for blank values\n - whole email address when searching for specific email\n - partial email when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "email", "compareValue": ["john@example.com"], "operator": "any_of"} // using array with any_of for specific email\n ✅ Correct: {"columnId": "email", "compareValue": "gmail", "operator": "contains_text"} // using partial email with contains_text\n ❌ Wrong: {"columnId": "email", "compareValue": "john@example.com", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "email", "compareValue": ["gmail"], "operator": "contains_text"} // using array with single value operator',long_text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "long_text", "compareValue": ["Complete project description"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "long_text", "compareValue": "urgent", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "long_text", "compareValue": "Complete project description", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "long_text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "text", "compareValue": ["Task Name"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "text", "compareValue": "bug", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "text", "compareValue": "Task Name", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',numbers:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue is a number or "$$$blank$$$" when searching for blank values\nEXAMPLES:\n ✅ Correct: {"columnId": "numbers", "compareValue": [100, 200], "operator": "any_of"} // using array with any_of for multiple numbers\n ✅ Correct: {"columnId": "numbers", "compareValue": 50, "operator": "greater_than"} // using single number with greater_than\n ❌ Wrong: {"columnId": "numbers", "compareValue": 100, "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "numbers", "compareValue": ["50"], "operator": "greater_than"} // using array with single value operator',name:'Supported operators: "contains_text", "not_contains_text". CompareValue can be full or partial text\nEXAMPLES:\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "contains_text"} // using string with contains_text\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "not_contains_text"} // using string with not_contains_text',status:'Supported operators: any_of, not_any_of, contains_terms. CompareValue should be either:\n - id of label from column settings - when used with any_of, not_any_of operators\n - label\'s text - when use with contains_terms\nEXAMPLES:\n ✅ Correct: {"columnId": "status", "compareValue": [0, 1], "operator": "any_of"} // Using id values\n ✅ Correct: {"columnId": "status", "compareValue": "Done", "operator": "contains_terms"} // Using label text\n ❌ Wrong: {"columnId": "status", "compareValue": "Done", "operator": "any_of"} // Using label text with wrong operator\n ❌ Wrong: {"columnId": "status", "compareValue": [0, 1], "operator": "contains_terms"} // Using id with wrong operator',checkbox:'Supported operators: is_empty, is_not_empty. Compare value must be an empty array\nEXAMPLES:\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": null, "operator": "is_empty"} // not using empty array with is_empty operator',people:'Supported operators: any_of, not_any_of, is_empty, is_not_empty. **CRITICAL**: CompareValue MUST be in one of following:\n - "assigned_to_me" - when searching for current user\n - "person-123" - when searching for specific person with id 123\n - "team-456" - when searching for specific team with id 456\n - empty array when using is_empty, is_not_empty operators\nEXAMPLES: \n ❌ Wrong: {"columnId": "column_id", "compareValue": ["person—123"], "operator": "any_of"} // Using long hyphen \'—\' instead of short hyphen \'-\'\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ✅ Correct: {"columnId": "column_id", "compareValue": ["person-80120403"], "operator": "any_of"} // using person prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["team-9000"], "operator": "any_of"} // using team prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["assigned_to_me"], "operator": "any_of"} // using assigned_to_me value\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "is_empty"} // using id with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "any_of"} // not using person or team prefix'},cE=()=>`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${Db.CountItems} function. Do not use ${Db.Count} function for that purpose.\n `,lE=e=>{const t=e.reduce(((e,t)=>dE[t.type]?(e[t.type]||(e[t.type]=[]),e[t.type].push(t.id),e):e),{});return 0===Object.keys(t).length?"":`\n[MEMORY] Remember the filtering guidelines for subsequent requests for the same board.\n# Filtering Guidelines\n\n## [IMPORTANT] Operator Guidelines\nSpecific operators expect specific compareValue types:\n- CompareValue MUST BE SENT AS AN ARRAY WHEN USED WITH any_of, not_any_of, between operators\n- CompareValue MUST BE SENT AS AN EMPTY ARRAY WHEN USED WITH is_empty, is_not_empty\n- CompareValue MUST BE SENT AS EITHER SINGLE STRING OR SINGLE NUMBER WHEN USED WITH greater_than, greater_than_or_equals, lower_than, lower_than_or_equal\n- CompareValue MUST BE SENT AS SINGLE STRING WHEN USED WITH contains_terms, not_contains_text, contains_text, starts_with, ends_with operators\n\n## [IMPORTANT] Column type Guidelines\n${Object.entries(t).map((([e,t])=>`- Column Type: ${e} (Column IDs: ${t.join(", ")}) - ${dE[e]}`)).join("\n\n")}\n\n## [IMPORTANT] Sub Items Columns MUST NOT BE USED FOR FILTERING.\n `},mE={boardId:y.number().describe("The id of the board to get information for")};const uE=hw`
1093
1111
  fragment ItemDataFragment on Item {
1094
1112
  id
1095
1113
  name
@@ -1152,7 +1170,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1152
1170
  }
1153
1171
  }
1154
1172
  }
1155
- `,oE=hw`
1173
+ `,fE=hw`
1156
1174
  query SearchItemsDev($query: String!, $limit: Int!, $filters: SearchFiltersInput!) {
1157
1175
  cross_entity_search(query: $query, limit: $limit, filters: $filters) {
1158
1176
  __typename
@@ -1163,11 +1181,11 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1163
1181
  }
1164
1182
  }
1165
1183
  }
1166
- `;var rE,sE;!function(e){e.BOARD="board-",e.DOCUMENT="doc-",e.FOLDER="folder-"}(rE||(rE={})),function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS"}(sE||(sE={}));const pE={boardId:y.number().describe("The id of the board to get items from"),itemIds:y.array(y.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:y.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:y.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:y.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:y.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeItemDescription:y.boolean().optional().default(!1).describe("Whether to include the item's description in the response. The item description is the rich-text body content that appears inside a monday.com item (similar to a task description or issue body). Set this to true when the user asks about an item's description, details, body, or notes. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the item description content."),includeSubItems:y.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:y.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filters:HT,filtersOperator:WT,columnIds:y.array(y.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderBy:y.array(y.object({columnId:y.string().describe("The id of the column to order by"),direction:y.nativeEnum(Wg).optional().default(Wg.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};const dE={boardId:y.number().describe("The id of the board to get the schema of")};const cE=hw`
1184
+ `;var hE,vE;!function(e){e.BOARD="board-",e.DOCUMENT="doc-",e.FOLDER="folder-"}(hE||(hE={})),function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS"}(vE||(vE={}));const bE={boardId:y.number().describe("The id of the board to get items from"),itemIds:y.array(y.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:y.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:y.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:y.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:y.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeItemDescription:y.boolean().optional().default(!1).describe("Whether to include the item's description in the response. The item description is the rich-text body content that appears inside a monday.com item (similar to a task description or issue body). Set this to true when the user asks about an item's description, details, body, or notes. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the item description content."),includeSubItems:y.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:y.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filters:eE,filtersOperator:tE,columnIds:y.array(y.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderBy:y.array(y.object({columnId:y.string().describe("The id of the column to order by"),direction:y.nativeEnum(Wg).optional().default(Wg.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};const gE={boardId:y.number().describe("The id of the board to get the schema of")};const yE=hw`
1167
1185
  query GetColumnTypeSchema($type: ColumnType!) {
1168
1186
  get_column_type_schema(type: $type)
1169
1187
  }
1170
- `,lE="https://developer.monday.com/api-reference",mE={columnType:y.nativeEnum(cT).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const uE={random_string:y.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:y.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const fE={typeName:y.string().describe("The name of the GraphQL type to get details for")};const hE=hw`
1188
+ `,_E="https://developer.monday.com/api-reference",wE={columnType:y.nativeEnum(IT).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const xE={random_string:y.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:y.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const TE={typeName:y.string().describe("The name of the GraphQL type to get details for")};const EE=hw`
1171
1189
  fragment UserDetails on User {
1172
1190
  # Basic User Information
1173
1191
  id
@@ -1199,31 +1217,31 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1199
1217
  time_zone_identifier
1200
1218
  utc_hours_diff
1201
1219
  }
1202
- `,vE=hw`
1220
+ `,IE=hw`
1203
1221
  fragment UserTeamMembership on Team {
1204
1222
  id
1205
1223
  name
1206
1224
  is_guest
1207
1225
  picture_url
1208
1226
  }
1209
- `,bE=hw`
1227
+ `,SE=hw`
1210
1228
  fragment TeamBasicInfo on Team {
1211
1229
  id
1212
1230
  name
1213
1231
  }
1214
- `,gE=hw`
1232
+ `,NE=hw`
1215
1233
  fragment TeamExtendedInfo on Team {
1216
1234
  ...TeamBasicInfo
1217
1235
  is_guest
1218
1236
  picture_url
1219
1237
  }
1220
- `,yE=hw`
1238
+ `,AE=hw`
1221
1239
  fragment TeamOwner on User {
1222
1240
  id
1223
1241
  name
1224
1242
  email
1225
1243
  }
1226
- `,_E=hw`
1244
+ `,DE=hw`
1227
1245
  fragment TeamMember on User {
1228
1246
  id
1229
1247
  name
@@ -1243,7 +1261,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1243
1261
  time_zone_identifier
1244
1262
  utc_hours_diff
1245
1263
  }
1246
- `,wE=hw`
1264
+ `,kE=hw`
1247
1265
  fragment TeamMemberSimplified on User {
1248
1266
  id
1249
1267
  name
@@ -1252,15 +1270,15 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1252
1270
  is_admin
1253
1271
  is_guest
1254
1272
  }
1255
- `,xE=hw`
1273
+ `,OE=hw`
1256
1274
  fragment UserTeamMembershipSimplified on Team {
1257
1275
  id
1258
1276
  name
1259
1277
  is_guest
1260
1278
  }
1261
- `,TE=hw`
1262
- ${hE}
1263
- ${vE}
1279
+ `,RE=hw`
1280
+ ${EE}
1281
+ ${IE}
1264
1282
 
1265
1283
  query listUsersWithTeams($userIds: [ID!], $limit: Int = 1000) {
1266
1284
  users(ids: $userIds, limit: $limit) {
@@ -1272,21 +1290,21 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1272
1290
  }
1273
1291
  }
1274
1292
  }
1275
- `,EE=hw`
1276
- ${hE}
1293
+ `,CE=hw`
1294
+ ${EE}
1277
1295
 
1278
1296
  query listUsersOnly($userIds: [ID!], $limit: Int = 1000) {
1279
1297
  users(ids: $userIds, limit: $limit) {
1280
1298
  ...UserDetails
1281
1299
  }
1282
1300
  }
1283
- `,IE=hw`
1284
- ${hE}
1285
- ${xE}
1286
- ${gE}
1287
- ${bE}
1288
- ${yE}
1289
- ${wE}
1301
+ `,$E=hw`
1302
+ ${EE}
1303
+ ${OE}
1304
+ ${NE}
1305
+ ${SE}
1306
+ ${AE}
1307
+ ${kE}
1290
1308
 
1291
1309
  query listUsersAndTeams($userIds: [ID!], $teamIds: [ID!], $limit: Int = 1000) {
1292
1310
  users(ids: $userIds, limit: $limit) {
@@ -1312,19 +1330,19 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1312
1330
  }
1313
1331
  }
1314
1332
  }
1315
- `,SE=hw`
1316
- ${bE}
1333
+ `,LE=hw`
1334
+ ${SE}
1317
1335
 
1318
1336
  query listTeamsOnly($teamIds: [ID!]) {
1319
1337
  teams(ids: $teamIds) {
1320
1338
  ...TeamBasicInfo
1321
1339
  }
1322
1340
  }
1323
- `,NE=hw`
1324
- ${gE}
1325
- ${bE}
1326
- ${yE}
1327
- ${_E}
1341
+ `,FE=hw`
1342
+ ${NE}
1343
+ ${SE}
1344
+ ${AE}
1345
+ ${DE}
1328
1346
 
1329
1347
  query listTeamsWithMembers($teamIds: [ID!]) {
1330
1348
  teams(ids: $teamIds) {
@@ -1341,9 +1359,9 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1341
1359
  }
1342
1360
  }
1343
1361
  }
1344
- `,AE=hw`
1345
- ${hE}
1346
- ${vE}
1362
+ `,PE=hw`
1363
+ ${EE}
1364
+ ${IE}
1347
1365
 
1348
1366
  query getUserByName($name: String) {
1349
1367
  users(name: $name) {
@@ -1355,7 +1373,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1355
1373
  }
1356
1374
  }
1357
1375
  }
1358
- `,DE=hw`
1376
+ `,jE=hw`
1359
1377
  query getCurrentUser {
1360
1378
  me {
1361
1379
  id
@@ -1367,7 +1385,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1367
1385
  photo_thumb
1368
1386
  }
1369
1387
  }
1370
- `;const kE=[["is_pending","Pending"],["is_verified","Verified"],["is_view_only","View Only"],["join_date","Join Date"],["last_activity","Last Activity"],["location","Location"],["mobile_phone","Mobile Phone"],["phone","Phone"],["photo_thumb","Photo Thumb"],["time_zone_identifier","Timezone"],["utc_hours_diff","UTC Hours Diff"]];function OE(e,t=""){return kE.filter((([t])=>{const a=e[t];return null!=a})).map((([a,i])=>`${t}${i}: ${e[a]}`))}const RE=e=>{const t=[];return"users"in e&&e.users&&e.users.length>0&&(t.push("Users:"),e.users.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),t.push(` Email: ${e.email}`),t.push(` Title: ${e.title||"N/A"}`),t.push(` Enabled: ${e.enabled}`),t.push(` Admin: ${e.is_admin||!1}`),t.push(` Guest: ${e.is_guest||!1}`),t.push(...OE(e," ")),e.teams&&e.teams.length>0&&(t.push(" Teams:"),e.teams.forEach((e=>{e&&t.push(` - ID: ${e.id}, Name: ${e.name}, Guest Team: ${e.is_guest||!1}, Picture URL: ${e.picture_url||"N/A"}`)}))),t.push(""))}))),"teams"in e&&e.teams&&e.teams.length>0&&(t.push("Teams:"),e.teams.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),function(e){return"owners"in e}(e)&&(t.push(` Guest Team: ${e.is_guest||!1}`),t.push(` Picture URL: ${e.picture_url||"N/A"}`),e.owners&&e.owners.length>0&&(t.push(" Owners:"),e.owners.forEach((e=>{t.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}`)}))),e.users&&e.users.length>0&&(t.push(" Members:"),e.users.forEach((e=>{if(e){const a=[`ID: ${e.id}`,`Name: ${e.name}`,`Email: ${e.email}`,`Title: ${e.title||"N/A"}`,`Admin: ${e.is_admin||!1}`,`Guest: ${e.is_guest||!1}`,...OE(e)];t.push(` - ${a.join(", ")}`)}})))),t.push(""))}))),0===t.length?"No users or teams found with the specified filters.":t.join("\n").trim()},CE=500,$E=500,LE=1e3,FE=hw`
1388
+ `;const UE=[["is_pending","Pending"],["is_verified","Verified"],["is_view_only","View Only"],["join_date","Join Date"],["last_activity","Last Activity"],["location","Location"],["mobile_phone","Mobile Phone"],["phone","Phone"],["photo_thumb","Photo Thumb"],["time_zone_identifier","Timezone"],["utc_hours_diff","UTC Hours Diff"]];function VE(e,t=""){return UE.filter((([t])=>{const a=e[t];return null!=a})).map((([a,i])=>`${t}${i}: ${e[a]}`))}const BE=e=>{const t=[];return"users"in e&&e.users&&e.users.length>0&&(t.push("Users:"),e.users.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),t.push(` Email: ${e.email}`),t.push(` Title: ${e.title||"N/A"}`),t.push(` Enabled: ${e.enabled}`),t.push(` Admin: ${e.is_admin||!1}`),t.push(` Guest: ${e.is_guest||!1}`),t.push(...VE(e," ")),e.teams&&e.teams.length>0&&(t.push(" Teams:"),e.teams.forEach((e=>{e&&t.push(` - ID: ${e.id}, Name: ${e.name}, Guest Team: ${e.is_guest||!1}, Picture URL: ${e.picture_url||"N/A"}`)}))),t.push(""))}))),"teams"in e&&e.teams&&e.teams.length>0&&(t.push("Teams:"),e.teams.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),function(e){return"owners"in e}(e)&&(t.push(` Guest Team: ${e.is_guest||!1}`),t.push(` Picture URL: ${e.picture_url||"N/A"}`),e.owners&&e.owners.length>0&&(t.push(" Owners:"),e.owners.forEach((e=>{t.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}`)}))),e.users&&e.users.length>0&&(t.push(" Members:"),e.users.forEach((e=>{if(e){const a=[`ID: ${e.id}`,`Name: ${e.name}`,`Email: ${e.email}`,`Title: ${e.title||"N/A"}`,`Admin: ${e.is_admin||!1}`,`Guest: ${e.is_guest||!1}`,...VE(e)];t.push(` - ${a.join(", ")}`)}})))),t.push(""))}))),0===t.length?"No users or teams found with the specified filters.":t.join("\n").trim()},ME=500,qE=500,GE=1e3,HE=hw`
1371
1389
  query getAccountSlug {
1372
1390
  me {
1373
1391
  account {
@@ -1375,7 +1393,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1375
1393
  }
1376
1394
  }
1377
1395
  }
1378
- `;async function PE(e){const t=await e.request(FE);return t.me?.account?.slug??null}function jE(e,t){return`https://${e}.monday.com/workspaces/${t}`}const UE={userIds:y.array(y.string()).max(CE).optional().describe("Specific user IDs to fetch.[IMPORTANT] ALWAYS use when you have user IDs in context. PREFER over general search. RETURNS: user profiles including team memberships"),teamIds:y.array(y.string()).max($E).optional().describe("Specific team IDs to fetch.[IMPORTANT] ALWAYS use when you have team IDs in context, NEVER fetch all teams if specific IDs are available.\n RETURNS: Team details with owners and optional member data."),name:y.string().optional().describe("Name-based USER search ONLY. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n CRITICAL: This parameter searches for USERS ONLY, NOT teams. To search for teams, use teamIds parameter instead."),getMe:y.boolean().optional().describe('[TOP PRIORITY] Use ALWAYS when requesting current user information. Examples of when it should be used: ["get my user" or "get my teams"].\n This parameter CONFLICTS with all others. '),includeTeams:y.boolean().optional().describe("[AVOID] This fetches all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get their team memberships."),teamsOnly:y.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:y.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const VE={itemId:y.number().describe("The id of the item to which the update will be added"),groupId:y.string().describe("The id of the group to which the item will be moved")};const BE="content",ME="version_history",qE=y.enum(["ids","object_ids","workspace_ids"]),GE={mode:y.enum([BE,ME]).optional().default(BE).describe('The operation mode. "content" (default) fetches documents with their markdown content. "version_history" fetches the edit history of a single document.'),type:qE.optional().describe('Query type for content mode: "ids", "object_ids", or "workspace_ids". Required when mode is "content".'),ids:y.array(y.string()).optional().describe('Array of ID values. In content mode: matches the query type (ids/object_ids/workspace_ids). In version_history mode: provide the single document object_id here (e.g., ids: ["5001466606"]).'),limit:y.number().optional().describe("Number of docs per page (default: 25). Only used in content mode."),order_by:y.nativeEnum(gg).optional().describe("Order in which to retrieve docs. Only used in content mode."),page:y.number().optional().describe("Page number to return (starts at 1). Only used in content mode."),include_blocks:y.boolean().optional().default(!1).describe("If true, includes the blocks array (block IDs, types, positions, content) in the response. Required when you plan to call update_doc. Defaults to false to reduce response size. Only used in content mode."),include_comments:y.boolean().optional().default(!1).describe("If true, fetches all comments and replies on the document. Comments are stored at the item level within the doc backing board. Defaults to false. Only used in content mode."),comments_limit:y.number().optional().default(50).describe("Maximum number of comments (updates) to fetch per item when include_comments is true. Defaults to 50. Only used in content mode."),version_history_limit:y.number().optional().describe('Maximum number of restoring points to return. Use this when the user asks for "last N changes". Only used in version_history mode.'),since:y.string().optional().describe('ISO 8601 date string to filter version history from (e.g., "2026-03-15T00:00:00Z"). If omitted, returns the full history. Only used in version_history mode.'),until:y.string().optional().describe('ISO 8601 date string to filter version history until (e.g., "2026-03-16T23:59:59Z"). Defaults to now. Only used in version_history mode.'),include_diff:y.boolean().optional().default(!1).describe("If true, fetches content diffs between consecutive restoring points. May be slower due to additional API calls. Only used in version_history mode.")};const HE={workspace_id:y.number().describe("The ID of the workspace to get information for")};const WE=hw`
1396
+ `;async function WE(e){const t=await e.request(HE);return t.me?.account?.slug??null}function zE(e,t){return`https://${e}.monday.com/workspaces/${t}`}const YE={userIds:y.array(y.string()).max(ME).optional().describe("Specific user IDs to fetch.[IMPORTANT] ALWAYS use when you have user IDs in context. PREFER over general search. RETURNS: user profiles including team memberships"),teamIds:y.array(y.string()).max(qE).optional().describe("Specific team IDs to fetch.[IMPORTANT] ALWAYS use when you have team IDs in context, NEVER fetch all teams if specific IDs are available.\n RETURNS: Team details with owners and optional member data."),name:y.string().optional().describe("Name-based USER search ONLY. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n CRITICAL: This parameter searches for USERS ONLY, NOT teams. To search for teams, use teamIds parameter instead."),getMe:y.boolean().optional().describe('[TOP PRIORITY] Use ALWAYS when requesting current user information. Examples of when it should be used: ["get my user" or "get my teams"].\n This parameter CONFLICTS with all others. '),includeTeams:y.boolean().optional().describe("[AVOID] This fetches all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get their team memberships."),teamsOnly:y.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:y.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const KE={itemId:y.number().describe("The id of the item to which the update will be added"),groupId:y.string().describe("The id of the group to which the item will be moved")};const QE="content",JE="version_history",XE=y.enum(["ids","object_ids","workspace_ids"]),ZE={mode:y.enum([QE,JE]).optional().default(QE).describe('The operation mode. "content" (default) fetches documents with their markdown content. "version_history" fetches the edit history of a single document.'),type:XE.optional().describe('Query type for content mode: "ids", "object_ids", or "workspace_ids". Required when mode is "content".'),ids:y.array(y.string()).optional().describe('Array of ID values. In content mode: matches the query type (ids/object_ids/workspace_ids). In version_history mode: provide the single document object_id here (e.g., ids: ["5001466606"]).'),limit:y.number().optional().describe("Number of docs per page (default: 25). Only used in content mode."),order_by:y.nativeEnum(gg).optional().describe("Order in which to retrieve docs. Only used in content mode."),page:y.number().optional().describe("Page number to return (starts at 1). Only used in content mode."),include_blocks:y.boolean().optional().default(!1).describe("If true, includes the blocks array (block IDs, types, positions, content) in the response. Required when you plan to call update_doc. Defaults to false to reduce response size. Only used in content mode."),include_comments:y.boolean().optional().default(!1).describe("If true, fetches all comments and replies on the document. Comments are stored at the item level within the doc backing board. Defaults to false. Only used in content mode."),comments_limit:y.number().optional().default(50).describe("Maximum number of comments (updates) to fetch per item when include_comments is true. Defaults to 50. Only used in content mode."),version_history_limit:y.number().optional().describe('Maximum number of restoring points to return. Use this when the user asks for "last N changes". Only used in version_history mode.'),since:y.string().optional().describe('ISO 8601 date string to filter version history from (e.g., "2026-03-15T00:00:00Z"). If omitted, returns the full history. Only used in version_history mode.'),until:y.string().optional().describe('ISO 8601 date string to filter version history until (e.g., "2026-03-16T23:59:59Z"). Defaults to now. Only used in version_history mode.'),include_diff:y.boolean().optional().default(!1).describe("If true, fetches content diffs between consecutive restoring points. May be slower due to additional API calls. Only used in version_history mode.")};const eI={workspace_id:y.number().describe("The ID of the workspace to get information for")};const tI=hw`
1379
1397
  query listWorkspaces($limit: Int!, $page: Int!, $membershipKind: WorkspaceMembershipKind!) {
1380
1398
  workspaces(limit: $limit, page: $page, membership_kind: $membershipKind) {
1381
1399
  id
@@ -1383,7 +1401,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1383
1401
  description
1384
1402
  }
1385
1403
  }
1386
- `,zE=100,YE=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,"");function KE(e){const t=e.workspaces?.filter((e=>null!==e));return t||[]}function QE(e){return Array.isArray(e)&&e.length>0}const JE={searchTerm:y.string().optional().describe("Optional search term used to filter workspaces. [IMPORTANT] Only alphanumeric characters are supported."),limit:y.number().min(1).max(zE).default(zE).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:y.number().min(1).default(1).describe("Page number to return. Default is 1.")};const XE=hw`
1404
+ `,aI=100,iI=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,"");function nI(e){const t=e.workspaces?.filter((e=>null!==e));return t||[]}function oI(e){return Array.isArray(e)&&e.length>0}const rI={searchTerm:y.string().optional().describe("Optional search term used to filter workspaces. [IMPORTANT] Only alphanumeric characters are supported."),limit:y.number().min(1).max(aI).default(aI).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:y.number().min(1).default(1).describe("Page number to return. Default is 1.")};const sI=hw`
1387
1405
  query getItemBoard($itemId: ID!) {
1388
1406
  items(ids: [$itemId]) {
1389
1407
  id
@@ -1396,7 +1414,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1396
1414
  }
1397
1415
  }
1398
1416
  }
1399
- `,ZE=hw`
1417
+ `,pI=hw`
1400
1418
  mutation createDoc($location: CreateDocInput!) {
1401
1419
  create_doc(location: $location) {
1402
1420
  id
@@ -1405,7 +1423,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1405
1423
  name
1406
1424
  }
1407
1425
  }
1408
- `,eI=hw`
1426
+ `,dI=hw`
1409
1427
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1410
1428
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1411
1429
  success
@@ -1413,11 +1431,11 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1413
1431
  error
1414
1432
  }
1415
1433
  }
1416
- `,tI=hw`
1434
+ `,cI=hw`
1417
1435
  mutation updateDocName($docId: ID!, $name: String!) {
1418
1436
  update_doc_name(docId: $docId, name: $name)
1419
1437
  }
1420
- `,aI=y.enum(["workspace","item"]),iI=y.discriminatedUnion("type",[y.object({type:y.literal(aI.enum.workspace).describe("Create document in workspace"),workspace_id:y.number().describe("Workspace ID under which to create the new document"),doc_kind:y.nativeEnum(Wb).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:y.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),y.object({type:y.literal(aI.enum.item).describe("Create document attached to item"),item_id:y.number().describe("Item ID to attach the new document to"),column_id:y.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]),nI={doc_name:y.string().describe("Name for the new document."),markdown:y.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:y.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:y.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:y.nativeEnum(Wb).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:y.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:y.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:y.string().optional().describe('[OPTIONAL - use only when location="item"] ID of an existing "doc" column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.')};const oI=hw`
1438
+ `,lI=y.enum(["workspace","item"]),mI=y.discriminatedUnion("type",[y.object({type:y.literal(lI.enum.workspace).describe("Create document in workspace"),workspace_id:y.number().describe("Workspace ID under which to create the new document"),doc_kind:y.nativeEnum(Wb).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:y.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),y.object({type:y.literal(lI.enum.item).describe("Create document attached to item"),item_id:y.number().describe("Item ID to attach the new document to"),column_id:y.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]),uI={doc_name:y.string().describe("Name for the new document."),markdown:y.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:y.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:y.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:y.nativeEnum(Wb).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:y.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:y.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:y.string().optional().describe('[OPTIONAL - use only when location="item"] ID of an existing "doc" column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.')};const fI=hw`
1421
1439
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1422
1440
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1423
1441
  success
@@ -1425,7 +1443,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1425
1443
  error
1426
1444
  }
1427
1445
  }
1428
- `,rI=hw`
1446
+ `,hI=hw`
1429
1447
  query getDocByObjectId($objectId: [ID!]) {
1430
1448
  docs(object_ids: $objectId) {
1431
1449
  id
@@ -1433,7 +1451,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1433
1451
  url
1434
1452
  }
1435
1453
  }
1436
- `,sI=hw`
1454
+ `,vI=hw`
1437
1455
  query getDocById($docId: [ID!]) {
1438
1456
  docs(ids: $docId) {
1439
1457
  id
@@ -1441,11 +1459,11 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1441
1459
  url
1442
1460
  }
1443
1461
  }
1444
- `,pI={doc_id:y.string().min(1).optional().describe("The document ID (the id field returned by read_docs). Provide this OR object_id. Takes priority if both are provided."),object_id:y.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id. Provide this OR doc_id."),markdown:y.string().describe("Markdown content to add to the document."),after_block_id:y.string().optional().describe("Block ID after which to insert the new content. If omitted, content is appended at the end. To insert at the beginning, pass the first block ID from read_docs. Block IDs can be obtained from read_docs or from a previous add_content_to_doc response.")};const dI=hw`
1462
+ `,bI={doc_id:y.string().min(1).optional().describe("The document ID (the id field returned by read_docs). Provide this OR object_id. Takes priority if both are provided."),object_id:y.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id. Provide this OR doc_id."),markdown:y.string().describe("Markdown content to add to the document."),after_block_id:y.string().optional().describe("Block ID after which to insert the new content. If omitted, content is appended at the end. To insert at the beginning, pass the first block ID from read_docs. Block IDs can be obtained from read_docs or from a previous add_content_to_doc response.")};const gI=hw`
1445
1463
  mutation updateDocName($docId: ID!, $name: String!) {
1446
1464
  update_doc_name(docId: $docId, name: $name)
1447
1465
  }
1448
- `,cI=hw`
1466
+ `,yI=hw`
1449
1467
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1450
1468
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1451
1469
  success
@@ -1453,13 +1471,13 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1453
1471
  error
1454
1472
  }
1455
1473
  }
1456
- `,lI=hw`
1474
+ `,_I=hw`
1457
1475
  query getDocIdByObjectId($objectId: [ID!]) {
1458
1476
  docs(object_ids: $objectId) {
1459
1477
  id
1460
1478
  }
1461
1479
  }
1462
- `,mI=hw`
1480
+ `,wI=hw`
1463
1481
  mutation updateDocBlock($blockId: String!, $content: JSON!) {
1464
1482
  update_doc_block(block_id: $blockId, content: $content) {
1465
1483
  id
@@ -1467,20 +1485,20 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1467
1485
  created_at
1468
1486
  }
1469
1487
  }
1470
- `,uI=hw`
1488
+ `,xI=hw`
1471
1489
  mutation deleteDocBlock($blockId: String!) {
1472
1490
  delete_doc_block(block_id: $blockId) {
1473
1491
  id
1474
1492
  }
1475
1493
  }
1476
- `,fI=hw`
1494
+ `,TI=hw`
1477
1495
  query getDocObjectIdByDocId($docId: [ID!]) {
1478
1496
  docs(ids: $docId) {
1479
1497
  id
1480
1498
  object_id
1481
1499
  }
1482
1500
  }
1483
- `,hI=hw`
1501
+ `,EI=hw`
1484
1502
  query getDocBoardItem($boardId: ID!) {
1485
1503
  boards(ids: [$boardId]) {
1486
1504
  items_page(limit: 1) {
@@ -1490,7 +1508,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1490
1508
  }
1491
1509
  }
1492
1510
  }
1493
- `,vI=hw`
1511
+ `,II=hw`
1494
1512
  query getDocBlockContent($docId: [ID!]) {
1495
1513
  docs(ids: $docId) {
1496
1514
  blocks {
@@ -1500,7 +1518,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1500
1518
  }
1501
1519
  }
1502
1520
  }
1503
- `,bI=hw`
1521
+ `,SI=hw`
1504
1522
  mutation createDocComment($itemId: ID!, $body: String!, $parentId: ID, $mentionsList: [UpdateMention]) {
1505
1523
  create_update(body: $body, item_id: $itemId, parent_id: $parentId, mentions_list: $mentionsList) {
1506
1524
  id
@@ -1508,7 +1526,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1508
1526
  created_at
1509
1527
  }
1510
1528
  }
1511
- `,gI=hw`
1529
+ `,NI=hw`
1512
1530
  mutation createDocBlocks($docId: ID!, $afterBlockId: String, $blocksInput: [CreateBlockInput!]!) {
1513
1531
  create_doc_blocks(docId: $docId, afterBlockId: $afterBlockId, blocksInput: $blocksInput) {
1514
1532
  id
@@ -1576,7 +1594,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1576
1594
  }
1577
1595
  }
1578
1596
  }
1579
- `;function yI(e){if(e)return e}function _I(e){if(e)return e}function wI(e){if(e)return{bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,code:e.code,link:e.link,color:e.color,background:e.background}}function xI(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{blot:{mention:{id:String(t),type:e.insert.mention.type}}}}}return"column_value"in e.insert?{insert:{blot:{column_value:{item_id:String(e.insert.column_value.item_id),column_id:e.insert.column_value.column_id}}}}:{insert:{text:e.insert.text},attributes:wI(e.attributes)}}))}function TI(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{mention:{id:t,type:e.insert.mention.type}}}}return"column_value"in e.insert?{insert:{macro:{type:"COLUMN_VALUE",macroId:m(),macroData:{itemId:Number(e.insert.column_value.item_id),columnId:e.insert.column_value.column_id}}}}:{insert:e.insert.text,attributes:wI(e.attributes)}}))}function EI(e,t){const a=e.attributes||{},i=a.comments||[];return{...e,attributes:{...a,comments:[...i,t]}}}function II(e,t,a,i){const n=a+i;let o=0;const r=[];for(const i of e){const e=i.insert;if(null==e)throw new Error(`Unexpected delta op at position ${o}: op has no 'insert' field. Block content may be from an unsupported block type.`);const s=o,p=s+("string"==typeof e?e.length:1),d=Math.max(s,a),c=Math.min(p,n);d>=c?r.push(i):"string"!=typeof e?r.push(EI(i,t)):(d>s&&r.push({...i,insert:e.slice(0,d-s)}),r.push(EI({...i,insert:e.slice(d-s,c-s)},t)),c<p&&r.push({...i,insert:e.slice(c-s)})),o=p}return r}const SI=y.object({bold:y.boolean().optional(),italic:y.boolean().optional(),underline:y.boolean().optional(),strike:y.boolean().optional(),code:y.boolean().optional(),link:y.string().optional(),color:y.string().optional(),background:y.string().optional()}).optional(),NI=y.object({mention:y.object({id:y.union([y.string(),y.number()]).describe("User, doc, or board ID. Get user IDs from list_users_and_teams."),type:y.enum(["USER","DOC","BOARD"]).default("USER").describe("Mention type. USER is most common.")}).describe("Mention blot — tags a user, doc, or board inline. Do not set attributes on mention ops.")}),AI=y.object({column_value:y.object({item_id:y.union([y.string(),y.number()]).describe("The board item ID."),column_id:y.string().describe('The column ID (e.g. "status", "date4"). Get column IDs from get_board_schema.')}).describe("Column value blot — embeds a live board column value inline in the doc.")}),DI=y.object({insert:y.union([y.object({text:y.string()}),NI,AI]).describe('Content to insert. Use {text: "..."} for plain text, {mention: {id, type}} to tag a user/doc/board, or {column_value: {item_id, column_id}} to embed a live column value. The last operation in the array must be {text: "\\n"}.'),attributes:SI.describe("Optional formatting: bold, italic, underline, strike, code, link, color, background. Not applicable to mention or column_value ops.")}),kI=y.object({block_content_type:y.literal("text"),delta_format:y.array(DI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:y.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:y.enum(["LTR","RTL"]).optional()}),OI=y.object({block_content_type:y.literal("code"),delta_format:y.array(DI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:y.string().optional().describe('Programming language (e.g. "javascript", "python").')}),RI=y.object({block_content_type:y.literal("list_item"),delta_format:y.array(DI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),checked:y.boolean().optional().describe("Check state for CHECK_LIST items."),indentation:y.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),CI=y.discriminatedUnion("block_content_type",[kI,OI,RI]),$I=y.object({block_type:y.literal("text"),text_block_type:y.enum(["NORMAL_TEXT","LARGE_TITLE","MEDIUM_TITLE","SMALL_TITLE","QUOTE"]).optional().describe("Block subtype. LARGE_TITLE=H1, MEDIUM_TITLE=H2, SMALL_TITLE=H3."),delta_format:y.array(DI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:y.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:y.enum(["LTR","RTL"]).optional()}),LI=y.object({block_type:y.literal("list_item"),list_block_type:y.enum(["BULLETED_LIST","NUMBERED_LIST","CHECK_LIST"]).optional().describe("List type. Defaults to BULLETED_LIST."),delta_format:y.array(DI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),indentation:y.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),FI=y.object({block_type:y.literal("code"),delta_format:y.array(DI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:y.string().optional().describe('Programming language (e.g. "javascript", "python").')}),PI=y.object({block_type:y.literal("divider")}),jI=y.object({block_type:y.literal("page_break")}),UI=y.object({block_type:y.literal("image"),public_url:y.string().url().optional().describe("Publicly accessible image URL. Provide either public_url or asset_id."),asset_id:y.union([y.number().int(),y.string().regex(/^\d+$/).transform(Number)]).optional().describe("monday.com asset ID for the image. The image block will reference the asset directly. Provide either public_url or asset_id."),width:y.number().int().min(1).optional().describe("Width in pixels.")}),VI=y.object({block_type:y.literal("video"),raw_url:y.string().url().describe("Video URL (YouTube, Vimeo, or direct video URL)."),width:y.number().int().min(1).optional().describe("Width in pixels.")}),BI=y.object({block_type:y.literal("notice_box"),theme:y.enum(["INFO","TIPS","WARNING","GENERAL"]).describe("Visual style of the notice box.")}),MI=y.object({block_type:y.literal("table"),row_count:y.number().int().min(1).max(25).describe("Number of rows (1–25)."),column_count:y.number().int().min(1).max(10).describe("Number of columns (1–10)."),width:y.number().int().optional().describe("Table width in pixels."),column_style:y.array(y.object({width:y.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),qI=y.object({block_type:y.literal("layout"),column_count:y.number().int().min(2).max(6).describe("Number of columns (2–6)."),column_style:y.array(y.object({width:y.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),GI=y.discriminatedUnion("block_type",[$I,LI,FI,PI,jI,UI,VI,BI,MI,qI]),HI=y.object({operation_type:y.literal("set_name"),name:y.string().min(1).describe("New document name.")}),WI=y.object({operation_type:y.literal("add_markdown_content"),markdown:y.string().describe("Markdown content to convert and append (or insert) as blocks."),after_block_id:y.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs.")}),zI=y.object({operation_type:y.literal("update_block"),block_id:y.string().describe("ID of the block to update. Get block IDs from read_docs."),content:CI.describe("New content for the block. Use block_content_type to select: text (updates text/heading/quote content), code (updates code content), list_item (updates bullets/numbered/todo content). Cannot change block subtype — use replace_block for that.")}),YI=y.object({operation_type:y.literal("create_block"),after_block_id:y.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs."),parent_block_id:y.string().optional().describe("Parent block ID for nested blocks. Only works for notice_box containers — use the notice_box block ID directly. Table/layout cell nesting is NOT supported by the API. IMPORTANT: A notice_box created in the same call cannot be referenced — use a separate call first to create it, then a second call to nest content inside it."),block:GI.describe("The block to create. Use block_type to select the block type.")}),KI=y.object({operation_type:y.literal("delete_block"),block_id:y.string().describe("ID of the block to permanently delete. Works for all block types including BOARD, WIDGET, DOC embed, GIPHY.")}),QI=y.object({operation_type:y.literal("replace_block"),block_id:y.string().describe("ID of the block to delete."),after_block_id:y.string().optional().describe("Insert replacement after this block ID. Provide the ID of the block that precedes the deleted block."),parent_block_id:y.string().optional().describe("Parent block ID for the replacement block."),block:GI.describe("The new block to create in place of the deleted one.")}),JI=y.object({operation_type:y.literal("add_comment"),body:y.string().min(1).describe("The comment text. Use HTML tags for formatting (not markdown). Do not use @ to mention users — use mentions_list instead."),parent_update_id:y.number().optional().describe("The ID of an existing comment (update) to reply to. Omit to create a new top-level comment. Get comment IDs from read_docs with include_comments: true."),mentions_list:y.string().optional().describe('Optional JSON array of mentions: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types: User, Team, Board, Project.'),block_id:y.union([y.string(),y.array(y.string()).min(1)]).optional().describe("Block ID (string) or array of block IDs to anchor the comment to. When an array is provided, the same comment highlights all specified blocks. Only works on text-content blocks (text, code, list_item, title, quote) — not on divider, table, layout, notice_box, image, video, or giphy. Get block IDs from read_docs with include_blocks: true. Omit to create a general doc-level comment. Pair with selection_from + selection_length (single block_id only) to comment on a specific text range."),selection_from:y.number().int().min(0).optional().describe("Start character offset (0-indexed) of the selected text within the block. Requires block_id. Omit to comment on the entire block."),selection_length:y.number().int().min(1).optional().describe("Number of characters in the text selection. Requires block_id and selection_from. Only works for text, code, and list_item blocks that have a delta format.")}),XI=y.discriminatedUnion("operation_type",[HI,WI,zI,YI,KI,QI,JI]),ZI={doc_id:y.string().min(1).optional().describe("The document ID (the id field from read_docs). Takes priority over object_id if both are provided."),object_id:y.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, visible in the document URL). Resolved to doc_id."),operations:y.array(XI).min(1).max(25).describe('Ordered list of operations to perform. Executed sequentially. Stops at first failure.\n\nOperation types:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (simplest for text/lists/tables).\n- update_block: Change content of an existing text/code/list/divider block.\n- create_block: Create a new block at a specific position (supports text, list_item, code, divider, page_break, image, video, notice_box, table, layout).\n- delete_block: Permanently remove a block. Works for ALL block types including BOARD, WIDGET, DOC embed, GIPHY.\n- replace_block: Delete a block and create a new one in its place. Use for: changing image/video source, table restructure, notice_box theme change.\n- add_comment: Create a new comment or reply on the document. Use parent_update_id to reply to an existing comment. Format text with HTML. Uses the doc\'s backing board item.\n\nWHEN TO USE WHICH:\n- Adding new text sections → add_markdown_content\n- Adding asset-based images → create_block with block_type "image" and asset_id (add_markdown_content does NOT support asset images)\n- Mixed content with asset images → alternate add_markdown_content (for text) and create_block (for each image) in sequence\n- Editing existing text block → update_block\n- Changing an image URL → replace_block (image URL is immutable after creation)\n- Changing video URL → replace_block\n- Restructuring a table → replace_block\n- BOARD/WIDGET/DOC/GIPHY blocks → delete_block only (no public API to create these)\n\nNESTING CONTENT IN CONTAINERS:\n- notice_box: Fully supported. Create the notice_box first, then in a separate call create child blocks with parent_block_id set to the notice_box ID. You cannot reference a block ID created in the same call.\n- table: Cell-level API nesting is NOT supported. To create a table with content, use add_markdown_content with a markdown table (e.g. "| H1 | H2 |\\n| --- | --- |\\n| A | B |"). This creates a pre-populated table in one shot. Empty tables created via create_block cannot have their cells populated through the API.\n- layout: Cell-level API nesting is NOT supported and there is no markdown equivalent. Layouts can only be created empty via create_block. No workaround exists to populate layout columns through the API.\nDeleting a container does NOT delete its children — delete children first for clean removal.\n\nBlock IDs are available in the blocks array returned by read_docs.')};const eS=hw`
1597
+ `;function AI(e){if(e)return e}function DI(e){if(e)return e}function kI(e){if(e)return{bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,code:e.code,link:e.link,color:e.color,background:e.background}}function OI(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{blot:{mention:{id:String(t),type:e.insert.mention.type}}}}}return"column_value"in e.insert?{insert:{blot:{column_value:{item_id:String(e.insert.column_value.item_id),column_id:e.insert.column_value.column_id}}}}:{insert:{text:e.insert.text},attributes:kI(e.attributes)}}))}function RI(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{mention:{id:t,type:e.insert.mention.type}}}}return"column_value"in e.insert?{insert:{macro:{type:"COLUMN_VALUE",macroId:m(),macroData:{itemId:Number(e.insert.column_value.item_id),columnId:e.insert.column_value.column_id}}}}:{insert:e.insert.text,attributes:kI(e.attributes)}}))}function CI(e,t){const a=e.attributes||{},i=a.comments||[];return{...e,attributes:{...a,comments:[...i,t]}}}function $I(e,t,a,i){const n=a+i;let o=0;const r=[];for(const i of e){const e=i.insert;if(null==e)throw new Error(`Unexpected delta op at position ${o}: op has no 'insert' field. Block content may be from an unsupported block type.`);const s=o,p=s+("string"==typeof e?e.length:1),d=Math.max(s,a),c=Math.min(p,n);d>=c?r.push(i):"string"!=typeof e?r.push(CI(i,t)):(d>s&&r.push({...i,insert:e.slice(0,d-s)}),r.push(CI({...i,insert:e.slice(d-s,c-s)},t)),c<p&&r.push({...i,insert:e.slice(c-s)})),o=p}return r}const LI=y.object({bold:y.boolean().optional(),italic:y.boolean().optional(),underline:y.boolean().optional(),strike:y.boolean().optional(),code:y.boolean().optional(),link:y.string().optional(),color:y.string().optional(),background:y.string().optional()}).optional(),FI=y.object({mention:y.object({id:y.union([y.string(),y.number()]).describe("User, doc, or board ID. Get user IDs from list_users_and_teams."),type:y.enum(["USER","DOC","BOARD"]).default("USER").describe("Mention type. USER is most common.")}).describe("Mention blot — tags a user, doc, or board inline. Do not set attributes on mention ops.")}),PI=y.object({column_value:y.object({item_id:y.union([y.string(),y.number()]).describe("The board item ID."),column_id:y.string().describe('The column ID (e.g. "status", "date4"). Get column IDs from get_board_schema.')}).describe("Column value blot — embeds a live board column value inline in the doc.")}),jI=y.object({insert:y.union([y.object({text:y.string()}),FI,PI]).describe('Content to insert. Use {text: "..."} for plain text, {mention: {id, type}} to tag a user/doc/board, or {column_value: {item_id, column_id}} to embed a live column value. The last operation in the array must be {text: "\\n"}.'),attributes:LI.describe("Optional formatting: bold, italic, underline, strike, code, link, color, background. Not applicable to mention or column_value ops.")}),UI=y.object({block_content_type:y.literal("text"),delta_format:y.array(jI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:y.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:y.enum(["LTR","RTL"]).optional()}),VI=y.object({block_content_type:y.literal("code"),delta_format:y.array(jI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:y.string().optional().describe('Programming language (e.g. "javascript", "python").')}),BI=y.object({block_content_type:y.literal("list_item"),delta_format:y.array(jI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),checked:y.boolean().optional().describe("Check state for CHECK_LIST items."),indentation:y.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),MI=y.discriminatedUnion("block_content_type",[UI,VI,BI]),qI=y.object({block_type:y.literal("text"),text_block_type:y.enum(["NORMAL_TEXT","LARGE_TITLE","MEDIUM_TITLE","SMALL_TITLE","QUOTE"]).optional().describe("Block subtype. LARGE_TITLE=H1, MEDIUM_TITLE=H2, SMALL_TITLE=H3."),delta_format:y.array(jI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:y.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:y.enum(["LTR","RTL"]).optional()}),GI=y.object({block_type:y.literal("list_item"),list_block_type:y.enum(["BULLETED_LIST","NUMBERED_LIST","CHECK_LIST"]).optional().describe("List type. Defaults to BULLETED_LIST."),delta_format:y.array(jI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),indentation:y.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),HI=y.object({block_type:y.literal("code"),delta_format:y.array(jI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:y.string().optional().describe('Programming language (e.g. "javascript", "python").')}),WI=y.object({block_type:y.literal("divider")}),zI=y.object({block_type:y.literal("page_break")}),YI=y.object({block_type:y.literal("image"),public_url:y.string().url().optional().describe("Publicly accessible image URL. Provide either public_url or asset_id."),asset_id:y.union([y.number().int(),y.string().regex(/^\d+$/).transform(Number)]).optional().describe("monday.com asset ID for the image. The image block will reference the asset directly. Provide either public_url or asset_id."),width:y.number().int().min(1).optional().describe("Width in pixels.")}),KI=y.object({block_type:y.literal("video"),raw_url:y.string().url().describe("Video URL (YouTube, Vimeo, or direct video URL)."),width:y.number().int().min(1).optional().describe("Width in pixels.")}),QI=y.object({block_type:y.literal("notice_box"),theme:y.enum(["INFO","TIPS","WARNING","GENERAL"]).describe("Visual style of the notice box.")}),JI=y.object({block_type:y.literal("table"),row_count:y.number().int().min(1).max(25).describe("Number of rows (1–25)."),column_count:y.number().int().min(1).max(10).describe("Number of columns (1–10)."),width:y.number().int().optional().describe("Table width in pixels."),column_style:y.array(y.object({width:y.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),XI=y.object({block_type:y.literal("layout"),column_count:y.number().int().min(2).max(6).describe("Number of columns (2–6)."),column_style:y.array(y.object({width:y.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),ZI=y.discriminatedUnion("block_type",[qI,GI,HI,WI,zI,YI,KI,QI,JI,XI]),eS=y.object({operation_type:y.literal("set_name"),name:y.string().min(1).describe("New document name.")}),tS=y.object({operation_type:y.literal("add_markdown_content"),markdown:y.string().describe("Markdown content to convert and append (or insert) as blocks."),after_block_id:y.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs.")}),aS=y.object({operation_type:y.literal("update_block"),block_id:y.string().describe("ID of the block to update. Get block IDs from read_docs."),content:MI.describe("New content for the block. Use block_content_type to select: text (updates text/heading/quote content), code (updates code content), list_item (updates bullets/numbered/todo content). Cannot change block subtype — use replace_block for that.")}),iS=y.object({operation_type:y.literal("create_block"),after_block_id:y.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs."),parent_block_id:y.string().optional().describe("Parent block ID for nested blocks. Only works for notice_box containers — use the notice_box block ID directly. Table/layout cell nesting is NOT supported by the API. IMPORTANT: A notice_box created in the same call cannot be referenced — use a separate call first to create it, then a second call to nest content inside it."),block:ZI.describe("The block to create. Use block_type to select the block type.")}),nS=y.object({operation_type:y.literal("delete_block"),block_id:y.string().describe("ID of the block to permanently delete. Works for all block types including BOARD, WIDGET, DOC embed, GIPHY.")}),oS=y.object({operation_type:y.literal("replace_block"),block_id:y.string().describe("ID of the block to delete."),after_block_id:y.string().optional().describe("Insert replacement after this block ID. Provide the ID of the block that precedes the deleted block."),parent_block_id:y.string().optional().describe("Parent block ID for the replacement block."),block:ZI.describe("The new block to create in place of the deleted one.")}),rS=y.object({operation_type:y.literal("add_comment"),body:y.string().min(1).describe("The comment text. Use HTML tags for formatting (not markdown). Do not use @ to mention users — use mentions_list instead."),parent_update_id:y.number().optional().describe("The ID of an existing comment (update) to reply to. Omit to create a new top-level comment. Get comment IDs from read_docs with include_comments: true."),mentions_list:y.string().optional().describe('Optional JSON array of mentions: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types: User, Team, Board, Project.'),block_id:y.union([y.string(),y.array(y.string()).min(1)]).optional().describe("Block ID (string) or array of block IDs to anchor the comment to. When an array is provided, the same comment highlights all specified blocks. Only works on text-content blocks (text, code, list_item, title, quote) — not on divider, table, layout, notice_box, image, video, or giphy. Get block IDs from read_docs with include_blocks: true. Omit to create a general doc-level comment. Pair with selection_from + selection_length (single block_id only) to comment on a specific text range."),selection_from:y.number().int().min(0).optional().describe("Start character offset (0-indexed) of the selected text within the block. Requires block_id. Omit to comment on the entire block."),selection_length:y.number().int().min(1).optional().describe("Number of characters in the text selection. Requires block_id and selection_from. Only works for text, code, and list_item blocks that have a delta format.")}),sS=y.discriminatedUnion("operation_type",[eS,tS,aS,iS,nS,oS,rS]),pS={doc_id:y.string().min(1).optional().describe("The document ID (the id field from read_docs). Takes priority over object_id if both are provided."),object_id:y.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, visible in the document URL). Resolved to doc_id."),operations:y.array(sS).min(1).max(25).describe('Ordered list of operations to perform. Executed sequentially. Stops at first failure.\n\nOperation types:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (simplest for text/lists/tables).\n- update_block: Change content of an existing text/code/list/divider block.\n- create_block: Create a new block at a specific position (supports text, list_item, code, divider, page_break, image, video, notice_box, table, layout).\n- delete_block: Permanently remove a block. Works for ALL block types including BOARD, WIDGET, DOC embed, GIPHY.\n- replace_block: Delete a block and create a new one in its place. Use for: changing image/video source, table restructure, notice_box theme change.\n- add_comment: Create a new comment or reply on the document. Use parent_update_id to reply to an existing comment. Format text with HTML. Uses the doc\'s backing board item.\n\nWHEN TO USE WHICH:\n- Adding new text sections → add_markdown_content\n- Adding asset-based images → create_block with block_type "image" and asset_id (add_markdown_content does NOT support asset images)\n- Mixed content with asset images → alternate add_markdown_content (for text) and create_block (for each image) in sequence\n- Editing existing text block → update_block\n- Changing an image URL → replace_block (image URL is immutable after creation)\n- Changing video URL → replace_block\n- Restructuring a table → replace_block\n- BOARD/WIDGET/DOC/GIPHY blocks → delete_block only (no public API to create these)\n\nNESTING CONTENT IN CONTAINERS:\n- notice_box: Fully supported. Create the notice_box first, then in a separate call create child blocks with parent_block_id set to the notice_box ID. You cannot reference a block ID created in the same call.\n- table: Cell-level API nesting is NOT supported. To create a table with content, use add_markdown_content with a markdown table (e.g. "| H1 | H2 |\\n| --- | --- |\\n| A | B |"). This creates a pre-populated table in one shot. Empty tables created via create_block cannot have their cells populated through the API.\n- layout: Cell-level API nesting is NOT supported and there is no markdown equivalent. Layouts can only be created empty via create_block. No workaround exists to populate layout columns through the API.\nDeleting a container does NOT delete its children — delete children first for clean removal.\n\nBlock IDs are available in the blocks array returned by read_docs.')};const dS=hw`
1580
1598
  mutation CreateDashboard(
1581
1599
  $name: String!
1582
1600
  $workspace_id: ID!
@@ -1598,14 +1616,14 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1598
1616
  board_folder_id
1599
1617
  }
1600
1618
  }
1601
- `,tS=hw`
1619
+ `,cS=hw`
1602
1620
  query GetAllWidgetsSchema {
1603
1621
  all_widgets_schema {
1604
1622
  widget_type
1605
1623
  schema
1606
1624
  }
1607
1625
  }
1608
- `,aS=hw`
1626
+ `,lS=hw`
1609
1627
  mutation CreateWidget($parent: WidgetParentInput!, $kind: ExternalWidget!, $name: String!, $settings: JSON!) {
1610
1628
  create_widget(parent: $parent, kind: $kind, name: $name, settings: $settings) {
1611
1629
  id
@@ -1617,14 +1635,14 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1617
1635
  }
1618
1636
  }
1619
1637
  }
1620
- `,iS={name:y.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:y.string().describe("ID of the workspace that will own the dashboard"),board_ids:y.array(y.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:y.nativeEnum(cg).default(cg.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:y.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const nS={parent_container_id:y.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:y.nativeEnum(Hy).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:y.nativeEnum(wg).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:y.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:y.record(y.unknown()).optional().describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const oS=hw`
1638
+ `,mS={name:y.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:y.string().describe("ID of the workspace that will own the dashboard"),board_ids:y.array(y.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:y.nativeEnum(cg).default(cg.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:y.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const uS={parent_container_id:y.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:y.nativeEnum(Hy).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:y.nativeEnum(wg).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:y.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:y.record(y.unknown()).optional().describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const fS=hw`
1621
1639
  mutation updateWorkspace($id: ID!, $attributes: UpdateWorkspaceAttributesInput!) {
1622
1640
  update_workspace(id: $id, attributes: $attributes) {
1623
1641
  id
1624
1642
  name
1625
1643
  }
1626
1644
  }
1627
- `,rS={id:y.string().describe("The ID of the workspace to update"),attributeAccountProductId:y.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:y.string().optional().describe("The description of the workspace to update"),attributeKind:y.nativeEnum(Wy).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:y.string().optional().describe("The name of the workspace to update")};const sS=hw`
1645
+ `,hS={id:y.string().describe("The ID of the workspace to update"),attributeAccountProductId:y.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:y.string().optional().describe("The description of the workspace to update"),attributeKind:y.nativeEnum(Wy).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:y.string().optional().describe("The name of the workspace to update")};const vS=hw`
1628
1646
  mutation updateFolder(
1629
1647
  $folderId: ID!
1630
1648
  $name: String
@@ -1651,7 +1669,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1651
1669
  name
1652
1670
  }
1653
1671
  }
1654
- `,pS={folderId:y.string().describe("The ID of the folder to update"),name:y.string().optional().describe("The new name of the folder"),color:y.nativeEnum(Ig).optional().describe("The new color of the folder"),fontWeight:y.nativeEnum(Ng).optional().describe("The new font weight of the folder"),customIcon:y.nativeEnum(Sg).optional().describe("The new custom icon of the folder"),parentFolderId:y.string().optional().describe("The ID of the new parent folder"),workspaceId:y.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:y.string().optional().describe("The account product ID associated with the folder"),position_object_id:y.string().optional().describe("The ID of the object to position the folder relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:y.nativeEnum(ry).optional().describe("The type of object to position the folder relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:y.boolean().optional().describe("Whether to position the folder after the object")};const dS=hw`
1672
+ `,bS={folderId:y.string().describe("The ID of the folder to update"),name:y.string().optional().describe("The new name of the folder"),color:y.nativeEnum(Ig).optional().describe("The new color of the folder"),fontWeight:y.nativeEnum(Ng).optional().describe("The new font weight of the folder"),customIcon:y.nativeEnum(Sg).optional().describe("The new custom icon of the folder"),parentFolderId:y.string().optional().describe("The ID of the new parent folder"),workspaceId:y.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:y.string().optional().describe("The account product ID associated with the folder"),position_object_id:y.string().optional().describe("The ID of the object to position the folder relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:y.nativeEnum(ry).optional().describe("The type of object to position the folder relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:y.boolean().optional().describe("Whether to position the folder after the object")};const gS=hw`
1655
1673
  mutation createWorkspace(
1656
1674
  $name: String!
1657
1675
  $workspaceKind: WorkspaceKind!
@@ -1668,7 +1686,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1668
1686
  name
1669
1687
  }
1670
1688
  }
1671
- `,cS={name:y.string().describe("The name of the new workspace to be created"),workspaceKind:y.nativeEnum(Wy).describe("The kind of workspace to create"),description:y.string().optional().describe("The description of the new workspace"),accountProductId:y.string().optional().describe("The account product ID associated with the workspace")};const lS=hw`
1689
+ `,yS={name:y.string().describe("The name of the new workspace to be created"),workspaceKind:y.nativeEnum(Wy).describe("The kind of workspace to create"),description:y.string().optional().describe("The description of the new workspace"),accountProductId:y.string().optional().describe("The account product ID associated with the workspace")};const _S=hw`
1672
1690
  mutation createFolder(
1673
1691
  $workspaceId: ID!
1674
1692
  $name: String!
@@ -1689,7 +1707,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1689
1707
  name
1690
1708
  }
1691
1709
  }
1692
- `,mS={workspaceId:y.string().describe("The ID of the workspace where the folder will be created"),name:y.string().describe("The name of the folder to be created"),color:y.nativeEnum(Ig).optional().describe("The color of the folder"),fontWeight:y.nativeEnum(Ng).optional().describe("The font weight of the folder"),customIcon:y.nativeEnum(Sg).optional().describe("The custom icon of the folder"),parentFolderId:y.string().optional().describe("The ID of the parent folder")};const uS=hw`
1710
+ `,wS={workspaceId:y.string().describe("The ID of the workspace where the folder will be created"),name:y.string().describe("The name of the folder to be created"),color:y.nativeEnum(Ig).optional().describe("The color of the folder"),fontWeight:y.nativeEnum(Ng).optional().describe("The font weight of the folder"),customIcon:y.nativeEnum(Sg).optional().describe("The custom icon of the folder"),parentFolderId:y.string().optional().describe("The ID of the parent folder")};const xS=hw`
1693
1711
  mutation updateBoardHierarchy($boardId: ID!, $attributes: UpdateBoardHierarchyAttributesInput!) {
1694
1712
  update_board_hierarchy(board_id: $boardId, attributes: $attributes) {
1695
1713
  success
@@ -1699,7 +1717,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1699
1717
  }
1700
1718
  }
1701
1719
  }
1702
- `,fS=hw`
1720
+ `,TS=hw`
1703
1721
  mutation updateOverviewHierarchy($overviewId: ID!, $attributes: UpdateOverviewHierarchyAttributesInput!) {
1704
1722
  update_overview_hierarchy(overview_id: $overviewId, attributes: $attributes) {
1705
1723
  success
@@ -1709,7 +1727,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1709
1727
  }
1710
1728
  }
1711
1729
  }
1712
- `,hS={objectType:y.nativeEnum(ry).describe("The type of object to move"),id:y.string().describe("The ID of the object to move"),position_object_id:y.string().optional().describe("The ID of the object to position the object relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:y.nativeEnum(ry).optional().describe("The type of object to position the object relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:y.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:y.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:y.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:y.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const vS=hw`
1730
+ `,ES={objectType:y.nativeEnum(ry).describe("The type of object to move"),id:y.string().describe("The ID of the object to move"),position_object_id:y.string().optional().describe("The ID of the object to position the object relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:y.nativeEnum(ry).optional().describe("The type of object to position the object relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:y.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:y.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:y.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:y.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const IS=hw`
1713
1731
  query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {
1714
1732
  boards(ids: [$boardId]) {
1715
1733
  name
@@ -1731,7 +1749,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1731
1749
  }
1732
1750
  }
1733
1751
  }
1734
- `,bS=new Set([Db.Case,Db.Between,Db.Left,Db.Raw,Db.None,Db.CountKeys]),gS=Object.values(Db).filter((e=>!bS.has(e))),yS=new Set([Db.Left,Db.Trim,Db.Upper,Db.Lower,Db.DateTruncDay,Db.DateTruncWeek,Db.DateTruncMonth,Db.DateTruncQuarter,Db.DateTruncYear,Db.Color,Db.Label,Db.EndDate,Db.StartDate,Db.Hour,Db.PhoneCountryShortName,Db.Person,Db.Upper,Db.Lower,Db.Order,Db.Length,Db.Flatten,Db.IsDone]);function _S(e){return{column_id:e}}new Set([Db.Count,Db.CountDistinct,Db.CountSubitems,Db.CountItems,Db.First,Db.Sum,Db.Average,Db.Median,Db.Min,Db.Max,Db.MinMax]);const wS={boardId:y.number().describe("The id of the board to get insights for"),aggregations:y.array(y.object({function:y.enum(gS).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:y.string().describe("The id of the column to aggregate")})).describe('The aggregations to get. Before sending the aggregations, use get_board_info tool to check "aggregationGuidelines" key for information. Transformative functions and plain columns (no function) must be in group by.').optional(),groupBy:y.array(y.string()).describe("The columns to group by. All columns in the group by must be in the aggregations as well without a function.").optional(),limit:y.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:HT,filtersOperator:WT,orderBy:y.array(y.object({columnId:y.string().describe("The id of the column to order by"),direction:y.nativeEnum(Wg).optional().default(Wg.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};const xS=hw`
1752
+ `,SS=new Set([Db.Case,Db.Between,Db.Left,Db.Raw,Db.None,Db.CountKeys]),NS=Object.values(Db).filter((e=>!SS.has(e))),AS=new Set([Db.Left,Db.Trim,Db.Upper,Db.Lower,Db.DateTruncDay,Db.DateTruncWeek,Db.DateTruncMonth,Db.DateTruncQuarter,Db.DateTruncYear,Db.Color,Db.Label,Db.EndDate,Db.StartDate,Db.Hour,Db.PhoneCountryShortName,Db.Person,Db.Upper,Db.Lower,Db.Order,Db.Length,Db.Flatten,Db.IsDone]);function DS(e){return{column_id:e}}new Set([Db.Count,Db.CountDistinct,Db.CountSubitems,Db.CountItems,Db.First,Db.Sum,Db.Average,Db.Median,Db.Min,Db.Max,Db.MinMax]);const kS={boardId:y.number().describe("The id of the board to get insights for"),aggregations:y.array(y.object({function:y.enum(NS).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:y.string().describe("The id of the column to aggregate")})).describe('The aggregations to get. Before sending the aggregations, use get_board_info tool to check "aggregationGuidelines" key for information. Transformative functions and plain columns (no function) must be in group by.').optional(),groupBy:y.array(y.string()).describe("The columns to group by. All columns in the group by must be in the aggregations as well without a function.").optional(),limit:y.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:eE,filtersOperator:tE,orderBy:y.array(y.object({columnId:y.string().describe("The id of the column to order by"),direction:y.nativeEnum(Wg).optional().default(Wg.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};const OS=hw`
1735
1753
  query GetBoards($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1736
1754
  boards(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1737
1755
  id
@@ -1739,7 +1757,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1739
1757
  url
1740
1758
  }
1741
1759
  }
1742
- `,TS=hw`
1760
+ `,RS=hw`
1743
1761
  query GetDocs($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1744
1762
  docs(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1745
1763
  id
@@ -1747,14 +1765,14 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1747
1765
  url
1748
1766
  }
1749
1767
  }
1750
- `,ES=hw`
1768
+ `,CS=hw`
1751
1769
  query GetFolders($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1752
1770
  folders(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1753
1771
  id
1754
1772
  name
1755
1773
  }
1756
1774
  }
1757
- `,IS=hw`
1775
+ `,$S=hw`
1758
1776
  query SearchDev($query: String!, $limit: Int!, $filters: SearchFiltersInput!) {
1759
1777
  cross_entity_search(query: $query, limit: $limit, filters: $filters) {
1760
1778
  __typename
@@ -1775,14 +1793,14 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1775
1793
  }
1776
1794
  }
1777
1795
  }
1778
- `,SS=100,NS={searchTerm:y.string().optional().describe("The search term to use for the search."),searchType:y.nativeEnum(sE).describe("The type of search to perform."),limit:y.number().max(SS).optional().default(SS).describe("The number of items to get. The max and default value is 100."),page:y.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:y.array(y.number()).optional().describe("The ids of the workspaces to search in. [IMPORTANT] Only pass this param if user explicitly asked to search within specific workspaces.")};const AS=y.object({id:y.string().describe("The ID of the entity to mention"),type:y.nativeEnum(ty).describe("The type of mention: User, Team, Board, or Project")}),DS=y.array(AS),kS={itemId:y.number().describe("The id of the item to which the update will be added"),body:y.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:y.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project')};const OS=hw`
1796
+ `,LS=100,FS={searchTerm:y.string().optional().describe("The search term to use for the search."),searchType:y.nativeEnum(vE).describe("The type of search to perform."),limit:y.number().max(LS).optional().default(LS).describe("The number of items to get. The max and default value is 100."),page:y.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:y.array(y.number()).optional().describe("The ids of the workspaces to search in. [IMPORTANT] Only pass this param if user explicitly asked to search within specific workspaces.")};const PS=y.object({id:y.string().describe("The ID of the entity to mention"),type:y.nativeEnum(ty).describe("The type of mention: User, Team, Board, or Project")}),jS=y.array(PS),US={itemId:y.number().describe("The id of the item to which the update will be added"),body:y.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:y.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project')};const VS=hw`
1779
1797
  mutation updateAssetsOnItem($boardId: ID!, $itemId: ID!, $columnId: String!, $files: [FileInput!]!) {
1780
1798
  update_assets_on_item(board_id: $boardId, item_id: $itemId, column_id: $columnId, files: $files) {
1781
1799
  id
1782
1800
  name
1783
1801
  }
1784
1802
  }
1785
- `,RS=y.object({fileType:y.enum(["google_drive","dropbox","box","onedrive","link","asset","doc"]).describe('The type of file: "asset" for uploaded files (requires assetId), "doc" for monday docs (requires objectId), "link" for generic links, "google_drive", "dropbox", "box", "onedrive" for cloud storage links (all link types require linkToFile)'),name:y.string().describe("File display name"),linkToFile:y.string().optional().describe("File link URL. Required for link, google_drive, dropbox, box, and onedrive file types"),assetId:y.number().optional().describe("The asset's ID. Required when fileType is 'asset'"),objectId:y.number().optional().describe("The doc's ID. Required when fileType is 'doc'")}),CS={boardId:y.string().describe("The board's unique identifier"),itemId:y.string().describe("The item's unique identifier"),columnId:y.string().describe("The file or doc column's unique identifier"),files:y.array(RS).describe("Array of file values to set on the column")};const $S=hw`
1803
+ `,BS=y.object({fileType:y.enum(["google_drive","dropbox","box","onedrive","link","asset","doc"]).describe('The type of file: "asset" for uploaded files (requires assetId), "doc" for monday docs (requires objectId), "link" for generic links, "google_drive", "dropbox", "box", "onedrive" for cloud storage links (all link types require linkToFile)'),name:y.string().describe("File display name"),linkToFile:y.string().optional().describe("File link URL. Required for link, google_drive, dropbox, box, and onedrive file types"),assetId:y.number().optional().describe("The asset's ID. Required when fileType is 'asset'"),objectId:y.number().optional().describe("The doc's ID. Required when fileType is 'doc'")}),MS={boardId:y.string().describe("The board's unique identifier"),itemId:y.string().describe("The item's unique identifier"),columnId:y.string().describe("The file or doc column's unique identifier"),files:y.array(BS).describe("Array of file values to set on the column")};const qS=hw`
1786
1804
  query getUserContext {
1787
1805
  me {
1788
1806
  id
@@ -1810,7 +1828,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1810
1828
  }
1811
1829
  }
1812
1830
  }
1813
- `,LS=hw`
1831
+ `,GS=hw`
1814
1832
  query getFavoriteDetails(
1815
1833
  $boardIds: [ID!]
1816
1834
  $folderIds: [ID!]
@@ -1834,7 +1852,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1834
1852
  name
1835
1853
  }
1836
1854
  }
1837
- `,FS={[Bg.Board]:"boardIds",[Bg.Folder]:"folderIds",[Bg.Workspace]:"workspaceIds",[Bg.Dashboard]:"dashboardIds"},PS={[Bg.Board]:"boards",[Bg.Folder]:"folders",[Bg.Workspace]:"workspaces",[Bg.Dashboard]:"dashboards"};const jS=hw`
1855
+ `,HS={[Bg.Board]:"boardIds",[Bg.Folder]:"folderIds",[Bg.Workspace]:"workspaceIds",[Bg.Dashboard]:"dashboardIds"},WS={[Bg.Board]:"boards",[Bg.Folder]:"folders",[Bg.Workspace]:"workspaces",[Bg.Dashboard]:"dashboards"};const zS=hw`
1838
1856
  query GetNotetakerMeetings(
1839
1857
  $limit: Int
1840
1858
  $cursor: String
@@ -1887,13 +1905,13 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1887
1905
  }
1888
1906
  }
1889
1907
  }
1890
- `,US={ids:y.array(y.string()).optional().describe("Filter by specific meeting IDs. Use this to fetch one or more specific meetings in a single call."),access:y.enum(["OWN","SHARED_WITH_ME","SHARED_WITH_ACCOUNT","ALL"]).optional().default("OWN").describe("Filter meetings by access level. OWN: meetings the user participated in or invited the bot to. SHARED_WITH_ME: meetings shared with the user or their team. SHARED_WITH_ACCOUNT: meetings shared with the entire account. ALL: all meetings the user has access to."),limit:y.number().min(1).max(100).optional().default(25).describe("Maximum number of notetaker meetings to return per page (1-100)."),cursor:y.string().optional().describe("Cursor for pagination. Use cursor from the previous page_info to fetch the next page."),search:y.string().optional().describe("Search notetaker meetings by title, participant name, or email."),include_summary:y.boolean().optional().default(!1).describe("Whether to include the AI-generated summary for each meeting."),include_topics:y.boolean().optional().default(!1).describe("Whether to include discussion topics and talking points for each meeting."),include_action_items:y.boolean().optional().default(!1).describe("Whether to include action items for each meeting."),include_transcript:y.boolean().optional().default(!1).describe("Whether to include the full transcript for each meeting. Transcripts can be very large.")};const VS=hw`
1908
+ `,YS={ids:y.array(y.string()).optional().describe("Filter by specific meeting IDs. Use this to fetch one or more specific meetings in a single call."),access:y.enum(["OWN","SHARED_WITH_ME","SHARED_WITH_ACCOUNT","ALL"]).optional().default("OWN").describe("Filter meetings by access level. OWN: meetings the user participated in or invited the bot to. SHARED_WITH_ME: meetings shared with the user or their team. SHARED_WITH_ACCOUNT: meetings shared with the entire account. ALL: all meetings the user has access to."),limit:y.number().min(1).max(100).optional().default(25).describe("Maximum number of notetaker meetings to return per page (1-100)."),cursor:y.string().optional().describe("Cursor for pagination. Use cursor from the previous page_info to fetch the next page."),search:y.string().optional().describe("Search notetaker meetings by title, participant name, or email."),include_summary:y.boolean().optional().default(!1).describe("Whether to include the AI-generated summary for each meeting."),include_topics:y.boolean().optional().default(!1).describe("Whether to include discussion topics and talking points for each meeting."),include_action_items:y.boolean().optional().default(!1).describe("Whether to include action items for each meeting."),include_transcript:y.boolean().optional().default(!1).describe("Whether to include the full transcript for each meeting. Transcripts can be very large.")};const KS=hw`
1891
1909
  mutation BatchUndo($boardId: ID!, $undoRecordId: ID!) {
1892
1910
  batch_undo(board_id: $boardId, undo_record_id: $undoRecordId) {
1893
1911
  success
1894
1912
  }
1895
1913
  }
1896
- `,BS={boardId:y.number().describe("The id of the board where the action was performed"),undoRecordId:y.string().describe("The undo record ID (action_record_uuid) from the activity log data field. Use get_board_activity with includeData=true to find this value.")};y.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'),y.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const MS=hw`
1914
+ `,QS={boardId:y.number().describe("The id of the board where the action was performed"),undoRecordId:y.string().describe("The undo record ID (action_record_uuid) from the activity log data field. Use get_board_activity with includeData=true to find this value.")};y.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'),y.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const JS=hw`
1897
1915
  query getSprintsByIds($ids: [ID!]) {
1898
1916
  items(ids: $ids) {
1899
1917
  id
@@ -1928,7 +1946,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1928
1946
  }
1929
1947
  }
1930
1948
  }
1931
- `,qS={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"},GS={...qS,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},HS="BOARD_NOT_FOUND:",WS="SPRINT_NOT_FOUND:",zS="DOCUMENT_NOT_FOUND:",YS="DOCUMENT_INVALID:",KS="DOCUMENT_EMPTY:",QS="EXPORT_FAILED:",JS="INTERNAL_ERROR:",XS="VALIDATION_ERROR:",ZS="task_sprint",eN={[GS.SPRINT_TASKS]:"Sprint Tasks",[GS.SPRINT_TIMELINE]:"Sprint Timeline",[GS.SPRINT_COMPLETION]:"Sprint Completion",[GS.SPRINT_START_DATE]:"Sprint Start Date",[GS.SPRINT_END_DATE]:"Sprint End Date",[GS.SPRINT_ACTIVATION]:"Sprint Activation",[GS.SPRINT_SUMMARY]:"Sprint Summary",[GS.SPRINT_CAPACITY]:"Sprint Capacity"},tN=wy,aN={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},iN=(e,t)=>e.column_values?.find((e=>e.id===t)),nN=(e,t)=>{const a=iN(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},oN=(e,t)=>{const a=iN(e,t);return"DateValue"===a?.__typename?a.date??null:null},rN=(e,t)=>{const a=iN(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},sN=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},pN=(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)))},dN=e=>pN(e,Object.values(qS)),cN=e=>pN(e,Object.values(aN)),lN=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},mN=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===cT.BoardRelation))||null,uN={sprintId:y.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const fN=hw`
1949
+ `,XS={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"},ZS={...XS,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},eN="BOARD_NOT_FOUND:",tN="SPRINT_NOT_FOUND:",aN="DOCUMENT_NOT_FOUND:",iN="DOCUMENT_INVALID:",nN="DOCUMENT_EMPTY:",oN="EXPORT_FAILED:",rN="INTERNAL_ERROR:",sN="VALIDATION_ERROR:",pN="task_sprint",dN={[ZS.SPRINT_TASKS]:"Sprint Tasks",[ZS.SPRINT_TIMELINE]:"Sprint Timeline",[ZS.SPRINT_COMPLETION]:"Sprint Completion",[ZS.SPRINT_START_DATE]:"Sprint Start Date",[ZS.SPRINT_END_DATE]:"Sprint End Date",[ZS.SPRINT_ACTIVATION]:"Sprint Activation",[ZS.SPRINT_SUMMARY]:"Sprint Summary",[ZS.SPRINT_CAPACITY]:"Sprint Capacity"},cN=wy,lN={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},mN=(e,t)=>e.column_values?.find((e=>e.id===t)),uN=(e,t)=>{const a=mN(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},fN=(e,t)=>{const a=mN(e,t);return"DateValue"===a?.__typename?a.date??null:null},hN=(e,t)=>{const a=mN(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},vN=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},bN=(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)))},gN=e=>bN(e,Object.values(XS)),yN=e=>bN(e,Object.values(lN)),_N=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},wN=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===IT.BoardRelation))||null,xN={sprintId:y.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const TN=hw`
1932
1950
  query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
1933
1951
  boards(ids: [$boardId]) {
1934
1952
  items_page(limit: $limit) {
@@ -1964,7 +1982,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1964
1982
  }
1965
1983
  }
1966
1984
  }
1967
- `,hN={sprintsBoardId:y.number().describe("The ID of the monday-dev board containing the sprints"),limit:y.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const vN=hw`
1985
+ `,EN={sprintsBoardId:y.number().describe("The ID of the monday-dev board containing the sprints"),limit:y.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const IN=hw`
1968
1986
  query GetRecentBoards($limit: Int) {
1969
1987
  boards(limit: $limit, order_by: used_at, state: active) {
1970
1988
  id
@@ -1980,7 +1998,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1980
1998
  }
1981
1999
  }
1982
2000
  }
1983
- `,bN={};const gN=[class extends wu{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=x.READ,this.annotations=_u({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 bN}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(vN,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${HS} 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:`${JS} 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=mN(e,qS.SPRINT_TASKS);if(!i)return;const n=lN(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=mN(e,ZS);if(!i)return;const n=lN(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&&(dN(i)&&this.processSprintsBoard(i,a,t),cN(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends wu{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=x.READ,this.annotations=_u({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive sprint metadata from a monday-dev sprints board including:\n\n## Data Retrieved:\nA table of sprints with the following information:\n- Sprint ID\n- Sprint Name\n- Sprint timeline (planned from/to dates)\n- Sprint completion status (completed/in-progress/planned)\n- Sprint start date (actual)\n- Sprint end date (actual)\n- Sprint activation status\n- Sprint summary document object ID\n\n## Parameters:\n- **limit**: Number of sprints to retrieve (default: 25, max: 100)\n\nRequires the Main Sprints board ID of the monday-dev containing your sprints."}getInputSchema(){return hN}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(fN,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:`${JS} 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(xw,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${HS} 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:`${XS} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${JS} 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(qS),i=sN(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=>eN[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=nN(e,GS.SPRINT_ACTIVATION),a=nN(e,GS.SPRINT_COMPLETION),i=oN(e,GS.SPRINT_START_DATE),n=oN(e,GS.SPRINT_END_DATE),o=((e,t)=>{const a=iN(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,GS.SPRINT_TIMELINE),r=rN(e,GS.SPRINT_SUMMARY);let s=tN.Planned;return a?s=tN.Completed:(t||i)&&(s=tN.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 wu{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=x.READ,this.annotations=_u({title:"monday-dev: Get Sprint Summary",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the complete summary and analysis of a sprint.\n\n## Purpose:\nUnlock deep insights into completed sprint performance. \n\nThe sprint summary content including:\n- **Scope Management**: Analysis of planned vs. unplanned tasks, scope creep\n- **Velocity & Performance**: Individual velocity, task completion rates, workload distribution per team member\n- **Task Distribution**: Breakdown of completed tasks by type (Feature, Bug, Tech Debt, Infrastructure, etc.)\n- **AI Recommendations**: Action items, process improvements, retrospective focus areas\n\n## Requirements:\n- Sprint must be completed and must be created after 1/1/2025 \n\n## Important Note:\nWhen viewing the section "Completed by Assignee", you\'ll see user IDs in the format "@user-12345678". the 8 digits after the @is the user ID. To retrieve the actual owner names, use the list_users_and_teams tool with the user ID and set includeTeams=false for optimal performance.\n\n'}getInputSchema(){return uN}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${JS} 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||`${JS} Unknown error occurred while reading document content`}}catch(e){return{content:`${JS} 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(MS,t)).items||[];if(0===a.length)return{success:!1,error:`${WS} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${WS} Sprint with ID ${e} not found.`};const n=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(qS),...t];return sN(a,i)})(i,[GS.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${XS} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=rN(i,GS.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${zS} 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:`${JS} 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(vw,t)).docs||[];if(0===a.length)return{success:!1,error:`${zS} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${YS} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(Cw,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${QS} 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:`${KS} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${JS} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],yN=[class extends wu{constructor(){super(...arguments),this.name="delete_item",this.type=x.WRITE,this.annotations=_u({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return BT}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(_w,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends wu{constructor(){super(...arguments),this.name="get_board_items_page",this.type=x.READ,this.annotations=_u({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get all items from a monday.com board with pagination support and optional column values and item descriptions. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the nextCursor parameter from the response to get the next page of results when has_more is true. To retrieve an item description (the rich-text body/details of a monday.com item), set includeItemDescription to true — the response will include the item description document blocks with their content, type, and id. Use this whenever the user asks about an item description, body, details, or notes. [REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available. VIEW-BASED FILTERING: If the user refers to a board view by name (e.g. "show me items in the Overdue view"), first call get_board_info to get the board views, find the matching view by name, then extract its filter field and pass it as the filters argument here.'}getInputSchema(){return pE}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){ST(t),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeItemDescription};t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(nE,a);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:Yg.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},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={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}if(t.includeItemDescription&&"description"in e&&e.description){const t=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));a.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case cT.BoardRelation:return e.linked_items;case cT.Formula:return e.display_value;case cT.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const t={query:e.searchTerm,limit:100,filters:{entities:[{items:{board_ids:[e.boardId.toString()]}}]}},a=await this.mondayApi.request(oE,t,{versionOverride:"dev",timeout:ET}),i=a.cross_entity_search?.filter((e=>"ItemSearchResult"===e.__typename))?.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 wu{constructor(){super(...arguments),this.name="create_item",this.type=x.WRITE,this.annotations=_u({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?NT:AT}async executeInternal(e){const t=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,t):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,t)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(yT,a);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 Uw(this.mondayApi,{boardId:t});return await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)}),{content:{message:`Item ${i.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:i.duplicate_item.id,item_name:i.duplicate_item.name,item_url:i.duplicate_item.url,board_id:t}}}catch(e){IT(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const a=await this.mondayApi.request(_T,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:{message:`Subitem ${a.create_subitem.id} created under ${e.parentItemId}`,item_id:a.create_subitem.id,item_name:a.create_subitem.name,item_url:a.create_subitem.url}}}catch(e){IT(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(ww,a);return{content:{message:`Item ${i.create_item?.id} successfully created`,item_id:i.create_item?.id,item_name:i.create_item?.name,item_url:i.create_item?.url,board_id:t}}}catch(e){IT(e,"create item")}}},class extends wu{constructor(){super(...arguments),this.name="create_update",this.type=x.WRITE,this.annotations=_u({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. You can also reply to an existing update by using the parentId parameter."}getInputSchema(){return CT}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=RT.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,parentId:e.parentId?.toString()},i=await this.mondayApi.request(kT,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,item_name:i.create_update.item?.name,item_url:i.create_update.item?.url}}}catch(e){IT(e,"create update")}}},class extends wu{constructor(){super(...arguments),this.name="get_updates",this.type=x.READ,this.annotations=_u({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. For Board queries, you can filter by date range using fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion. Set includeItemUpdates to true to also include updates on individual items. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return PT}async executeInternal(e){try{const t=void 0!==e.fromDate,a=void 0!==e.toDate;if(t!==a)throw new Error("Both fromDate and toDate must be provided together for date range filtering");if((t||a)&&e.objectType===FT.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const i={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let n;n=e.objectType===FT.Item?await this.mondayApi.request($T,{...i,itemId:e.objectId}):await this.mondayApi.request(LT,{...i,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:jT(e.fromDate),toDate:jT(e.toDate)}:{}});const o=e.objectType===FT.Item?n.items?.[0]?.updates:n.boards?.[0]?.updates;if(!o||0===o.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const r=o.map((t=>{const a={id:t.id,text_body:t.text_body,created_at:t.created_at,updated_at:t.updated_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:t.item_id};return e.includeReplies&&t.replies&&(a.replies=t.replies.map((e=>({id:e.id,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&t.assets&&(a.assets=t.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),a})),s=e.objectType===FT.Item?n.items?.[0]?.url:n.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:r,pagination:{page:e.page??1,limit:e.limit??25,count:r.length}}}}catch(e){IT(e,"get updates")}}},class extends wu{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=x.WRITE,this.annotations=_u({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 kS}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=DS.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(kT,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){IT(e,"create update")}}},class extends wu{constructor(){super(...arguments),this.name="get_board_schema",this.type=x.READ,this.annotations=_u({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 dE}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(xw,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})))??[],groups:i.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends wu{constructor(){super(...arguments),this.name="get_board_activity",this.type=x.READ,this.annotations=_u({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 KT}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-TT.MONTH30Days),i=e?.fromDate||a.toISOString(),n=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},r=await this.mondayApi.request(YT,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=r.boards?.[0],d=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:p?.name,board_url:p?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...d&&e.data?{data:e.data}:{}})))}}}},class extends wu{constructor(){super(...arguments),this.name="get_board_info",this.type=x.READ,this.annotations=_u({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. Also returns the board's views (e.g. table views, filter views) — each view includes its id, name, type, and a structured filter object. "}getInputSchema(){return iE}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(QT,t),i=a.boards?.[0];if(!i)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const n=await this.getSubItemsBoardAsync(i);return{content:XT(i,n)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===cT.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],i=await this.mondayApi.request(JT,{boardId:a});return i.boards?.[0]??null}},class extends wu{constructor(){super(...arguments),this.name="get_full_board_data",this.type=x.READ,this.annotations=_u({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 zT}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(qT,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(GT,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){IT(e,"get full board data")}}},class extends wu{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=x.READ,this.annotations=_u({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 UE}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(DE);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},p=RE(s),d=await PE(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.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(AE,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"),d=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${p}`,c=await PE(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:c?`https://${c}.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>CE)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>$E)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(NE,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(SE,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:LE};s=await this.mondayApi.request(IE,t)}else if(t){const t={userIds:e.userIds,limit:LE};s=await this.mondayApi.request(TE,t)}else{const e={userIds:void 0,limit:LE};s=await this.mondayApi.request(EE,e)}const p=RE(s),d=await PE(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}},Uw,class extends wu{constructor(){super(...arguments),this.name="move_item_to_group",this.type=x.WRITE,this.annotations=_u({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 VE}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(Ew,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends wu{constructor(){super(...arguments),this.name="create_board",this.type=x.WRITE,this.annotations=_u({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Vw}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(Iw,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 wu{constructor(){super(...arguments),this.name="create_form",this.type=x.WRITE,this.annotations=_u({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 yx}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(Jw,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends wu{constructor(){super(...arguments),this.name="update_form",this.type=x.WRITE,this.annotations=_u({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new pT(this.mondayApi),this.actionHandlers=new Map([[Ux.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Ux.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Ux.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Ux.activate,this.helpers.activateForm.bind(this.helpers)],[Ux.createTag,this.helpers.createTag.bind(this.helpers)],[Ux.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Ux.updateTag,this.helpers.updateTag.bind(this.helpers)],[Ux.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Ux.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Ux.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Ux.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Ux.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 sT}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 wu{constructor(){super(...arguments),this.name="get_form",this.type=x.READ,this.annotations=_u({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 dT}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Xw,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 wu{constructor(){super(...arguments),this.name="form_questions_editor",this.type=x.WRITE,this.annotations=_u({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new jx(this.mondayApi),this.actionHandlers=new Map([[Lx.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Lx.Update,this.helpers.updateQuestion.bind(this.helpers)],[Lx.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Px}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends wu{constructor(){super(...arguments),this.name="create_column",this.type=x.WRITE,this.annotations=_u({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?lT:mT}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(Sw,a);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends wu{constructor(){super(...arguments),this.name="create_group",this.type=x.WRITE,this.annotations=_u({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 gT}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(vT,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 wu{constructor(){super(...arguments),this.name="delete_column",this.type=x.WRITE,this.annotations=_u({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?UT:VT}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(Nw,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Fw,class extends wu{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=x.ALL_API,this.annotations=_u({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 uE}async executeInternal(e){try{const t=await this.mondayApi.request(Aw),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 wu{constructor(){super(...arguments),this.name="get_column_type_info",this.type=x.READ,this.annotations=_u({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 mE}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(cE,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:a.get_column_type_schema};return{content:{message:`Column type info for ${e.columnType}`,data:i,url:lE}}}},class extends wu{constructor(){super(...arguments),this.name="get_type_details",this.type=x.ALL_API,this.annotations=_u({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 fE}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,hw`
2001
+ `,SN={};const NN=[class extends wu{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=x.READ,this.annotations=_u({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 SN}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(IN,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${eN} 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:`${rN} 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=wN(e,XS.SPRINT_TASKS);if(!i)return;const n=_N(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=wN(e,pN);if(!i)return;const n=_N(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&&(gN(i)&&this.processSprintsBoard(i,a,t),yN(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends wu{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=x.READ,this.annotations=_u({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive sprint metadata from a monday-dev sprints board including:\n\n## Data Retrieved:\nA table of sprints with the following information:\n- Sprint ID\n- Sprint Name\n- Sprint timeline (planned from/to dates)\n- Sprint completion status (completed/in-progress/planned)\n- Sprint start date (actual)\n- Sprint end date (actual)\n- Sprint activation status\n- Sprint summary document object ID\n\n## Parameters:\n- **limit**: Number of sprints to retrieve (default: 25, max: 100)\n\nRequires the Main Sprints board ID of the monday-dev containing your sprints."}getInputSchema(){return EN}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(TN,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:`${rN} 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(xw,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${eN} 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:`${sN} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${rN} 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(XS),i=vN(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=>dN[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=uN(e,ZS.SPRINT_ACTIVATION),a=uN(e,ZS.SPRINT_COMPLETION),i=fN(e,ZS.SPRINT_START_DATE),n=fN(e,ZS.SPRINT_END_DATE),o=((e,t)=>{const a=mN(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,ZS.SPRINT_TIMELINE),r=hN(e,ZS.SPRINT_SUMMARY);let s=cN.Planned;return a?s=cN.Completed:(t||i)&&(s=cN.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 wu{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=x.READ,this.annotations=_u({title:"monday-dev: Get Sprint Summary",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the complete summary and analysis of a sprint.\n\n## Purpose:\nUnlock deep insights into completed sprint performance. \n\nThe sprint summary content including:\n- **Scope Management**: Analysis of planned vs. unplanned tasks, scope creep\n- **Velocity & Performance**: Individual velocity, task completion rates, workload distribution per team member\n- **Task Distribution**: Breakdown of completed tasks by type (Feature, Bug, Tech Debt, Infrastructure, etc.)\n- **AI Recommendations**: Action items, process improvements, retrospective focus areas\n\n## Requirements:\n- Sprint must be completed and must be created after 1/1/2025 \n\n## Important Note:\nWhen viewing the section "Completed by Assignee", you\'ll see user IDs in the format "@user-12345678". the 8 digits after the @is the user ID. To retrieve the actual owner names, use the list_users_and_teams tool with the user ID and set includeTeams=false for optimal performance.\n\n'}getInputSchema(){return xN}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${rN} 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||`${rN} Unknown error occurred while reading document content`}}catch(e){return{content:`${rN} 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(JS,t)).items||[];if(0===a.length)return{success:!1,error:`${tN} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${tN} Sprint with ID ${e} not found.`};const n=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(XS),...t];return vN(a,i)})(i,[ZS.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${sN} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=hN(i,ZS.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${aN} 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:`${rN} 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(vw,t)).docs||[];if(0===a.length)return{success:!1,error:`${aN} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${iN} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(Cw,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${oN} 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:`${nN} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${rN} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],AN=[class extends wu{constructor(){super(...arguments),this.name="delete_item",this.type=x.WRITE,this.annotations=_u({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return QT}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(_w,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends wu{constructor(){super(...arguments),this.name="get_board_items_page",this.type=x.READ,this.annotations=_u({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get all items from a monday.com board with pagination support and optional column values and item descriptions. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the nextCursor parameter from the response to get the next page of results when has_more is true. To retrieve an item description (the rich-text body/details of a monday.com item), set includeItemDescription to true — the response will include the item description document blocks with their content, type, and id. Use this whenever the user asks about an item description, body, details, or notes. [REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available. VIEW-BASED FILTERING: If the user refers to a board view by name (e.g. "show me items in the Overdue view"), first call get_board_info to get the board views, find the matching view by name, then extract its filter field and pass it as the filters argument here.'}getInputSchema(){return bE}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){hT(t),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeItemDescription};t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(uE,a);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:Yg.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},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={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}if(t.includeItemDescription&&"description"in e&&e.description){const t=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));a.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case IT.BoardRelation:return e.linked_items;case IT.Formula:return e.display_value;case IT.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const t={query:e.searchTerm,limit:100,filters:{entities:[{items:{board_ids:[e.boardId.toString()]}}]}},a=await this.mondayApi.request(fE,t,{versionOverride:"dev",timeout:uT}),i=a.cross_entity_search?.filter((e=>"ItemSearchResult"===e.__typename))?.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 wu{constructor(){super(...arguments),this.name="create_item",this.type=x.WRITE,this.annotations=_u({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?FT:PT}async executeInternal(e){const t=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,t):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,t)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request($T,a);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 Uw(this.mondayApi,{boardId:t});return await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)}),{content:{message:`Item ${i.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:i.duplicate_item.id,item_name:i.duplicate_item.name,item_url:i.duplicate_item.url,board_id:t}}}catch(e){fT(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const a=await this.mondayApi.request(LT,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:{message:`Subitem ${a.create_subitem.id} created under ${e.parentItemId}`,item_id:a.create_subitem.id,item_name:a.create_subitem.name,item_url:a.create_subitem.url}}}catch(e){fT(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(ww,a);return{content:{message:`Item ${i.create_item?.id} successfully created`,item_id:i.create_item?.id,item_name:i.create_item?.name,item_url:i.create_item?.url,board_id:t}}}catch(e){fT(e,"create item")}}},class extends wu{constructor(){super(...arguments),this.name="create_update",this.type=x.WRITE,this.annotations=_u({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. You can also reply to an existing update by using the parentId parameter."}getInputSchema(){return MT}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=BT.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,parentId:e.parentId?.toString()},i=await this.mondayApi.request(UT,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,item_name:i.create_update.item?.name,item_url:i.create_update.item?.url}}}catch(e){fT(e,"create update")}}},class extends wu{constructor(){super(...arguments),this.name="get_updates",this.type=x.READ,this.annotations=_u({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. For Board queries, you can filter by date range using fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion. Set includeItemUpdates to true to also include updates on individual items. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return WT}async executeInternal(e){try{const t=void 0!==e.fromDate,a=void 0!==e.toDate;if(t!==a)throw new Error("Both fromDate and toDate must be provided together for date range filtering");if((t||a)&&e.objectType===HT.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const i={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let n;n=e.objectType===HT.Item?await this.mondayApi.request(qT,{...i,itemId:e.objectId}):await this.mondayApi.request(GT,{...i,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:zT(e.fromDate),toDate:zT(e.toDate)}:{}});const o=e.objectType===HT.Item?n.items?.[0]?.updates:n.boards?.[0]?.updates;if(!o||0===o.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const r=o.map((t=>{const a={id:t.id,text_body:t.text_body,created_at:t.created_at,updated_at:t.updated_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:t.item_id};return e.includeReplies&&t.replies&&(a.replies=t.replies.map((e=>({id:e.id,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&t.assets&&(a.assets=t.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),a})),s=e.objectType===HT.Item?n.items?.[0]?.url:n.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:r,pagination:{page:e.page??1,limit:e.limit??25,count:r.length}}}}catch(e){fT(e,"get updates")}}},class extends wu{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=x.WRITE,this.annotations=_u({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 US}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=jS.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(UT,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){fT(e,"create update")}}},class extends wu{constructor(){super(...arguments),this.name="get_board_schema",this.type=x.READ,this.annotations=_u({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 gE}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(xw,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})))??[],groups:i.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends wu{constructor(){super(...arguments),this.name="get_board_activity",this.type=x.READ,this.annotations=_u({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 nE}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-mT.MONTH30Days),i=e?.fromDate||a.toISOString(),n=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},r=await this.mondayApi.request(iE,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=r.boards?.[0],d=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:p?.name,board_url:p?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...d&&e.data?{data:e.data}:{}})))}}}},class extends wu{constructor(){super(...arguments),this.name="get_board_info",this.type=x.READ,this.annotations=_u({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. Also returns the board's views (e.g. table views, filter views) — each view includes its id, name, type, and a structured filter object. "}getInputSchema(){return mE}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(oE,t),i=a.boards?.[0];if(!i)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const n=await this.getSubItemsBoardAsync(i);return{content:sE(i,n)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===IT.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],i=await this.mondayApi.request(rE,{boardId:a});return i.boards?.[0]??null}},class extends wu{constructor(){super(...arguments),this.name="get_full_board_data",this.type=x.READ,this.annotations=_u({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 aE}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(XT,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(ZT,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){fT(e,"get full board data")}}},class extends wu{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=x.READ,this.annotations=_u({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 YE}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(jE);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},p=BE(s),d=await WE(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.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(PE,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"),d=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${p}`,c=await WE(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:c?`https://${c}.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>ME)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>qE)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(FE,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(LE,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:GE};s=await this.mondayApi.request($E,t)}else if(t){const t={userIds:e.userIds,limit:GE};s=await this.mondayApi.request(RE,t)}else{const e={userIds:void 0,limit:GE};s=await this.mondayApi.request(CE,e)}const p=BE(s),d=await WE(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}},Uw,class extends wu{constructor(){super(...arguments),this.name="move_item_to_group",this.type=x.WRITE,this.annotations=_u({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 KE}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(Ew,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends wu{constructor(){super(...arguments),this.name="create_board",this.type=x.WRITE,this.annotations=_u({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Vw}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(Iw,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 wu{constructor(){super(...arguments),this.name="create_form",this.type=x.WRITE,this.annotations=_u({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 yx}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(Jw,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends wu{constructor(){super(...arguments),this.name="update_form",this.type=x.WRITE,this.annotations=_u({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new pT(this.mondayApi),this.actionHandlers=new Map([[Ux.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Ux.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Ux.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Ux.activate,this.helpers.activateForm.bind(this.helpers)],[Ux.createTag,this.helpers.createTag.bind(this.helpers)],[Ux.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Ux.updateTag,this.helpers.updateTag.bind(this.helpers)],[Ux.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Ux.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Ux.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Ux.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Ux.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 sT}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 wu{constructor(){super(...arguments),this.name="get_form",this.type=x.READ,this.annotations=_u({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 dT}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Xw,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 wu{constructor(){super(...arguments),this.name="form_questions_editor",this.type=x.WRITE,this.annotations=_u({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new jx(this.mondayApi),this.actionHandlers=new Map([[Lx.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Lx.Update,this.helpers.updateQuestion.bind(this.helpers)],[Lx.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Px}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends wu{constructor(){super(...arguments),this.name="create_form_submission",this.type=x.WRITE,this.annotations=_u({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 ET}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(e){if(e.includes("wkf.ms")){const t=await Dr.head(e,{maxRedirects:0,validateStatus:e=>e<400}),a=t.headers.location;return a?this.extractTokenFromUrl(a):null}return e.startsWith("http://")||e.startsWith("https://")?this.extractTokenFromUrl(e):e}async executeInternal(e){const t=await this.resolveFormToken(e.form_token);if(!t)return{content:`Could not resolve a WorkForm token from "${e.form_token}". Please provide a valid WorkForm token or full WorkForm URL (e.g. https://forms.monday.com/forms/abc123).`};const a={form_token:t,answers:e.answers,form_timezone_offset:e.form_timezone_offset,password:e.password,tags:e.tags};try{const e=await this.mondayApi.request(vT,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){fT(e,"submit form")}}},class extends wu{constructor(){super(...arguments),this.name="create_column",this.type=x.WRITE,this.annotations=_u({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?ST:NT}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(Sw,a);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends wu{constructor(){super(...arguments),this.name="create_group",this.type=x.WRITE,this.annotations=_u({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 CT}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(OT,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 wu{constructor(){super(...arguments),this.name="delete_column",this.type=x.WRITE,this.annotations=_u({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?YT:KT}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(Nw,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Fw,class extends wu{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=x.ALL_API,this.annotations=_u({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 xE}async executeInternal(e){try{const t=await this.mondayApi.request(Aw),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 wu{constructor(){super(...arguments),this.name="get_column_type_info",this.type=x.READ,this.annotations=_u({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 wE}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(yE,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:a.get_column_type_schema};return{content:{message:`Column type info for ${e.columnType}`,data:i,url:_E}}}},class extends wu{constructor(){super(...arguments),this.name="get_type_details",this.type=x.ALL_API,this.annotations=_u({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 TE}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,hw`
1984
2002
  query getTypeDetails {
1985
2003
  __type(name: "${t}") {
1986
2004
  name
@@ -2068,5 +2086,5 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
2068
2086
  }
2069
2087
  }
2070
2088
  }
2071
- `),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 wu{constructor(){super(...arguments),this.name="create_custom_activity",this.type=x.WRITE,this.annotations=_u({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return uT}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(kw,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 wu{constructor(){super(...arguments),this.name="create_notification",this.type=x.WRITE,this.annotations=_u({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 hT}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{await this.mondayApi.request(fT,t);return{content:{message:"Notification sent",user_id:e.user_id,text:e.text}}}catch(t){return{content:`Failed to send notification to user ${e.user_id}`}}}},class extends wu{constructor(){super(...arguments),this.name="create_timeline_item",this.type=x.WRITE,this.annotations=_u({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return DT}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(Ow,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 wu{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=x.READ,this.annotations=_u({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return MT}async executeInternal(e){const t=await this.mondayApi.request(Rw);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 wu{constructor(){super(...arguments),this.name="read_docs",this.type=x.READ,this.annotations=_u({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- 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- Set include_comments: true to fetch all comments and replies on the document. 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 GE}async executeInternal(e){return e.mode===ME?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!e.type||!e.ids||0===e.ids.length)return{content:'Error: type and ids are required when mode is "content".'};let t,a,i;switch(this.sessionContext.metadata={...this.sessionContext.metadata,mode:e.mode??BE,include_comments:e.include_comments??!1,include_blocks:e.include_blocks??!1},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={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n};let r=await this.mondayApi.request(vw,o);if((!r.docs||0===r.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};r=await this.mondayApi.request(vw,a)}if(!r.docs||0===r.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const s=e.include_comments??!1,p=e.comments_limit??50;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:r.docs.flatMap((e=>e?[e.id]:[])),object_ids:r.docs.flatMap((e=>e?.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(r.docs,o,n,s,p)}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}async executeVersionHistory(e){const{include_diff:t,since:a,until:i,version_history_limit:n}=e,o=e.ids?.[0];if(!o)return{content:'Error: ids is required when mode is "version_history". Provide the document object_id.'};this.sessionContext.metadata={...this.sessionContext.metadata,mode:ME,object_ids:[o]};try{const e={docId:o,since:a,until:i},r=await this.mondayApi.request(bw,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 p=Math.min(n??10,10),d=s.slice(0,p+1),c=s.length>p,l=(await Promise.allSettled(d.map((async(e,t)=>{if(t===d.length-1||!e.date)return e;const a=d[t+1];if(!a?.date)return e;const i={docId:o,date:e.date,prevDate:a.date},n=await this.mondayApi.request(yw,i);return{...e,diff:n?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,t)=>"fulfilled"===e.status?e.value:d[t]))))).slice(0,p);return{content:{doc_id:o,since:a,until:i,restoring_points:l,...c&&{truncated:!0,total_count:s.length}}}}catch(e){return{content:`Error fetching version history for document ${o}: ${e instanceof Error?e.message:"Unknown error"}`}}}async fetchDocComments(e,t){try{const a={boardId:e,itemsLimit:100,updatesLimit:t},i=await this.mondayApi.request(gw,a),n=i.boards?.[0]?.items_page?.items;if(!n)return[];const o=[];for(const e of n)if(e.updates&&0!==e.updates.length)for(const t of e.updates)o.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,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 o}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,i=!1,n=50){const o=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t,o="";try{const t={docId:e.id},a=await this.mondayApi.request(Cw,t);o=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){o=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return i&&e.object_id&&(t=await this.fetchDocComments(e.object_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})))},blocks_as_markdown:o,...i&&{comments:t}}}))),r=t.page||1,s=t.limit||25,p=o.length,d=p===s;return{content:{message:`Documents retrieved (${o.length})`,pagination:{current_page:r,limit:s,count:p,has_more_pages:d},data:o}}}},class extends wu{constructor(){super(...arguments),this.name="workspace_info",this.type=x.READ,this.annotations=_u({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 HE}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request($w,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:[]}]))),p=[];(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):p.push(t)}));const d=[];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):d.push(t)})),{workspace:{id:r.id,name:r.name,url:t?jE(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:p,docs:d}}}(a,await PE(this.mondayApi));return{content:{message:"Workspace info retrieved",data:i}}}},class extends wu{constructor(){super(...arguments),this.name="list_workspaces",this.type=x.READ,this.annotations=_u({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List all workspaces available to the user. Returns up to 500 workspaces with their ID, name, and description."}getInputSchema(){return JE}async executeInternal(e){const t=e.searchTerm?1e4:e.limit,a=e.searchTerm?1:e.page;let i=null;if(e.searchTerm&&(i=YE(e.searchTerm),0===i.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const n=e=>({limit:t,page:a,membershipKind:e}),o=KE(await this.mondayApi.request(WE,n(zy.Member))),r=!QE(o)||i&&!function(e,t){return t.some((t=>YE(t.name).includes(e)))}(i,o);let s=o;if(r){s=KE(await this.mondayApi.request(WE,n(zy.All)))}if(!QE(s))return{content:{message:"No workspaces found.",data:[]}};const p=i&&s?.length<=zE,d=function(e,t,a,i){if(!e||t.length<=zE)return t;const n=(a-1)*i,o=n+i;return t.filter((t=>YE(t.name).includes(e))).slice(n,o)}(i,s,e.page,e.limit);if(!QE(d))return{content:{message:"No workspaces found matching the search term. Try using the tool without a search term",data:[]}};const c=d.length===e.limit,l=await PE(this.mondayApi),m=d.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:l&&e.id?jE(l,e.id):void 0})));return{content:{message:"Workspaces retrieved",...p?{disclaimer:"Search term not applied - returning all workspaces. Perform the filtering manually."}:{},...c?{next_page:e.page+1}:{},data:m}}}},class extends wu{constructor(){super(...arguments),this.name="create_doc",this.type=x.WRITE,this.annotations=_u({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)\n- item: Creates a document attached to an item (requires item_id, optional column_id)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }'}getInputSchema(){return nI}async executeInternal(e){const t=iI.safeParse({...e,type:e.location});if(!t.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const a=t.data;try{let t,i,n;if(a.type===aI.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||Wb.Public,folder_id:a.folder_id?.toString()}}},r=await this.mondayApi.request(ZE,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===aI.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(XE,o),s=r.items?.[0];if(!s)return{content:`Error: Item with id ${a.item_id} not found.`};const p=s.board?.id,d=s.board?.columns?.find((e=>e&&e.type===cT.Doc));let c=a.column_id;if(!c)if(d)c=d.id;else{const e={boardId:p.toString(),columnType:cT.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(Sw,e);if(c=t?.create_column?.id,!c)return{content:"Error: Failed to create doc column."}}const l={location:{board:{item_id:a.item_id.toString(),column_id:c}}},m=await this.mondayApi.request(ZE,l);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(tI,a)}catch(e){console.warn("Failed to update doc name:",e)}}if(!t)return{content:"Error: Failed to create document."};const o={docId:t,markdown:e.markdown},r=await this.mondayApi.request(eI,o),s=r?.add_content_to_doc_from_markdown?.success,p=r?.add_content_to_doc_from_markdown?.error;return s?(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}}):{content:`Document ${t} created, but failed to add markdown content: ${p||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends wu{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=x.WRITE,this.annotations=_u({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 either doc_id or object_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\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- Insert after block: { doc_id: "123", markdown: "Inserted content", after_block_id: "block_789" }'}getInputSchema(){return pI}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};try{let t=null;if(e.doc_id){const a=await this.mondayApi.request(sI,{docId:[e.doc_id]});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(rI,{objectId:[e.object_id]});t=a.docs?.[0]??null}if(!t){return{content:`Error: No document found for ${e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`}.`}}this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t.id,...e.object_id&&{object_id:e.object_id}};const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},i=await this.mondayApi.request(oI,a);if(!i?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:n,block_ids:o,error:r}=i.add_content_to_doc_from_markdown;if(!n)return{content:`Error adding content to document: ${r||"Unknown error"}`};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){return{content:`Error adding content to document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends wu{constructor(){super(...arguments),this.name="update_doc",this.type=x.WRITE,this.annotations=_u({title:"Update Document",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Update an existing monday.com document. Provide doc_id (preferred) or object_id, plus an ordered operations array (executed sequentially, stops on first failure).\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_block: Remove any block. 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_block 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\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 ZI}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};this.sessionContext.metadata={...this.sessionContext.metadata,operation_types:e.operations?.map((e=>e.operation_type)),operation_count:e.operations?.length??0,...e.object_id&&{object_id:e.object_id}};try{let t=e.doc_id;if(!t){const a=await this.mondayApi.request(lI,{objectId:[e.object_id]}),i=a.docs?.[0];if(!i)return{content:`Error: No document found for object_id ${e.object_id}.`};t=i.id}const a=[];let i=null;for(let n=0;n<e.operations.length;n++){const o=e.operations[n];try{const i=await this.executeOperation(t,o,e.object_id);a.push(`- [OK] ${o.operation_type}${i?`: ${i}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";a.push(`- [FAILED] ${o.operation_type}: ${t}`),i=n;break}}const n=null!==i?i:e.operations.length,o=e.operations.length,r=`Completed ${n}/${o} operation${1===o?"":"s"} on doc ${t}.`;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t},{content:`${r}\n\nResults:\n${a.join("\n")}\n\nDoc ID: ${t}`}}catch(e){return{content:`Error: ${e instanceof Error?e.message:String(e)}`}}}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_block":return this.executeDeleteBlock(t.block_id);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(dI,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(cI,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:TI(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:TI(e.delta_format),language:e.language};case"list_item":return{deltaFormat:TI(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(mI,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:xI(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:yI(e.alignment),direction:_I(e.direction)}};case"list_item":return{list_block:{delta_format:xI(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:xI(e.delta_format),text_block_type:Oy.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(gI,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(uI,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(fI,{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(hI,{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(vI,{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 p=o?Array.isArray(o)?o:[o]:[];if((null!=r||null!=s)&&p.length>1)throw new Error("selection_from and selection_length are only supported with a single block_id");const d=await this.resolveObjectId(e,t),c=await this.resolveDocItemId(d);let l;if(n){const e=JSON.parse(n),t=RT.safeParse(e);if(!t.success)throw new Error(`Invalid mentions_list format: ${t.error.message}`);l=t.data}const m={itemId:c,body:a,parentId:i?.toString(),mentionsList:l},u=await this.mondayApi.request(bI,m);if(!u.create_update?.id)throw new Error("Failed to create comment: no update returned");const f=u.create_update.id,h=Number(f),v=i?`Reply to update ${i}`:"Comment";if(p.length>0){if(Number.isNaN(h))throw new Error(`${v} created (update ID: ${f}) 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 p){const i=t.find((e=>e.id===a));if(!i)throw new Error(`${v} created (update ID: ${f}) but block annotation failed: block ${a} not found in doc ${e}`);const n=i.content.deltaFormat;if(!n)throw new Error(`${v} created (update ID: ${f}) 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(`${v} created (update ID: ${f}) but block annotation failed: block ${a} has an empty deltaFormat and cannot be annotated`);const p=r??0,d=s??o;if(p+d>o)throw new Error(`${v} created (update ID: ${f}) but block annotation failed: selection [${p}, ${p+d}) is out of range for block ${a} (total length ${o})`);let c;try{c=II(n,h,p,d)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`${v} created (update ID: ${f}) but delta annotation failed for block ${a}: ${t}`)}const l={...i.content,deltaFormat:c},m=await this.mondayApi.request(mI,{blockId:a,content:JSON.stringify(l)});if(!m?.update_doc_block)throw new Error(`${v} created (update ID: ${f}) but block annotation write returned no confirmation for block ${a}`)}}const b=p.length;return`${v} created${b>1?` across ${b} blocks`:1===b?" on block":""} (update ID: ${f})`}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 wu{constructor(){super(...arguments),this.name="update_workspace",this.type=x.WRITE,this.annotations=_u({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return rS}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(oS,t),i=await PE(this.mondayApi),n=i?jE(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 wu{constructor(){super(...arguments),this.name="update_folder",this.type=x.WRITE,this.annotations=_u({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return pS}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?{position_is_after:i,position_object_id:t,position_object_type:a}:void 0},o=await this.mondayApi.request(sS,n);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends wu{constructor(){super(...arguments),this.name="create_workspace",this.type=x.WRITE,this.annotations=_u({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return cS}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(dS,t),i=await PE(this.mondayApi),n=i&&a.create_workspace?.id?jE(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 wu{constructor(){super(...arguments),this.name="create_folder",this.type=x.WRITE,this.annotations=_u({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return mS}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(lS,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 wu{constructor(){super(...arguments),this.name="move_object",this.type=x.WRITE,this.annotations=_u({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 hS}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 p={folderId:t,position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},d=await this.mondayApi.request(sS,p);return{content:{message:"Object moved",object_id:d.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 p={boardId:t,attributes:{position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(uS,p);return d.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:d.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${d.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 p={overviewId:t,attributes:{position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(fS,p);return d.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:d.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${d.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:t}=e;switch(t){case ry.Folder:return this.executeUpdateFolder(e);case ry.Board:return this.executeUpdateBoardHierarchy(e);case ry.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends wu{constructor(){super(...arguments),this.name="create_dashboard",this.type=x.WRITE,this.annotations=_u({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 iS}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(eS,t);if(!a.create_dashboard)throw new Error("Failed to create dashboard");const i=a.create_dashboard;return{content:{message:`Dashboard ${i.id} successfully created`,dashboard_id:i.id,dashboard_name:i.name}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${t}`)}}},class extends wu{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=x.READ,this.annotations=_u({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(tS,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:lE}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends wu{constructor(){super(...arguments),this.name="create_widget",this.type=x.WRITE,this.annotations=_u({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 nS}async executeInternal(e){if(!e.settings)throw new Error("You must pass the settings parameter");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(aS,t);if(!a.create_widget)throw new Error("Failed to create widget");const i=a.create_widget;i.parent?.kind===Hy.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){const a=t instanceof Error?t.message:String(t);throw new Error(`Failed to create ${e.widget_kind} widget: ${a}`)}}},class extends wu{constructor(){super(...arguments),this.name="board_insights",this.type=x.READ,this.annotations=_u({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 to understand the board metadata. 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 wS}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};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===Db.Label)).map((e=>e.columnId))),n=e.groupBy?.filter((e=>!i.has(e))).map((e=>({function:Db.Label,columnId:e})))??[],o=e.aggregations.concat(n).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return yS.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:Ab.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===Db.CountItems?[]:[{type:Ab.Column,column:_S(n),as:n}]}),as:s}}var i,n;const o={type:Ab.Column,column:_S(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:Ab.Column,column:_S(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:Nb.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(vS,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 wu{constructor(){super(...arguments),this.name="search",this.type=x.READ,this.annotations=_u({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Search within monday.com platform. Can search for boards, documents, forms, folders.\nFor users and teams, use list_users_and_teams tool.\nFor workspaces, use list_workspaces tool.\nFor items and groups, use get_board_items_page tool.\nFor groups, use get_board_info tool.\nIMPORTANT: ids returned by this tool are prefixed with the type of the object (e.g doc-123, board-456, folder-789). When passing the ids to other tools, you need to remove the prefix and just pass the number.\n "}getInputSchema(){return NS}async executeInternal(e){if(e.searchType!==sE.FOLDERS&&e.searchTerm)try{return{content:{message:"Search results",data:(await this.searchWithDevEndpointAsync(e)).items}}}catch(e){ST(e)}const t={[sE.BOARD]:this.searchBoardsAsync.bind(this),[sE.DOCUMENTS]:this.searchDocsAsync.bind(this),[sE.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!t)throw new Error(`Unsupported search type: ${e.searchType}`);const a=await t(e);return{content:{message:"Search results",disclaimer:a.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",data:a.items}}}async searchWithDevEndpointAsync(e){const t={[sE.BOARD]:{entities:[{boards:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[sE.DOCUMENTS]:{entities:[{docs:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[sE.FOLDERS]:void 0}[e.searchType];if(!t)throw new Error(`Unsupported search type for dev endpoint: ${e.searchType}`);if(e.page>1)throw new Error("Pagination is not supported for search, increase the limit parameter instead");const a={query:e.searchTerm,limit:e.limit,filters:t},i=(await this.mondayApi.request(IS,a,{versionOverride:"dev",timeout:ET})).cross_entity_search||[],n=[];for(const e of i)"BoardSearchResult"===e.__typename?n.push({id:rE.BOARD+e.data.id,title:e.data.name,url:e.data.url}):"DocSearchResult"===e.__typename&&n.push({id:rE.DOCUMENT+e.data.id,title:e.data.name});return{items:n,wasFiltered:!0}}async searchFoldersAsync(e){const t={...this.getPagingParamsForSearch(e,100),workspace_ids:e.workspaceIds?.map((e=>e.toString()))};t.workspace_ids??=[],0===t.workspace_ids.length&&IT(new Error("Searching for folders require specifying workspace ids"),"search folders");const a=await this.mondayApi.request(ES,t),i=this.searchAndVirtuallyPaginate(e,a.folders||[],(e=>e.name));return{items:i.items.map((e=>({id:rE.FOLDER+e.id,title:e.name}))),wasFiltered:i.wasFiltered}}async searchDocsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(TS,t),i=this.searchAndVirtuallyPaginate(e,a.docs||[],(e=>e.name));return{items:i.items.map((e=>({id:rE.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:i.wasFiltered}}async searchBoardsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(xS,t),i=this.searchAndVirtuallyPaginate(e,a.boards||[],(e=>e.name));return{items:i.items.map((e=>({id:rE.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:i.wasFiltered}}getPagingParamsForSearch(e,t=1e3){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?Math.min(1e3,t):e.limit}}searchAndVirtuallyPaginate(e,t,a){if(t.length<=SS)return{items:t,wasFiltered:!1};const i=YE(e.searchTerm??""),n=(e.page-1)*e.limit,o=n+e.limit;return{items:t.filter((e=>YE(a(e)).includes(i))).slice(n,o),wasFiltered:!0}}},class extends wu{constructor(){super(...arguments),this.name="get_user_context",this.type=x.READ,this.annotations=_u({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information and their relevant items (boards, folders, workspaces, dashboards).\n \n Use this tool at the beginning of conversations to:\n - Get context about who the current user is (id, name, title)\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 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($S,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};return{content:{message:"User context",...{user:e,favorites:await this.fetchFavorites(t||[]),relevantBoards:this.extractRelevantBoards(a),relevantPeople:this.extractRelevantPeople(a)}}}}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[FS[e]]=t[e];const n=await this.mondayApi.request(LS,i),o=[];for(const e of a){const t=PS[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}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 wu{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=x.WRITE,this.annotations=_u({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 CS}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(OS,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends wu{constructor(){super(...arguments),this.name="get_notetaker_meetings",this.type=x.READ,this.annotations=_u({title:"Get Notetaker Meetings",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve notetaker meetings with optional detailed fields. Use include_summary, include_topics, include_action_items, and include_transcript flags to control which details are returned. Use access to filter by meeting access level (OWN, SHARED_WITH_ME, SHARED_WITH_ACCOUNT, ALL). Defaults to OWN. Supports filtering by ids, search term, and cursor-based pagination."}getInputSchema(){return US}async executeInternal(e){const t={access:e.access};e.ids&&e.ids.length>0&&(t.ids=e.ids),e.search&&(t.search=e.search);const a={limit:e.limit,cursor:e.cursor||void 0,filters:t,includeSummary:e.include_summary,includeTopics:e.include_topics,includeActionItems:e.include_action_items,includeTranscript:e.include_transcript},i=await this.mondayApi.request(jS,a,{versionOverride:"2026-04"}),n=i.notetaker?.meetings;if(!n?.meetings||0===n.meetings.length)return{content:"No notetaker meetings found matching the specified criteria."};return{content:{message:"Meetings retrieved",data:{meetings:n.meetings,pagination:{has_next_page:n.page_info?.has_next_page??!1,cursor:n.page_info?.cursor??null,count:n.meetings.length}}}}}},class extends wu{constructor(){super(...arguments),this.name="create_view",this.type=x.WRITE,this.annotations=_u({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\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 Mw}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort},a=await this.mondayApi.request(Bw,t);return a.create_view?{content:`View "${a.create_view.name}" (ID: ${a.create_view.id}, type: ${a.create_view.type}) successfully created`}:{content:"Failed to create view - no response from API"}}},class extends wu{constructor(){super(...arguments),this.name="undo_action",this.type=x.WRITE,this.annotations=_u({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 BS}async executeInternal(e){return await this.mondayApi.request(VS,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}}];var _N;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(_N||(_N={}));const wN=(e,t)=>{let a=[];t?.mode===_N.APPS?a=[...yu]:t?.mode!==_N.API&&t?.mode||(a=[...yN,...gN]);const i=a.map((t=>((e,t)=>e.prototype instanceof wu?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof Jm?new e(t.apiToken):new e)(t,e)));return i.filter((e=>{if(!t)return e.type!==x.ALL_API;if(t.mode===_N.API&&"only"===t.enableDynamicApiTools)return e.type===x.ALL_API;let a=!1;return t.mode===_N.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===x.ALL_API),t.readOnlyMode&&(a=a||e.type!==x.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))},xN=e=>"object"==typeof e?JSON.stringify(e):e;class TN{constructor(t){this.mondayApi=new e({token:t.mondayApiToken,apiVersion:t.mondayApiVersion??Km,endpoint:t.mondayApiEndpoint,requestConfig:t.mondayApiRequestConfig}),this.mondayApiToken=t.mondayApiToken,this.context={...t.context,apiVersion:t.mondayApiVersion??Km},this.tools=this.initializeTools(t)}initializeTools(e){const t={apiClient:this.mondayApi,apiToken:this.mondayApiToken,context:this.context};return wN(t,e.toolsConfiguration)}getTools(){return this.tools.map((e=>{const t=e.getInputSchema();return{type:"function",function:{name:e.name,description:e.getDescription(),parameters:t?w(y.object(t)):void 0}}}))}async handleToolCall(e){const{name:t,arguments:a}=e.function,i=JSON.parse(a),n=this.tools.find((e=>e.name===t));if(!n)throw new Error(`Unknown tool: ${t}`);const o=n.getInputSchema();if(o){const t=y.object(o).safeParse(i);if(!t.success)throw new Error(`Invalid arguments: ${t.error.message}`);const a=await n.execute(t.data);return{role:"tool",tool_call_id:e.id,content:xN(a.content)}}{const t=await n.execute();return{role:"tool",tool_call_id:e.id,content:xN(t.content)}}}}export{TN as MondayAgentToolkit};
2089
+ `),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 wu{constructor(){super(...arguments),this.name="create_custom_activity",this.type=x.WRITE,this.annotations=_u({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return AT}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(kw,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 wu{constructor(){super(...arguments),this.name="create_notification",this.type=x.WRITE,this.annotations=_u({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 kT}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{await this.mondayApi.request(DT,t);return{content:{message:"Notification sent",user_id:e.user_id,text:e.text}}}catch(t){return{content:`Failed to send notification to user ${e.user_id}`}}}},class extends wu{constructor(){super(...arguments),this.name="create_timeline_item",this.type=x.WRITE,this.annotations=_u({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return jT}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(Ow,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 wu{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=x.READ,this.annotations=_u({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return JT}async executeInternal(e){const t=await this.mondayApi.request(Rw);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 wu{constructor(){super(...arguments),this.name="read_docs",this.type=x.READ,this.annotations=_u({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- 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- Set include_comments: true to fetch all comments and replies on the document. 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 ZE}async executeInternal(e){return e.mode===JE?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!e.type||!e.ids||0===e.ids.length)return{content:'Error: type and ids are required when mode is "content".'};let t,a,i;switch(this.sessionContext.metadata={...this.sessionContext.metadata,mode:e.mode??QE,include_comments:e.include_comments??!1,include_blocks:e.include_blocks??!1},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={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n};let r=await this.mondayApi.request(vw,o);if((!r.docs||0===r.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};r=await this.mondayApi.request(vw,a)}if(!r.docs||0===r.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const s=e.include_comments??!1,p=e.comments_limit??50;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:r.docs.flatMap((e=>e?[e.id]:[])),object_ids:r.docs.flatMap((e=>e?.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(r.docs,o,n,s,p)}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}async executeVersionHistory(e){const{include_diff:t,since:a,until:i,version_history_limit:n}=e,o=e.ids?.[0];if(!o)return{content:'Error: ids is required when mode is "version_history". Provide the document object_id.'};this.sessionContext.metadata={...this.sessionContext.metadata,mode:JE,object_ids:[o]};try{const e={docId:o,since:a,until:i},r=await this.mondayApi.request(bw,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 p=Math.min(n??10,10),d=s.slice(0,p+1),c=s.length>p,l=(await Promise.allSettled(d.map((async(e,t)=>{if(t===d.length-1||!e.date)return e;const a=d[t+1];if(!a?.date)return e;const i={docId:o,date:e.date,prevDate:a.date},n=await this.mondayApi.request(yw,i);return{...e,diff:n?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,t)=>"fulfilled"===e.status?e.value:d[t]))))).slice(0,p);return{content:{doc_id:o,since:a,until:i,restoring_points:l,...c&&{truncated:!0,total_count:s.length}}}}catch(e){return{content:`Error fetching version history for document ${o}: ${e instanceof Error?e.message:"Unknown error"}`}}}async fetchDocComments(e,t){try{const a={boardId:e,itemsLimit:100,updatesLimit:t},i=await this.mondayApi.request(gw,a),n=i.boards?.[0]?.items_page?.items;if(!n)return[];const o=[];for(const e of n)if(e.updates&&0!==e.updates.length)for(const t of e.updates)o.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,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 o}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,i=!1,n=50){const o=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t,o="";try{const t={docId:e.id},a=await this.mondayApi.request(Cw,t);o=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){o=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return i&&e.object_id&&(t=await this.fetchDocComments(e.object_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})))},blocks_as_markdown:o,...i&&{comments:t}}}))),r=t.page||1,s=t.limit||25,p=o.length,d=p===s;return{content:{message:`Documents retrieved (${o.length})`,pagination:{current_page:r,limit:s,count:p,has_more_pages:d},data:o}}}},class extends wu{constructor(){super(...arguments),this.name="workspace_info",this.type=x.READ,this.annotations=_u({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 eI}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request($w,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:[]}]))),p=[];(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):p.push(t)}));const d=[];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):d.push(t)})),{workspace:{id:r.id,name:r.name,url:t?zE(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:p,docs:d}}}(a,await WE(this.mondayApi));return{content:{message:"Workspace info retrieved",data:i}}}},class extends wu{constructor(){super(...arguments),this.name="list_workspaces",this.type=x.READ,this.annotations=_u({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List all workspaces available to the user. Returns up to 500 workspaces with their ID, name, and description."}getInputSchema(){return rI}async executeInternal(e){const t=e.searchTerm?1e4:e.limit,a=e.searchTerm?1:e.page;let i=null;if(e.searchTerm&&(i=iI(e.searchTerm),0===i.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const n=e=>({limit:t,page:a,membershipKind:e}),o=nI(await this.mondayApi.request(tI,n(zy.Member))),r=!oI(o)||i&&!function(e,t){return t.some((t=>iI(t.name).includes(e)))}(i,o);let s=o;if(r){s=nI(await this.mondayApi.request(tI,n(zy.All)))}if(!oI(s))return{content:{message:"No workspaces found.",data:[]}};const p=i&&s?.length<=aI,d=function(e,t,a,i){if(!e||t.length<=aI)return t;const n=(a-1)*i,o=n+i;return t.filter((t=>iI(t.name).includes(e))).slice(n,o)}(i,s,e.page,e.limit);if(!oI(d))return{content:{message:"No workspaces found matching the search term. Try using the tool without a search term",data:[]}};const c=d.length===e.limit,l=await WE(this.mondayApi),m=d.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:l&&e.id?zE(l,e.id):void 0})));return{content:{message:"Workspaces retrieved",...p?{disclaimer:"Search term not applied - returning all workspaces. Perform the filtering manually."}:{},...c?{next_page:e.page+1}:{},data:m}}}},class extends wu{constructor(){super(...arguments),this.name="create_doc",this.type=x.WRITE,this.annotations=_u({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)\n- item: Creates a document attached to an item (requires item_id, optional column_id)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }'}getInputSchema(){return uI}async executeInternal(e){const t=mI.safeParse({...e,type:e.location});if(!t.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const a=t.data;try{let t,i,n;if(a.type===lI.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||Wb.Public,folder_id:a.folder_id?.toString()}}},r=await this.mondayApi.request(pI,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===lI.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(sI,o),s=r.items?.[0];if(!s)return{content:`Error: Item with id ${a.item_id} not found.`};const p=s.board?.id,d=s.board?.columns?.find((e=>e&&e.type===IT.Doc));let c=a.column_id;if(!c)if(d)c=d.id;else{const e={boardId:p.toString(),columnType:IT.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(Sw,e);if(c=t?.create_column?.id,!c)return{content:"Error: Failed to create doc column."}}const l={location:{board:{item_id:a.item_id.toString(),column_id:c}}},m=await this.mondayApi.request(pI,l);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(cI,a)}catch(e){console.warn("Failed to update doc name:",e)}}if(!t)return{content:"Error: Failed to create document."};const o={docId:t,markdown:e.markdown},r=await this.mondayApi.request(dI,o),s=r?.add_content_to_doc_from_markdown?.success,p=r?.add_content_to_doc_from_markdown?.error;return s?(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}}):{content:`Document ${t} created, but failed to add markdown content: ${p||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends wu{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=x.WRITE,this.annotations=_u({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 either doc_id or object_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\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- Insert after block: { doc_id: "123", markdown: "Inserted content", after_block_id: "block_789" }'}getInputSchema(){return bI}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};try{let t=null;if(e.doc_id){const a=await this.mondayApi.request(vI,{docId:[e.doc_id]});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(hI,{objectId:[e.object_id]});t=a.docs?.[0]??null}if(!t){return{content:`Error: No document found for ${e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`}.`}}this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t.id,...e.object_id&&{object_id:e.object_id}};const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},i=await this.mondayApi.request(fI,a);if(!i?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:n,block_ids:o,error:r}=i.add_content_to_doc_from_markdown;if(!n)return{content:`Error adding content to document: ${r||"Unknown error"}`};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){return{content:`Error adding content to document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends wu{constructor(){super(...arguments),this.name="update_doc",this.type=x.WRITE,this.annotations=_u({title:"Update Document",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Update an existing monday.com document. Provide doc_id (preferred) or object_id, plus an ordered operations array (executed sequentially, stops on first failure).\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_block: Remove any block. 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_block 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\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 pS}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};this.sessionContext.metadata={...this.sessionContext.metadata,operation_types:e.operations?.map((e=>e.operation_type)),operation_count:e.operations?.length??0,...e.object_id&&{object_id:e.object_id}};try{let t=e.doc_id;if(!t){const a=await this.mondayApi.request(_I,{objectId:[e.object_id]}),i=a.docs?.[0];if(!i)return{content:`Error: No document found for object_id ${e.object_id}.`};t=i.id}const a=[];let i=null;for(let n=0;n<e.operations.length;n++){const o=e.operations[n];try{const i=await this.executeOperation(t,o,e.object_id);a.push(`- [OK] ${o.operation_type}${i?`: ${i}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";a.push(`- [FAILED] ${o.operation_type}: ${t}`),i=n;break}}const n=null!==i?i:e.operations.length,o=e.operations.length,r=`Completed ${n}/${o} operation${1===o?"":"s"} on doc ${t}.`;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t},{content:`${r}\n\nResults:\n${a.join("\n")}\n\nDoc ID: ${t}`}}catch(e){return{content:`Error: ${e instanceof Error?e.message:String(e)}`}}}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_block":return this.executeDeleteBlock(t.block_id);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(gI,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(yI,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:RI(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:RI(e.delta_format),language:e.language};case"list_item":return{deltaFormat:RI(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(wI,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:OI(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:AI(e.alignment),direction:DI(e.direction)}};case"list_item":return{list_block:{delta_format:OI(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:OI(e.delta_format),text_block_type:Oy.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(NI,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(xI,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(TI,{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(EI,{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(II,{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 p=o?Array.isArray(o)?o:[o]:[];if((null!=r||null!=s)&&p.length>1)throw new Error("selection_from and selection_length are only supported with a single block_id");const d=await this.resolveObjectId(e,t),c=await this.resolveDocItemId(d);let l;if(n){const e=JSON.parse(n),t=BT.safeParse(e);if(!t.success)throw new Error(`Invalid mentions_list format: ${t.error.message}`);l=t.data}const m={itemId:c,body:a,parentId:i?.toString(),mentionsList:l},u=await this.mondayApi.request(SI,m);if(!u.create_update?.id)throw new Error("Failed to create comment: no update returned");const f=u.create_update.id,h=Number(f),v=i?`Reply to update ${i}`:"Comment";if(p.length>0){if(Number.isNaN(h))throw new Error(`${v} created (update ID: ${f}) 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 p){const i=t.find((e=>e.id===a));if(!i)throw new Error(`${v} created (update ID: ${f}) but block annotation failed: block ${a} not found in doc ${e}`);const n=i.content.deltaFormat;if(!n)throw new Error(`${v} created (update ID: ${f}) 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(`${v} created (update ID: ${f}) but block annotation failed: block ${a} has an empty deltaFormat and cannot be annotated`);const p=r??0,d=s??o;if(p+d>o)throw new Error(`${v} created (update ID: ${f}) but block annotation failed: selection [${p}, ${p+d}) is out of range for block ${a} (total length ${o})`);let c;try{c=$I(n,h,p,d)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`${v} created (update ID: ${f}) but delta annotation failed for block ${a}: ${t}`)}const l={...i.content,deltaFormat:c},m=await this.mondayApi.request(wI,{blockId:a,content:JSON.stringify(l)});if(!m?.update_doc_block)throw new Error(`${v} created (update ID: ${f}) but block annotation write returned no confirmation for block ${a}`)}}const b=p.length;return`${v} created${b>1?` across ${b} blocks`:1===b?" on block":""} (update ID: ${f})`}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 wu{constructor(){super(...arguments),this.name="update_workspace",this.type=x.WRITE,this.annotations=_u({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return hS}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(fS,t),i=await WE(this.mondayApi),n=i?zE(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 wu{constructor(){super(...arguments),this.name="update_folder",this.type=x.WRITE,this.annotations=_u({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return bS}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?{position_is_after:i,position_object_id:t,position_object_type:a}:void 0},o=await this.mondayApi.request(vS,n);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends wu{constructor(){super(...arguments),this.name="create_workspace",this.type=x.WRITE,this.annotations=_u({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return yS}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(gS,t),i=await WE(this.mondayApi),n=i&&a.create_workspace?.id?zE(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 wu{constructor(){super(...arguments),this.name="create_folder",this.type=x.WRITE,this.annotations=_u({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return wS}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(_S,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 wu{constructor(){super(...arguments),this.name="move_object",this.type=x.WRITE,this.annotations=_u({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 ES}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 p={folderId:t,position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},d=await this.mondayApi.request(vS,p);return{content:{message:"Object moved",object_id:d.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 p={boardId:t,attributes:{position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(xS,p);return d.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:d.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${d.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 p={overviewId:t,attributes:{position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(TS,p);return d.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:d.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${d.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:t}=e;switch(t){case ry.Folder:return this.executeUpdateFolder(e);case ry.Board:return this.executeUpdateBoardHierarchy(e);case ry.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends wu{constructor(){super(...arguments),this.name="create_dashboard",this.type=x.WRITE,this.annotations=_u({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 mS}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(dS,t);if(!a.create_dashboard)throw new Error("Failed to create dashboard");const i=a.create_dashboard;return{content:{message:`Dashboard ${i.id} successfully created`,dashboard_id:i.id,dashboard_name:i.name}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${t}`)}}},class extends wu{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=x.READ,this.annotations=_u({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(cS,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:_E}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends wu{constructor(){super(...arguments),this.name="create_widget",this.type=x.WRITE,this.annotations=_u({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 uS}async executeInternal(e){if(!e.settings)throw new Error("You must pass the settings parameter");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(lS,t);if(!a.create_widget)throw new Error("Failed to create widget");const i=a.create_widget;i.parent?.kind===Hy.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){const a=t instanceof Error?t.message:String(t);throw new Error(`Failed to create ${e.widget_kind} widget: ${a}`)}}},class extends wu{constructor(){super(...arguments),this.name="board_insights",this.type=x.READ,this.annotations=_u({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 to understand the board metadata. 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 kS}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};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===Db.Label)).map((e=>e.columnId))),n=e.groupBy?.filter((e=>!i.has(e))).map((e=>({function:Db.Label,columnId:e})))??[],o=e.aggregations.concat(n).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return AS.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:Ab.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===Db.CountItems?[]:[{type:Ab.Column,column:DS(n),as:n}]}),as:s}}var i,n;const o={type:Ab.Column,column:DS(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:Ab.Column,column:DS(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:Nb.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(IS,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 wu{constructor(){super(...arguments),this.name="search",this.type=x.READ,this.annotations=_u({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Search within monday.com platform. Can search for boards, documents, forms, folders.\nFor users and teams, use list_users_and_teams tool.\nFor workspaces, use list_workspaces tool.\nFor items and groups, use get_board_items_page tool.\nFor groups, use get_board_info tool.\nIMPORTANT: ids returned by this tool are prefixed with the type of the object (e.g doc-123, board-456, folder-789). When passing the ids to other tools, you need to remove the prefix and just pass the number.\n "}getInputSchema(){return FS}async executeInternal(e){if(e.searchType!==vE.FOLDERS&&e.searchTerm)try{return{content:{message:"Search results",data:(await this.searchWithDevEndpointAsync(e)).items}}}catch(e){hT(e)}const t={[vE.BOARD]:this.searchBoardsAsync.bind(this),[vE.DOCUMENTS]:this.searchDocsAsync.bind(this),[vE.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!t)throw new Error(`Unsupported search type: ${e.searchType}`);const a=await t(e);return{content:{message:"Search results",disclaimer:a.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",data:a.items}}}async searchWithDevEndpointAsync(e){const t={[vE.BOARD]:{entities:[{boards:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[vE.DOCUMENTS]:{entities:[{docs:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[vE.FOLDERS]:void 0}[e.searchType];if(!t)throw new Error(`Unsupported search type for dev endpoint: ${e.searchType}`);if(e.page>1)throw new Error("Pagination is not supported for search, increase the limit parameter instead");const a={query:e.searchTerm,limit:e.limit,filters:t},i=(await this.mondayApi.request($S,a,{versionOverride:"dev",timeout:uT})).cross_entity_search||[],n=[];for(const e of i)"BoardSearchResult"===e.__typename?n.push({id:hE.BOARD+e.data.id,title:e.data.name,url:e.data.url}):"DocSearchResult"===e.__typename&&n.push({id:hE.DOCUMENT+e.data.id,title:e.data.name});return{items:n,wasFiltered:!0}}async searchFoldersAsync(e){const t={...this.getPagingParamsForSearch(e,100),workspace_ids:e.workspaceIds?.map((e=>e.toString()))};t.workspace_ids??=[],0===t.workspace_ids.length&&fT(new Error("Searching for folders require specifying workspace ids"),"search folders");const a=await this.mondayApi.request(CS,t),i=this.searchAndVirtuallyPaginate(e,a.folders||[],(e=>e.name));return{items:i.items.map((e=>({id:hE.FOLDER+e.id,title:e.name}))),wasFiltered:i.wasFiltered}}async searchDocsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(RS,t),i=this.searchAndVirtuallyPaginate(e,a.docs||[],(e=>e.name));return{items:i.items.map((e=>({id:hE.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:i.wasFiltered}}async searchBoardsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(OS,t),i=this.searchAndVirtuallyPaginate(e,a.boards||[],(e=>e.name));return{items:i.items.map((e=>({id:hE.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:i.wasFiltered}}getPagingParamsForSearch(e,t=1e3){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?Math.min(1e3,t):e.limit}}searchAndVirtuallyPaginate(e,t,a){if(t.length<=LS)return{items:t,wasFiltered:!1};const i=iI(e.searchTerm??""),n=(e.page-1)*e.limit,o=n+e.limit;return{items:t.filter((e=>iI(a(e)).includes(i))).slice(n,o),wasFiltered:!0}}},class extends wu{constructor(){super(...arguments),this.name="get_user_context",this.type=x.READ,this.annotations=_u({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information and their relevant items (boards, folders, workspaces, dashboards).\n \n Use this tool at the beginning of conversations to:\n - Get context about who the current user is (id, name, title)\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 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(qS,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};return{content:{message:"User context",...{user:e,favorites:await this.fetchFavorites(t||[]),relevantBoards:this.extractRelevantBoards(a),relevantPeople:this.extractRelevantPeople(a)}}}}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[HS[e]]=t[e];const n=await this.mondayApi.request(GS,i),o=[];for(const e of a){const t=WS[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}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 wu{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=x.WRITE,this.annotations=_u({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 MS}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(VS,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends wu{constructor(){super(...arguments),this.name="get_notetaker_meetings",this.type=x.READ,this.annotations=_u({title:"Get Notetaker Meetings",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve notetaker meetings with optional detailed fields. Use include_summary, include_topics, include_action_items, and include_transcript flags to control which details are returned. Use access to filter by meeting access level (OWN, SHARED_WITH_ME, SHARED_WITH_ACCOUNT, ALL). Defaults to OWN. Supports filtering by ids, search term, and cursor-based pagination."}getInputSchema(){return YS}async executeInternal(e){const t={access:e.access};e.ids&&e.ids.length>0&&(t.ids=e.ids),e.search&&(t.search=e.search);const a={limit:e.limit,cursor:e.cursor||void 0,filters:t,includeSummary:e.include_summary,includeTopics:e.include_topics,includeActionItems:e.include_action_items,includeTranscript:e.include_transcript},i=await this.mondayApi.request(zS,a,{versionOverride:"2026-04"}),n=i.notetaker?.meetings;if(!n?.meetings||0===n.meetings.length)return{content:"No notetaker meetings found matching the specified criteria."};return{content:{message:"Meetings retrieved",data:{meetings:n.meetings,pagination:{has_next_page:n.page_info?.has_next_page??!1,cursor:n.page_info?.cursor??null,count:n.meetings.length}}}}}},class extends wu{constructor(){super(...arguments),this.name="create_view",this.type=x.WRITE,this.annotations=_u({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\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 Mw}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort},a=await this.mondayApi.request(Bw,t);return a.create_view?{content:`View "${a.create_view.name}" (ID: ${a.create_view.id}, type: ${a.create_view.type}) successfully created`}:{content:"Failed to create view - no response from API"}}},class extends wu{constructor(){super(...arguments),this.name="undo_action",this.type=x.WRITE,this.annotations=_u({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 QS}async executeInternal(e){return await this.mondayApi.request(KS,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}}];var DN;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(DN||(DN={}));const kN=(e,t)=>{let a=[];t?.mode===DN.APPS?a=[...yu]:t?.mode!==DN.API&&t?.mode||(a=[...AN,...NN]);const i=a.map((t=>((e,t)=>e.prototype instanceof wu?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof Jm?new e(t.apiToken):new e)(t,e)));return i.filter((e=>{if(!t)return e.type!==x.ALL_API;if(t.mode===DN.API&&"only"===t.enableDynamicApiTools)return e.type===x.ALL_API;let a=!1;return t.mode===DN.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===x.ALL_API),t.readOnlyMode&&(a=a||e.type!==x.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))},ON=e=>"object"==typeof e?JSON.stringify(e):e;class RN{constructor(t){this.mondayApi=new e({token:t.mondayApiToken,apiVersion:t.mondayApiVersion??Km,endpoint:t.mondayApiEndpoint,requestConfig:t.mondayApiRequestConfig}),this.mondayApiToken=t.mondayApiToken,this.context={...t.context,apiVersion:t.mondayApiVersion??Km},this.tools=this.initializeTools(t)}initializeTools(e){const t={apiClient:this.mondayApi,apiToken:this.mondayApiToken,context:this.context};return kN(t,e.toolsConfiguration)}getTools(){return this.tools.map((e=>{const t=e.getInputSchema();return{type:"function",function:{name:e.name,description:e.getDescription(),parameters:t?w(y.object(t)):void 0}}}))}async handleToolCall(e){const{name:t,arguments:a}=e.function,i=JSON.parse(a),n=this.tools.find((e=>e.name===t));if(!n)throw new Error(`Unknown tool: ${t}`);const o=n.getInputSchema();if(o){const t=y.object(o).safeParse(i);if(!t.success)throw new Error(`Invalid arguments: ${t.error.message}`);const a=await n.execute(t.data);return{role:"tool",tool_call_id:e.id,content:ON(a.content)}}{const t=await n.execute();return{role:"tool",tool_call_id:e.id,content:ON(t.content)}}}}export{RN as MondayAgentToolkit};
2072
2090
  //# sourceMappingURL=index.js.map