@mondaydotcomorg/agent-toolkit 2.20.2 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -701,7 +701,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
701
701
  description
702
702
  }
703
703
  }
704
- `,nx={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."},ox={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."}},sx={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."}},rx={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). Required when creating select type questions. Can only be provided when creating a question, not yet supported for updating a question.",selectOptionsLabel:"The display text for individual option choices in select-type questions."},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."}},px={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."},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"}},dx={destination_workspace_id:e.string().describe(ox.args.destinationWorkspaceId),destination_folder_id:e.string().optional().describe(ox.args.destinationFolderId),destination_folder_name:e.string().optional().describe(ox.args.destinationFolderName),board_kind:e.nativeEnum(ig).optional().describe(ox.args.boardKind),destination_name:e.string().optional().describe(ox.args.destinationName),board_owner_ids:e.array(e.string()).optional().describe(ox.args.boardOwnerIds),board_owner_team_ids:e.array(e.string()).optional().describe(ox.args.boardOwnerTeamIds),board_subscriber_ids:e.array(e.string()).optional().describe(ox.args.boardSubscriberIds),board_subscriber_teams_ids:e.array(e.string()).optional().describe(ox.args.boardSubscriberTeamsIds)};var lx,cx,mx,ux,fx,hx,vx,gx,bx,yx,wx,xx,_x,Tx,Ex,Ix;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(lx||(lx={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(cx||(cx={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(mx||(mx={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(ux||(ux={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(fx||(fx={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(hx||(hx={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(vx||(vx={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(gx||(gx={})),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"}(bx||(bx={})),function(e){e.Account="account",e.QueryParam="queryParam"}(yx||(yx={})),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"}(wx||(wx={})),function(e){e.And="AND",e.Or="OR"}(xx||(xx={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(_x||(_x={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(Tx||(Tx={})),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"}(Ex||(Ex={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(Ix||(Ix={}));const Nx=e.object({type:e.nativeEnum(Yg).describe(rx.properties.type),title:e.string().describe(rx.properties.title).optional(),description:e.string().describe(rx.properties.description).optional(),visible:e.boolean().describe(rx.properties.visible).optional(),required:e.boolean().describe(rx.properties.required).optional(),options:e.array(e.object({label:e.string().describe(rx.properties.selectOptionsLabel)})).describe(rx.properties.selectOptions).optional(),settings:e.object({checkedByDefault:e.boolean().describe(px.properties.checkedByDefault).optional(),defaultCurrentDate:e.boolean().describe(px.properties.defaultCurrentDate).optional(),display:e.nativeEnum(zg).describe(px.properties.display).optional(),includeTime:e.boolean().describe(px.properties.includeTime).optional(),locationAutofilled:e.boolean().describe(px.properties.locationAutofilled).optional(),optionsOrder:e.nativeEnum(Wg).describe(px.properties.optionsOrder).optional(),prefixAutofilled:e.boolean().describe(px.properties.prefixAutofilled).optional(),prefixPredefined:e.object({enabled:e.boolean().describe(px.properties.prefixPredefinedEnabled),prefix:e.string().describe(px.properties.prefixPredefinedPrefix).optional()}).describe(px.properties.prefixPredefined).optional(),skipValidation:e.boolean().describe(px.properties.skipValidation).optional(),prefill:e.object({enabled:e.boolean().describe(px.properties.prefillEnabled),lookup:e.string().describe(px.properties.prefillLookup).optional(),source:e.nativeEnum(Gg).describe(px.properties.prefillSource).optional()}).describe(px.properties.prefill).optional()}).optional()}),Sx={action:e.nativeEnum(Ix).describe(rx.actions.type),formToken:e.string().describe(nx.formToken),questionId:e.string().describe(nx.questionId).optional(),question:Nx.describe(rx.actions.question).optional(),questionStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The question object. Send this as a stringified JSON of "question" field. Read "question" field description for details how to use it.')};class Ax{constructor(e){this.mondayApi=e}async deleteQuestion(e){const a=e.questionId;if(!a)return{content:"Question ID is required when deleting a question."};const t={formToken:e.formToken,questionId:a};return await this.mondayApi.request(qw,t),{content:`Form question with id ${a} deleted successfully.`}}async updateQuestion(e){const a=e.questionId;if(!a)return{content:"Question ID is required when updating a question."};const t=e.question;if(!t)return{content:"Must provide updated patch props for the question when updating."};const i={formToken:e.formToken,questionId:a,question:t};return await this.mondayApi.request(Gw,i),{content:`Form question with id ${a} updated successfully.`}}async createQuestion(e){const a=e.question;if(!a)return{content:"Must provide a full question payload when creating a question."};if(!a.title)return{content:"Must provide a title for the question when creating a question."};const t={formToken:e.formToken,question:{...a,title:a.title}},i=await this.mondayApi.request(Hw,t);return{content:`Form question created successfully. ID: ${i.create_form_question?.id}`}}}const Dx=(e,a,t)=>{const i=`${String(a)}Stringified`;if(e[a]||!e[i])return;let n;try{n=JSON.parse(e[i])}catch{throw new Error(`${String(i)} is not a valid JSON`)}const o=a in n&&1===Object.keys(n).length?n[a]:n,s=t.safeParse(o);if(!s.success)throw new Error(`JSON string defined as ${String(i)} does not match the specified schema`);e[a]=s.data};var Ox;!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"}(Ox||(Ox={}));const kx=e.object({id:e.string().describe(ox.properties.tags.id).optional(),name:e.string().describe(ox.properties.tags.name).optional(),value:e.string().describe(ox.properties.tags.value).optional(),columnId:e.string().describe(ox.properties.tags.columnId).optional()}),Rx=e.object({type:e.nativeEnum(ux).describe(sx.properties.backgroundType).optional(),value:e.string().describe(sx.properties.backgroundValue).optional()}),Cx=e.object({format:e.nativeEnum(hx).describe(sx.properties.format).optional(),alignment:e.nativeEnum(vx).describe(sx.properties.alignment).optional(),direction:e.nativeEnum(fx).describe(sx.properties.direction).optional()}),$x=e.object({position:e.nativeEnum(mx).describe(sx.properties.logoPosition).optional(),size:e.nativeEnum(cx).describe(sx.properties.logoSize).optional()}),Lx=e.object({text:e.string().describe(sx.properties.submitButtonText).optional()}),Fx=e.object({font:e.string().describe(sx.properties.font).optional(),color:e.string().describe(sx.properties.textColor).optional(),size:e.nativeEnum(gx).describe(sx.properties.fontSize).optional()}),jx=e.object({enabled:e.boolean().describe(sx.properties.redirectAfterSubmissionEnabled).optional(),redirectUrl:e.string().describe(sx.properties.redirectUrl).optional()}),Vx=e.object({allowEditSubmission:e.boolean().describe(sx.properties.allowEditSubmission).optional(),allowResubmit:e.boolean().describe(sx.properties.allowResubmit).optional(),allowViewSubmission:e.boolean().describe(sx.properties.allowViewSubmission).optional(),description:e.string().describe(sx.properties.postSubmissionDescription).optional(),redirectAfterSubmission:jx.describe(sx.properties.redirectAfterSubmission).optional(),showSuccessImage:e.boolean().describe(sx.properties.showSuccessImage).optional(),title:e.string().describe(sx.properties.postSubmissionTitle).optional()}),Px=e.object({enabled:e.boolean().describe(sx.properties.closeDateEnabled).optional(),date:e.string().describe(sx.properties.closeDateValue).optional()}),Ux=e.object({enabled:e.boolean().describe(sx.properties.draftSubmissionEnabled).optional()}),Bx=e.object({itemGroupId:e.string().describe(sx.properties.itemGroupId).optional(),includeNameQuestion:e.boolean().describe(sx.properties.includeNameQuestion).optional(),includeUpdateQuestion:e.boolean().describe(sx.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:e.boolean().describe(sx.properties.syncQuestionAndColumnsTitles).optional()}),Mx=e.object({enabled:e.boolean().describe(sx.properties.passwordEnabled).optional()}),qx=e.object({text:e.string().describe(sx.properties.startButtonText).optional()}),Hx=e.object({enabled:e.boolean().describe(sx.properties.preSubmissionEnabled).optional(),title:e.string().describe(sx.properties.preSubmissionTitle).optional(),description:e.string().describe(sx.properties.preSubmissionDescription).optional(),startButton:qx.describe(sx.properties.startButton).optional()}),Gx=e.object({enabled:e.boolean().describe(sx.properties.requireLoginEnabled).optional(),redirectToLogin:e.boolean().describe(sx.properties.redirectToLogin).optional()}),zx=e.object({enabled:e.boolean().describe(sx.properties.responseLimitEnabled).optional(),limit:e.number().describe(sx.properties.responseLimitValue).optional()}),Wx=e.object({background:Rx.describe(sx.properties.background).optional(),hideBranding:e.boolean().describe(sx.properties.hideBranding).optional(),layout:Cx.describe(sx.properties.layout).optional(),logo:$x.describe(sx.properties.logo).optional(),primaryColor:e.string().describe(sx.properties.primaryColor).optional(),showProgressBar:e.boolean().describe(sx.properties.showProgressBar).optional(),submitButton:Lx.describe(sx.properties.submitButton).optional(),text:Fx.describe(sx.properties.text).optional()}),Yx=e.object({language:e.string().describe(sx.properties.language).optional(),logoAltText:e.string().describe(sx.properties.logoAltText).optional()}),Kx=e.object({afterSubmissionView:Vx.describe(sx.properties.afterSubmissionView).optional(),closeDate:Px.describe(sx.properties.closeDate).optional(),draftSubmission:Ux.describe(sx.properties.draftSubmission).optional(),monday:Bx.describe(sx.properties.monday).optional(),password:Mx.describe(sx.properties.password).optional(),preSubmissionView:Hx.describe(sx.properties.preSubmissionView).optional(),reCaptchaChallenge:e.boolean().describe(sx.properties.reCaptchaChallenge).optional(),requireLogin:Gx.describe(sx.properties.requireLogin).optional(),responseLimit:zx.describe(sx.properties.responseLimit).optional()}),Jx=e.object({id:e.string().describe(ox.inputs.questionId)}),Qx=e.object({appearance:Wx.describe(ox.inputs.form.appearance).optional(),accessibility:Yx.describe(ox.inputs.form.accessibility).optional(),features:Kx.describe(ox.inputs.form.features).optional(),title:e.string().describe(ox.inputs.title).optional(),description:e.string().describe(ox.inputs.description).optional(),questions:e.array(Jx).describe(ox.inputs.questions).optional()}),Xx={formToken:e.string().describe(nx.formToken),action:e.nativeEnum(Ox).describe(ox.operations.updateForm.action),formPassword:e.string().describe(sx.operations.setFormPassword).optional(),tag:kx.describe(ox.inputs.tag).optional(),tagStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The tag data. Send this as a stringified JSON of "tag" field. Read "tag" field description for details how to use it.'),form:Qx.describe(ox.inputs.form.describe).optional(),formStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The form data. Send this as a stringified JSON of "form" field. Read "form" field description for details how to use it.')};class Zx{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 a={formToken:e.formToken,input:{password:e.formPassword}};return await this.mondayApi.request(zw,a),{content:"Form password successfully set."}}async shortenFormUrl(e){const a={formToken:e.formToken};return await this.mondayApi.request(Ww,a),{content:"Form URL successfully shortened."}}async deactivateForm(e){const a={formToken:e.formToken};return await this.mondayApi.request(Yw,a),{content:"Form successfully deactivated."}}async activateForm(e){const a={formToken:e.formToken};return await this.mondayApi.request(Kw,a),{content:"Form successfully activated."}}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 a={formToken:e.formToken,tag:{name:e.tag.name,value:e.tag.value}},t=await this.mondayApi.request(Qw,a);return{content:`Tag successfully added: ${JSON.stringify(t.create_form_tag,null,2)}`}}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 a={formToken:e.formToken,tagId:e.tag.id};return await this.mondayApi.request(Jw,a),{content:`Tag with id: ${e.tag.id} successfully deleted.`}}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 a={formToken:e.formToken,tagId:e.tag.id,tag:{value:e.tag.value}};return(await this.mondayApi.request(Xw,a)).update_form_tag?{content:`Tag with id: ${e.tag.id} successfully updated to value: ${e.tag.value}.`}:{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 a={formToken:e.formToken,appearance:e.form.appearance},t=await this.mondayApi.request(Zw,a);return{content:`Appearance successfully updated: ${JSON.stringify(t.update_form_settings?.appearance,null,2)}`}}async updateAccessibility(e){if(!e.form?.accessibility)return{content:'Accessibility is required for the action "updateAccessibility" in the update form tool.'};const a={formToken:e.formToken,accessibility:e.form.accessibility},t=await this.mondayApi.request(ex,a);return{content:`Accessibility successfully updated: ${JSON.stringify(t.update_form_settings?.accessibility,null,2)}`}}async updateFeatures(e){if(!e.form?.features)return{content:'Features is required for the action "updateFeatures" in the update form tool.'};const a={formToken:e.formToken,features:e.form.features},t=await this.mondayApi.request(ax,a);return{content:`Features successfully updated: ${JSON.stringify(t.update_form_settings?.features,null,2)}`}}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 a={formToken:e.formToken,questions:e.form.questions},t=await this.mondayApi.request(tx,a);return{content:`Question order successfully updated: ${JSON.stringify(t.update_form?.questions,null,2)}`}}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 a={formToken:e.formToken,title:e.form.title,description:e.form.description},t=await this.mondayApi.request(ix,a);return{content:`Form header content successfully updated: ${JSON.stringify(t.update_form,null,2)}`}}}const e_={formToken:e.string().describe(nx.formToken)};const a_={columnType:e.nativeEnum(gg).describe("The type of the column to be created"),columnTitle:e.string().describe("The title of the column to be created"),columnDescription:e.string().optional().describe("The description of the column to be created"),columnSettings:e.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.")},t_={boardId:e.number().describe("The id of the board to which the new column will be added"),...a_};const i_={color:e.nativeEnum(bg).describe("The color of the custom activity"),icon_id:e.nativeEnum(yg).describe("The icon ID of the custom activity"),name:e.string().describe("The name of the custom activity")};const n_=dw`
704
+ `,nx={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."},ox={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."}},sx={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."}},rx={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). Required when creating select type questions. Can only be provided when creating a question, not yet supported for updating a question.",selectOptionsLabel:"The display text for individual option choices in select-type questions."},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."}},px={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."},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"}},dx={destination_workspace_id:e.string().describe(ox.args.destinationWorkspaceId),destination_folder_id:e.string().optional().describe(ox.args.destinationFolderId),destination_folder_name:e.string().optional().describe(ox.args.destinationFolderName),board_kind:e.nativeEnum(ig).optional().describe(ox.args.boardKind),destination_name:e.string().optional().describe(ox.args.destinationName),board_owner_ids:e.array(e.string()).optional().describe(ox.args.boardOwnerIds),board_owner_team_ids:e.array(e.string()).optional().describe(ox.args.boardOwnerTeamIds),board_subscriber_ids:e.array(e.string()).optional().describe(ox.args.boardSubscriberIds),board_subscriber_teams_ids:e.array(e.string()).optional().describe(ox.args.boardSubscriberTeamsIds)};var lx,cx,mx,ux,fx,hx,vx,gx,bx,yx,wx,xx,_x,Tx,Ex,Ix;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(lx||(lx={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(cx||(cx={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(mx||(mx={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(ux||(ux={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(fx||(fx={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(hx||(hx={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(vx||(vx={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(gx||(gx={})),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"}(bx||(bx={})),function(e){e.Account="account",e.QueryParam="queryParam"}(yx||(yx={})),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"}(wx||(wx={})),function(e){e.And="AND",e.Or="OR"}(xx||(xx={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(_x||(_x={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(Tx||(Tx={})),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"}(Ex||(Ex={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(Ix||(Ix={}));const Nx=e.object({type:e.nativeEnum(Yg).describe(rx.properties.type),title:e.string().describe(rx.properties.title).optional(),description:e.string().describe(rx.properties.description).optional(),visible:e.boolean().describe(rx.properties.visible).optional(),required:e.boolean().describe(rx.properties.required).optional(),options:e.array(e.object({label:e.string().describe(rx.properties.selectOptionsLabel)})).describe(rx.properties.selectOptions).optional(),settings:e.object({checkedByDefault:e.boolean().describe(px.properties.checkedByDefault).optional(),defaultCurrentDate:e.boolean().describe(px.properties.defaultCurrentDate).optional(),display:e.nativeEnum(zg).describe(px.properties.display).optional(),includeTime:e.boolean().describe(px.properties.includeTime).optional(),locationAutofilled:e.boolean().describe(px.properties.locationAutofilled).optional(),optionsOrder:e.nativeEnum(Wg).describe(px.properties.optionsOrder).optional(),prefixAutofilled:e.boolean().describe(px.properties.prefixAutofilled).optional(),prefixPredefined:e.object({enabled:e.boolean().describe(px.properties.prefixPredefinedEnabled),prefix:e.string().describe(px.properties.prefixPredefinedPrefix).optional()}).describe(px.properties.prefixPredefined).optional(),skipValidation:e.boolean().describe(px.properties.skipValidation).optional(),prefill:e.object({enabled:e.boolean().describe(px.properties.prefillEnabled),lookup:e.string().describe(px.properties.prefillLookup).optional(),source:e.nativeEnum(Gg).describe(px.properties.prefillSource).optional()}).describe(px.properties.prefill).optional()}).optional()}),Sx={action:e.nativeEnum(Ix).describe(rx.actions.type),formToken:e.string().describe(nx.formToken),questionId:e.string().describe(nx.questionId).optional(),question:Nx.describe(rx.actions.question).optional(),questionStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The question object. Send this as a stringified JSON of "question" field. Read "question" field description for details how to use it.')};class Ax{constructor(e){this.mondayApi=e}async deleteQuestion(e){const a=e.questionId;if(!a)return{content:"Question ID is required when deleting a question."};const t={formToken:e.formToken,questionId:a};return await this.mondayApi.request(qw,t),{content:`Form question with id ${a} deleted successfully.`}}async updateQuestion(e){const a=e.questionId;if(!a)return{content:"Question ID is required when updating a question."};const t=e.question;if(!t)return{content:"Must provide updated patch props for the question when updating."};const i={formToken:e.formToken,questionId:a,question:t};return await this.mondayApi.request(Gw,i),{content:`Form question with id ${a} updated successfully.`}}async createQuestion(e){const a=e.question;if(!a)return{content:"Must provide a full question payload when creating a question."};if(!a.title)return{content:"Must provide a title for the question when creating a question."};const t={formToken:e.formToken,question:{...a,title:a.title}},i=await this.mondayApi.request(Hw,t);return{content:`Form question created successfully. ID: ${i.create_form_question?.id}`}}}const Dx=(e,a,t)=>{const i=`${String(a)}Stringified`;if(e[a]||!e[i])return;let n;try{n=JSON.parse(e[i])}catch{throw new Error(`${String(i)} is not a valid JSON`)}const o="object"==typeof n&&!!n&&a in n&&1===Object.keys(n).length?n[a]:n,s=t.safeParse(o);if(!s.success)throw new Error(`JSON string defined as ${String(i)} does not match the specified schema`);e[a]=s.data};var Ox;!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"}(Ox||(Ox={}));const kx=e.object({id:e.string().describe(ox.properties.tags.id).optional(),name:e.string().describe(ox.properties.tags.name).optional(),value:e.string().describe(ox.properties.tags.value).optional(),columnId:e.string().describe(ox.properties.tags.columnId).optional()}),Rx=e.object({type:e.nativeEnum(ux).describe(sx.properties.backgroundType).optional(),value:e.string().describe(sx.properties.backgroundValue).optional()}),Cx=e.object({format:e.nativeEnum(hx).describe(sx.properties.format).optional(),alignment:e.nativeEnum(vx).describe(sx.properties.alignment).optional(),direction:e.nativeEnum(fx).describe(sx.properties.direction).optional()}),$x=e.object({position:e.nativeEnum(mx).describe(sx.properties.logoPosition).optional(),size:e.nativeEnum(cx).describe(sx.properties.logoSize).optional()}),Lx=e.object({text:e.string().describe(sx.properties.submitButtonText).optional()}),Fx=e.object({font:e.string().describe(sx.properties.font).optional(),color:e.string().describe(sx.properties.textColor).optional(),size:e.nativeEnum(gx).describe(sx.properties.fontSize).optional()}),jx=e.object({enabled:e.boolean().describe(sx.properties.redirectAfterSubmissionEnabled).optional(),redirectUrl:e.string().describe(sx.properties.redirectUrl).optional()}),Vx=e.object({allowEditSubmission:e.boolean().describe(sx.properties.allowEditSubmission).optional(),allowResubmit:e.boolean().describe(sx.properties.allowResubmit).optional(),allowViewSubmission:e.boolean().describe(sx.properties.allowViewSubmission).optional(),description:e.string().describe(sx.properties.postSubmissionDescription).optional(),redirectAfterSubmission:jx.describe(sx.properties.redirectAfterSubmission).optional(),showSuccessImage:e.boolean().describe(sx.properties.showSuccessImage).optional(),title:e.string().describe(sx.properties.postSubmissionTitle).optional()}),Px=e.object({enabled:e.boolean().describe(sx.properties.closeDateEnabled).optional(),date:e.string().describe(sx.properties.closeDateValue).optional()}),Ux=e.object({enabled:e.boolean().describe(sx.properties.draftSubmissionEnabled).optional()}),Bx=e.object({itemGroupId:e.string().describe(sx.properties.itemGroupId).optional(),includeNameQuestion:e.boolean().describe(sx.properties.includeNameQuestion).optional(),includeUpdateQuestion:e.boolean().describe(sx.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:e.boolean().describe(sx.properties.syncQuestionAndColumnsTitles).optional()}),Mx=e.object({enabled:e.boolean().describe(sx.properties.passwordEnabled).optional()}),qx=e.object({text:e.string().describe(sx.properties.startButtonText).optional()}),Hx=e.object({enabled:e.boolean().describe(sx.properties.preSubmissionEnabled).optional(),title:e.string().describe(sx.properties.preSubmissionTitle).optional(),description:e.string().describe(sx.properties.preSubmissionDescription).optional(),startButton:qx.describe(sx.properties.startButton).optional()}),Gx=e.object({enabled:e.boolean().describe(sx.properties.requireLoginEnabled).optional(),redirectToLogin:e.boolean().describe(sx.properties.redirectToLogin).optional()}),zx=e.object({enabled:e.boolean().describe(sx.properties.responseLimitEnabled).optional(),limit:e.number().describe(sx.properties.responseLimitValue).optional()}),Wx=e.object({background:Rx.describe(sx.properties.background).optional(),hideBranding:e.boolean().describe(sx.properties.hideBranding).optional(),layout:Cx.describe(sx.properties.layout).optional(),logo:$x.describe(sx.properties.logo).optional(),primaryColor:e.string().describe(sx.properties.primaryColor).optional(),showProgressBar:e.boolean().describe(sx.properties.showProgressBar).optional(),submitButton:Lx.describe(sx.properties.submitButton).optional(),text:Fx.describe(sx.properties.text).optional()}),Yx=e.object({language:e.string().describe(sx.properties.language).optional(),logoAltText:e.string().describe(sx.properties.logoAltText).optional()}),Kx=e.object({afterSubmissionView:Vx.describe(sx.properties.afterSubmissionView).optional(),closeDate:Px.describe(sx.properties.closeDate).optional(),draftSubmission:Ux.describe(sx.properties.draftSubmission).optional(),monday:Bx.describe(sx.properties.monday).optional(),password:Mx.describe(sx.properties.password).optional(),preSubmissionView:Hx.describe(sx.properties.preSubmissionView).optional(),reCaptchaChallenge:e.boolean().describe(sx.properties.reCaptchaChallenge).optional(),requireLogin:Gx.describe(sx.properties.requireLogin).optional(),responseLimit:zx.describe(sx.properties.responseLimit).optional()}),Jx=e.object({id:e.string().describe(ox.inputs.questionId)}),Qx=e.object({appearance:Wx.describe(ox.inputs.form.appearance).optional(),accessibility:Yx.describe(ox.inputs.form.accessibility).optional(),features:Kx.describe(ox.inputs.form.features).optional(),title:e.string().describe(ox.inputs.title).optional(),description:e.string().describe(ox.inputs.description).optional(),questions:e.array(Jx).describe(ox.inputs.questions).optional()}),Xx={formToken:e.string().describe(nx.formToken),action:e.nativeEnum(Ox).describe(ox.operations.updateForm.action),formPassword:e.string().describe(sx.operations.setFormPassword).optional(),tag:kx.describe(ox.inputs.tag).optional(),tagStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The tag data. Send this as a stringified JSON of "tag" field. Read "tag" field description for details how to use it.'),form:Qx.describe(ox.inputs.form.describe).optional(),formStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The form data. Send this as a stringified JSON of "form" field. Read "form" field description for details how to use it.')};class Zx{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 a={formToken:e.formToken,input:{password:e.formPassword}};return await this.mondayApi.request(zw,a),{content:"Form password successfully set."}}async shortenFormUrl(e){const a={formToken:e.formToken};return await this.mondayApi.request(Ww,a),{content:"Form URL successfully shortened."}}async deactivateForm(e){const a={formToken:e.formToken};return await this.mondayApi.request(Yw,a),{content:"Form successfully deactivated."}}async activateForm(e){const a={formToken:e.formToken};return await this.mondayApi.request(Kw,a),{content:"Form successfully activated."}}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 a={formToken:e.formToken,tag:{name:e.tag.name,value:e.tag.value}},t=await this.mondayApi.request(Qw,a);return{content:`Tag successfully added: ${JSON.stringify(t.create_form_tag,null,2)}`}}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 a={formToken:e.formToken,tagId:e.tag.id};return await this.mondayApi.request(Jw,a),{content:`Tag with id: ${e.tag.id} successfully deleted.`}}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 a={formToken:e.formToken,tagId:e.tag.id,tag:{value:e.tag.value}};return(await this.mondayApi.request(Xw,a)).update_form_tag?{content:`Tag with id: ${e.tag.id} successfully updated to value: ${e.tag.value}.`}:{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 a={formToken:e.formToken,appearance:e.form.appearance},t=await this.mondayApi.request(Zw,a);return{content:`Appearance successfully updated: ${JSON.stringify(t.update_form_settings?.appearance,null,2)}`}}async updateAccessibility(e){if(!e.form?.accessibility)return{content:'Accessibility is required for the action "updateAccessibility" in the update form tool.'};const a={formToken:e.formToken,accessibility:e.form.accessibility},t=await this.mondayApi.request(ex,a);return{content:`Accessibility successfully updated: ${JSON.stringify(t.update_form_settings?.accessibility,null,2)}`}}async updateFeatures(e){if(!e.form?.features)return{content:'Features is required for the action "updateFeatures" in the update form tool.'};const a={formToken:e.formToken,features:e.form.features},t=await this.mondayApi.request(ax,a);return{content:`Features successfully updated: ${JSON.stringify(t.update_form_settings?.features,null,2)}`}}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 a={formToken:e.formToken,questions:e.form.questions},t=await this.mondayApi.request(tx,a);return{content:`Question order successfully updated: ${JSON.stringify(t.update_form?.questions,null,2)}`}}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 a={formToken:e.formToken,title:e.form.title,description:e.form.description},t=await this.mondayApi.request(ix,a);return{content:`Form header content successfully updated: ${JSON.stringify(t.update_form,null,2)}`}}}const e_={formToken:e.string().describe(nx.formToken)};const a_={columnType:e.nativeEnum(gg).describe("The type of the column to be created"),columnTitle:e.string().describe("The title of the column to be created"),columnDescription:e.string().optional().describe("The description of the column to be created"),columnSettings:e.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.")},t_={boardId:e.number().describe("The id of the board to which the new column will be added"),...a_};const i_={color:e.nativeEnum(bg).describe("The color of the custom activity"),icon_id:e.nativeEnum(yg).describe("The icon ID of the custom activity"),name:e.string().describe("The name of the custom activity")};const n_=dw`
705
705
  mutation createGroup(
706
706
  $boardId: ID!
707
707
  $groupName: String!
@@ -1171,13 +1171,13 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1171
1171
  }
