@mondaydotcomorg/agent-toolkit 2.24.0 → 2.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core/index.js +58 -58
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/mcp/index.js +58 -58
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.js +58 -58
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/core/index.js +58 -58
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/mcp/index.js +58 -58
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.js +58 -58
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/mcp/index.js
CHANGED
|
@@ -702,7 +702,7 @@
|
|
|
702
702
|
description
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
|
-
`,LI={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."},zI={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."}},VI={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."}},UI={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."}},BI={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"}},MI={destination_workspace_id:e.z.string().describe(zI.args.destinationWorkspaceId),destination_folder_id:e.z.string().optional().describe(zI.args.destinationFolderId),destination_folder_name:e.z.string().optional().describe(zI.args.destinationFolderName),board_kind:e.z.nativeEnum(j_).optional().describe(zI.args.boardKind),destination_name:e.z.string().optional().describe(zI.args.destinationName),board_owner_ids:e.z.array(e.z.string()).optional().describe(zI.args.boardOwnerIds),board_owner_team_ids:e.z.array(e.z.string()).optional().describe(zI.args.boardOwnerTeamIds),board_subscriber_ids:e.z.array(e.z.string()).optional().describe(zI.args.boardSubscriberIds),board_subscriber_teams_ids:e.z.array(e.z.string()).optional().describe(zI.args.boardSubscriberTeamsIds)};var qI,HI,GI,WI,QI,KI,YI,JI,XI,ZI,eS,aS,tS,iS,nS,oS;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(qI||(qI={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(HI||(HI={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(GI||(GI={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(WI||(WI={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(QI||(QI={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(KI||(KI={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(YI||(YI={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(JI||(JI={})),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"}(XI||(XI={})),function(e){e.Account="account",e.QueryParam="queryParam"}(ZI||(ZI={})),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"}(eS||(eS={})),function(e){e.And="AND",e.Or="OR"}(aS||(aS={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(tS||(tS={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(iS||(iS={})),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"}(nS||(nS={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(oS||(oS={}));const rS=e.z.object({type:e.z.nativeEnum(Ax).describe(UI.properties.type),title:e.z.string().describe(UI.properties.title).optional(),description:e.z.string().describe(UI.properties.description).optional(),visible:e.z.boolean().describe(UI.properties.visible).optional(),required:e.z.boolean().describe(UI.properties.required).optional(),options:e.z.array(e.z.object({label:e.z.string().describe(UI.properties.selectOptionsLabel)})).describe(UI.properties.selectOptions).optional(),settings:e.z.object({checkedByDefault:e.z.boolean().describe(BI.properties.checkedByDefault).optional(),defaultCurrentDate:e.z.boolean().describe(BI.properties.defaultCurrentDate).optional(),display:e.z.nativeEnum(Sx).describe(BI.properties.display).optional(),includeTime:e.z.boolean().describe(BI.properties.includeTime).optional(),locationAutofilled:e.z.boolean().describe(BI.properties.locationAutofilled).optional(),optionsOrder:e.z.nativeEnum(Nx).describe(BI.properties.optionsOrder).optional(),prefixAutofilled:e.z.boolean().describe(BI.properties.prefixAutofilled).optional(),prefixPredefined:e.z.object({enabled:e.z.boolean().describe(BI.properties.prefixPredefinedEnabled),prefix:e.z.string().describe(BI.properties.prefixPredefinedPrefix).optional()}).describe(BI.properties.prefixPredefined).optional(),skipValidation:e.z.boolean().describe(BI.properties.skipValidation).optional(),prefill:e.z.object({enabled:e.z.boolean().describe(BI.properties.prefillEnabled),lookup:e.z.string().describe(BI.properties.prefillLookup).optional(),source:e.z.nativeEnum(Ix).describe(BI.properties.prefillSource).optional()}).describe(BI.properties.prefill).optional()}).optional()}),sS={action:e.z.nativeEnum(oS).describe(UI.actions.type),formToken:e.z.string().describe(LI.formToken),questionId:e.z.string().describe(LI.questionId).optional(),question:rS.describe(UI.actions.question).optional(),questionStringified:e.z.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 pS{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(EI,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(II,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(TI,t);return{content:`Form question created successfully. ID: ${i.create_form_question?.id}`}}}const dS=(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,r=t.safeParse(o);if(!r.success)throw new Error(`JSON string defined as ${String(i)} does not match the specified schema`);e[a]=r.data};var lS;!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"}(lS||(lS={}));const cS=e.z.object({id:e.z.string().describe(zI.properties.tags.id).optional(),name:e.z.string().describe(zI.properties.tags.name).optional(),value:e.z.string().describe(zI.properties.tags.value).optional(),columnId:e.z.string().describe(zI.properties.tags.columnId).optional()}),mS=e.z.object({type:e.z.nativeEnum(WI).describe(VI.properties.backgroundType).optional(),value:e.z.string().describe(VI.properties.backgroundValue).optional()}),uS=e.z.object({format:e.z.nativeEnum(KI).describe(VI.properties.format).optional(),alignment:e.z.nativeEnum(YI).describe(VI.properties.alignment).optional(),direction:e.z.nativeEnum(QI).describe(VI.properties.direction).optional()}),hS=e.z.object({position:e.z.nativeEnum(GI).describe(VI.properties.logoPosition).optional(),size:e.z.nativeEnum(HI).describe(VI.properties.logoSize).optional()}),fS=e.z.object({text:e.z.string().describe(VI.properties.submitButtonText).optional()}),vS=e.z.object({font:e.z.string().describe(VI.properties.font).optional(),color:e.z.string().describe(VI.properties.textColor).optional(),size:e.z.nativeEnum(JI).describe(VI.properties.fontSize).optional()}),gS=e.z.object({enabled:e.z.boolean().describe(VI.properties.redirectAfterSubmissionEnabled).optional(),redirectUrl:e.z.string().describe(VI.properties.redirectUrl).optional()}),bS=e.z.object({allowEditSubmission:e.z.boolean().describe(VI.properties.allowEditSubmission).optional(),allowResubmit:e.z.boolean().describe(VI.properties.allowResubmit).optional(),allowViewSubmission:e.z.boolean().describe(VI.properties.allowViewSubmission).optional(),description:e.z.string().describe(VI.properties.postSubmissionDescription).optional(),redirectAfterSubmission:gS.describe(VI.properties.redirectAfterSubmission).optional(),showSuccessImage:e.z.boolean().describe(VI.properties.showSuccessImage).optional(),title:e.z.string().describe(VI.properties.postSubmissionTitle).optional()}),yS=e.z.object({enabled:e.z.boolean().describe(VI.properties.closeDateEnabled).optional(),date:e.z.string().describe(VI.properties.closeDateValue).optional()}),wS=e.z.object({enabled:e.z.boolean().describe(VI.properties.draftSubmissionEnabled).optional()}),_S=e.z.object({itemGroupId:e.z.string().describe(VI.properties.itemGroupId).optional(),includeNameQuestion:e.z.boolean().describe(VI.properties.includeNameQuestion).optional(),includeUpdateQuestion:e.z.boolean().describe(VI.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:e.z.boolean().describe(VI.properties.syncQuestionAndColumnsTitles).optional()}),xS=e.z.object({enabled:e.z.boolean().describe(VI.properties.passwordEnabled).optional()}),ES=e.z.object({text:e.z.string().describe(VI.properties.startButtonText).optional()}),TS=e.z.object({enabled:e.z.boolean().describe(VI.properties.preSubmissionEnabled).optional(),title:e.z.string().describe(VI.properties.preSubmissionTitle).optional(),description:e.z.string().describe(VI.properties.preSubmissionDescription).optional(),startButton:ES.describe(VI.properties.startButton).optional()}),IS=e.z.object({enabled:e.z.boolean().describe(VI.properties.requireLoginEnabled).optional(),redirectToLogin:e.z.boolean().describe(VI.properties.redirectToLogin).optional()}),SS=e.z.object({enabled:e.z.boolean().describe(VI.properties.responseLimitEnabled).optional(),limit:e.z.number().describe(VI.properties.responseLimitValue).optional()}),NS=e.z.object({background:mS.describe(VI.properties.background).optional(),hideBranding:e.z.boolean().describe(VI.properties.hideBranding).optional(),layout:uS.describe(VI.properties.layout).optional(),logo:hS.describe(VI.properties.logo).optional(),primaryColor:e.z.string().describe(VI.properties.primaryColor).optional(),showProgressBar:e.z.boolean().describe(VI.properties.showProgressBar).optional(),submitButton:fS.describe(VI.properties.submitButton).optional(),text:vS.describe(VI.properties.text).optional()}),AS=e.z.object({language:e.z.string().describe(VI.properties.language).optional(),logoAltText:e.z.string().describe(VI.properties.logoAltText).optional()}),DS=e.z.object({afterSubmissionView:bS.describe(VI.properties.afterSubmissionView).optional(),closeDate:yS.describe(VI.properties.closeDate).optional(),draftSubmission:wS.describe(VI.properties.draftSubmission).optional(),monday:_S.describe(VI.properties.monday).optional(),password:xS.describe(VI.properties.password).optional(),preSubmissionView:TS.describe(VI.properties.preSubmissionView).optional(),reCaptchaChallenge:e.z.boolean().describe(VI.properties.reCaptchaChallenge).optional(),requireLogin:IS.describe(VI.properties.requireLogin).optional(),responseLimit:SS.describe(VI.properties.responseLimit).optional()}),OS=e.z.object({id:e.z.string().describe(zI.inputs.questionId)}),kS=e.z.object({appearance:NS.describe(zI.inputs.form.appearance).optional(),accessibility:AS.describe(zI.inputs.form.accessibility).optional(),features:DS.describe(zI.inputs.form.features).optional(),title:e.z.string().describe(zI.inputs.title).optional(),description:e.z.string().describe(zI.inputs.description).optional(),questions:e.z.array(OS).describe(zI.inputs.questions).optional()}),RS={formToken:e.z.string().describe(LI.formToken),action:e.z.nativeEnum(lS).describe(zI.operations.updateForm.action),formPassword:e.z.string().describe(VI.operations.setFormPassword).optional(),tag:cS.describe(zI.inputs.tag).optional(),tagStringified:e.z.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:kS.describe(zI.inputs.form.describe).optional(),formStringified:e.z.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 PS{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(SI,a),{content:"Form password successfully set."}}async shortenFormUrl(e){const a={formToken:e.formToken};return await this.mondayApi.request(NI,a),{content:"Form URL successfully shortened."}}async deactivateForm(e){const a={formToken:e.formToken};return await this.mondayApi.request(AI,a),{content:"Form successfully deactivated."}}async activateForm(e){const a={formToken:e.formToken};return await this.mondayApi.request(DI,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(kI,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(OI,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(RI,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(PI,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(CI,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($I,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(FI,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(jI,a);return{content:`Form header content successfully updated: ${JSON.stringify(t.update_form,null,2)}`}}}const CS={formToken:e.z.string().describe(LI.formToken)};const $S={columnType:e.z.nativeEnum(J_).describe("The type of the column to be created"),columnTitle:e.z.string().describe("The title of the column to be created"),columnDescription:e.z.string().optional().describe("The description of the column to be created"),columnSettings:e.z.string().optional().describe("Column-specific configuration settings as a JSON string. Use the get_column_type_info tool to fetch the JSON schema for the given column type.")},FS={boardId:e.z.number().describe("The id of the board to which the new column will be added"),...$S};const jS={color:e.z.nativeEnum(X_).describe("The color of the custom activity"),icon_id:e.z.nativeEnum(Z_).describe("The icon ID of the custom activity"),name:e.z.string().describe("The name of the custom activity")};const LS=MT`
|
|
705
|
+
`,LI={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."},zI={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."}},VI={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."}},UI={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."}},BI={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"}},MI={destination_workspace_id:e.z.string().describe(zI.args.destinationWorkspaceId),destination_folder_id:e.z.string().optional().describe(zI.args.destinationFolderId),destination_folder_name:e.z.string().optional().describe(zI.args.destinationFolderName),board_kind:e.z.nativeEnum(j_).optional().describe(zI.args.boardKind),destination_name:e.z.string().optional().describe(zI.args.destinationName),board_owner_ids:e.z.array(e.z.string()).optional().describe(zI.args.boardOwnerIds),board_owner_team_ids:e.z.array(e.z.string()).optional().describe(zI.args.boardOwnerTeamIds),board_subscriber_ids:e.z.array(e.z.string()).optional().describe(zI.args.boardSubscriberIds),board_subscriber_teams_ids:e.z.array(e.z.string()).optional().describe(zI.args.boardSubscriberTeamsIds)};var qI,HI,GI,WI,QI,KI,YI,JI,XI,ZI,eS,aS,tS,iS,nS,oS;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(qI||(qI={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(HI||(HI={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(GI||(GI={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(WI||(WI={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(QI||(QI={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(KI||(KI={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(YI||(YI={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(JI||(JI={})),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"}(XI||(XI={})),function(e){e.Account="account",e.QueryParam="queryParam"}(ZI||(ZI={})),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"}(eS||(eS={})),function(e){e.And="AND",e.Or="OR"}(aS||(aS={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(tS||(tS={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(iS||(iS={})),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"}(nS||(nS={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(oS||(oS={}));const rS=e.z.object({type:e.z.nativeEnum(Ax).describe(UI.properties.type),title:e.z.string().describe(UI.properties.title).optional(),description:e.z.string().describe(UI.properties.description).optional(),visible:e.z.boolean().describe(UI.properties.visible).optional(),required:e.z.boolean().describe(UI.properties.required).optional(),options:e.z.array(e.z.object({label:e.z.string().describe(UI.properties.selectOptionsLabel)})).describe(UI.properties.selectOptions).optional(),settings:e.z.object({checkedByDefault:e.z.boolean().describe(BI.properties.checkedByDefault).optional(),defaultCurrentDate:e.z.boolean().describe(BI.properties.defaultCurrentDate).optional(),display:e.z.nativeEnum(Sx).describe(BI.properties.display).optional(),includeTime:e.z.boolean().describe(BI.properties.includeTime).optional(),locationAutofilled:e.z.boolean().describe(BI.properties.locationAutofilled).optional(),optionsOrder:e.z.nativeEnum(Nx).describe(BI.properties.optionsOrder).optional(),prefixAutofilled:e.z.boolean().describe(BI.properties.prefixAutofilled).optional(),prefixPredefined:e.z.object({enabled:e.z.boolean().describe(BI.properties.prefixPredefinedEnabled),prefix:e.z.string().describe(BI.properties.prefixPredefinedPrefix).optional()}).describe(BI.properties.prefixPredefined).optional(),skipValidation:e.z.boolean().describe(BI.properties.skipValidation).optional(),prefill:e.z.object({enabled:e.z.boolean().describe(BI.properties.prefillEnabled),lookup:e.z.string().describe(BI.properties.prefillLookup).optional(),source:e.z.nativeEnum(Ix).describe(BI.properties.prefillSource).optional()}).describe(BI.properties.prefill).optional()}).optional()}),sS={action:e.z.nativeEnum(oS).describe(UI.actions.type),formToken:e.z.string().describe(LI.formToken),questionId:e.z.string().describe(LI.questionId).optional(),question:rS.describe(UI.actions.question).optional(),questionStringified:e.z.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 pS{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(EI,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(II,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(TI,t);return{content:`Form question created successfully. ID: ${i.create_form_question?.id}`}}}const dS=(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,r=t.safeParse(o);if(!r.success)throw new Error(`JSON string defined as ${String(i)} does not match the specified schema`);e[a]=r.data};var lS;!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"}(lS||(lS={}));const cS=e.z.object({id:e.z.string().describe(zI.properties.tags.id).optional(),name:e.z.string().describe(zI.properties.tags.name).optional(),value:e.z.string().describe(zI.properties.tags.value).optional(),columnId:e.z.string().describe(zI.properties.tags.columnId).optional()}),mS=e.z.object({type:e.z.nativeEnum(WI).describe(VI.properties.backgroundType).optional(),value:e.z.string().describe(VI.properties.backgroundValue).optional()}),uS=e.z.object({format:e.z.nativeEnum(KI).describe(VI.properties.format).optional(),alignment:e.z.nativeEnum(YI).describe(VI.properties.alignment).optional(),direction:e.z.nativeEnum(QI).describe(VI.properties.direction).optional()}),hS=e.z.object({position:e.z.nativeEnum(GI).describe(VI.properties.logoPosition).optional(),size:e.z.nativeEnum(HI).describe(VI.properties.logoSize).optional()}),fS=e.z.object({text:e.z.string().describe(VI.properties.submitButtonText).optional()}),vS=e.z.object({font:e.z.string().describe(VI.properties.font).optional(),color:e.z.string().describe(VI.properties.textColor).optional(),size:e.z.nativeEnum(JI).describe(VI.properties.fontSize).optional()}),gS=e.z.object({enabled:e.z.boolean().describe(VI.properties.redirectAfterSubmissionEnabled).optional(),redirectUrl:e.z.string().describe(VI.properties.redirectUrl).optional()}),bS=e.z.object({allowEditSubmission:e.z.boolean().describe(VI.properties.allowEditSubmission).optional(),allowResubmit:e.z.boolean().describe(VI.properties.allowResubmit).optional(),allowViewSubmission:e.z.boolean().describe(VI.properties.allowViewSubmission).optional(),description:e.z.string().describe(VI.properties.postSubmissionDescription).optional(),redirectAfterSubmission:gS.describe(VI.properties.redirectAfterSubmission).optional(),showSuccessImage:e.z.boolean().describe(VI.properties.showSuccessImage).optional(),title:e.z.string().describe(VI.properties.postSubmissionTitle).optional()}),yS=e.z.object({enabled:e.z.boolean().describe(VI.properties.closeDateEnabled).optional(),date:e.z.string().describe(VI.properties.closeDateValue).optional()}),wS=e.z.object({enabled:e.z.boolean().describe(VI.properties.draftSubmissionEnabled).optional()}),_S=e.z.object({itemGroupId:e.z.string().describe(VI.properties.itemGroupId).optional(),includeNameQuestion:e.z.boolean().describe(VI.properties.includeNameQuestion).optional(),includeUpdateQuestion:e.z.boolean().describe(VI.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:e.z.boolean().describe(VI.properties.syncQuestionAndColumnsTitles).optional()}),xS=e.z.object({enabled:e.z.boolean().describe(VI.properties.passwordEnabled).optional()}),ES=e.z.object({text:e.z.string().describe(VI.properties.startButtonText).optional()}),TS=e.z.object({enabled:e.z.boolean().describe(VI.properties.preSubmissionEnabled).optional(),title:e.z.string().describe(VI.properties.preSubmissionTitle).optional(),description:e.z.string().describe(VI.properties.preSubmissionDescription).optional(),startButton:ES.describe(VI.properties.startButton).optional()}),IS=e.z.object({enabled:e.z.boolean().describe(VI.properties.requireLoginEnabled).optional(),redirectToLogin:e.z.boolean().describe(VI.properties.redirectToLogin).optional()}),SS=e.z.object({enabled:e.z.boolean().describe(VI.properties.responseLimitEnabled).optional(),limit:e.z.number().describe(VI.properties.responseLimitValue).optional()}),NS=e.z.object({background:mS.describe(VI.properties.background).optional(),hideBranding:e.z.boolean().describe(VI.properties.hideBranding).optional(),layout:uS.describe(VI.properties.layout).optional(),logo:hS.describe(VI.properties.logo).optional(),primaryColor:e.z.string().describe(VI.properties.primaryColor).optional(),showProgressBar:e.z.boolean().describe(VI.properties.showProgressBar).optional(),submitButton:fS.describe(VI.properties.submitButton).optional(),text:vS.describe(VI.properties.text).optional()}),AS=e.z.object({language:e.z.string().describe(VI.properties.language).optional(),logoAltText:e.z.string().describe(VI.properties.logoAltText).optional()}),DS=e.z.object({afterSubmissionView:bS.describe(VI.properties.afterSubmissionView).optional(),closeDate:yS.describe(VI.properties.closeDate).optional(),draftSubmission:wS.describe(VI.properties.draftSubmission).optional(),monday:_S.describe(VI.properties.monday).optional(),password:xS.describe(VI.properties.password).optional(),preSubmissionView:TS.describe(VI.properties.preSubmissionView).optional(),reCaptchaChallenge:e.z.boolean().describe(VI.properties.reCaptchaChallenge).optional(),requireLogin:IS.describe(VI.properties.requireLogin).optional(),responseLimit:SS.describe(VI.properties.responseLimit).optional()}),OS=e.z.object({id:e.z.string().describe(zI.inputs.questionId)}),kS=e.z.object({appearance:NS.describe(zI.inputs.form.appearance).optional(),accessibility:AS.describe(zI.inputs.form.accessibility).optional(),features:DS.describe(zI.inputs.form.features).optional(),title:e.z.string().describe(zI.inputs.title).optional(),description:e.z.string().describe(zI.inputs.description).optional(),questions:e.z.array(OS).describe(zI.inputs.questions).optional()}),RS={formToken:e.z.string().describe(LI.formToken),action:e.z.nativeEnum(lS).describe(zI.operations.updateForm.action),formPassword:e.z.string().describe(VI.operations.setFormPassword).optional(),tag:cS.describe(zI.inputs.tag).optional(),tagStringified:e.z.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:kS.describe(zI.inputs.form.describe).optional(),formStringified:e.z.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 PS{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(SI,a),{content:"Form password successfully set."}}async shortenFormUrl(e){const a={formToken:e.formToken};return await this.mondayApi.request(NI,a),{content:"Form URL successfully shortened."}}async deactivateForm(e){const a={formToken:e.formToken};return await this.mondayApi.request(AI,a),{content:"Form successfully deactivated."}}async activateForm(e){const a={formToken:e.formToken};return await this.mondayApi.request(DI,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(kI,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(OI,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(RI,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(PI,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(CI,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($I,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(FI,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(jI,a);return{content:`Form header content successfully updated: ${JSON.stringify(t.update_form,null,2)}`}}}const CS={formToken:e.z.string().describe(LI.formToken)};const $S=Object.fromEntries(Object.entries(J_).filter((([e])=>"Person"!==e))),FS={columnType:e.z.nativeEnum($S).describe("The type of the column to be created"),columnTitle:e.z.string().describe("The title of the column to be created"),columnDescription:e.z.string().optional().describe("The description of the column to be created"),columnSettings:e.z.string().optional().describe("Column-specific configuration settings as a JSON string. Use the get_column_type_info tool to fetch the JSON schema for the given column type.")},jS={boardId:e.z.number().describe("The id of the board to which the new column will be added"),...FS};const LS={color:e.z.nativeEnum(X_).describe("The color of the custom activity"),icon_id:e.z.nativeEnum(Z_).describe("The icon ID of the custom activity"),name:e.z.string().describe("The name of the custom activity")};const zS=MT`
|
|
706
706
|
mutation createGroup(
|
|
707
707
|
$boardId: ID!
|
|
708
708
|
$groupName: String!
|
|
@@ -721,14 +721,14 @@
|
|
|
721
721
|
title
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
`,
|
|
724
|
+
`,VS=["#037f4c","#00c875","#9cd326","#cab641","#ffcb00","#784bd1","#9d50dd","#007eb5","#579bfc","#66ccff","#bb3354","#df2f4a","#ff007f","#ff5ac4","#ff642e","#fdab3d","#7f5347","#c4c4c4","#757575"],US={boardId:e.z.string().describe("The ID of the board to create the group in"),groupName:e.z.string().max(255).describe("The name of the new group (maximum 255 characters)"),groupColor:e.z.enum(VS).optional().describe(`The color for the group. Must be one of the predefined Monday.com group colors: ${VS.join(", ")}`),relativeTo:e.z.string().optional().describe("The ID of the group to position this new group relative to"),positionRelativeMethod:e.z.nativeEnum(Gx).optional().describe("Whether to position the new group before or after the relativeTo group")};const BS=MT`
|
|
725
725
|
mutation duplicateItem($boardId: ID!, $itemId: ID!, $withUpdates: Boolean) {
|
|
726
726
|
duplicate_item(board_id: $boardId, item_id: $itemId, with_updates: $withUpdates) {
|
|
727
727
|
id
|
|
728
728
|
name
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
|
-
`,
|
|
731
|
+
`,MS=MT`
|
|
732
732
|
mutation createSubitem($parentItemId: ID!, $itemName: String!, $columnValues: JSON) {
|
|
733
733
|
create_subitem(parent_item_id: $parentItemId, item_name: $itemName, column_values: $columnValues) {
|
|
734
734
|
id
|
|
@@ -738,7 +738,7 @@
|
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
|
-
`,
|
|
741
|
+
`,qS={name:e.z.string().describe("The name of the new item to be created, must be relevant to the user's request"),groupId:e.z.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:e.z.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"},\\"dropdown_id\\":\\"value\\", \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"'),parentItemId:e.z.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:e.z.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},HS={boardId:e.z.number().describe("The id of the board to which the new item will be added"),...qS};const GS={item_id:e.z.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:e.z.string().describe("The ID of the custom activity for the timeline item"),title:e.z.string().describe("The title of the new timeline item"),summary:e.z.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:e.z.string().optional().describe("The content of the new timeline item"),timestamp:e.z.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:e.z.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:e.z.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:e.z.string().optional().describe("The location to add to the new timeline item"),phone:e.z.string().optional().describe("The phone number to add to the new timeline item"),url:e.z.string().optional().describe("The URL to add to the new timeline item")};const WS={itemId:e.z.number().describe("The id of the item to which the update will be added"),body:e.z.string().describe("The update to be created, must be relevant to the user's request"),mentionsList:e.z.string().optional().describe('Optional JSON string containing an array of mention objects with "id" (string) and "type" (MentionType enum value). Example: \'[{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]\'')};const QS={columnId:e.z.string().describe("The id of the column to be deleted")},KS={boardId:e.z.number().describe("The id of the board to which the new column will be added"),...QS};const YS={itemId:e.z.number()};const JS={};const XS=MT`
|
|
742
742
|
query GetBoardAllActivity(
|
|
743
743
|
$boardId: ID!
|
|
744
744
|
$fromDate: ISO8601DateTime!
|
|
@@ -756,7 +756,7 @@
|
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
}
|
|
759
|
-
`,
|
|
759
|
+
`,ZS=1e3;var eN,aN;!function(e){e[e.YEAR=31536e3]="YEAR",e[e.MONTH31Days=2678400]="MONTH31Days",e[e.MONTH30Days=2592e3]="MONTH30Days",e[e.MONTH29Days=2505600]="MONTH29Days",e[e.MONTH28Days=2419200]="MONTH28Days",e[e.WEEK=604800]="WEEK",e[e.DAY=86400]="DAY",e[e.HOUR=3600]="HOUR",e[e.MINUTE=60]="MINUTE"}(eN||(eN={})),function(e){e[e.YEAR=31536e6]="YEAR",e[e.MONTH31Days=26784e5]="MONTH31Days",e[e.MONTH30Days=2592e6]="MONTH30Days",e[e.MONTH29Days=25056e5]="MONTH29Days",e[e.MONTH28Days=24192e5]="MONTH28Days",e[e.DAY=864e5]="DAY",e[e.HOUR=36e5]="HOUR",e[e.MINUTE=6e4]="MINUTE",e[e.SECOND=ZS]="SECOND"}(aN||(aN={}));const tN={boardId:e.z.number().describe("The id of the board to get activity for"),fromDate:e.z.string().optional().describe("Start date for activity range (ISO8601DateTime format). Defaults to 30 days ago"),toDate:e.z.string().optional().describe("End date for activity range (ISO8601DateTime format). Defaults to now")};const iN=MT`
|
|
760
760
|
query GetBoardInfo($boardId: ID!) {
|
|
761
761
|
boards(ids: [$boardId]) {
|
|
762
762
|
# Basic Board Metadata
|
|
@@ -833,7 +833,7 @@
|
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
`,
|
|
836
|
+
`,nN=MT`
|
|
837
837
|
query GetBoardInfoJustColumns($boardId: ID!) {
|
|
838
838
|
boards(ids: [$boardId]) {
|
|
839
839
|
columns {
|
|
@@ -846,7 +846,7 @@
|
|
|
846
846
|
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
|
-
`,
|
|
849
|
+
`,oN=(e,a)=>({board:{...e,subItemColumns:a?.columns??void 0},filteringGuidelines:pN(e.columns.filter(rN))});function rN(e){return!!e&&["id","type"].every((a=>a in e))}const sN={last_updated:'Supported operators: any_of, not_any_of. CompareValue should be either:\n - "TODAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "YESTERDAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\nEXAMPLES:\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // using TODAY with correct compareAttribute\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "UPDATED_AT"} // using THIS_WEEK with not_any_of\n ❌ Wrong: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of"} // missing required compareAttribute\n ❌ Wrong: {"columnId": "last_updated", "compareValue": "TODAY", "operator": "any_of", "compareAttribute": "UPDATED_AT"} // not using array for any_of operator',date:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue should be either:\n - Date in "YYYY-MM-DD" format must be passed along with "EXACT" string e.g. compareValue:["2025-01-01", "EXACT"]\n - "TODAY" - Item with today\'s date\n - "TOMORROW" - Item with tomorrow\'s date\n - "THIS_WEEK" - Item with this week\'s date\n - "ONE_WEEK_AGO" - Item with one week ago\'s date\nEXAMPLES:\n ✅ Correct: {"columnId": "date", "compareValue": ["2025-01-01", "EXACT"], "operator": "any_of"} // using exact date format with EXACT\n ✅ Correct: {"columnId": "date", "compareValue": "TODAY", "operator": "greater_than"} // using TODAY with greater_than\n ❌ Wrong: {"columnId": "date", "compareValue": "2025-01-01", "operator": "any_of"} // missing EXACT string for exact date\n ❌ Wrong: {"columnId": "date", "compareValue": ["TODAY"], "operator": "greater_than"} // using array with single value operator',email:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be:\n - empty string "" when searching for blank values\n - whole email address when searching for specific email\n - partial email when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "email", "compareValue": ["john@example.com"], "operator": "any_of"} // using array with any_of for specific email\n ✅ Correct: {"columnId": "email", "compareValue": "gmail", "operator": "contains_text"} // using partial email with contains_text\n ❌ Wrong: {"columnId": "email", "compareValue": "john@example.com", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "email", "compareValue": ["gmail"], "operator": "contains_text"} // using array with single value operator',long_text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "long_text", "compareValue": ["Complete project description"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "long_text", "compareValue": "urgent", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "long_text", "compareValue": "Complete project description", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "long_text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "text", "compareValue": ["Task Name"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "text", "compareValue": "bug", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "text", "compareValue": "Task Name", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',numbers:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue is a number or "$$$blank$$$" when searching for blank values\nEXAMPLES:\n ✅ Correct: {"columnId": "numbers", "compareValue": [100, 200], "operator": "any_of"} // using array with any_of for multiple numbers\n ✅ Correct: {"columnId": "numbers", "compareValue": 50, "operator": "greater_than"} // using single number with greater_than\n ❌ Wrong: {"columnId": "numbers", "compareValue": 100, "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "numbers", "compareValue": ["50"], "operator": "greater_than"} // using array with single value operator',name:'Supported operators: "contains_text", "not_contains_text". CompareValue can be full or partial text\nEXAMPLES:\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "contains_text"} // using string with contains_text\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "not_contains_text"} // using string with not_contains_text',status:'Supported operators: any_of, not_any_of, contains_terms. CompareValue should be either:\n - id of label from column settings - when used with any_of, not_any_of operators\n - label\'s text - when use with contains_terms\nEXAMPLES:\n ✅ Correct: {"columnId": "status", "compareValue": [0, 1], "operator": "any_of"} // Using id values\n ✅ Correct: {"columnId": "status", "compareValue": "Done", "operator": "contains_terms"} // Using label text\n ❌ Wrong: {"columnId": "status", "compareValue": "Done", "operator": "any_of"} // Using label text with wrong operator\n ❌ Wrong: {"columnId": "status", "compareValue": [0, 1], "operator": "contains_terms"} // Using id with wrong operator',checkbox:'Supported operators: is_empty, is_not_empty. Compare value must be an empty array\nEXAMPLES:\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": null, "operator": "is_empty"} // not using empty array with is_empty operator',people:'Supported operators: any_of, not_any_of, is_empty, is_not_empty. **CRITICAL**: CompareValue MUST be in one of following:\n - "assigned_to_me" - when searching for current user\n - "person-123" - when searching for specific person with id 123\n - "team-456" - when searching for specific team with id 456\n - empty array when using is_empty, is_not_empty operators\nEXAMPLES: \n ❌ Wrong: {"columnId": "column_id", "compareValue": ["person—123"], "operator": "any_of"} // Using long hyphen \'—\' instead of short hyphen \'-\'\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ✅ Correct: {"columnId": "column_id", "compareValue": ["person-80120403"], "operator": "any_of"} // using person prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["team-9000"], "operator": "any_of"} // using team prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["assigned_to_me"], "operator": "any_of"} // using assigned_to_me value\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "is_empty"} // using id with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "any_of"} // not using person or team prefix'},pN=e=>{const a=e.reduce(((e,a)=>sN[a.type]?(e[a.type]||(e[a.type]=[]),e[a.type].push(a.id),e):e),{});return 0===Object.keys(a).length?"":`\n[MEMORY] Remember the filtering guidelines for subsequent requests for the same board.\n# Filtering Guidelines\n\n## [IMPORTANT] Operator Guidelines\nSpecific operators expect specific compareValue types:\n- CompareValue MUST BE SENT AS AN ARRAY WHEN USED WITH any_of, not_any_of, between operators\n- CompareValue MUST BE SENT AS AN EMPTY ARRAY WHEN USED WITH is_empty, is_not_empty\n- CompareValue MUST BE SENT AS EITHER SINGLE STRING OR SINGLE NUMBER WHEN USED WITH greater_than, greater_than_or_equals, lower_than, lower_than_or_equal\n- CompareValue MUST BE SENT AS SINGLE STRING WHEN USED WITH contains_terms, not_contains_text, contains_text, starts_with, ends_with operators\n\n## [IMPORTANT] Column type Guidelines\n${Object.entries(a).map((([e,a])=>`- Column Type: ${e} (Column IDs: ${a.join(", ")}) - ${sN[e]}`)).join("\n\n")}\n\n## [IMPORTANT] Sub Items Columns MUST NOT BE USED FOR FILTERING.\n `},dN={boardId:e.z.number().describe("The id of the board to get information for")};const lN=MT`
|
|
850
850
|
fragment ItemDataFragment on Item {
|
|
851
851
|
id
|
|
852
852
|
name
|
|
@@ -875,7 +875,7 @@
|
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
|
-
`,
|
|
878
|
+
`,cN=MT`
|
|
879
879
|
query SmartSearchBoardItemIds($searchTerm: String!, $board_ids: [ID!]) {
|
|
880
880
|
search_items(board_ids: $board_ids, query: $searchTerm, size: 100) {
|
|
881
881
|
results {
|
|
@@ -885,11 +885,11 @@
|
|
|
885
885
|
}
|
|
886
886
|
}
|
|
887
887
|
}
|
|
888
|
-
`,
|
|
888
|
+
`,mN={boardId:e.z.number().describe("The id of the board to get items from"),itemIds:e.z.array(e.z.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:e.z.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:e.z.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:e.z.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:e.z.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeSubItems:e.z.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:e.z.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filtersStringified:e.z.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.z.array(e.z.object({columnId:e.z.string().describe("The id of the column to filter by"),compareAttribute:e.z.string().optional().describe("The attribute to compare the value to"),compareValue:e.z.union([e.z.string(),e.z.number(),e.z.boolean(),e.z.array(e.z.union([e.z.string(),e.z.number()]))]).describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:e.z.nativeEnum(Cx).optional().default(Cx.AnyOf).describe("The operator to use for the filter")})).optional().describe('The configuration of filters to apply on the items. Before sending the filters, use get_board_info tool to check "filteringGuidelines" key for filtering by the column.'),filtersOperator:e.z.nativeEnum(Px).optional().default(Px.And).describe("The operator to use for the filters"),columnIds:e.z.array(e.z.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderByStringified:e.z.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.z.array(e.z.object({columnId:e.z.string().describe("The id of the column to order by"),direction:e.z.nativeEnum(Rx).optional().default(Rx.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};const uN={boardId:e.z.number().describe("The id of the board to get the schema of")};const hN=MT`
|
|
889
889
|
query GetColumnTypeSchema($type: ColumnType!) {
|
|
890
890
|
get_column_type_schema(type: $type)
|
|
891
891
|
}
|
|
892
|
-
`,
|
|
892
|
+
`,fN={columnType:e.z.nativeEnum($S).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const vN={random_string:e.z.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:e.z.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const gN={typeName:e.z.string().describe("The name of the GraphQL type to get details for")};function bN(e){return e?"NON_NULL"===e.kind?`${bN(e.ofType)}!`:"LIST"===e.kind?`[${bN(e.ofType)}]`:e.name||"unknown":"unknown"}const yN=MT`
|
|
893
893
|
fragment UserDetails on User {
|
|
894
894
|
# Basic User Information
|
|
895
895
|
id
|
|
@@ -917,31 +917,31 @@
|
|
|
917
917
|
time_zone_identifier
|
|
918
918
|
utc_hours_diff
|
|
919
919
|
}
|
|
920
|
-
`,
|
|
920
|
+
`,wN=MT`
|
|
921
921
|
fragment UserTeamMembership on Team {
|
|
922
922
|
id
|
|
923
923
|
name
|
|
924
924
|
is_guest
|
|
925
925
|
picture_url
|
|
926
926
|
}
|
|
927
|
-
`,
|
|
927
|
+
`,_N=MT`
|
|
928
928
|
fragment TeamBasicInfo on Team {
|
|
929
929
|
id
|
|
930
930
|
name
|
|
931
931
|
}
|
|
932
|
-
`,
|
|
932
|
+
`,xN=MT`
|
|
933
933
|
fragment TeamExtendedInfo on Team {
|
|
934
934
|
...TeamBasicInfo
|
|
935
935
|
is_guest
|
|
936
936
|
picture_url
|
|
937
937
|
}
|
|
938
|
-
`,
|
|
938
|
+
`,EN=MT`
|
|
939
939
|
fragment TeamOwner on User {
|
|
940
940
|
id
|
|
941
941
|
name
|
|
942
942
|
email
|
|
943
943
|
}
|
|
944
|
-
`,
|
|
944
|
+
`,TN=MT`
|
|
945
945
|
fragment TeamMember on User {
|
|
946
946
|
id
|
|
947
947
|
name
|
|
@@ -961,7 +961,7 @@
|
|
|
961
961
|
time_zone_identifier
|
|
962
962
|
utc_hours_diff
|
|
963
963
|
}
|
|
964
|
-
`,
|
|
964
|
+
`,IN=MT`
|
|
965
965
|
fragment TeamMemberSimplified on User {
|
|
966
966
|
id
|
|
967
967
|
name
|
|
@@ -970,15 +970,15 @@
|
|
|
970
970
|
is_admin
|
|
971
971
|
is_guest
|
|
972
972
|
}
|
|
973
|
-
`,
|
|
973
|
+
`,SN=MT`
|
|
974
974
|
fragment UserTeamMembershipSimplified on Team {
|
|
975
975
|
id
|
|
976
976
|
name
|
|
977
977
|
is_guest
|
|
978
978
|
}
|
|
979
|
-
`,
|
|
980
|
-
${bN}
|
|
979
|
+
`,NN=MT`
|
|
981
980
|
${yN}
|
|
981
|
+
${wN}
|
|
982
982
|
|
|
983
983
|
query listUsersWithTeams($userIds: [ID!], $limit: Int = 1000) {
|
|
984
984
|
users(ids: $userIds, limit: $limit) {
|
|
@@ -990,9 +990,9 @@
|
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
992
|
}
|
|
993
|
-
`,
|
|
994
|
-
${bN}
|
|
993
|
+
`,AN=MT`
|
|
995
994
|
${yN}
|
|
995
|
+
${wN}
|
|
996
996
|
|
|
997
997
|
query listUsersOnly($userIds: [ID!], $limit: Int = 1000) {
|
|
998
998
|
users(ids: $userIds, limit: $limit) {
|
|
@@ -1004,13 +1004,13 @@
|
|
|
1004
1004
|
}
|
|
1005
1005
|
}
|
|
1006
1006
|
}
|
|
1007
|
-
`,
|
|
1008
|
-
${
|
|
1009
|
-
${
|
|
1010
|
-
${_N}
|
|
1011
|
-
${wN}
|
|
1007
|
+
`,DN=MT`
|
|
1008
|
+
${yN}
|
|
1009
|
+
${SN}
|
|
1012
1010
|
${xN}
|
|
1013
|
-
${
|
|
1011
|
+
${_N}
|
|
1012
|
+
${EN}
|
|
1013
|
+
${IN}
|
|
1014
1014
|
|
|
1015
1015
|
query listUsersAndTeams($userIds: [ID!], $teamIds: [ID!], $limit: Int = 1000) {
|
|
1016
1016
|
users(ids: $userIds, limit: $limit) {
|
|
@@ -1036,19 +1036,19 @@
|
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
`,
|
|
1040
|
-
${
|
|
1039
|
+
`,ON=MT`
|
|
1040
|
+
${_N}
|
|
1041
1041
|
|
|
1042
1042
|
query listTeamsOnly($teamIds: [ID!]) {
|
|
1043
1043
|
teams(ids: $teamIds) {
|
|
1044
1044
|
...TeamBasicInfo
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
|
-
`,
|
|
1048
|
-
${_N}
|
|
1049
|
-
${wN}
|
|
1047
|
+
`,kN=MT`
|
|
1050
1048
|
${xN}
|
|
1049
|
+
${_N}
|
|
1051
1050
|
${EN}
|
|
1051
|
+
${TN}
|
|
1052
1052
|
|
|
1053
1053
|
query listTeamsWithMembers($teamIds: [ID!]) {
|
|
1054
1054
|
teams(ids: $teamIds) {
|
|
@@ -1065,9 +1065,9 @@
|
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
|
-
`,
|
|
1069
|
-
${bN}
|
|
1068
|
+
`,RN=MT`
|
|
1070
1069
|
${yN}
|
|
1070
|
+
${wN}
|
|
1071
1071
|
|
|
1072
1072
|
query getUserByName($name: String) {
|
|
1073
1073
|
users(name: $name) {
|
|
@@ -1079,7 +1079,7 @@
|
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
|
-
`,
|
|
1082
|
+
`,PN=MT`
|
|
1083
1083
|
query getCurrentUser {
|
|
1084
1084
|
me {
|
|
1085
1085
|
id
|
|
@@ -1090,7 +1090,7 @@
|
|
|
1090
1090
|
is_guest
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
|
1093
|
-
`;const
|
|
1093
|
+
`;const CN=e=>{const a=[];return"users"in e&&e.users&&e.users.length>0&&(a.push("Users:"),e.users.forEach((e=>{e&&(a.push(` ID: ${e.id}`),a.push(` Name: ${e.name}`),a.push(` Email: ${e.email}`),a.push(` Title: ${e.title||"N/A"}`),a.push(` Enabled: ${e.enabled}`),a.push(` Admin: ${e.is_admin||!1}`),a.push(` Guest: ${e.is_guest||!1}`),a.push(` Pending: ${e.is_pending||!1}`),a.push(` Verified: ${e.is_verified||!1}`),a.push(` View Only: ${e.is_view_only||!1}`),a.push(` Join Date: ${e.join_date||"N/A"}`),a.push(` Last Activity: ${e.last_activity||"N/A"}`),a.push(` Location: ${e.location||"N/A"}`),a.push(` Mobile Phone: ${e.mobile_phone||"N/A"}`),a.push(` Phone: ${e.phone||"N/A"}`),a.push(` Timezone: ${e.time_zone_identifier||"N/A"}`),a.push(` UTC Hours Diff: ${e.utc_hours_diff||"N/A"}`),e.teams&&e.teams.length>0&&(a.push(" Teams:"),e.teams.forEach((e=>{e&&a.push(` - ID: ${e.id}, Name: ${e.name}, Guest Team: ${e.is_guest||!1}`)}))),a.push(""))}))),"teams"in e&&e.teams&&e.teams.length>0&&(a.push("Teams:"),e.teams.forEach((e=>{e&&(a.push(` ID: ${e.id}`),a.push(` Name: ${e.name}`),function(e){return"owners"in e}(e)&&(a.push(` Guest Team: ${e.is_guest||!1}`),a.push(` Picture URL: ${e.picture_url||"N/A"}`),e.owners&&e.owners.length>0&&(a.push(" Owners:"),e.owners.forEach((e=>{a.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}`)}))),e.users&&e.users.length>0&&(a.push(" Members:"),e.users.forEach((e=>{e&&a.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}, Title: ${e.title||"N/A"}, Admin: ${e.is_admin||!1}, Guest: ${e.is_guest||!1}`)})))),a.push(""))}))),0===a.length?"No users or teams found with the specified filters.":a.join("\n").trim()},$N=500,FN=500,jN=1e3,LN={userIds:e.z.array(e.z.string()).max($N).optional().describe("Specific user IDs to fetch.[IMPORTANT] ALWAYS use when you have user IDs in context. PREFER over general search. RETURNS: user profiles including team memberships"),teamIds:e.z.array(e.z.string()).max(FN).optional().describe("Specific team IDs to fetch.[IMPORTANT] ALWAYS use when you have team IDs in context, NEVER fetch all teams if specific IDs are available.\n RETURNS: Team details with owners and optional member data."),name:e.z.string().optional().describe("Name-based user search. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n This parameter CONFLICTS with all others."),getMe:e.z.boolean().optional().describe('[TOP PRIORITY] Use ALWAYS when requesting current user information. Examples of when it should be used: ["get my user" or "get my teams"].\n This parameter CONFLICTS with all others. '),includeTeams:e.z.boolean().optional().describe("[AVOID] This fetches all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get their team memberships."),teamsOnly:e.z.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:e.z.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const zN={itemId:e.z.number().describe("The id of the item to which the update will be added"),groupId:e.z.string().describe("The id of the group to which the item will be moved")};const VN={type:e.z.enum(["ids","object_ids","workspace_ids"]).describe("Query type of ids parameter that is used query by: ids, object_ids, or workspace_ids"),ids:e.z.array(e.z.string()).min(1).describe("Array of ID values for this query type (at least 1 required)"),limit:e.z.number().optional().describe("Number of docs per page (default: 25). Affects pagination - if you get exactly this many results, there may be more pages."),order_by:e.z.nativeEnum(px).optional().describe("The order in which to retrieve your docs. The default shows created_at with the newest docs listed first. This argument will not be applied if you query docs by specific ids."),page:e.z.number().optional().describe("The page number to return (starts at 1). Use this to paginate through large result sets. Check response for has_more_pages indicator.")};const UN={workspace_id:e.z.number().describe("The ID of the workspace to get information for")};const BN=MT`
|
|
1094
1094
|
query listWorkspaces($limit: Int!, $page: Int!) {
|
|
1095
1095
|
workspaces(limit: $limit, page: $page) {
|
|
1096
1096
|
id
|
|
@@ -1098,7 +1098,7 @@
|
|
|
1098
1098
|
description
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
|
-
`,
|
|
1101
|
+
`,MN=100,qN=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,""),HN={searchTerm:e.z.string().optional().describe("The search term to filter the workspaces by. If not provided, all workspaces will be returned. [IMPORANT] Only alphanumeric characters are supported."),limit:e.z.number().min(1).max(MN).default(MN).describe("The number of workspaces to return. Default and maximum allowed is 100"),page:e.z.number().min(1).default(1).describe("The page number to return. Default is 1.")};const GN=MT`
|
|
1102
1102
|
query getItemBoard($itemId: ID!) {
|
|
1103
1103
|
items(ids: [$itemId]) {
|
|
1104
1104
|
id
|
|
@@ -1111,7 +1111,7 @@
|
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
1113
|
}
|
|
1114
|
-
`,
|
|
1114
|
+
`,WN=MT`
|
|
1115
1115
|
mutation createDoc($location: CreateDocInput!) {
|
|
1116
1116
|
create_doc(location: $location) {
|
|
1117
1117
|
id
|
|
@@ -1119,7 +1119,7 @@
|
|
|
1119
1119
|
name
|
|
1120
1120
|
}
|
|
1121
1121
|
}
|
|
1122
|
-
`,
|
|
1122
|
+
`,QN=MT`
|
|
1123
1123
|
mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
|
|
1124
1124
|
add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
|
|
1125
1125
|
success
|
|
@@ -1127,11 +1127,11 @@
|
|
|
1127
1127
|
error
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
|
-
`,
|
|
1130
|
+
`,KN=MT`
|
|
1131
1131
|
mutation updateDocName($docId: ID!, $name: String!) {
|
|
1132
1132
|
update_doc_name(docId: $docId, name: $name)
|
|
1133
1133
|
}
|
|
1134
|
-
`,
|
|
1134
|
+
`,YN=e.z.enum(["workspace","item"]),JN=e.z.discriminatedUnion("type",[e.z.object({type:e.z.literal(YN.enum.workspace).describe("Create document in workspace"),workspace_id:e.z.number().describe("Workspace ID under which to create the new document"),doc_kind:e.z.nativeEnum(j_).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:e.z.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),e.z.object({type:e.z.literal(YN.enum.item).describe("Create document attached to item"),item_id:e.z.number().describe("Item ID to attach the new document to"),column_id:e.z.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]),XN={doc_name:e.z.string().describe("Name for the new document."),markdown:e.z.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:e.z.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:e.z.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:e.z.nativeEnum(j_).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:e.z.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:e.z.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:e.z.string().optional().describe('[OPTIONAL - use only when location="item"] ID of an existing "doc" column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.')};const ZN=MT`
|
|
1135
1135
|
mutation CreateDashboard(
|
|
1136
1136
|
$name: String!
|
|
1137
1137
|
$workspace_id: ID!
|
|
@@ -1153,14 +1153,14 @@
|
|
|
1153
1153
|
board_folder_id
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
|
-
`,
|
|
1156
|
+
`,eA=MT`
|
|
1157
1157
|
query GetAllWidgetsSchema {
|
|
1158
1158
|
all_widgets_schema {
|
|
1159
1159
|
widget_type
|
|
1160
1160
|
schema
|
|
1161
1161
|
}
|
|
1162
1162
|
}
|
|
1163
|
-
`,
|
|
1163
|
+
`,aA=MT`
|
|
1164
1164
|
mutation CreateWidget($parent: WidgetParentInput!, $kind: ExternalWidget!, $name: String!, $settings: JSON!) {
|
|
1165
1165
|
create_widget(parent: $parent, kind: $kind, name: $name, settings: $settings) {
|
|
1166
1166
|
id
|
|
@@ -1172,13 +1172,13 @@
|
|
|
1172
1172
|
}
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
|
-
`,
|
|
1175
|
+
`,tA={name:e.z.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:e.z.string().describe("ID of the workspace that will own the dashboard"),board_ids:e.z.array(e.z.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.z.nativeEnum(ax).default(ax.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:e.z.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const iA={parent_container_id:e.z.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:e.z.nativeEnum(_E).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:e.z.nativeEnum(cx).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:e.z.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.z.record(e.z.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.z.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 nA=MT`
|
|
1176
1176
|
mutation updateWorkspace($id: ID!, $attributes: UpdateWorkspaceAttributesInput!) {
|
|
1177
1177
|
update_workspace(id: $id, attributes: $attributes) {
|
|
1178
1178
|
id
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
1181
|
-
`,
|
|
1181
|
+
`,oA={id:e.z.string().describe("The ID of the workspace to update"),attributeAccountProductId:e.z.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:e.z.string().optional().describe("The description of the workspace to update"),attributeKind:e.z.nativeEnum(xE).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:e.z.string().optional().describe("The name of the workspace to update")};const rA=MT`
|
|
1182
1182
|
mutation updateFolder(
|
|
1183
1183
|
$folderId: ID!
|
|
1184
1184
|
$name: String
|
|
@@ -1204,7 +1204,7 @@
|
|
|
1204
1204
|
id
|
|
1205
1205
|
}
|
|
1206
1206
|
}
|
|
1207
|
-
`,
|
|
1207
|
+
`,sA={folderId:e.z.string().describe("The ID of the folder to update"),name:e.z.string().optional().describe("The new name of the folder"),color:e.z.nativeEnum(fx).optional().describe("The new color of the folder"),fontWeight:e.z.nativeEnum(gx).optional().describe("The new font weight of the folder"),customIcon:e.z.nativeEnum(vx).optional().describe("The new custom icon of the folder"),parentFolderId:e.z.string().optional().describe("The ID of the new parent folder"),workspaceId:e.z.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:e.z.string().optional().describe("The account product ID associated with the folder"),position_object_id:e.z.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.z.nativeEnum(qx).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.z.boolean().optional().describe("Whether to position the folder after the object")};const pA=MT`
|
|
1208
1208
|
mutation createWorkspace(
|
|
1209
1209
|
$name: String!
|
|
1210
1210
|
$workspaceKind: WorkspaceKind!
|
|
@@ -1220,7 +1220,7 @@
|
|
|
1220
1220
|
id
|
|
1221
1221
|
}
|
|
1222
1222
|
}
|
|
1223
|
-
`,
|
|
1223
|
+
`,dA={name:e.z.string().describe("The name of the new workspace to be created"),workspaceKind:e.z.nativeEnum(xE).describe("The kind of workspace to create"),description:e.z.string().optional().describe("The description of the new workspace"),accountProductId:e.z.string().optional().describe("The account product ID associated with the workspace")};const lA=MT`
|
|
1224
1224
|
mutation createFolder(
|
|
1225
1225
|
$workspaceId: ID!
|
|
1226
1226
|
$name: String!
|
|
@@ -1240,7 +1240,7 @@
|
|
|
1240
1240
|
id
|
|
1241
1241
|
}
|
|
1242
1242
|
}
|
|
1243
|
-
`,
|
|
1243
|
+
`,cA={workspaceId:e.z.string().describe("The ID of the workspace where the folder will be created"),name:e.z.string().describe("The name of the folder to be created"),color:e.z.nativeEnum(fx).optional().describe("The color of the folder"),fontWeight:e.z.nativeEnum(gx).optional().describe("The font weight of the folder"),customIcon:e.z.nativeEnum(vx).optional().describe("The custom icon of the folder"),parentFolderId:e.z.string().optional().describe("The ID of the parent folder")};const mA=MT`
|
|
1244
1244
|
mutation updateBoardHierarchy($boardId: ID!, $attributes: UpdateBoardHierarchyAttributesInput!) {
|
|
1245
1245
|
update_board_hierarchy(board_id: $boardId, attributes: $attributes) {
|
|
1246
1246
|
success
|
|
@@ -1250,7 +1250,7 @@
|
|
|
1250
1250
|
}
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
|
-
`,
|
|
1253
|
+
`,uA=MT`
|
|
1254
1254
|
mutation updateOverviewHierarchy($overviewId: ID!, $attributes: UpdateOverviewHierarchyAttributesInput!) {
|
|
1255
1255
|
update_overview_hierarchy(overview_id: $overviewId, attributes: $attributes) {
|
|
1256
1256
|
success
|
|
@@ -1260,7 +1260,7 @@
|
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
1262
1262
|
}
|
|
1263
|
-
`,
|
|
1263
|
+
`,hA={objectType:e.z.nativeEnum(qx).describe("The type of object to move"),id:e.z.string().describe("The ID of the object to move"),position_object_id:e.z.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.z.nativeEnum(qx).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.z.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:e.z.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:e.z.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:e.z.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const fA=MT`
|
|
1264
1264
|
query aggregateBoardInsights($query: AggregateQueryInput!) {
|
|
1265
1265
|
aggregate(query: $query) {
|
|
1266
1266
|
results {
|
|
@@ -1281,7 +1281,7 @@
|
|
|
1281
1281
|
}
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
|
-
`,
|
|
1284
|
+
`,vA=new Set([x_.Case,x_.Between,x_.Left,x_.Raw,x_.None,x_.CountKeys]),gA=Object.values(x_).filter((e=>!vA.has(e))),bA=new Set([x_.Left,x_.Trim,x_.Upper,x_.Lower,x_.DateTruncDay,x_.DateTruncWeek,x_.DateTruncMonth,x_.DateTruncQuarter,x_.DateTruncYear,x_.Color,x_.Label,x_.EndDate,x_.StartDate,x_.Hour,x_.PhoneCountryShortName,x_.Person,x_.Upper,x_.Lower,x_.Order,x_.Length,x_.Flatten,x_.IsDone]);function yA(e){return{column_id:e}}new Set([x_.Count,x_.CountDistinct,x_.CountSubitems,x_.CountItems,x_.First,x_.Sum,x_.Average,x_.Median,x_.Min,x_.Max,x_.MinMax]);const wA={boardId:e.z.number().describe("The id of the board to get insights for"),aggregationsStringified:e.z.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.z.array(e.z.object({function:e.z.enum(gA).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:e.z.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.z.array(e.z.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.z.number().describe("The limit of the results").max(1e3).optional().default(1e3),filtersStringified:e.z.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.z.array(e.z.object({columnId:e.z.string().describe("The id of the column to filter by"),compareAttribute:e.z.string().optional().describe("The attribute to compare the value to"),compareValue:e.z.any().describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:e.z.nativeEnum(Cx).optional().default(Cx.AnyOf).describe("The operator to use for the filter")})).optional().describe('The configuration of filters to apply on the items. Before sending the filters, use get_board_info tool to check "filteringGuidelines" key for filtering by the column.'),filtersOperator:e.z.nativeEnum(Px).optional().default(Px.And).describe("The logical operator to use for the filters"),orderByStringified:e.z.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.z.array(e.z.object({columnId:e.z.string().describe("The id of the column to order by"),direction:e.z.nativeEnum(Rx).optional().default(Rx.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};const _A=MT`
|
|
1285
1285
|
query GetBoards($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
|
|
1286
1286
|
boards(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
|
|
1287
1287
|
id
|
|
@@ -1289,7 +1289,7 @@
|
|
|
1289
1289
|
url
|
|
1290
1290
|
}
|
|
1291
1291
|
}
|
|
1292
|
-
`,
|
|
1292
|
+
`,xA=MT`
|
|
1293
1293
|
query GetDocs($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
|
|
1294
1294
|
docs(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
|
|
1295
1295
|
id
|
|
@@ -1297,14 +1297,14 @@
|
|
|
1297
1297
|
url
|
|
1298
1298
|
}
|
|
1299
1299
|
}
|
|
1300
|
-
`,
|
|
1300
|
+
`,EA=MT`
|
|
1301
1301
|
query GetFolders($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
|
|
1302
1302
|
folders(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
|
|
1303
1303
|
id
|
|
1304
1304
|
name
|
|
1305
1305
|
}
|
|
1306
1306
|
}
|
|
1307
|
-
`;var
|
|
1307
|
+
`;var TA,IA;!function(e){e.BOARD="board-",e.DOCUMENT="doc-",e.FOLDER="folder-"}(TA||(TA={})),function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS"}(IA||(IA={}));const SA=100,NA={searchTerm:e.z.string().optional().describe("The search term to use for the search."),searchType:e.z.nativeEnum(IA).describe("The type of search to perform."),limit:e.z.number().max(SA).optional().default(SA).describe("The number of items to get. The max and default value is 100."),page:e.z.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:e.z.array(e.z.number()).optional().describe("The ids of the workspaces to search in. Pass if you want to search only in specific workspaces.")};const AA={action:e.z.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),toolName:e.z.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)")};class DA{constructor(){this.name="manage_tools",this.type=Zi.READ,this.enabledByDefault=!0,this.annotations={title:"Discover & Manage monday.com Tools",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}}setToolkitManager(e){this.toolkitManager=e}getDescription(){return"Discover and manage available monday.com tools. Use this tool first to see what tools are available, check which ones are active/inactive, and enable any tools you need for your tasks. When enabling a tool, you will be asked for confirmation first. Essential for understanding your monday.com toolkit capabilities."}getInputSchema(){return AA}async execute(e){if(!this.toolkitManager)throw new Error("Toolkit manager not initialized");if(!e)throw new Error("Input parameters are required");const{action:a,toolName:t}=e;switch(a){case"enable":if(!t)throw new Error("Tool name is required for enable action");if(this.toolkitManager.isToolEnabled(t))return{content:`Tool '${t}' is already enabled`};return{content:this.toolkitManager.enableTool(t)?`✅ Tool '${t}' has been enabled and is now available for use`:`❌ Failed to enable tool '${t}' (tool not found)`};case"disable":if(!t)throw new Error("Tool name is required for disable action");return{content:this.toolkitManager.disableTool(t)?`Tool '${t}' has been disabled`:`Failed to disable tool '${t}' (tool not found)`};case"status":if(t){return{content:`Tool '${t}' is ${this.toolkitManager.isToolEnabled(t)?"enabled":"disabled"}`}}{const e=this.toolkitManager.getToolsStatus();return{content:`All tools status:\n${Object.entries(e).map((([e,a])=>`${e}: ${a?"enabled":"disabled"}`)).join("\n")}`}}case"detailed":{const e=this.toolkitManager.getDetailedToolsStatus(),a=Object.entries(e).filter((([,e])=>e.enabled)),t=Object.entries(e).filter((([,e])=>!e.enabled));let i="monday.com Tools Discovery:\n\n";return a.length>0&&(i+="✅ ACTIVE TOOLS (ready to use):\n",i+=a.map((([e,a])=>` • ${e} (default: ${a.enabledByDefault?"enabled":"disabled"})`)).join("\n")),t.length>0&&(i+="\n\n⚠️ INACTIVE TOOLS (need activation):\n",i+=t.map((([e,a])=>` • ${e} (default: ${a.enabledByDefault?"enabled":"disabled"}) - use {"action": "enable", "toolName": "${e}"} to activate`)).join("\n")),{content:i}}case"reset":{if(!t)throw new Error("Tool name is required for reset action");const e=this.toolkitManager.resetToolToDefault(t),a=this.toolkitManager.isToolEnabledByDefault(t);return{content:e?`Tool '${t}' has been reset to its default state (${a?"enabled":"disabled"})`:`Failed to reset tool '${t}' (tool not found)`}}case"list":{const e=this.toolkitManager.getToolsStatus();return{content:`Available tools: ${Object.entries(e).map((([e,a])=>`${e} (${a?"enabled":"disabled"})`)).join(", ")}`}}default:throw new Error("Invalid action. Use: enable, disable, status, list, detailed, or reset")}}}const OA=MT`
|
|
1308
1308
|
query getSprintsByIds($ids: [ID!]) {
|
|
1309
1309
|
items(ids: $ids) {
|
|
1310
1310
|
id
|
|
@@ -1339,7 +1339,7 @@
|
|
|
1339
1339
|
}
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
|
-
`,
|
|
1342
|
+
`,kA={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"},RA={...kA,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},PA="BOARD_NOT_FOUND:",CA="SPRINT_NOT_FOUND:",$A="DOCUMENT_NOT_FOUND:",FA="DOCUMENT_INVALID:",jA="DOCUMENT_EMPTY:",LA="EXPORT_FAILED:",zA="INTERNAL_ERROR:",VA="VALIDATION_ERROR:",UA="task_sprint",BA={[RA.SPRINT_TASKS]:"Sprint Tasks",[RA.SPRINT_TIMELINE]:"Sprint Timeline",[RA.SPRINT_COMPLETION]:"Sprint Completion",[RA.SPRINT_START_DATE]:"Sprint Start Date",[RA.SPRINT_END_DATE]:"Sprint End Date",[RA.SPRINT_ACTIVATION]:"Sprint Activation",[RA.SPRINT_SUMMARY]:"Sprint Summary",[RA.SPRINT_CAPACITY]:"Sprint Capacity"},MA=aE,qA={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},HA=(e,a)=>e.column_values?.find((e=>e.id===a)),GA=(e,a)=>{const t=HA(e,a);return"CheckboxValue"===t?.__typename?t.checked??!1:null},WA=(e,a)=>{const t=HA(e,a);return"DateValue"===t?.__typename?t.date??null:null},QA=(e,a)=>{const t=HA(e,a);return"DocValue"===t?.__typename&&t.file?.doc?.object_id?t.file.doc.object_id:null},KA=(e,a)=>{const t=a.filter((a=>!e.has(a)));return{isValid:0===t.length,missingColumns:t}},YA=(e,a)=>{if(!e.columns)return!1;const t=new Set(e.columns.filter((e=>null!==e)).map((e=>e.id)));return a.every((e=>t.has(e)))},JA=e=>YA(e,Object.values(kA)),XA=e=>YA(e,Object.values(qA)),ZA=e=>{if(!e?.settings)return null;const a=e.settings;return a.boardIds&&Array.isArray(a.boardIds)&&a.boardIds[0]?.toString()||a.boardId?.toString()||null},eD=(e,a)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===a&&e.type===$S.BoardRelation))||null,aD={sprintId:e.z.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const tD=MT`
|
|
1343
1343
|
query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
|
|
1344
1344
|
boards(ids: [$boardId]) {
|
|
1345
1345
|
items_page(limit: $limit) {
|
|
@@ -1375,7 +1375,7 @@
|
|
|
1375
1375
|
}
|
|
1376
1376
|
}
|
|
1377
1377
|
}
|
|
1378
|
-
`,
|
|
1378
|
+
`,iD={sprintsBoardId:e.z.number().describe("The ID of the monday-dev board containing the sprints"),limit:e.z.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const nD=MT`
|
|
1379
1379
|
query GetRecentBoards($limit: Int) {
|
|
1380
1380
|
boards(limit: $limit, order_by: used_at, state: active) {
|
|
1381
1381
|
id
|
|
@@ -1391,7 +1391,7 @@
|
|
|
1391
1391
|
}
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
|
-
`,nD={};const oD=[class extends fg{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=Zi.READ,this.annotations=hg({title:"monday-dev: Get Sprints Boards",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Discover monday-dev sprints boards and their associated tasks boards in your account.\n\n## Purpose:\nIdentifies and returns monday-dev sprints board IDs and tasks board IDs that you need to use with other monday-dev tools. \nThis tool scans your recently used boards (up to 100) to find valid monday-dev sprint management boards.\n\n## What it Returns:\n- Pairs of sprints boards and their corresponding tasks boards\n- Board IDs, names, and workspace information for each pair\n- The bidirectional relationship between each sprints board and its tasks board\n\n## Note:\nSearches recently used boards (up to 100). If none found, ask user to provide board IDs manually."}getInputSchema(){return nD}async executeInternal(e){try{const e={limit:100},a=((await this.mondayApi.request(iD,e)).boards||[]).filter((e=>null!==e));if(0===a.length)return{content:`${RA} No boards found in your account. Please verify you have access to monday.com boards.`};const t=this.extractBoardPairs(a);if(0===t.length)return{content:this.generateNotFoundMessage(a.length)};return{content:this.generateReport(t)}}catch(e){return{content:`${LA} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}generateMultiplePairsWarning(e){return`## ⚠️ Multiple SprintsBoard Detected\n**${e}** different board pairs found. Each pair is isolated and workspace-specific.\n**AI Agent - REQUIRED:** Before ANY operation, confirm with user which pair and workspace to use.\n---\n`}generatePairDetails(e,a){return`### Pair ${a+1}\n**Sprints Board:**\n- ID: \`${e.sprintsBoard.id}\`\n- Name: ${e.sprintsBoard.name}\n- Workspace: ${e.sprintsBoard.workspaceName} (ID: ${e.sprintsBoard.workspaceId})\n\n**Tasks Board:**\n- ID: \`${e.tasksBoard.id}\`\n- Name: ${e.tasksBoard.name}\n- Workspace: ${e.tasksBoard.workspaceName} (ID: ${e.tasksBoard.workspaceId})\n---\n\n`}generateTechnicalReference(){return"## 📋 Technical Reference\n\n**Sprint Operations** (all require correct board pair):\n• Add to Sprint: Update `task_sprint` column with sprint item ID\n• Remove from Sprint: Clear `task_sprint` column (set to null)\n• Search in Sprint: Filter where `task_sprint` equals sprint item ID\n• Move Between Sprints: Update `task_sprint` with new sprint item ID\n• Backlog Tasks: `task_sprint` is empty/null\n\n**Critical:** `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}generateReport(e){const a=e.length>1?this.generateMultiplePairsWarning(e.length):"",t=e.map(((e,a)=>this.generatePairDetails(e,a))).join(""),i=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${a}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${t}${i}`}generateNotFoundMessage(e){return`## No Monday-Dev Sprints Board Pairs Found\n\n**Boards Checked:** ${e} (recently used)\n\nNo board pairs with sprint relationships found in your recent boards.\n\n### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`}createBoardInfo(e,a,t){return{id:e,name:a?.name||t,workspaceId:a?.workspace?.id||"unknown",workspaceName:a?.workspace?.name||"Unknown"}}processSprintsBoard(e,a,t){const i=ZA(e,OA.SPRINT_TASKS);if(!i)return;const n=XA(i);if(!n)return;const o=`${e.id}:${n}`;if(t.has(o))return;const r=a.get(n);t.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,a,t){const i=ZA(e,VA);if(!i)return;const n=XA(i);if(!n)return;const o=`${n}:${e.id}`;if(t.has(o))return;const r=a.get(n);t.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const a=new Map,t=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(YA(i)&&this.processSprintsBoard(i,t,a),JA(i)&&this.processTasksBoard(i,t,a));return Array.from(a.values())}},class extends fg{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=Zi.READ,this.annotations=hg({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 tD}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(aD,t),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${LA} 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(WT,a),i=t.boards?.[0];if(!i)return{success:!1,error:`${RA} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${zA} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${LA} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const a=new Set(e.filter((e=>null!==e)).map((e=>e.id))),t=Object.values(OA),i=QA(a,t);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((a=>{const t=(e=>UA[e]||e)(a);e+=`- ${t}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}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=HA(e,kA.SPRINT_ACTIVATION),o=HA(e,kA.SPRINT_COMPLETION),r=GA(e,kA.SPRINT_START_DATE),s=GA(e,kA.SPRINT_END_DATE),p=((e,a)=>{const t=qA(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,kA.SPRINT_TIMELINE),d=WA(e,kA.SPRINT_SUMMARY);let l=BA.Planned;o?l=BA.Completed:(n||r)&&(l=BA.Active);const c=p?`${p.from} to ${p.to}`:"Not set";a+=`| ${t} | ${i} | ${l} | ${c} | ${r||"Not started"} | ${s||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),a+="\n## Status Definitions:\n",a+=`- **${BA.Planned}**: Sprint not yet started (no activation, no start date)\n`,a+=`- **${BA.Active}**: Sprint is active (activated but not completed)\n`,a+=`- **${BA.Completed}**: Sprint is finished\n\n`,a}},class extends fg{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=Zi.READ,this.annotations=hg({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 eD}async executeInternal(e){try{const a=await this.getSprintMetadata(e.sprintId);if(!a.success)return{content:a.error||`${LA} Unknown error occurred while getting sprint metadata`};const t=await this.readSprintSummaryDocument(a.documentObjectId);return t.success?{content:t.content}:{content:t.error||`${LA} Unknown error occurred while reading document content`}}catch(e){return{content:`${LA} 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(DA,a)).items||[];if(0===t.length)return{success:!1,error:`${PA} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=t[0];if(!i)return{success:!1,error:`${PA} Sprint with ID ${e} not found.`};const n=((e,a=[])=>{const t=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(OA),...a];return QA(t,i)})(i,[kA.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${zA} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=WA(i,kA.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${CA} 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:`${LA} 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(nI,a)).docs||[];if(0===t.length)return{success:!1,error:`${CA} Document with object ID ${e} not found or not accessible.`};const i=t[0];if(!i||!i.id)return{success:!1,error:`${$A} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(oI,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${jA} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const r=o.export_markdown_from_doc.markdown;return r?{success:!0,content:r}:{success:!1,error:`${FA} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${LA} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],rD=[class extends fg{constructor(){super(...arguments),this.name="delete_item",this.type=Zi.WRITE,this.annotations=hg({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return KS}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(qT,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_items_page",this.type=Zi.READ,this.annotations=hg({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true.[REQUIRED PRECONDITION]: Before using this tool, if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available."}getInputSchema(){return cN}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{dS(e,"filters",cN.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};dS(e,"filters",cN.filters),dS(e,"orderBy",cN.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(dN,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:Cx.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={board_ids:[e.boardId.toString()],searchTerm:e.searchTerm},t=await this.mondayApi.request(lN,a),i=t.search_items?.results?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends fg{constructor(){super(...arguments),this.name="create_item",this.type=Zi.WRITE,this.annotations=hg({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications.[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 column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?MS:qS}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(US,t);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},r=new cI(this.mondayApi,this.apiToken,{boardId:a}),s=await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)});if(s.content.includes("Error"))throw new Error("Failed to update duplicated item: "+s.content);return{content:`Item ${i.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){this.rethrowWrapped(e,"duplicate item")}}async createSubitem(e){const a={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const t=await this.mondayApi.request(BS,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(HT,t);return{content:`Item ${i.create_item?.id} successfully created`}}catch(e){this.rethrowWrapped(e,"create item")}}rethrowWrapped(e,a){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)throw new Error(`Failed to ${a}: ${t.response.errors.map((e=>e.message)).join(", ")}`)}throw new Error(`Failed to ${a}: ${t}`)}},class extends fg{constructor(){super(...arguments),this.name="create_update",this.type=Zi.WRITE,this.annotations=hg({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return GS}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(GT,t);return{content:`Update ${i.create_update?.id} successfully created on item ${e.itemId}`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_schema",this.type=Zi.READ,this.annotations=hg({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return mN}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},i=await this.mondayApi.request(WT,t);return{content:`The current schema of the board ${a} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_activity",this.type=Zi.READ,this.annotations=hg({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days)"}getInputSchema(){return aN}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-eN.MONTH30Days),i=e?.fromDate||t.toISOString(),n=e?.toDate||a.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1},r=await this.mondayApi.request(JS,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=s.filter((e=>null!=e)).map((e=>`• ${e.created_at}: ${e.event} on ${e.entity} by user ${e.user_id}${e.data?` - Data: ${e.data}`:""}`)).join("\n");return{content:`Activity logs for board ${e.boardId} from ${i} to ${n} (${s.length} entries):\n\n${p}`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_info",this.type=Zi.READ,this.annotations=hg({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return pN}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(tN,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:JSON.stringify(nN(i,n),null,2)}}async getSubItemsBoardAsync(e){const a=e.columns?.find((e=>e?.type===J_.Subtasks));if(!a)return null;const t=a.settings.boardIds[0],i=await this.mondayApi.request(iN,{boardId:t});return i.boards?.[0]??null}},class extends fg{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=Zi.READ,this.annotations=hg({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"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 jN}async executeInternal(e){const a=e.userIds&&e.userIds.length>0,t=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(a||t||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(RN);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]};return{content:PN(s)}}if(r){if(a||t||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(kN,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const p=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n");return{content:`Found ${s.users.length} user(s) matching "${e.name}":\n\n${p}`}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(a&&e.userIds&&e.userIds.length>CN)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>$N)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!a&&t&&!i)if(o){const a={teamIds:e.teamIds};s=await this.mondayApi.request(ON,a)}else{const a={teamIds:e.teamIds};s=await this.mondayApi.request(DN,a)}else if(i){const a={userIds:e.userIds,teamIds:e.teamIds,limit:FN};s=await this.mondayApi.request(AN,a)}else if(a){const a={userIds:e.userIds,limit:FN};s=await this.mondayApi.request(SN,a)}else{const e={userIds:void 0,limit:FN};s=await this.mondayApi.request(NN,e)}return{content:PN(s)}}},cI,class extends fg{constructor(){super(...arguments),this.name="move_item_to_group",this.type=Zi.WRITE,this.annotations=hg({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return LN}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(KT,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends fg{constructor(){super(...arguments),this.name="create_board",this.type=Zi.WRITE,this.annotations=hg({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return mI}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(YT,a);return{content:`Board ${t.create_board?.id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="create_form",this.type=Zi.WRITE,this.annotations=hg({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. This will create a new form as well as a new board for which the form’s responses will be stored. The returned board_id is the ID of the board that was created while the returned formToken can be used for all future queries and mutations to continue editing the form."}getInputSchema(){return MI}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(_I,a);return{content:`Form created successfully. Board ID: ${t.create_form?.boardId}, Token: ${t.create_form?.token}`}}},class extends fg{constructor(){super(...arguments),this.name="update_form",this.type=Zi.WRITE,this.annotations=hg({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new PS(this.mondayApi),this.actionHandlers=new Map([[lS.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[lS.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[lS.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[lS.activate,this.helpers.activateForm.bind(this.helpers)],[lS.createTag,this.helpers.createTag.bind(this.helpers)],[lS.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[lS.updateTag,this.helpers.updateTag.bind(this.helpers)],[lS.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[lS.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[lS.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[lS.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[lS.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 RS}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(dS(e,"tag",RS.tag),dS(e,"form",RS.form),await a(e)):{content:"Received an invalid action for the update form tool."}}},class extends fg{constructor(){super(...arguments),this.name="get_form",this.type=Zi.READ,this.annotations=hg({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token. Form tokens can be extracted from the form’s url. Given a form url, such as https://forms.monday.com/forms/abc123def456ghi789?r=use1, the token is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the token is abc123def456ghi789."}getInputSchema(){return CS}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(xI,a);return t.form?{content:`The form with the token ${e.formToken} is: ${JSON.stringify(t.form,null,2)}`}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends fg{constructor(){super(...arguments),this.name="form_questions_editor",this.type=Zi.WRITE,this.annotations=hg({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new pS(this.mondayApi),this.actionHandlers=new Map([[oS.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[oS.Update,this.helpers.updateQuestion.bind(this.helpers)],[oS.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return sS}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(dS(e,"question",sS.question),await a(e)):{content:`Unknown action: ${e.action}`}}},class extends fg{constructor(){super(...arguments),this.name="create_column",this.type=Zi.WRITE,this.annotations=hg({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?$S:FS}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(JT,a);return{content:`Column ${t.create_column?.id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="create_group",this.type=Zi.WRITE,this.annotations=hg({title:"Create Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new group in a monday.com board. Groups are sections that organize related items. Use when users want to add structure, categorize items, or create workflow phases. Groups can be positioned relative to existing groups and assigned predefined colors. Items will always be created in the top group and so the top group should be the most relevant one for new item creation"}getInputSchema(){return VS}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(LS,a);return{content:`Group "${t.create_group?.title}" (ID: ${t.create_group?.id}) successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="delete_column",this.type=Zi.WRITE,this.annotations=hg({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?WS:QS}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},t=await this.mondayApi.request(XT,a);return{content:`Column ${t.delete_column?.id} successfully deleted`}}},pI,class extends fg{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=Zi.ALL_API,this.annotations=hg({title:"Get GraphQL Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch the monday.com GraphQL schema structure including query and mutation definitions. This tool returns available query fields, mutation fields, and a list of GraphQL types in the schema. You can filter results by operation type (read/write) to focus on either queries or mutations."}getInputSchema(){return fN}async executeInternal(e){try{const a=await this.mondayApi.request(ZT),t=e?.operationType,i=a.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=a.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=a.__schema,r=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let s="## GraphQL Schema\n";return t&&"read"!==t||(s+=`- Query Type: ${a.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${i}\n\n`),t&&"write"!==t||(s+=`- Mutation Type: ${a.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${n}\n\n`),s+=`## Available Types\n${r}\n\n`,s+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:s}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends fg{constructor(){super(...arguments),this.name="get_column_type_info",this.type=Zi.READ,this.annotations=hg({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieves comprehensive information about a specific column type, including JSON schema definition and other metadata. Use this before creating columns with the create_column tool to understand the structure, validation rules, and available properties for column settings."}getInputSchema(){return hN}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(uN,a);if(!t?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:t.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(i,null,2)}`}}},class extends fg{constructor(){super(...arguments),this.name="get_type_details",this.type=Zi.ALL_API,this.annotations=hg({title:"Get Type Details",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get detailed information about a specific GraphQL type from the monday.com API schema"}getInputSchema(){return vN}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,MT`
|
|
1394
|
+
`,oD={};const rD=[class extends fg{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=Zi.READ,this.annotations=hg({title:"monday-dev: Get Sprints Boards",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Discover monday-dev sprints boards and their associated tasks boards in your account.\n\n## Purpose:\nIdentifies and returns monday-dev sprints board IDs and tasks board IDs that you need to use with other monday-dev tools. \nThis tool scans your recently used boards (up to 100) to find valid monday-dev sprint management boards.\n\n## What it Returns:\n- Pairs of sprints boards and their corresponding tasks boards\n- Board IDs, names, and workspace information for each pair\n- The bidirectional relationship between each sprints board and its tasks board\n\n## Note:\nSearches recently used boards (up to 100). If none found, ask user to provide board IDs manually."}getInputSchema(){return oD}async executeInternal(e){try{const e={limit:100},a=((await this.mondayApi.request(nD,e)).boards||[]).filter((e=>null!==e));if(0===a.length)return{content:`${PA} No boards found in your account. Please verify you have access to monday.com boards.`};const t=this.extractBoardPairs(a);if(0===t.length)return{content:this.generateNotFoundMessage(a.length)};return{content:this.generateReport(t)}}catch(e){return{content:`${zA} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}generateMultiplePairsWarning(e){return`## ⚠️ Multiple SprintsBoard Detected\n**${e}** different board pairs found. Each pair is isolated and workspace-specific.\n**AI Agent - REQUIRED:** Before ANY operation, confirm with user which pair and workspace to use.\n---\n`}generatePairDetails(e,a){return`### Pair ${a+1}\n**Sprints Board:**\n- ID: \`${e.sprintsBoard.id}\`\n- Name: ${e.sprintsBoard.name}\n- Workspace: ${e.sprintsBoard.workspaceName} (ID: ${e.sprintsBoard.workspaceId})\n\n**Tasks Board:**\n- ID: \`${e.tasksBoard.id}\`\n- Name: ${e.tasksBoard.name}\n- Workspace: ${e.tasksBoard.workspaceName} (ID: ${e.tasksBoard.workspaceId})\n---\n\n`}generateTechnicalReference(){return"## 📋 Technical Reference\n\n**Sprint Operations** (all require correct board pair):\n• Add to Sprint: Update `task_sprint` column with sprint item ID\n• Remove from Sprint: Clear `task_sprint` column (set to null)\n• Search in Sprint: Filter where `task_sprint` equals sprint item ID\n• Move Between Sprints: Update `task_sprint` with new sprint item ID\n• Backlog Tasks: `task_sprint` is empty/null\n\n**Critical:** `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}generateReport(e){const a=e.length>1?this.generateMultiplePairsWarning(e.length):"",t=e.map(((e,a)=>this.generatePairDetails(e,a))).join(""),i=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${a}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${t}${i}`}generateNotFoundMessage(e){return`## No Monday-Dev Sprints Board Pairs Found\n\n**Boards Checked:** ${e} (recently used)\n\nNo board pairs with sprint relationships found in your recent boards.\n\n### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`}createBoardInfo(e,a,t){return{id:e,name:a?.name||t,workspaceId:a?.workspace?.id||"unknown",workspaceName:a?.workspace?.name||"Unknown"}}processSprintsBoard(e,a,t){const i=eD(e,kA.SPRINT_TASKS);if(!i)return;const n=ZA(i);if(!n)return;const o=`${e.id}:${n}`;if(t.has(o))return;const r=a.get(n);t.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,a,t){const i=eD(e,UA);if(!i)return;const n=ZA(i);if(!n)return;const o=`${n}:${e.id}`;if(t.has(o))return;const r=a.get(n);t.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const a=new Map,t=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(JA(i)&&this.processSprintsBoard(i,t,a),XA(i)&&this.processTasksBoard(i,t,a));return Array.from(a.values())}},class extends fg{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=Zi.READ,this.annotations=hg({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 iD}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(tD,t),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${zA} 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(WT,a),i=t.boards?.[0];if(!i)return{success:!1,error:`${PA} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${VA} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${zA} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const a=new Set(e.filter((e=>null!==e)).map((e=>e.id))),t=Object.values(kA),i=KA(a,t);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((a=>{const t=(e=>BA[e]||e)(a);e+=`- ${t}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}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=GA(e,RA.SPRINT_ACTIVATION),o=GA(e,RA.SPRINT_COMPLETION),r=WA(e,RA.SPRINT_START_DATE),s=WA(e,RA.SPRINT_END_DATE),p=((e,a)=>{const t=HA(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,RA.SPRINT_TIMELINE),d=QA(e,RA.SPRINT_SUMMARY);let l=MA.Planned;o?l=MA.Completed:(n||r)&&(l=MA.Active);const c=p?`${p.from} to ${p.to}`:"Not set";a+=`| ${t} | ${i} | ${l} | ${c} | ${r||"Not started"} | ${s||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),a+="\n## Status Definitions:\n",a+=`- **${MA.Planned}**: Sprint not yet started (no activation, no start date)\n`,a+=`- **${MA.Active}**: Sprint is active (activated but not completed)\n`,a+=`- **${MA.Completed}**: Sprint is finished\n\n`,a}},class extends fg{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=Zi.READ,this.annotations=hg({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 aD}async executeInternal(e){try{const a=await this.getSprintMetadata(e.sprintId);if(!a.success)return{content:a.error||`${zA} Unknown error occurred while getting sprint metadata`};const t=await this.readSprintSummaryDocument(a.documentObjectId);return t.success?{content:t.content}:{content:t.error||`${zA} Unknown error occurred while reading document content`}}catch(e){return{content:`${zA} 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(OA,a)).items||[];if(0===t.length)return{success:!1,error:`${CA} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=t[0];if(!i)return{success:!1,error:`${CA} Sprint with ID ${e} not found.`};const n=((e,a=[])=>{const t=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(kA),...a];return KA(t,i)})(i,[RA.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${VA} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=QA(i,RA.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${$A} 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:`${zA} 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(nI,a)).docs||[];if(0===t.length)return{success:!1,error:`${$A} Document with object ID ${e} not found or not accessible.`};const i=t[0];if(!i||!i.id)return{success:!1,error:`${FA} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(oI,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${LA} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const r=o.export_markdown_from_doc.markdown;return r?{success:!0,content:r}:{success:!1,error:`${jA} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${zA} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],sD=[class extends fg{constructor(){super(...arguments),this.name="delete_item",this.type=Zi.WRITE,this.annotations=hg({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return YS}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(qT,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_items_page",this.type=Zi.READ,this.annotations=hg({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available."}getInputSchema(){return mN}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{dS(e,"filters",mN.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};dS(e,"filters",mN.filters),dS(e,"orderBy",mN.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(lN,t),n=this.mapResult(i,e);return{content:JSON.stringify(n,null,2)}}rebuildFiltersWithManualSearch(e,a){return(a=(a=a??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:Cx.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={board_ids:[e.boardId.toString()],searchTerm:e.searchTerm},t=await this.mondayApi.request(cN,a),i=t.search_items?.results?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends fg{constructor(){super(...arguments),this.name="create_item",this.type=Zi.WRITE,this.annotations=hg({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?qS:HS}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(BS,t);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},r=new cI(this.mondayApi,this.apiToken,{boardId:a}),s=await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)});if(s.content.includes("Error"))throw new Error("Failed to update duplicated item: "+s.content);return{content:`Item ${i.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){this.rethrowWrapped(e,"duplicate item")}}async createSubitem(e){const a={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const t=await this.mondayApi.request(MS,a);if(!t.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:`Subitem ${t.create_subitem.id} successfully created under parent item ${e.parentItemId}`}}catch(e){this.rethrowWrapped(e,"create subitem")}}async createNewItem(e,a){try{const t={boardId:a.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(HT,t);return{content:`Item ${i.create_item?.id} successfully created`}}catch(e){this.rethrowWrapped(e,"create item")}}rethrowWrapped(e,a){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)throw new Error(`Failed to ${a}: ${t.response.errors.map((e=>e.message)).join(", ")}`)}throw new Error(`Failed to ${a}: ${t}`)}},class extends fg{constructor(){super(...arguments),this.name="create_update",this.type=Zi.WRITE,this.annotations=hg({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return WS}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(GT,t);return{content:`Update ${i.create_update?.id} successfully created on item ${e.itemId}`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_schema",this.type=Zi.READ,this.annotations=hg({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return uN}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},i=await this.mondayApi.request(WT,t);return{content:`The current schema of the board ${a} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_activity",this.type=Zi.READ,this.annotations=hg({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days)"}getInputSchema(){return tN}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-aN.MONTH30Days),i=e?.fromDate||t.toISOString(),n=e?.toDate||a.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1},r=await this.mondayApi.request(XS,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=s.filter((e=>null!=e)).map((e=>`• ${e.created_at}: ${e.event} on ${e.entity} by user ${e.user_id}${e.data?` - Data: ${e.data}`:""}`)).join("\n");return{content:`Activity logs for board ${e.boardId} from ${i} to ${n} (${s.length} entries):\n\n${p}`}}},class extends fg{constructor(){super(...arguments),this.name="get_board_info",this.type=Zi.READ,this.annotations=hg({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return dN}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(iN,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:JSON.stringify(oN(i,n),null,2)}}async getSubItemsBoardAsync(e){const a=e.columns?.find((e=>e?.type===$S.Subtasks));if(!a)return null;const t=a.settings.boardIds[0],i=await this.mondayApi.request(nN,{boardId:t});return i.boards?.[0]??null}},class extends fg{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=Zi.READ,this.annotations=hg({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"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 LN}async executeInternal(e){const a=e.userIds&&e.userIds.length>0,t=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(a||t||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(PN);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]};return{content:CN(s)}}if(r){if(a||t||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(RN,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const p=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n");return{content:`Found ${s.users.length} user(s) matching "${e.name}":\n\n${p}`}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(a&&e.userIds&&e.userIds.length>$N)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>FN)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!a&&t&&!i)if(o){const a={teamIds:e.teamIds};s=await this.mondayApi.request(kN,a)}else{const a={teamIds:e.teamIds};s=await this.mondayApi.request(ON,a)}else if(i){const a={userIds:e.userIds,teamIds:e.teamIds,limit:jN};s=await this.mondayApi.request(DN,a)}else if(a){const a={userIds:e.userIds,limit:jN};s=await this.mondayApi.request(NN,a)}else{const e={userIds:void 0,limit:jN};s=await this.mondayApi.request(AN,e)}return{content:CN(s)}}},cI,class extends fg{constructor(){super(...arguments),this.name="move_item_to_group",this.type=Zi.WRITE,this.annotations=hg({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return zN}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(KT,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends fg{constructor(){super(...arguments),this.name="create_board",this.type=Zi.WRITE,this.annotations=hg({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return mI}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(YT,a);return{content:`Board ${t.create_board?.id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="create_form",this.type=Zi.WRITE,this.annotations=hg({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. This will create a new form as well as a new board for which the form’s responses will be stored. The returned board_id is the ID of the board that was created while the returned formToken can be used for all future queries and mutations to continue editing the form."}getInputSchema(){return MI}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(_I,a);return{content:`Form created successfully. Board ID: ${t.create_form?.boardId}, Token: ${t.create_form?.token}`}}},class extends fg{constructor(){super(...arguments),this.name="update_form",this.type=Zi.WRITE,this.annotations=hg({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new PS(this.mondayApi),this.actionHandlers=new Map([[lS.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[lS.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[lS.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[lS.activate,this.helpers.activateForm.bind(this.helpers)],[lS.createTag,this.helpers.createTag.bind(this.helpers)],[lS.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[lS.updateTag,this.helpers.updateTag.bind(this.helpers)],[lS.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[lS.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[lS.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[lS.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[lS.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 RS}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(dS(e,"tag",RS.tag),dS(e,"form",RS.form),await a(e)):{content:"Received an invalid action for the update form tool."}}},class extends fg{constructor(){super(...arguments),this.name="get_form",this.type=Zi.READ,this.annotations=hg({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token. Form tokens can be extracted from the form’s url. Given a form url, such as https://forms.monday.com/forms/abc123def456ghi789?r=use1, the token is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the token is abc123def456ghi789."}getInputSchema(){return CS}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(xI,a);return t.form?{content:`The form with the token ${e.formToken} is: ${JSON.stringify(t.form,null,2)}`}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends fg{constructor(){super(...arguments),this.name="form_questions_editor",this.type=Zi.WRITE,this.annotations=hg({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new pS(this.mondayApi),this.actionHandlers=new Map([[oS.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[oS.Update,this.helpers.updateQuestion.bind(this.helpers)],[oS.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return sS}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?(dS(e,"question",sS.question),await a(e)):{content:`Unknown action: ${e.action}`}}},class extends fg{constructor(){super(...arguments),this.name="create_column",this.type=Zi.WRITE,this.annotations=hg({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?FS:jS}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(JT,a);return{content:`Column ${t.create_column?.id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="create_group",this.type=Zi.WRITE,this.annotations=hg({title:"Create Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new group in a monday.com board. Groups are sections that organize related items. Use when users want to add structure, categorize items, or create workflow phases. Groups can be positioned relative to existing groups and assigned predefined colors. Items will always be created in the top group and so the top group should be the most relevant one for new item creation"}getInputSchema(){return US}async executeInternal(e){const a={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},t=await this.mondayApi.request(zS,a);return{content:`Group "${t.create_group?.title}" (ID: ${t.create_group?.id}) successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="delete_column",this.type=Zi.WRITE,this.annotations=hg({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?QS:KS}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},t=await this.mondayApi.request(XT,a);return{content:`Column ${t.delete_column?.id} successfully deleted`}}},pI,class extends fg{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=Zi.ALL_API,this.annotations=hg({title:"Get GraphQL Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch the monday.com GraphQL schema structure including query and mutation definitions. This tool returns available query fields, mutation fields, and a list of GraphQL types in the schema. You can filter results by operation type (read/write) to focus on either queries or mutations."}getInputSchema(){return vN}async executeInternal(e){try{const a=await this.mondayApi.request(ZT),t=e?.operationType,i=a.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=a.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=a.__schema,r=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let s="## GraphQL Schema\n";return t&&"read"!==t||(s+=`- Query Type: ${a.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${i}\n\n`),t&&"write"!==t||(s+=`- Mutation Type: ${a.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${n}\n\n`),s+=`## Available Types\n${r}\n\n`,s+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:s}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends fg{constructor(){super(...arguments),this.name="get_column_type_info",this.type=Zi.READ,this.annotations=hg({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieves comprehensive information about a specific column type, including JSON schema definition and other metadata. Use this before creating columns with the create_column tool to understand the structure, validation rules, and available properties for column settings."}getInputSchema(){return fN}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(hN,a);if(!t?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:t.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(i,null,2)}`}}},class extends fg{constructor(){super(...arguments),this.name="get_type_details",this.type=Zi.ALL_API,this.annotations=hg({title:"Get Type Details",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get detailed information about a specific GraphQL type from the monday.com API schema"}getInputSchema(){return gN}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const t=(a=e.typeName,MT`
|
|
1395
1395
|
query getTypeDetails {
|
|
1396
1396
|
__type(name: "${a}") {
|
|
1397
1397
|
name
|
|
@@ -1479,5 +1479,5 @@
|
|
|
1479
1479
|
}
|
|
1480
1480
|
}
|
|
1481
1481
|
}
|
|
1482
|
-
`),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=gN(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=gN(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=gN(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 fg{constructor(){super(...arguments),this.name="create_custom_activity",this.type=Zi.WRITE,this.annotations=hg({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return jS}async executeInternal(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(aI,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="create_timeline_item",this.type=Zi.WRITE,this.annotations=hg({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return HS}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(tI,a);return{content:`Timeline item '${e.title}' with ID ${t.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends fg{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=Zi.READ,this.annotations=hg({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return YS}async executeInternal(e){const a=await this.mondayApi.request(iI);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 fg{constructor(){super(...arguments),this.name="read_docs",this.type=Zi.READ,this.annotations=hg({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 zN}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(nI,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(nI,t)}if(!o.docs||0===o.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const r=await this.enrichDocsWithMarkdown(o.docs,n),s=this.shouldSuggestPagination(o.docs.length,n.limit||25,n.page||1);return{content:r.content+s}}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(oI,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,r=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: ${r?"YES - call again with page: "+(i+1):"NO"}\n\nDOCUMENTS:\n${JSON.stringify(t,null,2)}`}}},class extends fg{constructor(){super(...arguments),this.name="workspace_info",this.type=Zi.READ,this.annotations=hg({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 VN}async executeInternal(e){const a={workspace_id:e.workspace_id},t=await this.mondayApi.request(rI,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 r=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:[]}]))),s=[];(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&&r.has(e.board_folder_id)?r.get(e.board_folder_id).boards.push(a):s.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&&r.has(e.doc_folder_id)?r.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(r.values()),root_items:{boards:s,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 fg{constructor(){super(...arguments),this.name="list_workspaces",this.type=Zi.READ,this.annotations=hg({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 qN}async executeInternal(e){const a=e.searchTerm?1e4:e.limit,t=e.searchTerm?1:e.page;let i=null;if(e.searchTerm&&(i=MN(e.searchTerm),0===i.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const n={limit:a,page:t},o=await this.mondayApi.request(UN,n),r=o.workspaces?.filter((e=>e));if(!r||0===r.length)return{content:"No workspaces found."};const s=i&&r.length<=BN,p=this.filterWorkspacesIfNeeded(i,r,e);if(0===p.length)return{content:"No workspaces found matching the search term. Try using the tool without a search term"};const d=p.length===e.limit,l=p.map((e=>{const a=e.description?` - ${e.description}`:"";return`• **${e.name}** (ID: ${e.id})${a}`})).join("\n");return{content:`\n${s?"IMPORTANT: Search term was not applied. Returning all workspaces. Please perform the filtering manually.":""}\n${l}\n${d?`PAGINATION INFO: More results available - call the tool again with page: ${e.page+1}`:""}\n `}}filterWorkspacesIfNeeded(e,a,t){if(!e||a.length<=BN)return a;const i=(t.page-1)*t.limit,n=i+t.limit;return a.filter((a=>MN(a.name).includes(e))).slice(i,n)}},class extends fg{constructor(){super(...arguments),this.name="create_doc",this.type=Zi.WRITE,this.annotations=hg({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 JN}async executeInternal(e){const a=YN.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===KN.enum.workspace){const n={location:{workspace:{workspace_id:t.workspace_id.toString(),name:e.doc_name,kind:t.doc_kind||j_.Public,folder_id:t.folder_id?.toString()}}},o=await this.mondayApi.request(GN,n);a=o?.create_doc?.id??void 0,i=o?.create_doc?.url??void 0}else if(t.type===KN.enum.item){const n={itemId:t.item_id.toString()},o=await this.mondayApi.request(HN,n),r=o.items?.[0];if(!r)return{content:`Error: Item with id ${t.item_id} not found.`};const s=r.board?.id,p=r.board?.columns?.find((e=>e&&e.type===J_.Doc));let d=t.column_id;if(!d)if(p)d=p.id;else{const e={boardId:s.toString(),columnType:J_.Doc,columnTitle:"Doc"},a=await this.mondayApi.request(JT,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(GN,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(QN,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(WN,n),r=o?.add_content_to_doc_from_markdown?.success,s=o?.add_content_to_doc_from_markdown?.error;return r?{content:`✅ Document successfully created (id: ${a}). ${i?`\n\nURL: ${i}`:""}`}:{content:`Document ${a} created, but failed to add markdown content: ${s||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends fg{constructor(){super(...arguments),this.name="update_workspace",this.type=Zi.WRITE,this.annotations=hg({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return nA}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(iA,a);return{content:`Workspace ${t.update_workspace?.id} successfully updated`}}},class extends fg{constructor(){super(...arguments),this.name="update_folder",this.type=Zi.WRITE,this.annotations=hg({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return rA}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(oA,n);return{content:`Folder ${o.update_folder?.id} successfully updated`}}},class extends fg{constructor(){super(...arguments),this.name="create_workspace",this.type=Zi.WRITE,this.annotations=hg({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return pA}async executeInternal(e){const a={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},t=await this.mondayApi.request(sA,a);return{content:`Workspace ${t.create_workspace?.id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="create_folder",this.type=Zi.WRITE,this.annotations=hg({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return lA}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(dA,a);return{content:`Folder ${t.create_folder?.id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="move_object",this.type=Zi.WRITE,this.annotations=hg({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 uA}async executeUpdateFolder(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=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:r,accountProductId:s},d=await this.mondayApi.request(oA,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:r,accountProductId:s}=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:r,account_product_id:s}},d=await this.mondayApi.request(cA,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:r,accountProductId:s}=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:r,account_product_id:s}},d=await this.mondayApi.request(mA,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 qx.Folder:return this.executeUpdateFolder(e);case qx.Board:return this.executeUpdateBoardHierarchy(e);case qx.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${a}`)}}},class extends fg{constructor(){super(...arguments),this.name="create_dashboard",this.type=Zi.WRITE,this.annotations=hg({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 aA}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(XN,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===ax.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 fg{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=Zi.READ,this.annotations=hg({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(ZN,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 fg{constructor(){super(...arguments),this.name="create_widget",this.type=Zi.WRITE,this.annotations=hg({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 tA}async executeInternal(e){if(dS(e,"settings",tA.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(eA,a);if(!t.create_widget)throw new Error("Failed to create widget");const i=t.create_widget,n=i.parent?.kind===_E.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 fg{constructor(){super(...arguments),this.name="board_insights",this.type=Zi.READ,this.annotations=hg({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 yA}async executeInternal(e){if(!e.aggregations&&!e.aggregationsStringified)return{content:'Input must contain either the "aggregations" field or the "aggregationsStringified" field.'};dS(e,"aggregations",yA.aggregations),dS(e,"filters",yA.filters),dS(e,"orderBy",yA.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}`,r=a[o]||0;a[o]=r+1;const s=`${o}_${r}`;return gA.has(e.function)&&(t.some((e=>e.column_id===s))||t.push({column_id:s})),{type:__.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===x_.CountItems?[]:[{type:__.Column,column:bA(n),as:n}]}),as:s}}var i,n;const o={type:__.Column,column:bA(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:__.Column,column:bA(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:w_.Table}}(e),o={query:{from:n,query:i,select:a,group_by:t,limit:e.limit}},r=await this.mondayApi.request(hA,o),s=(r.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 s.length?{content:`Board insights result (${s.length} rows):\n${JSON.stringify(s,null,2)}`}:{content:"No board insights found for the given query."}}},class extends fg{constructor(){super(...arguments),this.name="search",this.type=Zi.READ,this.annotations=hg({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Search within monday.com platform. Can search for boards, documents, forms, folders.\nFor users and teams, use list_users_and_teams tool.\nFor workspaces, use list_workspaces tool.\nFor items and groups, use get_board_items_page tool.\nFor groups, use get_board_info tool.\nIMPORTANT: ids returned by this tool are prefixed with the type of the object (e.g doc-123, board-456, folder-789). When passing the ids to other tools, you need to remove the prefix and just pass the number.\n "}getInputSchema(){return SA}async executeInternal(e){const a={[TA.BOARD]:this.searchBoardsAsync.bind(this),[TA.DOCUMENTS]:this.searchDocsAsync.bind(this),[TA.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!a)throw new Error(`Unsupported search type: ${e.searchType}`);const t=await a(e),i={disclaimer:t.wasFiltered?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",results:t.items};return{content:JSON.stringify(i,null,2)}}async searchFoldersAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(xA,a),i=this.searchAndVirtuallyPaginate(e,t.folders||[],(e=>e.name));return{items:i.items.map((e=>({id:EA.FOLDER+e.id,title:e.name}))),wasFiltered:i.wasFiltered}}async searchDocsAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(_A,a),i=this.searchAndVirtuallyPaginate(e,t.docs||[],(e=>e.name));return{items:i.items.map((e=>({id:EA.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:i.wasFiltered}}async searchBoardsAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(wA,a),i=this.searchAndVirtuallyPaginate(e,t.boards||[],(e=>e.name));return{items:i.items.map((e=>({id:EA.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:i.wasFiltered}}getPagingParamsForSearch(e){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?1e4:e.limit}}searchAndVirtuallyPaginate(e,a,t){if(a.length<=IA)return{items:a,wasFiltered:!1};const i=MN(e.searchTerm??""),n=(e.page-1)*e.limit,o=n+e.limit;return{items:a.filter((e=>MN(t(e)).includes(i))).slice(n,o),wasFiltered:!0}}}];var sD;!function(e){e.API="api",e.APPS="apps"}(sD||(sD={}));const pD=(e,a)=>{let t=[];a?.mode===sD.APPS?t=[...en]:a?.mode!==sD.API&&a?.mode||(t=[...rD,...oD]);const i=t.map((a=>((e,a)=>e.prototype instanceof fg?new e(a.apiClient,a.apiToken):new e)(a,e)));return i.filter((e=>{if(!a)return e.type!==Zi.ALL_API;if(a.mode===sD.API&&"only"===a.enableDynamicApiTools)return e.type===Zi.ALL_API;let t=!1;return a.mode===sD.API&&!1===a.enableDynamicApiTools&&(t=t||e.type===Zi.ALL_API),a.readOnlyMode&&(t=t||e.type!==Zi.READ),a.include?t=t||!a.include?.includes(e.name):a.exclude&&(t=t||a.exclude?.includes(e.name)),!t}))};class dD{constructor(){this.dynamicTools=new Map}registerTool(e,a){const t=e.enabledByDefault??!0,i=t;this.dynamicTools.set(e.name,{instance:e,mcpTool:a,enabled:i,enabledByDefault:t}),t||a.disable()}enableTool(e){const a=this.dynamicTools.get(e);return!!a&&(a.enabled||(a.mcpTool.enable(),a.enabled=!0),!0)}disableTool(e){const a=this.dynamicTools.get(e);return!!a&&(a.enabled&&(a.mcpTool.disable(),a.enabled=!1),!0)}isToolEnabled(e){const a=this.dynamicTools.get(e);return!!a&&a.enabled}isToolEnabledByDefault(e){const a=this.dynamicTools.get(e);return!a||a.enabledByDefault}getToolsStatus(){const e={};return this.dynamicTools.forEach(((a,t)=>{e[t]=a.enabled})),e}getDynamicToolNames(){return Array.from(this.dynamicTools.keys())}getDetailedToolsStatus(){const e={};return this.dynamicTools.forEach(((a,t)=>{e[t]={enabled:a.enabled,enabledByDefault:a.enabledByDefault}})),e}resetToolToDefault(e){const a=this.dynamicTools.get(e);return!!a&&(a.enabledByDefault&&!a.enabled?(a.mcpTool.enable(),a.enabled=!0,!0):!(!a.enabledByDefault&&a.enabled)||(a.mcpTool.disable(),a.enabled=!1,!0))}getAllDynamicTools(){return this.dynamicTools}clear(){this.dynamicTools.clear()}}exports.DynamicToolManager=dD,exports.MondayAgentToolkit=class extends Wi{constructor(e){super({name:"monday.com",version:"1.0.0"},{capabilities:{tools:{listChanged:!0}}}),this.dynamicToolManager=new dD,this.toolInstances=[],this.managementTool=null,this.mondayApiClient=this.createApiClient(e),this.mondayApiToken=e.mondayApiToken,this.registerTools(e)}createApiClient(e){return new t.ApiClient({token:e.mondayApiToken,apiVersion:e.mondayApiVersion??"2026-01",requestConfig:{...e.mondayApiRequestConfig,headers:{...e.mondayApiRequestConfig?.headers||{},"user-agent":"monday-api-mcp"}}})}registerTools(e){try{this.toolInstances=this.initializeTools(e),this.toolInstances.forEach((e=>this.registerSingleTool(e))),!0===e.toolsConfiguration?.enableToolManager&&this.registerManagementTool()}catch(e){throw new Error(`Failed to initialize Monday Agent Toolkit: ${e instanceof Error?e.message:String(e)}`)}}registerManagementTool(){const e=new AA;e.setToolkitManager(this.dynamicToolManager),this.managementTool=e,this.registerSingleTool(this.managementTool)}initializeTools(e){const a={apiClient:this.mondayApiClient,apiToken:this.mondayApiToken};return pD(a,e.toolsConfiguration)}registerSingleTool(a){const t=a.getInputSchema(),i=this.registerTool(a.name,{...a,title:a.annotations?.title,description:a.getDescription(),inputSchema:t},(async(i,n)=>{try{let n;if(t){const o=e.z.object(t).safeParse(i);if(!o.success)throw new Error(`Invalid arguments: ${o.error.message}`);n=await a.execute(o.data)}else n=await a.execute();return this.formatToolResult(n.content)}catch(e){return this.handleToolError(e,a.name)}}));this.dynamicToolManager.registerTool(a,i)}enableTool(e){return this.dynamicToolManager.enableTool(e)}disableTool(e){return this.dynamicToolManager.disableTool(e)}isToolEnabled(e){return this.dynamicToolManager.isToolEnabled(e)}getToolsStatus(){return this.dynamicToolManager.getToolsStatus()}getDynamicToolNames(){return this.dynamicToolManager.getDynamicToolNames()}getServer(){return this}getTools(){const e=[...this.toolInstances];return this.managementTool&&e.push(this.managementTool),e.map((e=>({name:e.name,description:e.getDescription(),schema:e.getInputSchema(),handler:this.createToolHandler(e)})))}getToolsForMcp(){const e=[...this.toolInstances];return this.managementTool&&e.push(this.managementTool),e.map((e=>({name:e.name,description:e.getDescription(),schema:e.getInputSchema(),handler:this.createMcpToolHandler(e)})))}createToolHandler(a){return async t=>{const i=a.getInputSchema();if(i){const n=e.z.object(i).safeParse(t);if(!n.success)throw new Error(`Invalid arguments: ${n.error.message}`);return(await a.execute(n.data)).content}return(await a.execute()).content}}createMcpToolHandler(a){return async(t,i)=>{try{const i=a.getInputSchema();if(i){const n=e.z.object(i).safeParse(t);if(!n.success)throw new Error(`Invalid arguments: ${n.error.message}`);const o=await a.execute(n.data);return{content:[{type:"text",text:String(o.content)}]}}{const e=await a.execute();return{content:[{type:"text",text:String(e.content)}]}}}catch(e){return{content:[{type:"text",text:`Error: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}}}formatToolResult(e){return{content:[{type:"text",text:e}]}}handleToolError(e,a){return{content:[{type:"text",text:`Failed to execute tool ${a}: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}};
|
|
1482
|
+
`),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=bN(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=bN(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=bN(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 fg{constructor(){super(...arguments),this.name="create_custom_activity",this.type=Zi.WRITE,this.annotations=hg({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return LS}async executeInternal(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(aI,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="create_timeline_item",this.type=Zi.WRITE,this.annotations=hg({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return GS}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(tI,a);return{content:`Timeline item '${e.title}' with ID ${t.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends fg{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=Zi.READ,this.annotations=hg({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return JS}async executeInternal(e){const a=await this.mondayApi.request(iI);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 fg{constructor(){super(...arguments),this.name="read_docs",this.type=Zi.READ,this.annotations=hg({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 VN}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(nI,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(nI,t)}if(!o.docs||0===o.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const r=await this.enrichDocsWithMarkdown(o.docs,n),s=this.shouldSuggestPagination(o.docs.length,n.limit||25,n.page||1);return{content:r.content+s}}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(oI,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,r=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: ${r?"YES - call again with page: "+(i+1):"NO"}\n\nDOCUMENTS:\n${JSON.stringify(t,null,2)}`}}},class extends fg{constructor(){super(...arguments),this.name="workspace_info",this.type=Zi.READ,this.annotations=hg({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 UN}async executeInternal(e){const a={workspace_id:e.workspace_id},t=await this.mondayApi.request(rI,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 r=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:[]}]))),s=[];(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&&r.has(e.board_folder_id)?r.get(e.board_folder_id).boards.push(a):s.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&&r.has(e.doc_folder_id)?r.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(r.values()),root_items:{boards:s,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 fg{constructor(){super(...arguments),this.name="list_workspaces",this.type=Zi.READ,this.annotations=hg({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 HN}async executeInternal(e){const a=e.searchTerm?1e4:e.limit,t=e.searchTerm?1:e.page;let i=null;if(e.searchTerm&&(i=qN(e.searchTerm),0===i.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const n={limit:a,page:t},o=await this.mondayApi.request(BN,n),r=o.workspaces?.filter((e=>e));if(!r||0===r.length)return{content:"No workspaces found."};const s=i&&r.length<=MN,p=this.filterWorkspacesIfNeeded(i,r,e);if(0===p.length)return{content:"No workspaces found matching the search term. Try using the tool without a search term"};const d=p.length===e.limit,l=p.map((e=>{const a=e.description?` - ${e.description}`:"";return`• **${e.name}** (ID: ${e.id})${a}`})).join("\n");return{content:`\n${s?"IMPORTANT: Search term was not applied. Returning all workspaces. Please perform the filtering manually.":""}\n${l}\n${d?`PAGINATION INFO: More results available - call the tool again with page: ${e.page+1}`:""}\n `}}filterWorkspacesIfNeeded(e,a,t){if(!e||a.length<=MN)return a;const i=(t.page-1)*t.limit,n=i+t.limit;return a.filter((a=>qN(a.name).includes(e))).slice(i,n)}},class extends fg{constructor(){super(...arguments),this.name="create_doc",this.type=Zi.WRITE,this.annotations=hg({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 XN}async executeInternal(e){const a=JN.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===YN.enum.workspace){const n={location:{workspace:{workspace_id:t.workspace_id.toString(),name:e.doc_name,kind:t.doc_kind||j_.Public,folder_id:t.folder_id?.toString()}}},o=await this.mondayApi.request(WN,n);a=o?.create_doc?.id??void 0,i=o?.create_doc?.url??void 0}else if(t.type===YN.enum.item){const n={itemId:t.item_id.toString()},o=await this.mondayApi.request(GN,n),r=o.items?.[0];if(!r)return{content:`Error: Item with id ${t.item_id} not found.`};const s=r.board?.id,p=r.board?.columns?.find((e=>e&&e.type===$S.Doc));let d=t.column_id;if(!d)if(p)d=p.id;else{const e={boardId:s.toString(),columnType:$S.Doc,columnTitle:"Doc"},a=await this.mondayApi.request(JT,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(WN,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(KN,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(QN,n),r=o?.add_content_to_doc_from_markdown?.success,s=o?.add_content_to_doc_from_markdown?.error;return r?{content:`✅ Document successfully created (id: ${a}). ${i?`\n\nURL: ${i}`:""}`}:{content:`Document ${a} created, but failed to add markdown content: ${s||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends fg{constructor(){super(...arguments),this.name="update_workspace",this.type=Zi.WRITE,this.annotations=hg({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return oA}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(nA,a);return{content:`Workspace ${t.update_workspace?.id} successfully updated`}}},class extends fg{constructor(){super(...arguments),this.name="update_folder",this.type=Zi.WRITE,this.annotations=hg({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return sA}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(rA,n);return{content:`Folder ${o.update_folder?.id} successfully updated`}}},class extends fg{constructor(){super(...arguments),this.name="create_workspace",this.type=Zi.WRITE,this.annotations=hg({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return dA}async executeInternal(e){const a={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},t=await this.mondayApi.request(pA,a);return{content:`Workspace ${t.create_workspace?.id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="create_folder",this.type=Zi.WRITE,this.annotations=hg({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return cA}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(lA,a);return{content:`Folder ${t.create_folder?.id} successfully created`}}},class extends fg{constructor(){super(...arguments),this.name="move_object",this.type=Zi.WRITE,this.annotations=hg({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 hA}async executeUpdateFolder(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=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:r,accountProductId:s},d=await this.mondayApi.request(rA,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:r,accountProductId:s}=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:r,account_product_id:s}},d=await this.mondayApi.request(mA,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:r,accountProductId:s}=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:r,account_product_id:s}},d=await this.mondayApi.request(uA,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 qx.Folder:return this.executeUpdateFolder(e);case qx.Board:return this.executeUpdateBoardHierarchy(e);case qx.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${a}`)}}},class extends fg{constructor(){super(...arguments),this.name="create_dashboard",this.type=Zi.WRITE,this.annotations=hg({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 tA}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(ZN,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===ax.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 fg{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=Zi.READ,this.annotations=hg({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(eA,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 fg{constructor(){super(...arguments),this.name="create_widget",this.type=Zi.WRITE,this.annotations=hg({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 iA}async executeInternal(e){if(dS(e,"settings",iA.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(aA,a);if(!t.create_widget)throw new Error("Failed to create widget");const i=t.create_widget,n=i.parent?.kind===_E.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 fg{constructor(){super(...arguments),this.name="board_insights",this.type=Zi.READ,this.annotations=hg({title:"Get Board Insights",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool allows you to calculate insights about board's data by filtering, grouping and aggregating columns. For example, you can get the total number of items in a board, the number of items in each status, the number of items in each column, etc. Use this tool when you need to get a summary of the board's data, for example, you want to know the total number of items in a board, the number of items in each status, the number of items in each column, etc.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available."}getInputSchema(){return wA}async executeInternal(e){if(!e.aggregations&&!e.aggregationsStringified)return{content:'Input must contain either the "aggregations" field or the "aggregationsStringified" field.'};dS(e,"aggregations",wA.aggregations),dS(e,"filters",wA.filters),dS(e,"orderBy",wA.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}`,r=a[o]||0;a[o]=r+1;const s=`${o}_${r}`;return bA.has(e.function)&&(t.some((e=>e.column_id===s))||t.push({column_id:s})),{type:__.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===x_.CountItems?[]:[{type:__.Column,column:yA(n),as:n}]}),as:s}}var i,n;const o={type:__.Column,column:yA(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:__.Column,column:yA(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:w_.Table}}(e),o={query:{from:n,query:i,select:a,group_by:t,limit:e.limit}},r=await this.mondayApi.request(fA,o),s=(r.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 s.length?{content:`Board insights result (${s.length} rows):\n${JSON.stringify(s,null,2)}`}:{content:"No board insights found for the given query."}}},class extends fg{constructor(){super(...arguments),this.name="search",this.type=Zi.READ,this.annotations=hg({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Search within monday.com platform. Can search for boards, documents, forms, folders.\nFor users and teams, use list_users_and_teams tool.\nFor workspaces, use list_workspaces tool.\nFor items and groups, use get_board_items_page tool.\nFor groups, use get_board_info tool.\nIMPORTANT: ids returned by this tool are prefixed with the type of the object (e.g doc-123, board-456, folder-789). When passing the ids to other tools, you need to remove the prefix and just pass the number.\n "}getInputSchema(){return NA}async executeInternal(e){const a={[IA.BOARD]:this.searchBoardsAsync.bind(this),[IA.DOCUMENTS]:this.searchDocsAsync.bind(this),[IA.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!a)throw new Error(`Unsupported search type: ${e.searchType}`);const t=await a(e),i={disclaimer:t.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",results:t.items};return{content:JSON.stringify(i,null,2)}}async searchFoldersAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(EA,a),i=this.searchAndVirtuallyPaginate(e,t.folders||[],(e=>e.name));return{items:i.items.map((e=>({id:TA.FOLDER+e.id,title:e.name}))),wasFiltered:i.wasFiltered}}async searchDocsAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(xA,a),i=this.searchAndVirtuallyPaginate(e,t.docs||[],(e=>e.name));return{items:i.items.map((e=>({id:TA.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:i.wasFiltered}}async searchBoardsAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(_A,a),i=this.searchAndVirtuallyPaginate(e,t.boards||[],(e=>e.name));return{items:i.items.map((e=>({id:TA.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:i.wasFiltered}}getPagingParamsForSearch(e){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?1e4:e.limit}}searchAndVirtuallyPaginate(e,a,t){if(a.length<=SA)return{items:a,wasFiltered:!1};const i=qN(e.searchTerm??""),n=(e.page-1)*e.limit,o=n+e.limit;return{items:a.filter((e=>qN(t(e)).includes(i))).slice(n,o),wasFiltered:!0}}}];var pD;!function(e){e.API="api",e.APPS="apps"}(pD||(pD={}));const dD=(e,a)=>{let t=[];a?.mode===pD.APPS?t=[...en]:a?.mode!==pD.API&&a?.mode||(t=[...sD,...rD]);const i=t.map((a=>((e,a)=>e.prototype instanceof fg?new e(a.apiClient,a.apiToken):new e)(a,e)));return i.filter((e=>{if(!a)return e.type!==Zi.ALL_API;if(a.mode===pD.API&&"only"===a.enableDynamicApiTools)return e.type===Zi.ALL_API;let t=!1;return a.mode===pD.API&&!1===a.enableDynamicApiTools&&(t=t||e.type===Zi.ALL_API),a.readOnlyMode&&(t=t||e.type!==Zi.READ),a.include?t=t||!a.include?.includes(e.name):a.exclude&&(t=t||a.exclude?.includes(e.name)),!t}))};class lD{constructor(){this.dynamicTools=new Map}registerTool(e,a){const t=e.enabledByDefault??!0,i=t;this.dynamicTools.set(e.name,{instance:e,mcpTool:a,enabled:i,enabledByDefault:t}),t||a.disable()}enableTool(e){const a=this.dynamicTools.get(e);return!!a&&(a.enabled||(a.mcpTool.enable(),a.enabled=!0),!0)}disableTool(e){const a=this.dynamicTools.get(e);return!!a&&(a.enabled&&(a.mcpTool.disable(),a.enabled=!1),!0)}isToolEnabled(e){const a=this.dynamicTools.get(e);return!!a&&a.enabled}isToolEnabledByDefault(e){const a=this.dynamicTools.get(e);return!a||a.enabledByDefault}getToolsStatus(){const e={};return this.dynamicTools.forEach(((a,t)=>{e[t]=a.enabled})),e}getDynamicToolNames(){return Array.from(this.dynamicTools.keys())}getDetailedToolsStatus(){const e={};return this.dynamicTools.forEach(((a,t)=>{e[t]={enabled:a.enabled,enabledByDefault:a.enabledByDefault}})),e}resetToolToDefault(e){const a=this.dynamicTools.get(e);return!!a&&(a.enabledByDefault&&!a.enabled?(a.mcpTool.enable(),a.enabled=!0,!0):!(!a.enabledByDefault&&a.enabled)||(a.mcpTool.disable(),a.enabled=!1,!0))}getAllDynamicTools(){return this.dynamicTools}clear(){this.dynamicTools.clear()}}exports.DynamicToolManager=lD,exports.MondayAgentToolkit=class extends Wi{constructor(e){super({name:"monday.com",version:"1.0.0"},{capabilities:{tools:{listChanged:!0}}}),this.dynamicToolManager=new lD,this.toolInstances=[],this.managementTool=null,this.mondayApiClient=this.createApiClient(e),this.mondayApiToken=e.mondayApiToken,this.registerTools(e)}createApiClient(e){return new t.ApiClient({token:e.mondayApiToken,apiVersion:e.mondayApiVersion??"2026-01",requestConfig:{...e.mondayApiRequestConfig,headers:{...e.mondayApiRequestConfig?.headers||{},"user-agent":"monday-api-mcp"}}})}registerTools(e){try{this.toolInstances=this.initializeTools(e),this.toolInstances.forEach((e=>this.registerSingleTool(e))),!0===e.toolsConfiguration?.enableToolManager&&this.registerManagementTool()}catch(e){throw new Error(`Failed to initialize Monday Agent Toolkit: ${e instanceof Error?e.message:String(e)}`)}}registerManagementTool(){const e=new DA;e.setToolkitManager(this.dynamicToolManager),this.managementTool=e,this.registerSingleTool(this.managementTool)}initializeTools(e){const a={apiClient:this.mondayApiClient,apiToken:this.mondayApiToken};return dD(a,e.toolsConfiguration)}registerSingleTool(a){const t=a.getInputSchema(),i=this.registerTool(a.name,{...a,title:a.annotations?.title,description:a.getDescription(),inputSchema:t},(async(i,n)=>{try{let n;if(t){const o=e.z.object(t).safeParse(i);if(!o.success)throw new Error(`Invalid arguments: ${o.error.message}`);n=await a.execute(o.data)}else n=await a.execute();return this.formatToolResult(n.content)}catch(e){return this.handleToolError(e,a.name)}}));this.dynamicToolManager.registerTool(a,i)}enableTool(e){return this.dynamicToolManager.enableTool(e)}disableTool(e){return this.dynamicToolManager.disableTool(e)}isToolEnabled(e){return this.dynamicToolManager.isToolEnabled(e)}getToolsStatus(){return this.dynamicToolManager.getToolsStatus()}getDynamicToolNames(){return this.dynamicToolManager.getDynamicToolNames()}getServer(){return this}getTools(){const e=[...this.toolInstances];return this.managementTool&&e.push(this.managementTool),e.map((e=>({name:e.name,description:e.getDescription(),schema:e.getInputSchema(),handler:this.createToolHandler(e)})))}getToolsForMcp(){const e=[...this.toolInstances];return this.managementTool&&e.push(this.managementTool),e.map((e=>({name:e.name,description:e.getDescription(),schema:e.getInputSchema(),handler:this.createMcpToolHandler(e)})))}createToolHandler(a){return async t=>{const i=a.getInputSchema();if(i){const n=e.z.object(i).safeParse(t);if(!n.success)throw new Error(`Invalid arguments: ${n.error.message}`);return(await a.execute(n.data)).content}return(await a.execute()).content}}createMcpToolHandler(a){return async(t,i)=>{try{const i=a.getInputSchema();if(i){const n=e.z.object(i).safeParse(t);if(!n.success)throw new Error(`Invalid arguments: ${n.error.message}`);const o=await a.execute(n.data);return{content:[{type:"text",text:String(o.content)}]}}{const e=await a.execute();return{content:[{type:"text",text:String(e.content)}]}}}catch(e){return{content:[{type:"text",text:`Error: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}}}formatToolResult(e){return{content:[{type:"text",text:e}]}}handleToolError(e,a){return{content:[{type:"text",text:`Failed to execute tool ${a}: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}};
|
|
1483
1483
|
//# sourceMappingURL=index.js.map
|