1172
1172
  }
1173
1173
  }
1174
- `,xT={name:e.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:e.string().describe("ID of the workspace that will own the dashboard"),board_ids:e.array(e.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:e.nativeEnum(xg).default(xg.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:e.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const _T={parent_container_id:e.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:e.nativeEnum(Bb).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:e.nativeEnum(kg).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:e.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:e.record(e.unknown()).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 TT=dw`
1174
+ `,xT={name:e.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:e.string().describe("ID of the workspace that will own the dashboard"),board_ids:e.array(e.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:e.nativeEnum(xg).default(xg.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:e.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const _T={parent_container_id:e.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:e.nativeEnum(Bb).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:e.nativeEnum(kg).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:e.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:e.record(e.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."),settingsStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The settings object. Send this as a stringified JSON of "settings" field. Read "settings" field description for details how to use it.')};const TT=dw`
1175
1175
  mutation updateWorkspace($id: ID!, $attributes: UpdateWorkspaceAttributesInput!) {
1176
1176
  update_workspace(id: $id, attributes: $attributes) {
1177
1177
  id
1178
1178
  }
1179
1179
  }
1180
- `,ET={id:e.string().describe("The ID of the workspace to update"),attributes:e.object({accountProductId:e.number().optional(),description:e.string().optional(),kind:e.nativeEnum(Mb).optional(),name:e.string().optional()}).describe("Attributes to update in the workspace")};const IT=dw`
1180
+ `,ET={id:e.string().describe("The ID of the workspace to update"),attributeAccountProductId:e.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:e.string().optional().describe("The description of the workspace to update"),attributeKind:e.nativeEnum(Mb).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:e.string().optional().describe("The name of the workspace to update")};const IT=dw`
1181
1181
  mutation updateFolder(
1182
1182
  $folderId: ID!
1183
1183
  $name: String
@@ -1203,7 +1203,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1203
1203
  id
1204
1204
  }
1205
1205
  }
1206
- `,NT={folderId:e.string().describe("The ID of the folder to update"),name:e.string().optional().describe("The new name of the folder"),color:e.nativeEnum(Lg).optional().describe("The new color of the folder"),fontWeight:e.nativeEnum(jg).optional().describe("The new font weight of the folder"),customIcon:e.nativeEnum(Fg).optional().describe("The new custom icon of the folder"),parentFolderId:e.string().optional().describe("The ID of the new parent folder"),workspaceId:e.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:e.string().optional().describe("The account product ID associated with the folder"),position:e.object({object_id:e.string().describe("The ID of the object to position the folder relative to"),object_type:e.nativeEnum(lb).describe("The type of object to position the folder relative to"),is_after:e.boolean().optional().describe("Whether to position the folder after the object")}).optional().describe("The new position of the folder")};const ST=dw`
1206
+ `,NT={folderId:e.string().describe("The ID of the folder to update"),name:e.string().optional().describe("The new name of the folder"),color:e.nativeEnum(Lg).optional().describe("The new color of the folder"),fontWeight:e.nativeEnum(jg).optional().describe("The new font weight of the folder"),customIcon:e.nativeEnum(Fg).optional().describe("The new custom icon of the folder"),parentFolderId:e.string().optional().describe("The ID of the new parent folder"),workspaceId:e.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:e.string().optional().describe("The account product ID associated with the folder"),position_object_id:e.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:e.nativeEnum(lb).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:e.boolean().optional().describe("Whether to position the folder after the object")};const ST=dw`
1207
1207
  mutation createWorkspace(
1208
1208
  $name: String!
1209
1209
  $workspaceKind: WorkspaceKind!
@@ -1259,7 +1259,28 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1259
1259
  }
1260
1260
  }
1261
1261
  }
1262
- `,CT={objectType:e.nativeEnum(lb).describe("The type of object to move"),id:e.string().describe("The ID of the object to move"),position:e.object({object_id:e.string().describe("The ID of the object to position the object relative to"),object_type:e.nativeEnum(lb).describe("The type of object to position the object relative to"),is_after:e.boolean().optional().describe("Whether to position the object after the object")}).optional().describe("The new position of the object. Required if changing the position based on another object."),parentFolderId:e.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:e.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:e.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};e.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'),e.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const $T=dw`
1262
+ `,CT={objectType:e.nativeEnum(lb).describe("The type of object to move"),id:e.string().describe("The ID of the object to move"),position_object_id:e.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:e.nativeEnum(lb).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:e.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:e.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:e.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:e.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const $T=dw`
1263
+ query aggregateBoardInsights($query: AggregateQueryInput!) {
1264
+ aggregate(query: $query) {
1265
+ results {
1266
+ entries {
1267
+ alias
1268
+ value {
1269
+ ... on AggregateBasicAggregationResult {
1270
+ result
1271
+ }
1272
+ ... on AggregateGroupByResult {
1273
+ value_string
1274
+ value_int
1275
+ value_float
1276
+ value_boolean
1277
+ }
1278
+ }
1279
+ }
1280
+ }
1281
+ }
1282
+ }
1283
+ `,LT=new Set([Mv.Case,Mv.Between,Mv.Left,Mv.Raw,Mv.None,Mv.CountKeys]),FT=Object.values(Mv).filter((e=>!LT.has(e))),jT=new Set([Mv.Left,Mv.Trim,Mv.Upper,Mv.Lower,Mv.DateTruncDay,Mv.DateTruncWeek,Mv.DateTruncMonth,Mv.DateTruncQuarter,Mv.DateTruncYear,Mv.Color,Mv.Label,Mv.EndDate,Mv.StartDate,Mv.Hour,Mv.PhoneCountryShortName,Mv.Person,Mv.Upper,Mv.Lower,Mv.Order,Mv.Length,Mv.Flatten,Mv.IsDone]);function VT(e){return{column_id:e}}new Set([Mv.Count,Mv.CountDistinct,Mv.CountSubitems,Mv.CountItems,Mv.First,Mv.Sum,Mv.Average,Mv.Median,Mv.Min,Mv.Max,Mv.MinMax]);const PT={boardId:e.number().describe("The id of the board to get insights for"),aggregationsStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The aggregations to get. Send this as a stringified JSON array of "aggregations" field. Read "aggregations" field description for details how to use it.'),aggregations:e.array(e.object({function:e.enum(FT).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:e.string().describe("The id of the column to aggregate")})).describe("The aggregations to get. Transformative functions and plain columns (no function) must be in group by. [REQUIRED PRECONDITION]: Either send this field or the stringified version of it.").optional(),groupBy:e.array(e.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:e.number().describe("The limit of the results").max(1e3).optional().default(1e3),filtersStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The filters to apply on the items. Send this as a stringified JSON array of "filters" field. Read "filters" field description for details how to use it.'),filters:e.array(e.object({columnId:e.string().describe("The id of the column to filter by"),compareAttribute:e.string().optional().describe("The attribute to compare the value to"),compareValue:e.any().describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:e.nativeEnum(eb).optional().default(eb.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 "Filtering Guidelines" section for filtering by the column.'),filtersOperator:e.nativeEnum(Zg).optional().default(Zg.And).describe("The logical operator to use for the filters"),orderByStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The order by to apply on the items. Send this as a stringified JSON array of "orderBy" field. Read "orderBy" field description for details how to use it.'),orderBy:e.array(e.object({columnId:e.string().describe("The id of the column to order by"),direction:e.nativeEnum(Xg).optional().default(Xg.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};e.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'),e.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const UT=dw`
1263
1284
  query getSprintsByIds($ids: [ID!]) {
1264
1285
  items(ids: $ids) {
1265
1286
  id
@@ -1294,7 +1315,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1294
1315
  }
1295
1316
  }
1296
1317
  }
1297
- `,LT={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"},FT={...LT,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},jT="BOARD_NOT_FOUND:",VT="SPRINT_NOT_FOUND:",PT="DOCUMENT_NOT_FOUND:",UT="DOCUMENT_INVALID:",BT="DOCUMENT_EMPTY:",MT="EXPORT_FAILED:",qT="INTERNAL_ERROR:",HT="VALIDATION_ERROR:",GT={[FT.SPRINT_TASKS]:"Sprint Tasks",[FT.SPRINT_TIMELINE]:"Sprint Timeline",[FT.SPRINT_COMPLETION]:"Sprint Completion",[FT.SPRINT_START_DATE]:"Sprint Start Date",[FT.SPRINT_END_DATE]:"Sprint End Date",[FT.SPRINT_ACTIVATION]:"Sprint Activation",[FT.SPRINT_SUMMARY]:"Sprint Summary",[FT.SPRINT_CAPACITY]:"Sprint Capacity"},zT=xb,WT=(e,a)=>e.column_values?.find((e=>e.id===a)),YT=(e,a)=>{const t=WT(e,a);return"CheckboxValue"===t?.__typename?t.checked??!1:null},KT=(e,a)=>{const t=WT(e,a);return"DateValue"===t?.__typename?t.date??null:null},JT=(e,a)=>{const t=WT(e,a);return"DocValue"===t?.__typename&&t.file?.doc?.object_id?t.file.doc.object_id:null},QT=e=>{const a=new Set(e.filter((e=>null!==e)).map((e=>e.id))),t=[],i=Object.values(LT);for(const e of i)a.has(e)||t.push(e);if(t.length>0){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return t.forEach((a=>{const t=(e=>GT[e]||e)(a);e+=`- ${t}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}},XT={sprintId:e.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const ZT=dw`
1318
+ `,BT={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"},MT={...BT,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},qT="BOARD_NOT_FOUND:",HT="SPRINT_NOT_FOUND:",GT="DOCUMENT_NOT_FOUND:",zT="DOCUMENT_INVALID:",WT="DOCUMENT_EMPTY:",YT="EXPORT_FAILED:",KT="INTERNAL_ERROR:",JT="VALIDATION_ERROR:",QT={[MT.SPRINT_TASKS]:"Sprint Tasks",[MT.SPRINT_TIMELINE]:"Sprint Timeline",[MT.SPRINT_COMPLETION]:"Sprint Completion",[MT.SPRINT_START_DATE]:"Sprint Start Date",[MT.SPRINT_END_DATE]:"Sprint End Date",[MT.SPRINT_ACTIVATION]:"Sprint Activation",[MT.SPRINT_SUMMARY]:"Sprint Summary",[MT.SPRINT_CAPACITY]:"Sprint Capacity"},XT=xb,ZT=(e,a)=>e.column_values?.find((e=>e.id===a)),eE=(e,a)=>{const t=ZT(e,a);return"CheckboxValue"===t?.__typename?t.checked??!1:null},aE=(e,a)=>{const t=ZT(e,a);return"DateValue"===t?.__typename?t.date??null:null},tE=(e,a)=>{const t=ZT(e,a);return"DocValue"===t?.__typename&&t.file?.doc?.object_id?t.file.doc.object_id:null},iE=e=>{const a=new Set(e.filter((e=>null!==e)).map((e=>e.id))),t=[],i=Object.values(BT);for(const e of i)a.has(e)||t.push(e);if(t.length>0){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return t.forEach((a=>{const t=(e=>QT[e]||e)(a);e+=`- ${t}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}},nE={sprintId:e.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const oE=dw`
1298
1319
  query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
1299
1320
  boards(ids: [$boardId]) {
1300
1321
  items_page(limit: $limit) {
@@ -1330,7 +1351,7 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1330
1351
  }
1331
1352
  }
1332
1353
  }
1333
- `,eE={sprintsBoardId:e.number().describe("The ID of the monday-dev board containing the sprints"),limit:e.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const aE=[class extends $m{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=g.READ,this.annotations=Cm({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 eE}async executeInternal(e){try{const a=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!a.success)return{content:a.error||"Board schema validation failed"};const t={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(ZT,t),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${qT} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const a={boardId:e.toString()},t=await this.mondayApi.request(uw,a),i=t.boards?.[0];if(!i)return{success:!1,error:`${jT} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=QT(n);return o.isValid?{success:!0}:{success:!1,error:`${HT} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${qT} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}generateSprintsMetadataReport(e){let a="# Sprints Metadata Report\n\n";return a+=`**Total Sprints:** ${e.length}\n\n`,a+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",a+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const t=e.name||"Unknown",i=e.id,n=YT(e,FT.SPRINT_ACTIVATION),o=YT(e,FT.SPRINT_COMPLETION),s=KT(e,FT.SPRINT_START_DATE),r=KT(e,FT.SPRINT_END_DATE),p=((e,a)=>{const t=WT(e,a);if("TimelineValue"===t?.__typename&&t.from&&t.to)return{from:t.from.split("T")[0],to:t.to.split("T")[0]};return null})(e,FT.SPRINT_TIMELINE),d=JT(e,FT.SPRINT_SUMMARY);let l=zT.Planned;o?l=zT.Completed:(n||s)&&(l=zT.Active);const c=p?`${p.from} to ${p.to}`:"Not set";a+=`| ${t} | ${i} | ${l} | ${c} | ${s||"Not started"} | ${r||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),a+="\n## Status Definitions:\n",a+=`- **${zT.Planned}**: Sprint not yet started (no activation, no start date)\n`,a+=`- **${zT.Active}**: Sprint is active (activated but not completed)\n`,a+=`- **${zT.Completed}**: Sprint is finished\n\n`,a}},class extends $m{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=g.READ,this.annotations=Cm({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 XT}async executeInternal(e){try{const a=await this.getSprintMetadata(e.sprintId);if(!a.success)return{content:a.error||`${qT} Unknown error occurred while getting sprint metadata`};const t=await this.readSprintSummaryDocument(a.documentObjectId);return t.success?{content:t.content}:{content:t.error||`${qT} Unknown error occurred while reading document content`}}catch(e){return{content:`${qT} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const a={ids:[String(e)]},t=(await this.mondayApi.request($T,a)).items||[];if(0===t.length)return{success:!1,error:`${VT} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=t[0];if(!i)return{success:!1,error:`${VT} Sprint with ID ${e} not found.`};const n=((e,a=[])=>((e,a)=>{const t=a.filter((a=>!e.has(a)));return{isValid:0===t.length,missingColumns:t}})(new Set((e.column_values||[]).map((e=>e.id))),[...Object.values(LT),...a]))(i,[FT.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${HT} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=JT(i,FT.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${PT} 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:`${qT} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const a={object_ids:[e],limit:1},t=(await this.mondayApi.request(Ew,a)).docs||[];if(0===t.length)return{success:!1,error:`${PT} Document with object ID ${e} not found or not accessible.`};const i=t[0];if(!i||!i.id)return{success:!1,error:`${UT} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(Iw,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${MT} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const s=o.export_markdown_from_doc.markdown;return s?{success:!0,content:s}:{success:!1,error:`${BT} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${qT} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],tE=[class extends $m{constructor(){super(...arguments),this.name="delete_item",this.type=g.WRITE,this.annotations=Cm({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return h_}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(lw,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends $m{constructor(){super(...arguments),this.name="get_board_items_page",this.type=g.READ,this.annotations=Cm({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true.[REQUIRED PRECONDITION]: Before using this tool, if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available."}getInputSchema(){return C_}async executeInternal(e){const a=!e.cursor;if(a&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch{Dx(e,"filters",C_.filters),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const t={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems};Dx(e,"filters",C_.filters),Dx(e,"orderBy",C_.orderBy),a&&(e.itemIds||e.filters||e.orderBy)&&(t.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(k_,t),n=this.mapResult(i,e);return{content:JSON.stringify(n,null,2)}}rebuildFiltersWithManualSearch(e,a){return(a=(a=a??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:eb.ContainsText,compareValue:e}),a}mapResult(e,a){const t=e.boards?.[0],i=t?.items_page,n=i?.items||[];return{board:{id:t?.id,name:t?.name},items:n.map((e=>this.mapItem(e,a))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,a){const t={id:e.id,name:e.name,created_at:e.created_at,updated_at:e.updated_at};if(a.includeColumns&&e.column_values){t.column_values={};for(const a of e.column_values)t.column_values[a.id]=this.getColumnValueData(a)}return a.includeSubItems&&"subitems"in e&&e.subitems&&(t.subitems=e.subitems.slice(0,a.subItemLimit).map((e=>this.mapItem(e,a)))),t}getColumnValueData(e){if(!e.value)return e.text||null;try{return JSON.parse(e.value)}catch{return e.value}}async getItemIdsFromSmartSearchAsync(e){const a={boardId:e.boardId.toString(),searchTerm:e.searchTerm},t=await this.mondayApi.request(R_,a),i=t.search_items?.results?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends $m{constructor(){super(...arguments),this.name="create_item",this.type=g.WRITE,this.annotations=Cm({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications."}getInputSchema(){return this.context?.boardId?d_:l_}async executeInternal(e){const a=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,a):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,a)}async duplicateAndUpdateItem(e,a){try{const t={boardId:a.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(r_,t);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},s=new kw(this.mondayApi,this.apiToken,{boardId:a}),r=await s.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)});if(r.content.includes("Error"))throw new Error("Failed to update duplicated item: "+r.content);return{content:`Item ${i.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){this.rethrowWrapped(e,"duplicate item")}}async createSubitem(e){const a={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const t=await this.mondayApi.request(p_,a);if(!t.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:`Subitem ${t.create_subitem.id} successfully created under parent item ${e.parentItemId}`}}catch(e){this.rethrowWrapped(e,"create subitem")}}async createNewItem(e,a){try{const t={boardId:a.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(cw,t);return{content:`Item ${i.create_item?.id} successfully created`}}catch(e){this.rethrowWrapped(e,"create item")}}rethrowWrapped(e,a){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)throw new Error(`Failed to ${a}: ${t.response.errors.map((e=>e.message)).join(", ")}`)}throw new Error(`Failed to ${a}: ${t}`)}},class extends $m{constructor(){super(...arguments),this.name="create_update",this.type=g.WRITE,this.annotations=Cm({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return m_}async executeInternal(e){let a;if(e.mentionsList)try{a=JSON.parse(e.mentionsList)}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e instanceof Error?e.message:"Unknown error"}`)}const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},i=await this.mondayApi.request(mw,t);return{content:`Update ${i.create_update?.id} successfully created on item ${e.itemId}`}}},class extends $m{constructor(){super(...arguments),this.name="get_board_schema",this.type=g.READ,this.annotations=Cm({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 $_}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},i=await this.mondayApi.request(uw,t);return{content:`The current schema of the board ${a} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends $m{constructor(){super(...arguments),this.name="get_board_activity",this.type=g.READ,this.annotations=Cm({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 __}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-x_.MONTH30Days),i=e?.fromDate||t.toISOString(),n=e?.toDate||a.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1},s=await this.mondayApi.request(g_,o),r=s.boards?.[0]?.activity_logs;if(!r||0===r.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=r.filter((e=>null!=e)).map((e=>`• ${e.created_at}: ${e.event} on ${e.entity} by user ${e.user_id}${e.data?` - Data: ${e.data}`:""}`)).join("\n");return{content:`Activity logs for board ${e.boardId} from ${i} to ${n} (${r.length} entries):\n\n${p}`}}},class extends $m{constructor(){super(...arguments),this.name="get_board_info",this.type=g.READ,this.annotations=Cm({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return O_}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(T_,a),i=t.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:I_(i,n)}}async getSubItemsBoardAsync(e){const a=e.columns?.find((e=>e?.type===gg.Subtasks));if(!a)return null;const t=a.settings.boardIds[0],i=await this.mondayApi.request(E_,{boardId:t});return i.boards?.[0]??null}},class extends $m{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=g.READ,this.annotations=Cm({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\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 \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."}getInputSchema(){return oT}async executeInternal(e){const a=e.userIds&&e.userIds.length>0,t=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,s=!!e.name;if(e.getMe||!1){if(a||t||i||n||o||s)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(eT);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const r={users:[e.me]};return{content:aT(r)}}if(s){if(a||t||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const s={name:e.name},r=await this.mondayApi.request(Z_,s);if(!r.users||0===r.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=r.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n");return{content:`Found ${r.users.length} user(s) matching "${e.name}":\n\n${p}`}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(a&&e.userIds&&e.userIds.length>tT)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(t&&e.teamIds&&e.teamIds.length>iT)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let r;if(n||!a&&t&&!i)if(o){const a={teamIds:e.teamIds};r=await this.mondayApi.request(X_,a)}else{const a={teamIds:e.teamIds};r=await this.mondayApi.request(Q_,a)}else if(i){const a={userIds:e.userIds,teamIds:e.teamIds,limit:nT};r=await this.mondayApi.request(J_,a)}else if(a){const a={userIds:e.userIds,limit:nT};r=await this.mondayApi.request(Y_,a)}else{const e={userIds:void 0,limit:nT};r=await this.mondayApi.request(K_,e)}return{content:aT(r)}}},kw,class extends $m{constructor(){super(...arguments),this.name="move_item_to_group",this.type=g.WRITE,this.annotations=Cm({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 sT}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(hw,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends $m{constructor(){super(...arguments),this.name="create_board",this.type=g.WRITE,this.annotations=Cm({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Rw}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(vw,a);return{content:`Board ${t.create_board?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_form",this.type=g.WRITE,this.annotations=Cm({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 dx}async executeInternal(e){const a={destination_workspace_id:e.destination_workspace_id,destination_folder_id:e.destination_folder_id,destination_folder_name:e.destination_folder_name,board_kind:e.board_kind,destination_name:e.destination_name,board_owner_ids:e.board_owner_ids,board_owner_team_ids:e.board_owner_team_ids,board_subscriber_ids:e.board_subscriber_ids,board_subscriber_teams_ids:e.board_subscriber_teams_ids},t=await this.mondayApi.request(Bw,a);return{content:`Form created successfully. Board ID: ${t.create_form?.boardId}, Token: ${t.create_form?.token}`}}},class extends $m{constructor(){super(...arguments),this.name="update_form",this.type=g.WRITE,this.annotations=Cm({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Zx(this.mondayApi),this.actionHandlers=new Map([[Ox.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Ox.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Ox.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Ox.activate,this.helpers.activateForm.bind(this.helpers)],[Ox.createTag,this.helpers.createTag.bind(this.helpers)],[Ox.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Ox.updateTag,this.helpers.updateTag.bind(this.helpers)],[Ox.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Ox.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Ox.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Ox.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Ox.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 Xx}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(Dx(e,"tag",Xx.tag),Dx(e,"form",Xx.form),await a(e)):{content:"Received an invalid action for the update form tool."}}},class extends $m{constructor(){super(...arguments),this.name="get_form",this.type=g.READ,this.annotations=Cm({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 e_}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(Mw,a);return t.form?{content:`The form with the token ${e.formToken} is: ${JSON.stringify(t.form,null,2)}`}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends $m{constructor(){super(...arguments),this.name="form_questions_editor",this.type=g.WRITE,this.annotations=Cm({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Ax(this.mondayApi),this.actionHandlers=new Map([[Ix.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Ix.Update,this.helpers.updateQuestion.bind(this.helpers)],[Ix.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Sx}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(Dx(e,"question",Sx.question),await a(e)):{content:`Unknown action: ${e.action}`}}},class extends $m{constructor(){super(...arguments),this.name="create_column",this.type=g.WRITE,this.annotations=Cm({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?a_:t_}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},t=await this.mondayApi.request(gw,a);return{content:`Column ${t.create_column?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_group",this.type=g.WRITE,this.annotations=Cm({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 s_}async executeInternal(e){const a={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},t=await this.mondayApi.request(n_,a);return{content:`Group "${t.create_group?.title}" (ID: ${t.create_group?.id}) successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="delete_column",this.type=g.WRITE,this.annotations=Cm({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?u_:f_}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},t=await this.mondayApi.request(bw,a);return{content:`Column ${t.delete_column?.id} successfully deleted`}}},Aw,class extends $m{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=g.ALL_API,this.annotations=Cm({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 j_}async executeInternal(e){try{const a=await this.mondayApi.request(yw),t=e?.operationType,i=a.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=a.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=a.__schema,s=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let r="## GraphQL Schema\n";return t&&"read"!==t||(r+=`- Query Type: ${a.__schema?.queryType?.name}\n\n`,r+=`## Query Fields\n${i}\n\n`),t&&"write"!==t||(r+=`- Mutation Type: ${a.__schema?.mutationType?.name}\n\n`,r+=`## Mutation Fields\n${n}\n\n`),r+=`## Available Types\n${s}\n\n`,r+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:r}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends $m{constructor(){super(...arguments),this.name="get_column_type_info",this.type=g.READ,this.annotations=Cm({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 F_}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(L_,a);if(!t?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:t.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(i,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="get_type_details",this.type=g.ALL_API,this.annotations=Cm({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 V_}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const t=(a=e.typeName,dw`
1354
+ `,sE={sprintsBoardId:e.number().describe("The ID of the monday-dev board containing the sprints"),limit:e.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const rE=[class extends $m{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=g.READ,this.annotations=Cm({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 sE}async executeInternal(e){try{const a=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!a.success)return{content:a.error||"Board schema validation failed"};const t={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(oE,t),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${KT} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const a={boardId:e.toString()},t=await this.mondayApi.request(uw,a),i=t.boards?.[0];if(!i)return{success:!1,error:`${qT} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=iE(n);return o.isValid?{success:!0}:{success:!1,error:`${JT} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${KT} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}generateSprintsMetadataReport(e){let a="# Sprints Metadata Report\n\n";return a+=`**Total Sprints:** ${e.length}\n\n`,a+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",a+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const t=e.name||"Unknown",i=e.id,n=eE(e,MT.SPRINT_ACTIVATION),o=eE(e,MT.SPRINT_COMPLETION),s=aE(e,MT.SPRINT_START_DATE),r=aE(e,MT.SPRINT_END_DATE),p=((e,a)=>{const t=ZT(e,a);if("TimelineValue"===t?.__typename&&t.from&&t.to)return{from:t.from.split("T")[0],to:t.to.split("T")[0]};return null})(e,MT.SPRINT_TIMELINE),d=tE(e,MT.SPRINT_SUMMARY);let l=XT.Planned;o?l=XT.Completed:(n||s)&&(l=XT.Active);const c=p?`${p.from} to ${p.to}`:"Not set";a+=`| ${t} | ${i} | ${l} | ${c} | ${s||"Not started"} | ${r||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),a+="\n## Status Definitions:\n",a+=`- **${XT.Planned}**: Sprint not yet started (no activation, no start date)\n`,a+=`- **${XT.Active}**: Sprint is active (activated but not completed)\n`,a+=`- **${XT.Completed}**: Sprint is finished\n\n`,a}},class extends $m{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=g.READ,this.annotations=Cm({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 nE}async executeInternal(e){try{const a=await this.getSprintMetadata(e.sprintId);if(!a.success)return{content:a.error||`${KT} Unknown error occurred while getting sprint metadata`};const t=await this.readSprintSummaryDocument(a.documentObjectId);return t.success?{content:t.content}:{content:t.error||`${KT} Unknown error occurred while reading document content`}}catch(e){return{content:`${KT} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const a={ids:[String(e)]},t=(await this.mondayApi.request(UT,a)).items||[];if(0===t.length)return{success:!1,error:`${HT} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=t[0];if(!i)return{success:!1,error:`${HT} Sprint with ID ${e} not found.`};const n=((e,a=[])=>((e,a)=>{const t=a.filter((a=>!e.has(a)));return{isValid:0===t.length,missingColumns:t}})(new Set((e.column_values||[]).map((e=>e.id))),[...Object.values(BT),...a]))(i,[MT.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${JT} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=tE(i,MT.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${GT} 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:`${KT} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const a={object_ids:[e],limit:1},t=(await this.mondayApi.request(Ew,a)).docs||[];if(0===t.length)return{success:!1,error:`${GT} Document with object ID ${e} not found or not accessible.`};const i=t[0];if(!i||!i.id)return{success:!1,error:`${zT} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(Iw,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${YT} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const s=o.export_markdown_from_doc.markdown;return s?{success:!0,content:s}:{success:!1,error:`${WT} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${KT} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],pE=[class extends $m{constructor(){super(...arguments),this.name="delete_item",this.type=g.WRITE,this.annotations=Cm({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return h_}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(lw,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends $m{constructor(){super(...arguments),this.name="get_board_items_page",this.type=g.READ,this.annotations=Cm({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true.[REQUIRED PRECONDITION]: Before using this tool, if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available."}getInputSchema(){return C_}async executeInternal(e){const a=!e.cursor;if(a&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch{Dx(e,"filters",C_.filters),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const t={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems};Dx(e,"filters",C_.filters),Dx(e,"orderBy",C_.orderBy),a&&(e.itemIds||e.filters||e.orderBy)&&(t.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(k_,t),n=this.mapResult(i,e);return{content:JSON.stringify(n,null,2)}}rebuildFiltersWithManualSearch(e,a){return(a=(a=a??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:eb.ContainsText,compareValue:e}),a}mapResult(e,a){const t=e.boards?.[0],i=t?.items_page,n=i?.items||[];return{board:{id:t?.id,name:t?.name},items:n.map((e=>this.mapItem(e,a))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,a){const t={id:e.id,name:e.name,created_at:e.created_at,updated_at:e.updated_at};if(a.includeColumns&&e.column_values){t.column_values={};for(const a of e.column_values)t.column_values[a.id]=this.getColumnValueData(a)}return a.includeSubItems&&"subitems"in e&&e.subitems&&(t.subitems=e.subitems.slice(0,a.subItemLimit).map((e=>this.mapItem(e,a)))),t}getColumnValueData(e){if(!e.value)return e.text||null;try{return JSON.parse(e.value)}catch{return e.value}}async getItemIdsFromSmartSearchAsync(e){const a={boardId:e.boardId.toString(),searchTerm:e.searchTerm},t=await this.mondayApi.request(R_,a),i=t.search_items?.results?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends $m{constructor(){super(...arguments),this.name="create_item",this.type=g.WRITE,this.annotations=Cm({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications."}getInputSchema(){return this.context?.boardId?d_:l_}async executeInternal(e){const a=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,a):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,a)}async duplicateAndUpdateItem(e,a){try{const t={boardId:a.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(r_,t);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},s=new kw(this.mondayApi,this.apiToken,{boardId:a}),r=await s.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)});if(r.content.includes("Error"))throw new Error("Failed to update duplicated item: "+r.content);return{content:`Item ${i.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){this.rethrowWrapped(e,"duplicate item")}}async createSubitem(e){const a={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const t=await this.mondayApi.request(p_,a);if(!t.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:`Subitem ${t.create_subitem.id} successfully created under parent item ${e.parentItemId}`}}catch(e){this.rethrowWrapped(e,"create subitem")}}async createNewItem(e,a){try{const t={boardId:a.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(cw,t);return{content:`Item ${i.create_item?.id} successfully created`}}catch(e){this.rethrowWrapped(e,"create item")}}rethrowWrapped(e,a){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)throw new Error(`Failed to ${a}: ${t.response.errors.map((e=>e.message)).join(", ")}`)}throw new Error(`Failed to ${a}: ${t}`)}},class extends $m{constructor(){super(...arguments),this.name="create_update",this.type=g.WRITE,this.annotations=Cm({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return m_}async executeInternal(e){let a;if(e.mentionsList)try{a=JSON.parse(e.mentionsList)}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e instanceof Error?e.message:"Unknown error"}`)}const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},i=await this.mondayApi.request(mw,t);return{content:`Update ${i.create_update?.id} successfully created on item ${e.itemId}`}}},class extends $m{constructor(){super(...arguments),this.name="get_board_schema",this.type=g.READ,this.annotations=Cm({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 $_}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},i=await this.mondayApi.request(uw,t);return{content:`The current schema of the board ${a} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends $m{constructor(){super(...arguments),this.name="get_board_activity",this.type=g.READ,this.annotations=Cm({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 __}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-x_.MONTH30Days),i=e?.fromDate||t.toISOString(),n=e?.toDate||a.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1},s=await this.mondayApi.request(g_,o),r=s.boards?.[0]?.activity_logs;if(!r||0===r.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=r.filter((e=>null!=e)).map((e=>`• ${e.created_at}: ${e.event} on ${e.entity} by user ${e.user_id}${e.data?` - Data: ${e.data}`:""}`)).join("\n");return{content:`Activity logs for board ${e.boardId} from ${i} to ${n} (${r.length} entries):\n\n${p}`}}},class extends $m{constructor(){super(...arguments),this.name="get_board_info",this.type=g.READ,this.annotations=Cm({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return O_}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(T_,a),i=t.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:I_(i,n)}}async getSubItemsBoardAsync(e){const a=e.columns?.find((e=>e?.type===gg.Subtasks));if(!a)return null;const t=a.settings.boardIds[0],i=await this.mondayApi.request(E_,{boardId:t});return i.boards?.[0]??null}},class extends $m{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=g.READ,this.annotations=Cm({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\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 \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."}getInputSchema(){return oT}async executeInternal(e){const a=e.userIds&&e.userIds.length>0,t=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,s=!!e.name;if(e.getMe||!1){if(a||t||i||n||o||s)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(eT);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const r={users:[e.me]};return{content:aT(r)}}if(s){if(a||t||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const s={name:e.name},r=await this.mondayApi.request(Z_,s);if(!r.users||0===r.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=r.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n");return{content:`Found ${r.users.length} user(s) matching "${e.name}":\n\n${p}`}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(a&&e.userIds&&e.userIds.length>tT)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(t&&e.teamIds&&e.teamIds.length>iT)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let r;if(n||!a&&t&&!i)if(o){const a={teamIds:e.teamIds};r=await this.mondayApi.request(X_,a)}else{const a={teamIds:e.teamIds};r=await this.mondayApi.request(Q_,a)}else if(i){const a={userIds:e.userIds,teamIds:e.teamIds,limit:nT};r=await this.mondayApi.request(J_,a)}else if(a){const a={userIds:e.userIds,limit:nT};r=await this.mondayApi.request(Y_,a)}else{const e={userIds:void 0,limit:nT};r=await this.mondayApi.request(K_,e)}return{content:aT(r)}}},kw,class extends $m{constructor(){super(...arguments),this.name="move_item_to_group",this.type=g.WRITE,this.annotations=Cm({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 sT}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(hw,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends $m{constructor(){super(...arguments),this.name="create_board",this.type=g.WRITE,this.annotations=Cm({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Rw}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(vw,a);return{content:`Board ${t.create_board?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_form",this.type=g.WRITE,this.annotations=Cm({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 dx}async executeInternal(e){const a={destination_workspace_id:e.destination_workspace_id,destination_folder_id:e.destination_folder_id,destination_folder_name:e.destination_folder_name,board_kind:e.board_kind,destination_name:e.destination_name,board_owner_ids:e.board_owner_ids,board_owner_team_ids:e.board_owner_team_ids,board_subscriber_ids:e.board_subscriber_ids,board_subscriber_teams_ids:e.board_subscriber_teams_ids},t=await this.mondayApi.request(Bw,a);return{content:`Form created successfully. Board ID: ${t.create_form?.boardId}, Token: ${t.create_form?.token}`}}},class extends $m{constructor(){super(...arguments),this.name="update_form",this.type=g.WRITE,this.annotations=Cm({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Zx(this.mondayApi),this.actionHandlers=new Map([[Ox.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Ox.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Ox.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Ox.activate,this.helpers.activateForm.bind(this.helpers)],[Ox.createTag,this.helpers.createTag.bind(this.helpers)],[Ox.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Ox.updateTag,this.helpers.updateTag.bind(this.helpers)],[Ox.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Ox.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Ox.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Ox.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Ox.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 Xx}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(Dx(e,"tag",Xx.tag),Dx(e,"form",Xx.form),await a(e)):{content:"Received an invalid action for the update form tool."}}},class extends $m{constructor(){super(...arguments),this.name="get_form",this.type=g.READ,this.annotations=Cm({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 e_}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(Mw,a);return t.form?{content:`The form with the token ${e.formToken} is: ${JSON.stringify(t.form,null,2)}`}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends $m{constructor(){super(...arguments),this.name="form_questions_editor",this.type=g.WRITE,this.annotations=Cm({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Ax(this.mondayApi),this.actionHandlers=new Map([[Ix.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Ix.Update,this.helpers.updateQuestion.bind(this.helpers)],[Ix.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Sx}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(Dx(e,"question",Sx.question),await a(e)):{content:`Unknown action: ${e.action}`}}},class extends $m{constructor(){super(...arguments),this.name="create_column",this.type=g.WRITE,this.annotations=Cm({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?a_:t_}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},t=await this.mondayApi.request(gw,a);return{content:`Column ${t.create_column?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_group",this.type=g.WRITE,this.annotations=Cm({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 s_}async executeInternal(e){const a={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},t=await this.mondayApi.request(n_,a);return{content:`Group "${t.create_group?.title}" (ID: ${t.create_group?.id}) successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="delete_column",this.type=g.WRITE,this.annotations=Cm({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?u_:f_}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},t=await this.mondayApi.request(bw,a);return{content:`Column ${t.delete_column?.id} successfully deleted`}}},Aw,class extends $m{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=g.ALL_API,this.annotations=Cm({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 j_}async executeInternal(e){try{const a=await this.mondayApi.request(yw),t=e?.operationType,i=a.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=a.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=a.__schema,s=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let r="## GraphQL Schema\n";return t&&"read"!==t||(r+=`- Query Type: ${a.__schema?.queryType?.name}\n\n`,r+=`## Query Fields\n${i}\n\n`),t&&"write"!==t||(r+=`- Mutation Type: ${a.__schema?.mutationType?.name}\n\n`,r+=`## Mutation Fields\n${n}\n\n`),r+=`## Available Types\n${s}\n\n`,r+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:r}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends $m{constructor(){super(...arguments),this.name="get_column_type_info",this.type=g.READ,this.annotations=Cm({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 F_}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(L_,a);if(!t?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:t.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(i,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="get_type_details",this.type=g.ALL_API,this.annotations=Cm({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 V_}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const t=(a=e.typeName,dw`
1334
1355
  query getTypeDetails {
1335
1356
  __type(name: "${a}") {
1336
1357
  name
@@ -1418,5 +1439,5 @@ import{z as e}from"zod";import a from"util";import t,{Readable as i}from"stream"
1418
1439
  }
1419
1440
  }
1420
1441
  }
1421
- `),i=await this.mondayApi.request(t);if(!i.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let n=`## Type: ${i.__type.name||"Unnamed"} ${e.typeName===i.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${i.__type.kind}\n${i.__type.description?`Description: ${i.__type.description}`:""}\n\n`;return i.__type.fields&&i.__type.fields.length>0&&(n+="## Fields\n",i.__type.fields.forEach((e=>{const a=P_(e.type);n+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(n+=" Arguments:\n",e.args.forEach((e=>{const a=P_(e.type);n+=` - ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),n+="\n"),i.__type.inputFields&&i.__type.inputFields.length>0&&(n+="## Input Fields\n",i.__type.inputFields.forEach((e=>{const a=P_(e.type);n+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),n+="\n"),i.__type.interfaces&&i.__type.interfaces.length>0&&(n+="## Implements\n",i.__type.interfaces.forEach((e=>{n+=`- ${e.name}\n`})),n+="\n"),i.__type.enumValues&&i.__type.enumValues.length>0&&(n+="## Enum Values\n",i.__type.enumValues.forEach((e=>{n+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),n+="\n"),i.__type.possibleTypes&&i.__type.possibleTypes.length>0&&(n+="## Possible Types\n",i.__type.possibleTypes.forEach((e=>{n+=`- ${e.name}\n`}))),n+=`\n## Usage Examples\nIf this is a Query or Mutation field, you can use it in the all_monday_api tool.\n\nExample for query:\nall_monday_api(operation: "query", name: "getTypeData", variables: "{\\"typeName\\": \\"${i.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:n}}catch(e){const a=e instanceof Error?e.message:"Unknown error",t=a.includes("JSON");return{content:`Error fetching type details: ${a}${t?"\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 a}},class extends $m{constructor(){super(...arguments),this.name="create_custom_activity",this.type=g.WRITE,this.annotations=Cm({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return i_}async executeInternal(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(xw,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_timeline_item",this.type=g.WRITE,this.annotations=Cm({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return c_}async executeInternal(e){const a={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&&(a.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const t=await this.mondayApi.request(_w,a);return{content:`Timeline item '${e.title}' with ID ${t.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends $m{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=g.READ,this.annotations=Cm({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return v_}async executeInternal(e){const a=await this.mondayApi.request(Tw);if(!a.custom_activity||0===a.custom_activity.length)return{content:"No custom activities found"};const t=a.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${t.length} custom activities: ${JSON.stringify(t,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="read_docs",this.type=g.READ,this.annotations=Cm({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get a collection of monday.com documents with their content as markdown. \n\nPAGINATION: \n- Default limit is 25 documents per page\n- Use 'page' parameter to get additional pages (starts at 1)\n- Check response for 'has_more_pages' to know if you should continue paginating\n- If user asks for \"all documents\" and you get exactly 25 results, continue with page 2, 3, etc.\n\nFILTERING: Provide a type value and array of ids:\n- type: 'ids' for specific document IDs\n- type: 'object_ids' for specific document object IDs \n- type: 'workspace_ids' for all docs in specific workspaces\n- ids: array of ID strings (at least 1 required)\n\nExamples:\n- { type: 'ids', ids: ['123', '456'] }\n- { type: 'object_ids', ids: ['123'] }\n- { type: 'workspace_ids', ids: ['ws_101'] }\n\nUSAGE PATTERNS:\n- For specific documents: use type 'ids' or 'object_ids' (A monday doc has two unique identifiers)\n- For workspace exploration: use type 'workspace_ids' with pagination\n- For large searches: start with page 1, then paginate if has_more_pages=true"}getInputSchema(){return rT}async executeInternal(e){try{let a,t,i;switch(e.type){case"ids":a=e.ids;break;case"object_ids":t=e.ids;break;case"workspace_ids":i=e.ids}const n={ids:a,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i};let o=await this.mondayApi.request(Ew,n);if((!o.docs||0===o.docs.length)&&a){const t={ids:void 0,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i};o=await this.mondayApi.request(Ew,t)}if(!o.docs||0===o.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const s=await this.enrichDocsWithMarkdown(o.docs,n),r=this.shouldSuggestPagination(o.docs.length,n.limit||25,n.page||1);return{content:s.content+r}}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}shouldSuggestPagination(e,a,t){return e===a?`\n\n🔄 PAGINATION SUGGESTION: You received exactly ${a} documents, which suggests there may be more. Consider calling this tool again with page: ${t+1} to get additional documents.`:""}async enrichDocsWithMarkdown(e,a){const t=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let a="";try{const t={docId:e.id},i=await this.mondayApi.request(Iw,t);a=i.export_markdown_from_doc.success&&i.export_markdown_from_doc.markdown?i.export_markdown_from_doc.markdown:`Error getting markdown: ${i.export_markdown_from_doc.error||"Unknown error"}`}catch(e){a=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return{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,blocks_as_markdown:a}}))),i=a.page||1,n=a.limit||25,o=t.length,s=o===n;return{content:`Successfully retrieved ${t.length} document${1===t.length?"":"s"}.\n\nPAGINATION INFO:\n- Current page: ${i}\n- Documents per page: ${n}\n- Documents in this response: ${o}\n- Has more pages: ${s?"YES - call again with page: "+(i+1):"NO"}\n\nDOCUMENTS:\n${JSON.stringify(t,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="workspace_info",this.type=g.READ,this.annotations=Cm({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 pT}async executeInternal(e){const a={workspace_id:e.workspace_id},t=await this.mondayApi.request(Nw,a);if(!t.workspaces||0===t.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e){const{workspaces:a,boards:t,docs:i,folders:n}=e,o=a?.[0];if(!o)throw new Error("No workspace found");const s=new Map((n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),r=[];(t||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const a={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(a):r.push(a)}));const p=[];return(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const a={id:e.id,name:e.name};e.doc_folder_id&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(a):p.push(a)})),{workspace:{id:o.id,name:o.name,description:o.description||"",kind:o.kind||"",created_at:o.created_at||"",state:o.state||"",is_default_workspace:o.is_default_workspace||!1,owners_subscribers:(o.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:r,docs:p}}}(t);return{content:`Workspace Information:\n\n**Workspace:** ${i.workspace.name} (ID: ${i.workspace.id})\n- Description: ${i.workspace.description||"No description"}\n- Kind: ${i.workspace.kind}\n- State: ${i.workspace.state}\n- Default Workspace: ${i.workspace.is_default_workspace?"Yes":"No"}\n- Created: ${i.workspace.created_at}\n- Owners/Subscribers: ${i.workspace.owners_subscribers.length} users\n\n**Folders (${i.folders.length}):**\n${i.folders.map((e=>`\n📁 ${e.name} (ID: ${e.id})\n - Boards (${e.boards.length}): ${e.boards.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n - Docs (${e.docs.length}): ${e.docs.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}`)).join("\n")}\n\n**Root Level Items:**\n- Boards (${i.root_items.boards.length}): ${i.root_items.boards.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n- Docs (${i.root_items.docs.length}): ${i.root_items.docs.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n\n**Summary:**\n- Total Folders: ${i.folders.length}\n- Total Boards: ${i.folders.reduce(((e,a)=>e+a.boards.length),0)+i.root_items.boards.length}\n- Total Docs: ${i.folders.reduce(((e,a)=>e+a.docs.length),0)+i.root_items.docs.length}\n\n${JSON.stringify(i,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="list_workspaces",this.type=g.READ,this.annotations=Cm({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 lT}async executeInternal(e){const a={limit:5e3},t=await this.mondayApi.request(dT,a);if(!t.workspaces||0===t.workspaces.length)return{content:"No workspaces found."};const i=t.workspaces.filter((e=>null!==e)).map((e=>{const a=e.description?` - ${e.description}`:"";return`• **${e.name}** (ID: ${e.id})${a}`})).join("\n");return{content:`**Available Workspaces (${t.workspaces.length}):**\n\n${i}\n\n**Summary:**\nTotal workspaces found: ${t.workspaces.length}\n\n${JSON.stringify(t.workspaces,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="create_doc",this.type=g.WRITE,this.annotations=Cm({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 gT}async executeInternal(e){const a=vT.safeParse({...e,type:e.location});if(!a.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const t=a.data;try{let a,i;if(t.type===hT.enum.workspace){const n={location:{workspace:{workspace_id:t.workspace_id.toString(),name:e.doc_name,kind:t.doc_kind||ig.Public,folder_id:t.folder_id?.toString()}}},o=await this.mondayApi.request(mT,n);a=o?.create_doc?.id??void 0,i=o?.create_doc?.url??void 0}else if(t.type===hT.enum.item){const n={itemId:t.item_id.toString()},o=await this.mondayApi.request(cT,n),s=o.items?.[0];if(!s)return{content:`Error: Item with id ${t.item_id} not found.`};const r=s.board?.id,p=s.board?.columns?.find((e=>e&&e.type===gg.Doc));let d=t.column_id;if(!d)if(p)d=p.id;else{const e={boardId:r.toString(),columnType:gg.Doc,columnTitle:"Doc"},a=await this.mondayApi.request(gw,e);if(d=a?.create_column?.id,!d)return{content:"Error: Failed to create doc column."}}const l={location:{board:{item_id:t.item_id.toString(),column_id:d}}},c=await this.mondayApi.request(mT,l);if(a=c.create_doc?.id??void 0,i=c.create_doc?.url??void 0,e.doc_name&&a)try{const t={docId:a,name:e.doc_name};await this.mondayApi.request(fT,t)}catch(e){console.warn("Failed to update doc name:",e)}}if(!a)return{content:"Error: Failed to create document."};const n={docId:a,markdown:e.markdown},o=await this.mondayApi.request(uT,n),s=o?.add_content_to_doc_from_markdown?.success,r=o?.add_content_to_doc_from_markdown?.error;return s?{content:`✅ Document successfully created (id: ${a}). ${i?`\n\nURL: ${i}`:""}`}:{content:`Document ${a} created, but failed to add markdown content: ${r||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends $m{constructor(){super(...arguments),this.name="update_workspace",this.type=g.WRITE,this.annotations=Cm({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return ET}async executeInternal(e){const a={id:e.id,attributes:e.attributes},t=await this.mondayApi.request(TT,a);return{content:`Workspace ${t.update_workspace?.id} successfully updated`}}},class extends $m{constructor(){super(...arguments),this.name="update_folder",this.type=g.WRITE,this.annotations=Cm({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return NT}async executeInternal(e){const a={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:e.position},t=await this.mondayApi.request(IT,a);return{content:`Folder ${t.update_folder?.id} successfully updated`}}},class extends $m{constructor(){super(...arguments),this.name="create_workspace",this.type=g.WRITE,this.annotations=Cm({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return AT}async executeInternal(e){const a={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},t=await this.mondayApi.request(ST,a);return{content:`Workspace ${t.create_workspace?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_folder",this.type=g.WRITE,this.annotations=Cm({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return OT}async executeInternal(e){const a={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},t=await this.mondayApi.request(DT,a);return{content:`Folder ${t.create_folder?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="move_object",this.type=g.WRITE,this.annotations=Cm({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 CT}async executeUpdateFolder(e){const{id:a,position:t,parentFolderId:i,workspaceId:n,accountProductId:o}=e,s={folderId:a,position:t,parentFolderId:i,workspaceId:n,accountProductId:o},r=await this.mondayApi.request(IT,s);return{content:`Object ${r.update_folder?.id} successfully moved`}}async executeUpdateBoardHierarchy(e){const{id:a,position:t,parentFolderId:i,workspaceId:n,accountProductId:o}=e,s={boardId:a,attributes:{position:t,folder_id:i,workspace_id:n,account_product_id:o}},r=await this.mondayApi.request(kT,s);return r.update_board_hierarchy?.success?{content:`Board ${r.update_board_hierarchy?.board?.id} position updated successfully`}:{content:`Board position updated failed: ${r.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:a,position:t,parentFolderId:i,workspaceId:n,accountProductId:o}=e,s={overviewId:a,attributes:{position:t,folder_id:i,workspace_id:n,account_product_id:o}},r=await this.mondayApi.request(RT,s);return r.update_overview_hierarchy?.success?{content:`Overview ${r.update_overview_hierarchy?.overview?.id} position updated successfully`}:{content:`Overview position updated failed: ${r.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:a}=e;switch(a){case lb.Folder:return this.executeUpdateFolder(e);case lb.Board:return this.executeUpdateBoardHierarchy(e);case lb.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${a}`)}}},class extends $m{constructor(){super(...arguments),this.name="create_dashboard",this.type=g.WRITE,this.annotations=Cm({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 xT}async executeInternal(e){try{const a={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()},t=await this.mondayApi.request(bT,a);if(!t.create_dashboard)throw new Error("Failed to create dashboard");const i=t.create_dashboard,n=i.board_folder_id?` in folder ${i.board_folder_id}`:" in workspace root",o=i.kind===xg.Public?"(visible to all workspace members)":"(private - visible only to invited users)";return{content:`✅ Dashboard "${i.name}" successfully created!\n\nDashboard Details:\n• ID: ${i.id}\n• Name: ${i.name}\n• Workspace ID: ${i.workspace_id}${n}\n• Visibility: ${i.kind} ${o}\n• Connected Boards: ${e.board_ids.length} board(s)\n\nNext Steps:\n1. Use 'all_widgets_schema' to understand available widget types\n2. Understand the connected boards structure, columns, and metadata. Map board ids to column ids\n3. Plan Domain-Beneficial Widgets - Strategic widget planning based on real data analysis\n4. Use 'create_widget' to add widgets to the dashboard`}}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${a}`)}}},class extends $m{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=g.READ,this.annotations=Cm({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={},a=await this.mondayApi.request(yT,e);if(!a.all_widgets_schema||0===a.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const t={};let i=0;for(const e of a.all_widgets_schema)if(e?.widget_type&&e?.schema){const a="string"==typeof e.schema?JSON.parse(e.schema):e.schema,n=a?.description||a?.title||`${e.widget_type} widget for data visualization`;t[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");return{content:`**Widget Schemas Retrieved Successfully!**\n\n🎯 **Available Widget Types** (${i} schemas found):\n${Object.keys(t).map((e=>`• **${e}**: ${t[e].description}`)).join("\n")}\n\n**Complete JSON Schema 7 Definitions:**\n\n${JSON.stringify(t,null,2)}\n\n**Schema Compliance Tips:**\n- All required fields MUST be provided in widget settings\n- Enum values must match exactly as specified in the schema\n- Data types must conform to the schema definitions\n- Nested objects must follow the exact structure\n\n⚡ **Next Steps:**\n- Use these schemas to validate widget settings before calling 'create_widget'\n- Reference the schema structure when planning widget configurations\n- Ensure 100% compliance with field requirements and data types`}}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${a}`)}}},class extends $m{constructor(){super(...arguments),this.name="create_widget",this.type=g.WRITE,this.annotations=Cm({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 _T}async executeInternal(e){try{const a={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},t=await this.mondayApi.request(wT,a);if(!t.create_widget)throw new Error("Failed to create widget");const i=t.create_widget,n=i.parent?.kind===Bb.Dashboard?`dashboard ${i.parent.id}`:`board view ${i.parent?.id}`;return{content:`✅ Widget "${i.name}" successfully created!\n\n**Widget Details:**\n• **ID**: ${i.id}\n• **Name**: ${i.name}\n• **Type**: ${i.kind}\n• **Location**: Placed in ${n}\n\n**Widget Configuration:**\n• **Settings Applied**: ${JSON.stringify(e.settings,null,2)}`}}catch(a){const t=a instanceof Error?a.message:String(a);throw new Error(`Failed to create ${e.widget_kind} widget: ${t}`)}}}],iE=[...tE,...aE,...b];export{b_ as ToolMode,g as ToolType,tE as allGraphqlApiTools,b as allMondayAppsTools,aE as allMondayDevTools,iE as allTools};
1442
+ `),i=await this.mondayApi.request(t);if(!i.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let n=`## Type: ${i.__type.name||"Unnamed"} ${e.typeName===i.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${i.__type.kind}\n${i.__type.description?`Description: ${i.__type.description}`:""}\n\n`;return i.__type.fields&&i.__type.fields.length>0&&(n+="## Fields\n",i.__type.fields.forEach((e=>{const a=P_(e.type);n+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(n+=" Arguments:\n",e.args.forEach((e=>{const a=P_(e.type);n+=` - ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),n+="\n"),i.__type.inputFields&&i.__type.inputFields.length>0&&(n+="## Input Fields\n",i.__type.inputFields.forEach((e=>{const a=P_(e.type);n+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),n+="\n"),i.__type.interfaces&&i.__type.interfaces.length>0&&(n+="## Implements\n",i.__type.interfaces.forEach((e=>{n+=`- ${e.name}\n`})),n+="\n"),i.__type.enumValues&&i.__type.enumValues.length>0&&(n+="## Enum Values\n",i.__type.enumValues.forEach((e=>{n+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),n+="\n"),i.__type.possibleTypes&&i.__type.possibleTypes.length>0&&(n+="## Possible Types\n",i.__type.possibleTypes.forEach((e=>{n+=`- ${e.name}\n`}))),n+=`\n## Usage Examples\nIf this is a Query or Mutation field, you can use it in the all_monday_api tool.\n\nExample for query:\nall_monday_api(operation: "query", name: "getTypeData", variables: "{\\"typeName\\": \\"${i.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:n}}catch(e){const a=e instanceof Error?e.message:"Unknown error",t=a.includes("JSON");return{content:`Error fetching type details: ${a}${t?"\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 a}},class extends $m{constructor(){super(...arguments),this.name="create_custom_activity",this.type=g.WRITE,this.annotations=Cm({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return i_}async executeInternal(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(xw,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_timeline_item",this.type=g.WRITE,this.annotations=Cm({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return c_}async executeInternal(e){const a={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&&(a.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const t=await this.mondayApi.request(_w,a);return{content:`Timeline item '${e.title}' with ID ${t.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends $m{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=g.READ,this.annotations=Cm({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return v_}async executeInternal(e){const a=await this.mondayApi.request(Tw);if(!a.custom_activity||0===a.custom_activity.length)return{content:"No custom activities found"};const t=a.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${t.length} custom activities: ${JSON.stringify(t,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="read_docs",this.type=g.READ,this.annotations=Cm({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get a collection of monday.com documents with their content as markdown. \n\nPAGINATION: \n- Default limit is 25 documents per page\n- Use 'page' parameter to get additional pages (starts at 1)\n- Check response for 'has_more_pages' to know if you should continue paginating\n- If user asks for \"all documents\" and you get exactly 25 results, continue with page 2, 3, etc.\n\nFILTERING: Provide a type value and array of ids:\n- type: 'ids' for specific document IDs\n- type: 'object_ids' for specific document object IDs \n- type: 'workspace_ids' for all docs in specific workspaces\n- ids: array of ID strings (at least 1 required)\n\nExamples:\n- { type: 'ids', ids: ['123', '456'] }\n- { type: 'object_ids', ids: ['123'] }\n- { type: 'workspace_ids', ids: ['ws_101'] }\n\nUSAGE PATTERNS:\n- For specific documents: use type 'ids' or 'object_ids' (A monday doc has two unique identifiers)\n- For workspace exploration: use type 'workspace_ids' with pagination\n- For large searches: start with page 1, then paginate if has_more_pages=true"}getInputSchema(){return rT}async executeInternal(e){try{let a,t,i;switch(e.type){case"ids":a=e.ids;break;case"object_ids":t=e.ids;break;case"workspace_ids":i=e.ids}const n={ids:a,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i};let o=await this.mondayApi.request(Ew,n);if((!o.docs||0===o.docs.length)&&a){const t={ids:void 0,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i};o=await this.mondayApi.request(Ew,t)}if(!o.docs||0===o.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const s=await this.enrichDocsWithMarkdown(o.docs,n),r=this.shouldSuggestPagination(o.docs.length,n.limit||25,n.page||1);return{content:s.content+r}}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}shouldSuggestPagination(e,a,t){return e===a?`\n\n🔄 PAGINATION SUGGESTION: You received exactly ${a} documents, which suggests there may be more. Consider calling this tool again with page: ${t+1} to get additional documents.`:""}async enrichDocsWithMarkdown(e,a){const t=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let a="";try{const t={docId:e.id},i=await this.mondayApi.request(Iw,t);a=i.export_markdown_from_doc.success&&i.export_markdown_from_doc.markdown?i.export_markdown_from_doc.markdown:`Error getting markdown: ${i.export_markdown_from_doc.error||"Unknown error"}`}catch(e){a=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return{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,blocks_as_markdown:a}}))),i=a.page||1,n=a.limit||25,o=t.length,s=o===n;return{content:`Successfully retrieved ${t.length} document${1===t.length?"":"s"}.\n\nPAGINATION INFO:\n- Current page: ${i}\n- Documents per page: ${n}\n- Documents in this response: ${o}\n- Has more pages: ${s?"YES - call again with page: "+(i+1):"NO"}\n\nDOCUMENTS:\n${JSON.stringify(t,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="workspace_info",this.type=g.READ,this.annotations=Cm({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 pT}async executeInternal(e){const a={workspace_id:e.workspace_id},t=await this.mondayApi.request(Nw,a);if(!t.workspaces||0===t.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e){const{workspaces:a,boards:t,docs:i,folders:n}=e,o=a?.[0];if(!o)throw new Error("No workspace found");const s=new Map((n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),r=[];(t||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const a={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(a):r.push(a)}));const p=[];return(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const a={id:e.id,name:e.name};e.doc_folder_id&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(a):p.push(a)})),{workspace:{id:o.id,name:o.name,description:o.description||"",kind:o.kind||"",created_at:o.created_at||"",state:o.state||"",is_default_workspace:o.is_default_workspace||!1,owners_subscribers:(o.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:r,docs:p}}}(t);return{content:`Workspace Information:\n\n**Workspace:** ${i.workspace.name} (ID: ${i.workspace.id})\n- Description: ${i.workspace.description||"No description"}\n- Kind: ${i.workspace.kind}\n- State: ${i.workspace.state}\n- Default Workspace: ${i.workspace.is_default_workspace?"Yes":"No"}\n- Created: ${i.workspace.created_at}\n- Owners/Subscribers: ${i.workspace.owners_subscribers.length} users\n\n**Folders (${i.folders.length}):**\n${i.folders.map((e=>`\n📁 ${e.name} (ID: ${e.id})\n - Boards (${e.boards.length}): ${e.boards.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n - Docs (${e.docs.length}): ${e.docs.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}`)).join("\n")}\n\n**Root Level Items:**\n- Boards (${i.root_items.boards.length}): ${i.root_items.boards.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n- Docs (${i.root_items.docs.length}): ${i.root_items.docs.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n\n**Summary:**\n- Total Folders: ${i.folders.length}\n- Total Boards: ${i.folders.reduce(((e,a)=>e+a.boards.length),0)+i.root_items.boards.length}\n- Total Docs: ${i.folders.reduce(((e,a)=>e+a.docs.length),0)+i.root_items.docs.length}\n\n${JSON.stringify(i,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="list_workspaces",this.type=g.READ,this.annotations=Cm({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 lT}async executeInternal(e){const a={limit:5e3},t=await this.mondayApi.request(dT,a);if(!t.workspaces||0===t.workspaces.length)return{content:"No workspaces found."};const i=t.workspaces.filter((e=>null!==e)).map((e=>{const a=e.description?` - ${e.description}`:"";return`• **${e.name}** (ID: ${e.id})${a}`})).join("\n");return{content:`**Available Workspaces (${t.workspaces.length}):**\n\n${i}\n\n**Summary:**\nTotal workspaces found: ${t.workspaces.length}\n\n${JSON.stringify(t.workspaces,null,2)}`}}},class extends $m{constructor(){super(...arguments),this.name="create_doc",this.type=g.WRITE,this.annotations=Cm({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 gT}async executeInternal(e){const a=vT.safeParse({...e,type:e.location});if(!a.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const t=a.data;try{let a,i;if(t.type===hT.enum.workspace){const n={location:{workspace:{workspace_id:t.workspace_id.toString(),name:e.doc_name,kind:t.doc_kind||ig.Public,folder_id:t.folder_id?.toString()}}},o=await this.mondayApi.request(mT,n);a=o?.create_doc?.id??void 0,i=o?.create_doc?.url??void 0}else if(t.type===hT.enum.item){const n={itemId:t.item_id.toString()},o=await this.mondayApi.request(cT,n),s=o.items?.[0];if(!s)return{content:`Error: Item with id ${t.item_id} not found.`};const r=s.board?.id,p=s.board?.columns?.find((e=>e&&e.type===gg.Doc));let d=t.column_id;if(!d)if(p)d=p.id;else{const e={boardId:r.toString(),columnType:gg.Doc,columnTitle:"Doc"},a=await this.mondayApi.request(gw,e);if(d=a?.create_column?.id,!d)return{content:"Error: Failed to create doc column."}}const l={location:{board:{item_id:t.item_id.toString(),column_id:d}}},c=await this.mondayApi.request(mT,l);if(a=c.create_doc?.id??void 0,i=c.create_doc?.url??void 0,e.doc_name&&a)try{const t={docId:a,name:e.doc_name};await this.mondayApi.request(fT,t)}catch(e){console.warn("Failed to update doc name:",e)}}if(!a)return{content:"Error: Failed to create document."};const n={docId:a,markdown:e.markdown},o=await this.mondayApi.request(uT,n),s=o?.add_content_to_doc_from_markdown?.success,r=o?.add_content_to_doc_from_markdown?.error;return s?{content:`✅ Document successfully created (id: ${a}). ${i?`\n\nURL: ${i}`:""}`}:{content:`Document ${a} created, but failed to add markdown content: ${r||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends $m{constructor(){super(...arguments),this.name="update_workspace",this.type=g.WRITE,this.annotations=Cm({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return ET}async executeInternal(e){const a={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},t=await this.mondayApi.request(TT,a);return{content:`Workspace ${t.update_workspace?.id} successfully updated`}}},class extends $m{constructor(){super(...arguments),this.name="update_folder",this.type=g.WRITE,this.annotations=Cm({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return NT}async executeInternal(e){const{position_object_id:a,position_object_type:t,position_is_after:i}=e;if(!!a!=!!t)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:a?{position_is_after:i,position_object_id:a,position_object_type:t}:void 0},o=await this.mondayApi.request(IT,n);return{content:`Folder ${o.update_folder?.id} successfully updated`}}},class extends $m{constructor(){super(...arguments),this.name="create_workspace",this.type=g.WRITE,this.annotations=Cm({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return AT}async executeInternal(e){const a={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},t=await this.mondayApi.request(ST,a);return{content:`Workspace ${t.create_workspace?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="create_folder",this.type=g.WRITE,this.annotations=Cm({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return OT}async executeInternal(e){const a={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},t=await this.mondayApi.request(DT,a);return{content:`Folder ${t.create_folder?.id} successfully created`}}},class extends $m{constructor(){super(...arguments),this.name="move_object",this.type=g.WRITE,this.annotations=Cm({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 CT}async executeUpdateFolder(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:s,accountProductId:r}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={folderId:a,position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,parentFolderId:o,workspaceId:s,accountProductId:r},d=await this.mondayApi.request(IT,p);return{content:`Object ${d.update_folder?.id} successfully moved`}}async executeUpdateBoardHierarchy(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:s,accountProductId:r}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={boardId:a,attributes:{position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,folder_id:o,workspace_id:s,account_product_id:r}},d=await this.mondayApi.request(kT,p);return d.update_board_hierarchy?.success?{content:`Board ${d.update_board_hierarchy?.board?.id} position updated successfully`}:{content:`Board position updated failed: ${d.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:s,accountProductId:r}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={overviewId:a,attributes:{position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,folder_id:o,workspace_id:s,account_product_id:r}},d=await this.mondayApi.request(RT,p);return d.update_overview_hierarchy?.success?{content:`Overview ${d.update_overview_hierarchy?.overview?.id} position updated successfully`}:{content:`Overview position updated failed: ${d.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:a}=e;switch(a){case lb.Folder:return this.executeUpdateFolder(e);case lb.Board:return this.executeUpdateBoardHierarchy(e);case lb.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${a}`)}}},class extends $m{constructor(){super(...arguments),this.name="create_dashboard",this.type=g.WRITE,this.annotations=Cm({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 xT}async executeInternal(e){try{const a={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()},t=await this.mondayApi.request(bT,a);if(!t.create_dashboard)throw new Error("Failed to create dashboard");const i=t.create_dashboard,n=i.board_folder_id?` in folder ${i.board_folder_id}`:" in workspace root",o=i.kind===xg.Public?"(visible to all workspace members)":"(private - visible only to invited users)";return{content:`✅ Dashboard "${i.name}" successfully created!\n\nDashboard Details:\n• ID: ${i.id}\n• Name: ${i.name}\n• Workspace ID: ${i.workspace_id}${n}\n• Visibility: ${i.kind} ${o}\n• Connected Boards: ${e.board_ids.length} board(s)\n\nNext Steps:\n1. Use 'all_widgets_schema' to understand available widget types\n2. Understand the connected boards structure, columns, and metadata. Map board ids to column ids\n3. Plan Domain-Beneficial Widgets - Strategic widget planning based on real data analysis\n4. Use 'create_widget' to add widgets to the dashboard`}}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${a}`)}}},class extends $m{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=g.READ,this.annotations=Cm({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={},a=await this.mondayApi.request(yT,e);if(!a.all_widgets_schema||0===a.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const t={};let i=0;for(const e of a.all_widgets_schema)if(e?.widget_type&&e?.schema){const a="string"==typeof e.schema?JSON.parse(e.schema):e.schema,n=a?.description||a?.title||`${e.widget_type} widget for data visualization`;t[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");return{content:`**Widget Schemas Retrieved Successfully!**\n\n🎯 **Available Widget Types** (${i} schemas found):\n${Object.keys(t).map((e=>`• **${e}**: ${t[e].description}`)).join("\n")}\n\n**Complete JSON Schema 7 Definitions:**\n\n${JSON.stringify(t,null,2)}\n\n**Schema Compliance Tips:**\n- All required fields MUST be provided in widget settings\n- Enum values must match exactly as specified in the schema\n- Data types must conform to the schema definitions\n- Nested objects must follow the exact structure\n\n⚡ **Next Steps:**\n- Use these schemas to validate widget settings before calling 'create_widget'\n- Reference the schema structure when planning widget configurations\n- Ensure 100% compliance with field requirements and data types`}}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${a}`)}}},class extends $m{constructor(){super(...arguments),this.name="create_widget",this.type=g.WRITE,this.annotations=Cm({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 _T}async executeInternal(e){if(Dx(e,"settings",_T.settings),!e.settings)throw new Error("You must pass either settings or settingsStringified parameter");try{const a={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},t=await this.mondayApi.request(wT,a);if(!t.create_widget)throw new Error("Failed to create widget");const i=t.create_widget,n=i.parent?.kind===Bb.Dashboard?`dashboard ${i.parent.id}`:`board view ${i.parent?.id}`;return{content:`✅ Widget "${i.name}" successfully created!\n\n**Widget Details:**\n• **ID**: ${i.id}\n• **Name**: ${i.name}\n• **Type**: ${i.kind}\n• **Location**: Placed in ${n}\n\n**Widget Configuration:**\n• **Settings Applied**: ${JSON.stringify(e.settings,null,2)}`}}catch(a){const t=a instanceof Error?a.message:String(a);throw new Error(`Failed to create ${e.widget_kind} widget: ${t}`)}}},class extends $m{constructor(){super(...arguments),this.name="board_insights",this.type=g.READ,this.annotations=Cm({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 you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available."}getInputSchema(){return PT}async executeInternal(e){if(!e.aggregations&&!e.aggregationsStringified)return{content:'Input must contain either the "aggregations" field or the "aggregationsStringified" field.'};Dx(e,"aggregations",PT.aggregations),Dx(e,"filters",PT.filters),Dx(e,"orderBy",PT.orderBy);const{selectElements:a,groupByElements:t}=function(e){const a={},t=e.groupBy?.map((e=>({column_id:e})))||[],i=e.aggregations.map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,s=a[o]||0;a[o]=s+1;const r=`${o}_${s}`;return jT.has(e.function)&&(t.some((e=>e.column_id===r))||t.push({column_id:r})),{type:Bv.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===Mv.CountItems?[]:[{type:Bv.Column,column:VT(n),as:n}]}),as:r}}var i,n;const o={type:Bv.Column,column:VT(e.columnId),as:e.columnId};return t.some((a=>a.column_id===e.columnId))||t.push({column_id:e.columnId}),o}));return t.forEach((e=>{i.some((a=>a.as===e.column_id))||i.push({type:Bv.Column,column:VT(e.column_id),as:e.column_id})})),{selectElements:i,groupByElements:t}}(e),i=function(e){if(!e.filters&&!e.orderBy)return;const a={};return e.filters&&(a.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),a.operator=e.filtersOperator),e.orderBy&&(a.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),a}(e),n=function(e){return{id:e.boardId.toString(),type:Uv.Table}}(e),o={query:{from:n,query:i,select:a,group_by:t,limit:e.limit}},s=await this.mondayApi.request($T,o),r=(s.aggregate?.results??[]).map((e=>{const a={};return(e.entries??[]).forEach((e=>{const t=e.alias??"";if(!t)return;const i=e.value;if(!i)return void(a[t]=null);const n=i.result??i.value_string??i.value_int??i.value_float??i.value_boolean??null;a[t]=n})),a}));return r.length?{content:`Board insights result (${r.length} rows):\n${JSON.stringify(r,null,2)}`}:{content:"No board insights found for the given query."}}}],dE=[...pE,...rE,...b];export{b_ as ToolMode,g as ToolType,pE as allGraphqlApiTools,b as allMondayAppsTools,rE as allMondayDevTools,dE as allTools};
1422
1443
  //# sourceMappingURL=index.js.map