@mondaydotcomorg/agent-toolkit 2.30.0 → 2.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core/index.d.ts +2 -0
- package/dist/cjs/core/index.js +1 -1
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/mcp/index.d.ts +2 -0
- package/dist/cjs/mcp/index.js +95 -95
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.d.ts +2 -0
- package/dist/cjs/openai/index.js +95 -95
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/core/index.d.ts +2 -0
- package/dist/esm/core/index.js +1 -1
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/mcp/index.d.ts +2 -0
- package/dist/esm/mcp/index.js +95 -95
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.d.ts +2 -0
- package/dist/esm/openai/index.js +95 -95
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +2 -2
package/dist/esm/mcp/index.js
CHANGED
|
@@ -363,7 +363,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
363
363
|
name
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
`,MI={query:e.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:e.string().describe("JSON string containing the variables for the GraphQL operation")};class
|
|
366
|
+
`,MI="2026-01",qI={query:e.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:e.string().describe("JSON string containing the variables for the GraphQL operation")};class HI extends Jg{constructor(e,t,a){super(e,t,a),this.name="all_monday_api",this.type=qn.ALL_API,this.annotations=Qg({title:"Run Query or Mutation on any monday.com API",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Execute any monday.com API operation by generating GraphQL queries and mutations dynamically. Make sure you ask only for the fields you need and nothing more. When providing the query/mutation - use get_graphql_schema and get_type_details tools first to understand the schema before crafting your query."}getInputSchema(){return qI}async loadSchema(e){if(HI.schemaCache[e])return HI.schemaCache[e];try{const t=await this.mondayApi.rawRequest($I),{data:a}=t,n=ex(a);return HI.schemaCache[e]=n,n}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}async validateOperation(e,t){var a;return Z_(await this.loadSchema(t),new Wy(e,a).parseDocument()).map((e=>e.message))}async executeInternal(e){const{query:t,variables:a}=e;try{let e={};try{e=JSON.parse(a)}catch(e){return{content:`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`}}const n=await this.validateOperation(t,this.context?.apiVersion??MI);if(n.length>0)return{content:n.join(", ")};const i=await this.mondayApi.request(t,e);return{content:JSON.stringify(i)}}catch(e){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)return{content:t.response.errors.map((e=>e.message)).join(", ")}}return{content:t}}}}HI.schemaCache={};const zI={itemId:e.number().describe("The ID of the item to be updated"),columnValues:e.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\\"}, \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"')},GI={boardId:e.number().describe("The ID of the board that contains the item to be updated"),...zI};class WI extends Jg{constructor(){super(...arguments),this.name="change_item_column_values",this.type=qn.WRITE,this.annotations=Qg({title:"Change Item Column Values",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Change the column values of an item in a monday.com board"}getInputSchema(){return this.context?.boardId?zI:GI}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),itemId:e.itemId.toString(),columnValues:e.columnValues},a=await this.mondayApi.request(DI,t);return{content:`Item ${a.change_multiple_column_values?.id} successfully updated with the new column values`}}}const YI={boardName:e.string().describe("The name of the board to create"),boardKind:e.nativeEnum(bx).default(bx.Public).describe("The kind of board to create"),boardDescription:e.string().optional().describe("The description of the board to create"),workspaceId:e.string().optional().describe("The ID of the workspace to create the board in")};const KI=II`
|
|
367
367
|
fragment QuestionBasic on FormQuestion {
|
|
368
368
|
id
|
|
369
369
|
type
|
|
@@ -372,13 +372,13 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
372
372
|
visible
|
|
373
373
|
required
|
|
374
374
|
}
|
|
375
|
-
`,
|
|
375
|
+
`,QI=II`
|
|
376
376
|
fragment QuestionOptions on FormQuestion {
|
|
377
377
|
options {
|
|
378
378
|
label
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
`,
|
|
381
|
+
`,JI=II`
|
|
382
382
|
fragment QuestionSettings on FormQuestion {
|
|
383
383
|
settings {
|
|
384
384
|
prefill {
|
|
@@ -401,17 +401,17 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
401
401
|
skipValidation
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
`,
|
|
404
|
+
`,XI=II`
|
|
405
405
|
fragment QuestionComplete on FormQuestion {
|
|
406
406
|
...QuestionBasic
|
|
407
407
|
...QuestionOptions
|
|
408
408
|
...QuestionSettings
|
|
409
409
|
showIfRules
|
|
410
410
|
}
|
|
411
|
-
${YI}
|
|
412
411
|
${KI}
|
|
413
412
|
${QI}
|
|
414
|
-
|
|
413
|
+
${JI}
|
|
414
|
+
`,ZI=II`
|
|
415
415
|
fragment FormFeatures on FormFeatures {
|
|
416
416
|
isInternal
|
|
417
417
|
reCaptchaChallenge
|
|
@@ -464,7 +464,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
464
464
|
syncQuestionAndColumnsTitles
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
`,
|
|
467
|
+
`,eS=II`
|
|
468
468
|
fragment FormAppearance on FormAppearance {
|
|
469
469
|
hideBranding
|
|
470
470
|
showProgressBar
|
|
@@ -492,19 +492,19 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
492
492
|
text
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
`,
|
|
495
|
+
`,tS=II`
|
|
496
496
|
fragment FormAccessibility on FormAccessibility {
|
|
497
497
|
language
|
|
498
498
|
logoAltText
|
|
499
499
|
}
|
|
500
|
-
`,
|
|
500
|
+
`,aS=II`
|
|
501
501
|
fragment FormTag on FormTag {
|
|
502
502
|
id
|
|
503
503
|
name
|
|
504
504
|
value
|
|
505
505
|
columnId
|
|
506
506
|
}
|
|
507
|
-
`,
|
|
507
|
+
`,nS=II`
|
|
508
508
|
mutation createForm(
|
|
509
509
|
$destination_workspace_id: ID!
|
|
510
510
|
$destination_folder_id: ID
|
|
@@ -531,7 +531,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
531
531
|
token
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
`,
|
|
534
|
+
`,iS=II`
|
|
535
535
|
query getForm($formToken: String!) {
|
|
536
536
|
form(formToken: $formToken) {
|
|
537
537
|
id
|
|
@@ -560,16 +560,16 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
${JI}
|
|
564
563
|
${XI}
|
|
565
564
|
${ZI}
|
|
566
565
|
${eS}
|
|
567
566
|
${tS}
|
|
568
|
-
|
|
567
|
+
${aS}
|
|
568
|
+
`,oS=II`
|
|
569
569
|
mutation deleteFormQuestion($formToken: String!, $questionId: String!) {
|
|
570
570
|
delete_question(formToken: $formToken, questionId: $questionId)
|
|
571
571
|
}
|
|
572
|
-
`,
|
|
572
|
+
`,rS=II`
|
|
573
573
|
mutation createFormQuestion($formToken: String!, $question: CreateQuestionInput!) {
|
|
574
574
|
create_form_question(formToken: $formToken, question: $question) {
|
|
575
575
|
...QuestionBasic
|
|
@@ -577,10 +577,10 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
577
577
|
...QuestionSettings
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
${YI}
|
|
581
580
|
${KI}
|
|
582
581
|
${QI}
|
|
583
|
-
|
|
582
|
+
${JI}
|
|
583
|
+
`,sS=II`
|
|
584
584
|
mutation updateFormQuestion($formToken: String!, $questionId: String!, $question: UpdateQuestionInput!) {
|
|
585
585
|
update_form_question(formToken: $formToken, questionId: $questionId, question: $question) {
|
|
586
586
|
...QuestionBasic
|
|
@@ -588,9 +588,9 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
588
588
|
...QuestionSettings
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
${YI}
|
|
592
591
|
${KI}
|
|
593
592
|
${QI}
|
|
593
|
+
${JI}
|
|
594
594
|
`;II`
|
|
595
595
|
mutation updateForm($formToken: String!, $input: UpdateFormInput!) {
|
|
596
596
|
update_form(formToken: $formToken, input: $input) {
|
|
@@ -615,46 +615,46 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
${XI}
|
|
619
618
|
${ZI}
|
|
620
619
|
${eS}
|
|
621
|
-
|
|
620
|
+
${tS}
|
|
621
|
+
`;const pS=II`
|
|
622
622
|
mutation setFormPassword($formToken: String!, $input: SetFormPasswordInput!) {
|
|
623
623
|
set_form_password(formToken: $formToken, input: $input) {
|
|
624
624
|
id
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
`,
|
|
627
|
+
`,dS=II`
|
|
628
628
|
mutation shortenFormUrl($formToken: String!) {
|
|
629
629
|
shorten_form_url(formToken: $formToken) {
|
|
630
630
|
enabled
|
|
631
631
|
url
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
`,
|
|
634
|
+
`,lS=II`
|
|
635
635
|
mutation deactivateForm($formToken: String!) {
|
|
636
636
|
deactivate_form(formToken: $formToken)
|
|
637
637
|
}
|
|
638
|
-
`,
|
|
638
|
+
`,cS=II`
|
|
639
639
|
mutation activateForm($formToken: String!) {
|
|
640
640
|
activate_form(formToken: $formToken)
|
|
641
641
|
}
|
|
642
|
-
`,
|
|
642
|
+
`,mS=II`
|
|
643
643
|
mutation deleteFormTag($formToken: String!, $tagId: String!) {
|
|
644
644
|
delete_form_tag(formToken: $formToken, tagId: $tagId)
|
|
645
645
|
}
|
|
646
|
-
`,
|
|
646
|
+
`,uS=II`
|
|
647
647
|
mutation createFormTag($formToken: String!, $tag: CreateFormTagInput!) {
|
|
648
648
|
create_form_tag(formToken: $formToken, tag: $tag) {
|
|
649
649
|
...FormTag
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
${
|
|
653
|
-
`,
|
|
652
|
+
${aS}
|
|
653
|
+
`,hS=II`
|
|
654
654
|
mutation updateFormTag($formToken: String!, $tagId: String!, $tag: UpdateFormTagInput!) {
|
|
655
655
|
update_form_tag(formToken: $formToken, tagId: $tagId, tag: $tag)
|
|
656
656
|
}
|
|
657
|
-
`,
|
|
657
|
+
`,fS=II`
|
|
658
658
|
mutation updateFormAppearance($formToken: String!, $appearance: FormAppearanceInput!) {
|
|
659
659
|
update_form_settings(formToken: $formToken, settings: { appearance: $appearance }) {
|
|
660
660
|
appearance {
|
|
@@ -662,8 +662,8 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
${
|
|
666
|
-
`,
|
|
665
|
+
${eS}
|
|
666
|
+
`,vS=II`
|
|
667
667
|
mutation updateFormAccessibility($formToken: String!, $accessibility: FormAccessibilityInput!) {
|
|
668
668
|
update_form_settings(formToken: $formToken, settings: { accessibility: $accessibility }) {
|
|
669
669
|
accessibility {
|
|
@@ -671,8 +671,8 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
|
-
${
|
|
675
|
-
`,
|
|
674
|
+
${tS}
|
|
675
|
+
`,gS=II`
|
|
676
676
|
mutation updateFormFeatures($formToken: String!, $features: FormFeaturesInput!) {
|
|
677
677
|
update_form_settings(formToken: $formToken, settings: { features: $features }) {
|
|
678
678
|
features {
|
|
@@ -680,8 +680,8 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
|
-
${
|
|
684
|
-
`,
|
|
683
|
+
${ZI}
|
|
684
|
+
`,yS=II`
|
|
685
685
|
mutation updateFormQuestionOrder($formToken: String!, $questions: [QuestionOrderInput!]!) {
|
|
686
686
|
update_form(formToken: $formToken, input: { questions: $questions }) {
|
|
687
687
|
questions {
|
|
@@ -689,14 +689,14 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
|
-
`,
|
|
692
|
+
`,bS=II`
|
|
693
693
|
mutation updateFormHeader($formToken: String!, $title: String, $description: String) {
|
|
694
694
|
update_form(formToken: $formToken, input: { title: $title, description: $description }) {
|
|
695
695
|
title
|
|
696
696
|
description
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
|
-
`,bS={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."},wS={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."}},_S={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."}},xS={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."}},ES={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"}},TS={destination_workspace_id:e.string().describe(wS.args.destinationWorkspaceId),destination_folder_id:e.string().optional().describe(wS.args.destinationFolderId),destination_folder_name:e.string().optional().describe(wS.args.destinationFolderName),board_kind:e.nativeEnum(bx).optional().describe(wS.args.boardKind),destination_name:e.string().optional().describe(wS.args.destinationName),board_owner_ids:e.array(e.string()).optional().describe(wS.args.boardOwnerIds),board_owner_team_ids:e.array(e.string()).optional().describe(wS.args.boardOwnerTeamIds),board_subscriber_ids:e.array(e.string()).optional().describe(wS.args.boardSubscriberIds),board_subscriber_teams_ids:e.array(e.string()).optional().describe(wS.args.boardSubscriberTeamsIds)};var IS,SS,NS,AS,DS,OS,kS,RS,CS,PS,$S,FS,LS,jS,VS,US;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(IS||(IS={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(SS||(SS={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(NS||(NS={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(AS||(AS={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(DS||(DS={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(OS||(OS={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(kS||(kS={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(RS||(RS={})),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"}(CS||(CS={})),function(e){e.Account="account",e.QueryParam="queryParam"}(PS||(PS={})),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"}($S||($S={})),function(e){e.And="AND",e.Or="OR"}(FS||(FS={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(LS||(LS={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(jS||(jS={})),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"}(VS||(VS={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(US||(US={}));const BS=e.object({type:e.nativeEnum(lE).describe(xS.properties.type),title:e.string().describe(xS.properties.title).optional(),description:e.string().describe(xS.properties.description).optional(),visible:e.boolean().describe(xS.properties.visible).optional(),required:e.boolean().describe(xS.properties.required).optional(),options:e.array(e.object({label:e.string().describe(xS.properties.selectOptionsLabel)})).describe(xS.properties.selectOptions).optional(),settings:e.object({checkedByDefault:e.boolean().describe(ES.properties.checkedByDefault).optional(),defaultCurrentDate:e.boolean().describe(ES.properties.defaultCurrentDate).optional(),display:e.nativeEnum(pE).describe(ES.properties.display).optional(),includeTime:e.boolean().describe(ES.properties.includeTime).optional(),locationAutofilled:e.boolean().describe(ES.properties.locationAutofilled).optional(),optionsOrder:e.nativeEnum(dE).describe(ES.properties.optionsOrder).optional(),prefixAutofilled:e.boolean().describe(ES.properties.prefixAutofilled).optional(),prefixPredefined:e.object({enabled:e.boolean().describe(ES.properties.prefixPredefinedEnabled),prefix:e.string().describe(ES.properties.prefixPredefinedPrefix).optional()}).describe(ES.properties.prefixPredefined).optional(),skipValidation:e.boolean().describe(ES.properties.skipValidation).optional(),prefill:e.object({enabled:e.boolean().describe(ES.properties.prefillEnabled),lookup:e.string().describe(ES.properties.prefillLookup).optional(),source:e.nativeEnum(sE).describe(ES.properties.prefillSource).optional()}).describe(ES.properties.prefill).optional()}).optional()}),MS={action:e.nativeEnum(US).describe(xS.actions.type),formToken:e.string().describe(bS.formToken),questionId:e.string().describe(bS.questionId).optional(),question:BS.describe(xS.actions.question).optional(),questionStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The question object. Send this as a stringified JSON of "question" field. Read "question" field description for details how to use it.')};class qS{constructor(e){this.mondayApi=e}async deleteQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when deleting a question."};const a={formToken:e.formToken,questionId:t};return await this.mondayApi.request(iS,a),{content:`Form question with id ${t} deleted successfully.`}}async updateQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when updating a question."};const a=e.question;if(!a)return{content:"Must provide updated patch props for the question when updating."};const n={formToken:e.formToken,questionId:t,question:a};return await this.mondayApi.request(rS,n),{content:`Form question with id ${t} updated successfully.`}}async createQuestion(e){const t=e.question;if(!t)return{content:"Must provide a full question payload when creating a question."};if(!t.title)return{content:"Must provide a title for the question when creating a question."};const a={formToken:e.formToken,question:{...t,title:t.title}},n=await this.mondayApi.request(oS,a);return{content:`Form question created successfully. ID: ${n.create_form_question?.id}`}}}const HS=(e,t,a)=>{const n=`${String(t)}Stringified`;if(e[t]||!e[n])return;let i;try{i=JSON.parse(e[n])}catch{throw new Error(`${String(n)} is not a valid JSON`)}const o="object"==typeof i&&!!i&&t in i&&1===Object.keys(i).length?i[t]:i,r=a.safeParse(o);if(!r.success)throw new Error(`JSON string defined as ${String(n)} does not match the specified schema`);e[t]=r.data};var zS;!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"}(zS||(zS={}));const GS=e.object({id:e.string().describe(wS.properties.tags.id).optional(),name:e.string().describe(wS.properties.tags.name).optional(),value:e.string().describe(wS.properties.tags.value).optional(),columnId:e.string().describe(wS.properties.tags.columnId).optional()}),WS=e.object({type:e.nativeEnum(AS).describe(_S.properties.backgroundType).optional(),value:e.string().describe(_S.properties.backgroundValue).optional()}),YS=e.object({format:e.nativeEnum(OS).describe(_S.properties.format).optional(),alignment:e.nativeEnum(kS).describe(_S.properties.alignment).optional(),direction:e.nativeEnum(DS).describe(_S.properties.direction).optional()}),KS=e.object({position:e.nativeEnum(NS).describe(_S.properties.logoPosition).optional(),size:e.nativeEnum(SS).describe(_S.properties.logoSize).optional()}),QS=e.object({text:e.string().describe(_S.properties.submitButtonText).optional()}),JS=e.object({font:e.string().describe(_S.properties.font).optional(),color:e.string().describe(_S.properties.textColor).optional(),size:e.nativeEnum(RS).describe(_S.properties.fontSize).optional()}),XS=e.object({enabled:e.boolean().describe(_S.properties.redirectAfterSubmissionEnabled).optional(),redirectUrl:e.string().describe(_S.properties.redirectUrl).optional()}),ZS=e.object({allowEditSubmission:e.boolean().describe(_S.properties.allowEditSubmission).optional(),allowResubmit:e.boolean().describe(_S.properties.allowResubmit).optional(),allowViewSubmission:e.boolean().describe(_S.properties.allowViewSubmission).optional(),description:e.string().describe(_S.properties.postSubmissionDescription).optional(),redirectAfterSubmission:XS.describe(_S.properties.redirectAfterSubmission).optional(),showSuccessImage:e.boolean().describe(_S.properties.showSuccessImage).optional(),title:e.string().describe(_S.properties.postSubmissionTitle).optional()}),eN=e.object({enabled:e.boolean().describe(_S.properties.closeDateEnabled).optional(),date:e.string().describe(_S.properties.closeDateValue).optional()}),tN=e.object({enabled:e.boolean().describe(_S.properties.draftSubmissionEnabled).optional()}),aN=e.object({itemGroupId:e.string().describe(_S.properties.itemGroupId).optional(),includeNameQuestion:e.boolean().describe(_S.properties.includeNameQuestion).optional(),includeUpdateQuestion:e.boolean().describe(_S.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:e.boolean().describe(_S.properties.syncQuestionAndColumnsTitles).optional()}),nN=e.object({enabled:e.boolean().describe(_S.properties.passwordEnabled).optional()}),iN=e.object({text:e.string().describe(_S.properties.startButtonText).optional()}),oN=e.object({enabled:e.boolean().describe(_S.properties.preSubmissionEnabled).optional(),title:e.string().describe(_S.properties.preSubmissionTitle).optional(),description:e.string().describe(_S.properties.preSubmissionDescription).optional(),startButton:iN.describe(_S.properties.startButton).optional()}),rN=e.object({enabled:e.boolean().describe(_S.properties.requireLoginEnabled).optional(),redirectToLogin:e.boolean().describe(_S.properties.redirectToLogin).optional()}),sN=e.object({enabled:e.boolean().describe(_S.properties.responseLimitEnabled).optional(),limit:e.number().describe(_S.properties.responseLimitValue).optional()}),pN=e.object({background:WS.describe(_S.properties.background).optional(),hideBranding:e.boolean().describe(_S.properties.hideBranding).optional(),layout:YS.describe(_S.properties.layout).optional(),logo:KS.describe(_S.properties.logo).optional(),primaryColor:e.string().describe(_S.properties.primaryColor).optional(),showProgressBar:e.boolean().describe(_S.properties.showProgressBar).optional(),submitButton:QS.describe(_S.properties.submitButton).optional(),text:JS.describe(_S.properties.text).optional()}),dN=e.object({language:e.string().describe(_S.properties.language).optional(),logoAltText:e.string().describe(_S.properties.logoAltText).optional()}),lN=e.object({afterSubmissionView:ZS.describe(_S.properties.afterSubmissionView).optional(),closeDate:eN.describe(_S.properties.closeDate).optional(),draftSubmission:tN.describe(_S.properties.draftSubmission).optional(),monday:aN.describe(_S.properties.monday).optional(),password:nN.describe(_S.properties.password).optional(),preSubmissionView:oN.describe(_S.properties.preSubmissionView).optional(),reCaptchaChallenge:e.boolean().describe(_S.properties.reCaptchaChallenge).optional(),requireLogin:rN.describe(_S.properties.requireLogin).optional(),responseLimit:sN.describe(_S.properties.responseLimit).optional()}),cN=e.object({id:e.string().describe(wS.inputs.questionId)}),mN=e.object({appearance:pN.describe(wS.inputs.form.appearance).optional(),accessibility:dN.describe(wS.inputs.form.accessibility).optional(),features:lN.describe(wS.inputs.form.features).optional(),title:e.string().describe(wS.inputs.title).optional(),description:e.string().describe(wS.inputs.description).optional(),questions:e.array(cN).describe(wS.inputs.questions).optional()}),uN={formToken:e.string().describe(bS.formToken),action:e.nativeEnum(zS).describe(wS.operations.updateForm.action),formPassword:e.string().describe(_S.operations.setFormPassword).optional(),tag:GS.describe(wS.inputs.tag).optional(),tagStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The tag data. Send this as a stringified JSON of "tag" field. Read "tag" field description for details how to use it.'),form:mN.describe(wS.inputs.form.describe).optional(),formStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The form data. Send this as a stringified JSON of "form" field. Read "form" field description for details how to use it.')};class hN{constructor(e){this.mondayApi=e}async setFormPassword(e){if(!e.formPassword)return{content:'formPassword is required for the action "setFormPassword" in the update form tool.'};const t={formToken:e.formToken,input:{password:e.formPassword}};return await this.mondayApi.request(sS,t),{content:"Form password successfully set."}}async shortenFormUrl(e){const t={formToken:e.formToken};return await this.mondayApi.request(pS,t),{content:"Form URL successfully shortened."}}async deactivateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(dS,t),{content:"Form successfully deactivated."}}async activateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(lS,t),{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 t={formToken:e.formToken,tag:{name:e.tag.name,value:e.tag.value}},a=await this.mondayApi.request(mS,t);return{content:`Tag successfully added: ${JSON.stringify(a.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 t={formToken:e.formToken,tagId:e.tag.id};return await this.mondayApi.request(cS,t),{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 t={formToken:e.formToken,tagId:e.tag.id,tag:{value:e.tag.value}};return(await this.mondayApi.request(uS,t)).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 t={formToken:e.formToken,appearance:e.form.appearance},a=await this.mondayApi.request(hS,t);return{content:`Appearance successfully updated: ${JSON.stringify(a.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 t={formToken:e.formToken,accessibility:e.form.accessibility},a=await this.mondayApi.request(fS,t);return{content:`Accessibility successfully updated: ${JSON.stringify(a.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 t={formToken:e.formToken,features:e.form.features},a=await this.mondayApi.request(vS,t);return{content:`Features successfully updated: ${JSON.stringify(a.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 t={formToken:e.formToken,questions:e.form.questions},a=await this.mondayApi.request(gS,t);return{content:`Question order successfully updated: ${JSON.stringify(a.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 t={formToken:e.formToken,title:e.form.title,description:e.form.description},a=await this.mondayApi.request(yS,t);return{content:`Form header content successfully updated: ${JSON.stringify(a.update_form,null,2)}`}}}const fN={formToken:e.string().describe(bS.formToken)};const vN=Object.fromEntries(Object.entries(Cx).filter((([e])=>"Person"!==e))),gN={columnType:e.nativeEnum(vN).describe("The type of the column to be created"),columnTitle:e.string().describe("The title of the column to be created"),columnDescription:e.string().optional().describe("The description of the column to be created"),columnSettings:e.string().optional().describe("Column-specific configuration settings as a JSON string. Use the get_column_type_info tool to fetch the JSON schema for the given column type.")},yN={boardId:e.number().describe("The id of the board to which the new column will be added"),...gN};const bN={color:e.nativeEnum(Px).describe("The color of the custom activity"),icon_id:e.nativeEnum($x).describe("The icon ID of the custom activity"),name:e.string().describe("The name of the custom activity")};const wN=II`
|
|
699
|
+
`,wS={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."},_S={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."}},xS={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."}},ES={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."}},TS={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"}},IS={destination_workspace_id:e.string().describe(_S.args.destinationWorkspaceId),destination_folder_id:e.string().optional().describe(_S.args.destinationFolderId),destination_folder_name:e.string().optional().describe(_S.args.destinationFolderName),board_kind:e.nativeEnum(bx).optional().describe(_S.args.boardKind),destination_name:e.string().optional().describe(_S.args.destinationName),board_owner_ids:e.array(e.string()).optional().describe(_S.args.boardOwnerIds),board_owner_team_ids:e.array(e.string()).optional().describe(_S.args.boardOwnerTeamIds),board_subscriber_ids:e.array(e.string()).optional().describe(_S.args.boardSubscriberIds),board_subscriber_teams_ids:e.array(e.string()).optional().describe(_S.args.boardSubscriberTeamsIds)};var SS,NS,AS,DS,OS,kS,RS,CS,PS,$S,FS,LS,jS,VS,US,BS;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(SS||(SS={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(NS||(NS={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(AS||(AS={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(DS||(DS={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(OS||(OS={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(kS||(kS={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(RS||(RS={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(CS||(CS={})),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"}(PS||(PS={})),function(e){e.Account="account",e.QueryParam="queryParam"}($S||($S={})),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"}(FS||(FS={})),function(e){e.And="AND",e.Or="OR"}(LS||(LS={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(jS||(jS={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(VS||(VS={})),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"}(US||(US={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(BS||(BS={}));const MS=e.object({type:e.nativeEnum(lE).describe(ES.properties.type),title:e.string().describe(ES.properties.title).optional(),description:e.string().describe(ES.properties.description).optional(),visible:e.boolean().describe(ES.properties.visible).optional(),required:e.boolean().describe(ES.properties.required).optional(),options:e.array(e.object({label:e.string().describe(ES.properties.selectOptionsLabel)})).describe(ES.properties.selectOptions).optional(),settings:e.object({checkedByDefault:e.boolean().describe(TS.properties.checkedByDefault).optional(),defaultCurrentDate:e.boolean().describe(TS.properties.defaultCurrentDate).optional(),display:e.nativeEnum(pE).describe(TS.properties.display).optional(),includeTime:e.boolean().describe(TS.properties.includeTime).optional(),locationAutofilled:e.boolean().describe(TS.properties.locationAutofilled).optional(),optionsOrder:e.nativeEnum(dE).describe(TS.properties.optionsOrder).optional(),prefixAutofilled:e.boolean().describe(TS.properties.prefixAutofilled).optional(),prefixPredefined:e.object({enabled:e.boolean().describe(TS.properties.prefixPredefinedEnabled),prefix:e.string().describe(TS.properties.prefixPredefinedPrefix).optional()}).describe(TS.properties.prefixPredefined).optional(),skipValidation:e.boolean().describe(TS.properties.skipValidation).optional(),prefill:e.object({enabled:e.boolean().describe(TS.properties.prefillEnabled),lookup:e.string().describe(TS.properties.prefillLookup).optional(),source:e.nativeEnum(sE).describe(TS.properties.prefillSource).optional()}).describe(TS.properties.prefill).optional()}).optional()}),qS={action:e.nativeEnum(BS).describe(ES.actions.type),formToken:e.string().describe(wS.formToken),questionId:e.string().describe(wS.questionId).optional(),question:MS.describe(ES.actions.question).optional(),questionStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The question object. Send this as a stringified JSON of "question" field. Read "question" field description for details how to use it.')};class HS{constructor(e){this.mondayApi=e}async deleteQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when deleting a question."};const a={formToken:e.formToken,questionId:t};return await this.mondayApi.request(oS,a),{content:`Form question with id ${t} deleted successfully.`}}async updateQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when updating a question."};const a=e.question;if(!a)return{content:"Must provide updated patch props for the question when updating."};const n={formToken:e.formToken,questionId:t,question:a};return await this.mondayApi.request(sS,n),{content:`Form question with id ${t} updated successfully.`}}async createQuestion(e){const t=e.question;if(!t)return{content:"Must provide a full question payload when creating a question."};if(!t.title)return{content:"Must provide a title for the question when creating a question."};const a={formToken:e.formToken,question:{...t,title:t.title}},n=await this.mondayApi.request(rS,a);return{content:`Form question created successfully. ID: ${n.create_form_question?.id}`}}}const zS=(e,t,a)=>{const n=`${String(t)}Stringified`;if(e[t]||!e[n])return;let i;try{i=JSON.parse(e[n])}catch{throw new Error(`${String(n)} is not a valid JSON`)}const o="object"==typeof i&&!!i&&t in i&&1===Object.keys(i).length?i[t]:i,r=a.safeParse(o);if(!r.success)throw new Error(`JSON string defined as ${String(n)} does not match the specified schema`);e[t]=r.data};var GS;!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"}(GS||(GS={}));const WS=e.object({id:e.string().describe(_S.properties.tags.id).optional(),name:e.string().describe(_S.properties.tags.name).optional(),value:e.string().describe(_S.properties.tags.value).optional(),columnId:e.string().describe(_S.properties.tags.columnId).optional()}),YS=e.object({type:e.nativeEnum(DS).describe(xS.properties.backgroundType).optional(),value:e.string().describe(xS.properties.backgroundValue).optional()}),KS=e.object({format:e.nativeEnum(kS).describe(xS.properties.format).optional(),alignment:e.nativeEnum(RS).describe(xS.properties.alignment).optional(),direction:e.nativeEnum(OS).describe(xS.properties.direction).optional()}),QS=e.object({position:e.nativeEnum(AS).describe(xS.properties.logoPosition).optional(),size:e.nativeEnum(NS).describe(xS.properties.logoSize).optional()}),JS=e.object({text:e.string().describe(xS.properties.submitButtonText).optional()}),XS=e.object({font:e.string().describe(xS.properties.font).optional(),color:e.string().describe(xS.properties.textColor).optional(),size:e.nativeEnum(CS).describe(xS.properties.fontSize).optional()}),ZS=e.object({enabled:e.boolean().describe(xS.properties.redirectAfterSubmissionEnabled).optional(),redirectUrl:e.string().describe(xS.properties.redirectUrl).optional()}),eN=e.object({allowEditSubmission:e.boolean().describe(xS.properties.allowEditSubmission).optional(),allowResubmit:e.boolean().describe(xS.properties.allowResubmit).optional(),allowViewSubmission:e.boolean().describe(xS.properties.allowViewSubmission).optional(),description:e.string().describe(xS.properties.postSubmissionDescription).optional(),redirectAfterSubmission:ZS.describe(xS.properties.redirectAfterSubmission).optional(),showSuccessImage:e.boolean().describe(xS.properties.showSuccessImage).optional(),title:e.string().describe(xS.properties.postSubmissionTitle).optional()}),tN=e.object({enabled:e.boolean().describe(xS.properties.closeDateEnabled).optional(),date:e.string().describe(xS.properties.closeDateValue).optional()}),aN=e.object({enabled:e.boolean().describe(xS.properties.draftSubmissionEnabled).optional()}),nN=e.object({itemGroupId:e.string().describe(xS.properties.itemGroupId).optional(),includeNameQuestion:e.boolean().describe(xS.properties.includeNameQuestion).optional(),includeUpdateQuestion:e.boolean().describe(xS.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:e.boolean().describe(xS.properties.syncQuestionAndColumnsTitles).optional()}),iN=e.object({enabled:e.boolean().describe(xS.properties.passwordEnabled).optional()}),oN=e.object({text:e.string().describe(xS.properties.startButtonText).optional()}),rN=e.object({enabled:e.boolean().describe(xS.properties.preSubmissionEnabled).optional(),title:e.string().describe(xS.properties.preSubmissionTitle).optional(),description:e.string().describe(xS.properties.preSubmissionDescription).optional(),startButton:oN.describe(xS.properties.startButton).optional()}),sN=e.object({enabled:e.boolean().describe(xS.properties.requireLoginEnabled).optional(),redirectToLogin:e.boolean().describe(xS.properties.redirectToLogin).optional()}),pN=e.object({enabled:e.boolean().describe(xS.properties.responseLimitEnabled).optional(),limit:e.number().describe(xS.properties.responseLimitValue).optional()}),dN=e.object({background:YS.describe(xS.properties.background).optional(),hideBranding:e.boolean().describe(xS.properties.hideBranding).optional(),layout:KS.describe(xS.properties.layout).optional(),logo:QS.describe(xS.properties.logo).optional(),primaryColor:e.string().describe(xS.properties.primaryColor).optional(),showProgressBar:e.boolean().describe(xS.properties.showProgressBar).optional(),submitButton:JS.describe(xS.properties.submitButton).optional(),text:XS.describe(xS.properties.text).optional()}),lN=e.object({language:e.string().describe(xS.properties.language).optional(),logoAltText:e.string().describe(xS.properties.logoAltText).optional()}),cN=e.object({afterSubmissionView:eN.describe(xS.properties.afterSubmissionView).optional(),closeDate:tN.describe(xS.properties.closeDate).optional(),draftSubmission:aN.describe(xS.properties.draftSubmission).optional(),monday:nN.describe(xS.properties.monday).optional(),password:iN.describe(xS.properties.password).optional(),preSubmissionView:rN.describe(xS.properties.preSubmissionView).optional(),reCaptchaChallenge:e.boolean().describe(xS.properties.reCaptchaChallenge).optional(),requireLogin:sN.describe(xS.properties.requireLogin).optional(),responseLimit:pN.describe(xS.properties.responseLimit).optional()}),mN=e.object({id:e.string().describe(_S.inputs.questionId)}),uN=e.object({appearance:dN.describe(_S.inputs.form.appearance).optional(),accessibility:lN.describe(_S.inputs.form.accessibility).optional(),features:cN.describe(_S.inputs.form.features).optional(),title:e.string().describe(_S.inputs.title).optional(),description:e.string().describe(_S.inputs.description).optional(),questions:e.array(mN).describe(_S.inputs.questions).optional()}),hN={formToken:e.string().describe(wS.formToken),action:e.nativeEnum(GS).describe(_S.operations.updateForm.action),formPassword:e.string().describe(xS.operations.setFormPassword).optional(),tag:WS.describe(_S.inputs.tag).optional(),tagStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The tag data. Send this as a stringified JSON of "tag" field. Read "tag" field description for details how to use it.'),form:uN.describe(_S.inputs.form.describe).optional(),formStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The form data. Send this as a stringified JSON of "form" field. Read "form" field description for details how to use it.')};class fN{constructor(e){this.mondayApi=e}async setFormPassword(e){if(!e.formPassword)return{content:'formPassword is required for the action "setFormPassword" in the update form tool.'};const t={formToken:e.formToken,input:{password:e.formPassword}};return await this.mondayApi.request(pS,t),{content:"Form password successfully set."}}async shortenFormUrl(e){const t={formToken:e.formToken};return await this.mondayApi.request(dS,t),{content:"Form URL successfully shortened."}}async deactivateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(lS,t),{content:"Form successfully deactivated."}}async activateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(cS,t),{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 t={formToken:e.formToken,tag:{name:e.tag.name,value:e.tag.value}},a=await this.mondayApi.request(uS,t);return{content:`Tag successfully added: ${JSON.stringify(a.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 t={formToken:e.formToken,tagId:e.tag.id};return await this.mondayApi.request(mS,t),{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 t={formToken:e.formToken,tagId:e.tag.id,tag:{value:e.tag.value}};return(await this.mondayApi.request(hS,t)).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 t={formToken:e.formToken,appearance:e.form.appearance},a=await this.mondayApi.request(fS,t);return{content:`Appearance successfully updated: ${JSON.stringify(a.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 t={formToken:e.formToken,accessibility:e.form.accessibility},a=await this.mondayApi.request(vS,t);return{content:`Accessibility successfully updated: ${JSON.stringify(a.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 t={formToken:e.formToken,features:e.form.features},a=await this.mondayApi.request(gS,t);return{content:`Features successfully updated: ${JSON.stringify(a.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 t={formToken:e.formToken,questions:e.form.questions},a=await this.mondayApi.request(yS,t);return{content:`Question order successfully updated: ${JSON.stringify(a.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 t={formToken:e.formToken,title:e.form.title,description:e.form.description},a=await this.mondayApi.request(bS,t);return{content:`Form header content successfully updated: ${JSON.stringify(a.update_form,null,2)}`}}}const vN={formToken:e.string().describe(wS.formToken)};const gN=Object.fromEntries(Object.entries(Cx).filter((([e])=>"Person"!==e))),yN={columnType:e.nativeEnum(gN).describe("The type of the column to be created"),columnTitle:e.string().describe("The title of the column to be created"),columnDescription:e.string().optional().describe("The description of the column to be created"),columnSettings:e.string().optional().describe("Column-specific configuration settings as a JSON string. Use the get_column_type_info tool to fetch the JSON schema for the given column type.")},bN={boardId:e.number().describe("The id of the board to which the new column will be added"),...yN};const wN={color:e.nativeEnum(Px).describe("The color of the custom activity"),icon_id:e.nativeEnum($x).describe("The icon ID of the custom activity"),name:e.string().describe("The name of the custom activity")};const _N=II`
|
|
700
700
|
mutation createGroup(
|
|
701
701
|
$boardId: ID!
|
|
702
702
|
$groupName: String!
|
|
@@ -715,14 +715,14 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
715
715
|
title
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
`,
|
|
718
|
+
`,xN=["#037f4c","#00c875","#9cd326","#cab641","#ffcb00","#784bd1","#9d50dd","#007eb5","#579bfc","#66ccff","#bb3354","#df2f4a","#ff007f","#ff5ac4","#ff642e","#fdab3d","#7f5347","#c4c4c4","#757575"],EN={boardId:e.string().describe("The ID of the board to create the group in"),groupName:e.string().max(255).describe("The name of the new group (maximum 255 characters)"),groupColor:e.enum(xN).optional().describe(`The color for the group. Must be one of the predefined Monday.com group colors: ${xN.join(", ")}`),relativeTo:e.string().optional().describe("The ID of the group to position this new group relative to"),positionRelativeMethod:e.nativeEnum(AE).optional().describe("Whether to position the new group before or after the relativeTo group")};const TN=II`
|
|
719
719
|
mutation duplicateItem($boardId: ID!, $itemId: ID!, $withUpdates: Boolean) {
|
|
720
720
|
duplicate_item(board_id: $boardId, item_id: $itemId, with_updates: $withUpdates) {
|
|
721
721
|
id
|
|
722
722
|
name
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
|
-
`,
|
|
725
|
+
`,IN=II`
|
|
726
726
|
mutation createSubitem($parentItemId: ID!, $itemName: String!, $columnValues: JSON) {
|
|
727
727
|
create_subitem(parent_item_id: $parentItemId, item_name: $itemName, column_values: $columnValues) {
|
|
728
728
|
id
|
|
@@ -732,13 +732,13 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
|
-
`,
|
|
735
|
+
`,SN=1e3;var NN,AN;function DN(e,t){const a=e?.response?.errors?.map((e=>e.message))?.join(", ");if(a)throw new Error(`Failed to ${t}: ${a}`);const n=e instanceof Error?e.message:"Unknown error";throw new Error(`Failed to ${t}: ${n}`)}!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"}(NN||(NN={})),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=SN]="SECOND"}(AN||(AN={}));const ON={name:e.string().describe("The name of the new item to be created, must be relevant to the user's request"),groupId:e.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.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.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:e.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},kN={boardId:e.number().describe("The id of the board to which the new item will be added"),...ON};const RN={item_id:e.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:e.string().describe("The ID of the custom activity for the timeline item"),title:e.string().describe("The title of the new timeline item"),summary:e.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:e.string().optional().describe("The content of the new timeline item"),timestamp:e.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:e.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:e.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:e.string().optional().describe("The location to add to the new timeline item"),phone:e.string().optional().describe("The phone number to add to the new timeline item"),url:e.string().optional().describe("The URL to add to the new timeline item")};const CN=II`
|
|
736
736
|
mutation createUpdate($itemId: ID!, $body: String!, $mentionsList: [UpdateMention]) {
|
|
737
737
|
create_update(body: $body, item_id: $itemId, mentions_list: $mentionsList) {
|
|
738
738
|
id
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
|
-
`,
|
|
741
|
+
`,PN=e.object({id:e.string().describe("The ID of the entity to mention"),type:e.nativeEnum(_E).describe("The type of mention: User, Team, Board, or Project")}),$N=e.array(PN),FN={itemId:e.number().describe("The id of the item to which the update will be added"),body:e.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:e.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project')};const LN={columnId:e.string().describe("The id of the column to be deleted")},jN={boardId:e.number().describe("The id of the board to which the new column will be added"),...LN};const VN={itemId:e.number()};const UN={};const BN=II`
|
|
742
742
|
query getBoardData($boardId: ID!, $itemsLimit: Int!) {
|
|
743
743
|
boards(ids: [$boardId]) {
|
|
744
744
|
id
|
|
@@ -781,7 +781,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
781
781
|
}
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
|
-
`,
|
|
784
|
+
`,MN=II`
|
|
785
785
|
query getUsersByIds($userIds: [ID!]!) {
|
|
786
786
|
users(ids: $userIds) {
|
|
787
787
|
id
|
|
@@ -789,7 +789,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
789
789
|
photo_tiny
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
|
-
`,
|
|
792
|
+
`,qN={boardId:e.number().describe("The ID of the board to fetch complete data for")};const HN=II`
|
|
793
793
|
query GetBoardAllActivity(
|
|
794
794
|
$boardId: ID!
|
|
795
795
|
$fromDate: ISO8601DateTime!
|
|
@@ -807,7 +807,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
807
807
|
}
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
|
-
`,
|
|
810
|
+
`,zN={boardId:e.number().describe("The id of the board to get activity for"),fromDate:e.string().optional().describe("Start date for activity range (ISO8601DateTime format). Defaults to 30 days ago"),toDate:e.string().optional().describe("End date for activity range (ISO8601DateTime format). Defaults to now")};const GN=II`
|
|
811
811
|
query GetBoardInfo($boardId: ID!) {
|
|
812
812
|
boards(ids: [$boardId]) {
|
|
813
813
|
# Basic Board Metadata
|
|
@@ -884,7 +884,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
884
884
|
}
|
|
885
885
|
}
|
|
886
886
|
}
|
|
887
|
-
`,
|
|
887
|
+
`,WN=II`
|
|
888
888
|
query GetBoardInfoJustColumns($boardId: ID!) {
|
|
889
889
|
boards(ids: [$boardId]) {
|
|
890
890
|
columns {
|
|
@@ -897,7 +897,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
897
897
|
|
|
898
898
|
}
|
|
899
899
|
}
|
|
900
|
-
`,
|
|
900
|
+
`,YN=(e,t)=>({board:{...e,subItemColumns:t?.columns??void 0},filteringGuidelines:XN(e.columns.filter(KN)),aggregationGuidelines:JN()});function KN(e){return!!e&&["id","type"].every((t=>t in e))}const QN={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'},JN=()=>`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${ix.CountItems} function. Do not use ${ix.Count} function for that purpose.\n `,XN=e=>{const t=e.reduce(((e,t)=>QN[t.type]?(e[t.type]||(e[t.type]=[]),e[t.type].push(t.id),e):e),{});return 0===Object.keys(t).length?"":`\n[MEMORY] Remember the filtering guidelines for subsequent requests for the same board.\n# Filtering Guidelines\n\n## [IMPORTANT] Operator Guidelines\nSpecific operators expect specific compareValue types:\n- CompareValue MUST BE SENT AS AN ARRAY WHEN USED WITH any_of, not_any_of, between operators\n- CompareValue MUST BE SENT AS AN EMPTY ARRAY WHEN USED WITH is_empty, is_not_empty\n- CompareValue MUST BE SENT AS EITHER SINGLE STRING OR SINGLE NUMBER WHEN USED WITH greater_than, greater_than_or_equals, lower_than, lower_than_or_equal\n- CompareValue MUST BE SENT AS SINGLE STRING WHEN USED WITH contains_terms, not_contains_text, contains_text, starts_with, ends_with operators\n\n## [IMPORTANT] Column type Guidelines\n${Object.entries(t).map((([e,t])=>`- Column Type: ${e} (Column IDs: ${t.join(", ")}) - ${QN[e]}`)).join("\n\n")}\n\n## [IMPORTANT] Sub Items Columns MUST NOT BE USED FOR FILTERING.\n `},ZN={boardId:e.number().describe("The id of the board to get information for")};const eA=II`
|
|
901
901
|
fragment ItemDataFragment on Item {
|
|
902
902
|
id
|
|
903
903
|
name
|
|
@@ -942,7 +942,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
|
-
`,
|
|
945
|
+
`,tA=II`
|
|
946
946
|
query SmartSearchBoardItemIds($searchTerm: String!, $board_ids: [ID!]) {
|
|
947
947
|
search_items(board_ids: $board_ids, query: $searchTerm, size: 100) {
|
|
948
948
|
results {
|
|
@@ -952,11 +952,11 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
|
-
`,
|
|
955
|
+
`,aA={boardId:e.number().describe("The id of the board to get items from"),itemIds:e.array(e.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:e.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.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:e.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.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.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.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.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The filters to apply on the items. Send this as a stringified JSON array of "filters" field. Read "filters" field description for details how to use it.'),filters:e.array(e.object({columnId:e.string().describe("The id of the column to filter by"),compareAttribute:e.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:e.union([e.string(),e.number(),e.boolean(),e.array(e.union([e.string(),e.number()]))]).describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:e.nativeEnum(vE).optional().default(vE.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.nativeEnum(fE).optional().default(fE.And).describe("The operator to use for the filters"),columnIds:e.array(e.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.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The order by to apply on the items. Send this as a stringified JSON array of "orderBy" field. Read "orderBy" field description for details how to use it.'),orderBy:e.array(e.object({columnId:e.string().describe("The id of the column to order by"),direction:e.nativeEnum(hE).optional().default(hE.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 nA={boardId:e.number().describe("The id of the board to get the schema of")};const iA=II`
|
|
956
956
|
query GetColumnTypeSchema($type: ColumnType!) {
|
|
957
957
|
get_column_type_schema(type: $type)
|
|
958
958
|
}
|
|
959
|
-
`,
|
|
959
|
+
`,oA={columnType:e.nativeEnum(gN).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const rA={random_string:e.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:e.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const sA={typeName:e.string().describe("The name of the GraphQL type to get details for")};function pA(e){return e?"NON_NULL"===e.kind?`${pA(e.ofType)}!`:"LIST"===e.kind?`[${pA(e.ofType)}]`:e.name||"unknown":"unknown"}const dA=II`
|
|
960
960
|
fragment UserDetails on User {
|
|
961
961
|
# Basic User Information
|
|
962
962
|
id
|
|
@@ -988,31 +988,31 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
988
988
|
time_zone_identifier
|
|
989
989
|
utc_hours_diff
|
|
990
990
|
}
|
|
991
|
-
`,
|
|
991
|
+
`,lA=II`
|
|
992
992
|
fragment UserTeamMembership on Team {
|
|
993
993
|
id
|
|
994
994
|
name
|
|
995
995
|
is_guest
|
|
996
996
|
picture_url
|
|
997
997
|
}
|
|
998
|
-
`,
|
|
998
|
+
`,cA=II`
|
|
999
999
|
fragment TeamBasicInfo on Team {
|
|
1000
1000
|
id
|
|
1001
1001
|
name
|
|
1002
1002
|
}
|
|
1003
|
-
`,
|
|
1003
|
+
`,mA=II`
|
|
1004
1004
|
fragment TeamExtendedInfo on Team {
|
|
1005
1005
|
...TeamBasicInfo
|
|
1006
1006
|
is_guest
|
|
1007
1007
|
picture_url
|
|
1008
1008
|
}
|
|
1009
|
-
`,
|
|
1009
|
+
`,uA=II`
|
|
1010
1010
|
fragment TeamOwner on User {
|
|
1011
1011
|
id
|
|
1012
1012
|
name
|
|
1013
1013
|
email
|
|
1014
1014
|
}
|
|
1015
|
-
`,
|
|
1015
|
+
`,hA=II`
|
|
1016
1016
|
fragment TeamMember on User {
|
|
1017
1017
|
id
|
|
1018
1018
|
name
|
|
@@ -1032,7 +1032,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1032
1032
|
time_zone_identifier
|
|
1033
1033
|
utc_hours_diff
|
|
1034
1034
|
}
|
|
1035
|
-
`,
|
|
1035
|
+
`,fA=II`
|
|
1036
1036
|
fragment TeamMemberSimplified on User {
|
|
1037
1037
|
id
|
|
1038
1038
|
name
|
|
@@ -1041,15 +1041,15 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1041
1041
|
is_admin
|
|
1042
1042
|
is_guest
|
|
1043
1043
|
}
|
|
1044
|
-
`,
|
|
1044
|
+
`,vA=II`
|
|
1045
1045
|
fragment UserTeamMembershipSimplified on Team {
|
|
1046
1046
|
id
|
|
1047
1047
|
name
|
|
1048
1048
|
is_guest
|
|
1049
1049
|
}
|
|
1050
|
-
`,
|
|
1051
|
-
${pA}
|
|
1050
|
+
`,gA=II`
|
|
1052
1051
|
${dA}
|
|
1052
|
+
${lA}
|
|
1053
1053
|
|
|
1054
1054
|
query listUsersWithTeams($userIds: [ID!], $limit: Int = 1000) {
|
|
1055
1055
|
users(ids: $userIds, limit: $limit) {
|
|
@@ -1061,9 +1061,9 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1061
1061
|
}
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
|
-
`,
|
|
1065
|
-
${pA}
|
|
1064
|
+
`,yA=II`
|
|
1066
1065
|
${dA}
|
|
1066
|
+
${lA}
|
|
1067
1067
|
|
|
1068
1068
|
query listUsersOnly($userIds: [ID!], $limit: Int = 1000) {
|
|
1069
1069
|
users(ids: $userIds, limit: $limit) {
|
|
@@ -1075,13 +1075,13 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1075
1075
|
}
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
|
-
`,
|
|
1079
|
-
${
|
|
1080
|
-
${
|
|
1081
|
-
${cA}
|
|
1082
|
-
${lA}
|
|
1078
|
+
`,bA=II`
|
|
1079
|
+
${dA}
|
|
1080
|
+
${vA}
|
|
1083
1081
|
${mA}
|
|
1084
|
-
${
|
|
1082
|
+
${cA}
|
|
1083
|
+
${uA}
|
|
1084
|
+
${fA}
|
|
1085
1085
|
|
|
1086
1086
|
query listUsersAndTeams($userIds: [ID!], $teamIds: [ID!], $limit: Int = 1000) {
|
|
1087
1087
|
users(ids: $userIds, limit: $limit) {
|
|
@@ -1107,19 +1107,19 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
1109
|
}
|
|
1110
|
-
`,
|
|
1111
|
-
${
|
|
1110
|
+
`,wA=II`
|
|
1111
|
+
${cA}
|
|
1112
1112
|
|
|
1113
1113
|
query listTeamsOnly($teamIds: [ID!]) {
|
|
1114
1114
|
teams(ids: $teamIds) {
|
|
1115
1115
|
...TeamBasicInfo
|
|
1116
1116
|
}
|
|
1117
1117
|
}
|
|
1118
|
-
`,
|
|
1119
|
-
${cA}
|
|
1120
|
-
${lA}
|
|
1118
|
+
`,_A=II`
|
|
1121
1119
|
${mA}
|
|
1120
|
+
${cA}
|
|
1122
1121
|
${uA}
|
|
1122
|
+
${hA}
|
|
1123
1123
|
|
|
1124
1124
|
query listTeamsWithMembers($teamIds: [ID!]) {
|
|
1125
1125
|
teams(ids: $teamIds) {
|
|
@@ -1136,9 +1136,9 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1136
1136
|
}
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
|
-
`,
|
|
1140
|
-
${pA}
|
|
1139
|
+
`,xA=II`
|
|
1141
1140
|
${dA}
|
|
1141
|
+
${lA}
|
|
1142
1142
|
|
|
1143
1143
|
query getUserByName($name: String) {
|
|
1144
1144
|
users(name: $name) {
|
|
@@ -1150,7 +1150,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
|
-
`,
|
|
1153
|
+
`,EA=II`
|
|
1154
1154
|
query getCurrentUser {
|
|
1155
1155
|
me {
|
|
1156
1156
|
id
|
|
@@ -1162,7 +1162,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1162
1162
|
photo_thumb
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
1165
|
-
`;const
|
|
1165
|
+
`;const TA=[["is_pending","Pending"],["is_verified","Verified"],["is_view_only","View Only"],["join_date","Join Date"],["last_activity","Last Activity"],["location","Location"],["mobile_phone","Mobile Phone"],["phone","Phone"],["photo_thumb","Photo Thumb"],["time_zone_identifier","Timezone"],["utc_hours_diff","UTC Hours Diff"]];function IA(e,t=""){return TA.filter((([t])=>{const a=e[t];return null!=a})).map((([a,n])=>`${t}${n}: ${e[a]}`))}const SA=e=>{const t=[];return"users"in e&&e.users&&e.users.length>0&&(t.push("Users:"),e.users.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),t.push(` Email: ${e.email}`),t.push(` Title: ${e.title||"N/A"}`),t.push(` Enabled: ${e.enabled}`),t.push(` Admin: ${e.is_admin||!1}`),t.push(` Guest: ${e.is_guest||!1}`),t.push(...IA(e," ")),e.teams&&e.teams.length>0&&(t.push(" Teams:"),e.teams.forEach((e=>{e&&t.push(` - ID: ${e.id}, Name: ${e.name}, Guest Team: ${e.is_guest||!1}, Picture URL: ${e.picture_url||"N/A"}`)}))),t.push(""))}))),"teams"in e&&e.teams&&e.teams.length>0&&(t.push("Teams:"),e.teams.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),function(e){return"owners"in e}(e)&&(t.push(` Guest Team: ${e.is_guest||!1}`),t.push(` Picture URL: ${e.picture_url||"N/A"}`),e.owners&&e.owners.length>0&&(t.push(" Owners:"),e.owners.forEach((e=>{t.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}`)}))),e.users&&e.users.length>0&&(t.push(" Members:"),e.users.forEach((e=>{if(e){const a=[`ID: ${e.id}`,`Name: ${e.name}`,`Email: ${e.email}`,`Title: ${e.title||"N/A"}`,`Admin: ${e.is_admin||!1}`,`Guest: ${e.is_guest||!1}`,...IA(e)];t.push(` - ${a.join(", ")}`)}})))),t.push(""))}))),0===t.length?"No users or teams found with the specified filters.":t.join("\n").trim()},NA=500,AA=500,DA=1e3,OA={userIds:e.array(e.string()).max(NA).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.array(e.string()).max(AA).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.string().optional().describe("Name-based USER search ONLY. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n CRITICAL: This parameter searches for USERS ONLY, NOT teams. To search for teams, use teamIds parameter instead."),getMe:e.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.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.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:e.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const kA={itemId:e.number().describe("The id of the item to which the update will be added"),groupId:e.string().describe("The id of the group to which the item will be moved")};const RA={type:e.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.array(e.string()).min(1).describe("Array of ID values for this query type (at least 1 required)"),limit:e.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.nativeEnum(Hx).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.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 CA={workspace_id:e.number().describe("The ID of the workspace to get information for")};const PA=II`
|
|
1166
1166
|
query listWorkspaces($limit: Int!, $page: Int!) {
|
|
1167
1167
|
workspaces(limit: $limit, page: $page) {
|
|
1168
1168
|
id
|
|
@@ -1170,7 +1170,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1170
1170
|
description
|
|
1171
1171
|
}
|
|
1172
1172
|
}
|
|
1173
|
-
|
|
1173
|
+
`,$A=100,FA=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,""),LA={searchTerm:e.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.number().min(1).max($A).default($A).describe("The number of workspaces to return. Default and maximum allowed is 100"),page:e.number().min(1).default(1).describe("The page number to return. Default is 1.")};const jA=II`
|
|
1174
1174
|
query getItemBoard($itemId: ID!) {
|
|
1175
1175
|
items(ids: [$itemId]) {
|
|
1176
1176
|
id
|
|
@@ -1183,7 +1183,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1183
1183
|
}
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
|
-
`,
|
|
1186
|
+
`,VA=II`
|
|
1187
1187
|
mutation createDoc($location: CreateDocInput!) {
|
|
1188
1188
|
create_doc(location: $location) {
|
|
1189
1189
|
id
|
|
@@ -1191,7 +1191,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1191
1191
|
name
|
|
1192
1192
|
}
|
|
1193
1193
|
}
|
|
1194
|
-
`,
|
|
1194
|
+
`,UA=II`
|
|
1195
1195
|
mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
|
|
1196
1196
|
add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
|
|
1197
1197
|
success
|
|
@@ -1199,11 +1199,11 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1199
1199
|
error
|
|
1200
1200
|
}
|
|
1201
1201
|
}
|
|
1202
|
-
`,
|
|
1202
|
+
`,BA=II`
|
|
1203
1203
|
mutation updateDocName($docId: ID!, $name: String!) {
|
|
1204
1204
|
update_doc_name(docId: $docId, name: $name)
|
|
1205
1205
|
}
|
|
1206
|
-
`,
|
|
1206
|
+
`,MA=e.enum(["workspace","item"]),qA=e.discriminatedUnion("type",[e.object({type:e.literal(MA.enum.workspace).describe("Create document in workspace"),workspace_id:e.number().describe("Workspace ID under which to create the new document"),doc_kind:e.nativeEnum(bx).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:e.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),e.object({type:e.literal(MA.enum.item).describe("Create document attached to item"),item_id:e.number().describe("Item ID to attach the new document to"),column_id:e.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.")})]),HA={doc_name:e.string().describe("Name for the new document."),markdown:e.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:e.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:e.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:e.nativeEnum(bx).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:e.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:e.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:e.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 zA=II`
|
|
1207
1207
|
mutation CreateDashboard(
|
|
1208
1208
|
$name: String!
|
|
1209
1209
|
$workspace_id: ID!
|
|
@@ -1225,14 +1225,14 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1225
1225
|
board_folder_id
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
|
-
`,
|
|
1228
|
+
`,GA=II`
|
|
1229
1229
|
query GetAllWidgetsSchema {
|
|
1230
1230
|
all_widgets_schema {
|
|
1231
1231
|
widget_type
|
|
1232
1232
|
schema
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
1235
|
-
`,
|
|
1235
|
+
`,WA=II`
|
|
1236
1236
|
mutation CreateWidget($parent: WidgetParentInput!, $kind: ExternalWidget!, $name: String!, $settings: JSON!) {
|
|
1237
1237
|
create_widget(parent: $parent, kind: $kind, name: $name, settings: $settings) {
|
|
1238
1238
|
id
|
|
@@ -1244,13 +1244,13 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1244
1244
|
}
|
|
1245
1245
|
}
|
|
1246
1246
|
}
|
|
1247
|
-
`,
|
|
1247
|
+
`,YA={name:e.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:e.string().describe("ID of the workspace that will own the dashboard"),board_ids:e.array(e.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:e.nativeEnum(Lx).default(Lx.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:e.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const KA={parent_container_id:e.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:e.nativeEnum(nT).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:e.nativeEnum(Wx).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:e.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:e.record(e.unknown()).optional().describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type."),settingsStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The settings object. Send this as a stringified JSON of "settings" field. Read "settings" field description for details how to use it.')};const QA=II`
|
|
1248
1248
|
mutation updateWorkspace($id: ID!, $attributes: UpdateWorkspaceAttributesInput!) {
|
|
1249
1249
|
update_workspace(id: $id, attributes: $attributes) {
|
|
1250
1250
|
id
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
|
-
`,
|
|
1253
|
+
`,JA={id:e.string().describe("The ID of the workspace to update"),attributeAccountProductId:e.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:e.string().optional().describe("The description of the workspace to update"),attributeKind:e.nativeEnum(iT).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:e.string().optional().describe("The name of the workspace to update")};const XA=II`
|
|
1254
1254
|
mutation updateFolder(
|
|
1255
1255
|
$folderId: ID!
|
|
1256
1256
|
$name: String
|
|
@@ -1276,7 +1276,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1276
1276
|
id
|
|
1277
1277
|
}
|
|
1278
1278
|
}
|
|
1279
|
-
`,
|
|
1279
|
+
`,ZA={folderId:e.string().describe("The ID of the folder to update"),name:e.string().optional().describe("The new name of the folder"),color:e.nativeEnum(Jx).optional().describe("The new color of the folder"),fontWeight:e.nativeEnum(Zx).optional().describe("The new font weight of the folder"),customIcon:e.nativeEnum(Xx).optional().describe("The new custom icon of the folder"),parentFolderId:e.string().optional().describe("The ID of the new parent folder"),workspaceId:e.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:e.string().optional().describe("The account product ID associated with the folder"),position_object_id:e.string().optional().describe("The ID of the object to position the folder relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:e.nativeEnum(SE).optional().describe("The type of object to position the folder relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:e.boolean().optional().describe("Whether to position the folder after the object")};const eD=II`
|
|
1280
1280
|
mutation createWorkspace(
|
|
1281
1281
|
$name: String!
|
|
1282
1282
|
$workspaceKind: WorkspaceKind!
|
|
@@ -1292,7 +1292,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1292
1292
|
id
|
|
1293
1293
|
}
|
|
1294
1294
|
}
|
|
1295
|
-
`,
|
|
1295
|
+
`,tD={name:e.string().describe("The name of the new workspace to be created"),workspaceKind:e.nativeEnum(iT).describe("The kind of workspace to create"),description:e.string().optional().describe("The description of the new workspace"),accountProductId:e.string().optional().describe("The account product ID associated with the workspace")};const aD=II`
|
|
1296
1296
|
mutation createFolder(
|
|
1297
1297
|
$workspaceId: ID!
|
|
1298
1298
|
$name: String!
|
|
@@ -1312,7 +1312,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1312
1312
|
id
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
|
-
`,
|
|
1315
|
+
`,nD={workspaceId:e.string().describe("The ID of the workspace where the folder will be created"),name:e.string().describe("The name of the folder to be created"),color:e.nativeEnum(Jx).optional().describe("The color of the folder"),fontWeight:e.nativeEnum(Zx).optional().describe("The font weight of the folder"),customIcon:e.nativeEnum(Xx).optional().describe("The custom icon of the folder"),parentFolderId:e.string().optional().describe("The ID of the parent folder")};const iD=II`
|
|
1316
1316
|
mutation updateBoardHierarchy($boardId: ID!, $attributes: UpdateBoardHierarchyAttributesInput!) {
|
|
1317
1317
|
update_board_hierarchy(board_id: $boardId, attributes: $attributes) {
|
|
1318
1318
|
success
|
|
@@ -1322,7 +1322,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
|
-
`,
|
|
1325
|
+
`,oD=II`
|
|
1326
1326
|
mutation updateOverviewHierarchy($overviewId: ID!, $attributes: UpdateOverviewHierarchyAttributesInput!) {
|
|
1327
1327
|
update_overview_hierarchy(overview_id: $overviewId, attributes: $attributes) {
|
|
1328
1328
|
success
|
|
@@ -1332,7 +1332,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1332
1332
|
}
|
|
1333
1333
|
}
|
|
1334
1334
|
}
|
|
1335
|
-
`,
|
|
1335
|
+
`,rD={objectType:e.nativeEnum(SE).describe("The type of object to move"),id:e.string().describe("The ID of the object to move"),position_object_id:e.string().optional().describe("The ID of the object to position the object relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:e.nativeEnum(SE).optional().describe("The type of object to position the object relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:e.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:e.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:e.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:e.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const sD=II`
|
|
1336
1336
|
query aggregateBoardInsights($query: AggregateQueryInput!) {
|
|
1337
1337
|
aggregate(query: $query) {
|
|
1338
1338
|
results {
|
|
@@ -1353,7 +1353,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
1355
1355
|
}
|
|
1356
|
-
`,
|
|
1356
|
+
`,pD=new Set([ix.Case,ix.Between,ix.Left,ix.Raw,ix.None,ix.CountKeys]),dD=Object.values(ix).filter((e=>!pD.has(e))),lD=new Set([ix.Left,ix.Trim,ix.Upper,ix.Lower,ix.DateTruncDay,ix.DateTruncWeek,ix.DateTruncMonth,ix.DateTruncQuarter,ix.DateTruncYear,ix.Color,ix.Label,ix.EndDate,ix.StartDate,ix.Hour,ix.PhoneCountryShortName,ix.Person,ix.Upper,ix.Lower,ix.Order,ix.Length,ix.Flatten,ix.IsDone]);function cD(e){return{column_id:e}}new Set([ix.Count,ix.CountDistinct,ix.CountSubitems,ix.CountItems,ix.First,ix.Sum,ix.Average,ix.Median,ix.Min,ix.Max,ix.MinMax]);const mD={boardId:e.number().describe("The id of the board to get insights for"),aggregationsStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The aggregations to get. Send this as a stringified JSON array of "aggregations" field. Read "aggregations" field description for details how to use it.'),aggregations:e.array(e.object({function:e.enum(dD).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:e.string().describe("The id of the column to aggregate")})).describe('The aggregations to get. Before sending the aggregations, use get_board_info tool to check "aggregationGuidelines" key for information. Transformative functions and plain columns (no function) must be in group by. [REQUIRED PRECONDITION]: Either send this field or the stringified version of it.').optional(),groupBy:e.array(e.string()).describe("The columns to group by. All columns in the group by must be in the aggregations as well without a function.").optional(),limit:e.number().describe("The limit of the results").max(1e3).optional().default(1e3),filtersStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The filters to apply on the items. Send this as a stringified JSON array of "filters" field. Read "filters" field description for details how to use it.'),filters:e.array(e.object({columnId:e.string().describe("The id of the column to filter by"),compareAttribute:e.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:e.any().describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:e.nativeEnum(vE).optional().default(vE.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.nativeEnum(fE).optional().default(fE.And).describe("The logical operator to use for the filters"),orderByStringified:e.string().optional().describe('**ONLY FOR MICROSOFT COPILOT**: The order by to apply on the items. Send this as a stringified JSON array of "orderBy" field. Read "orderBy" field description for details how to use it.'),orderBy:e.array(e.object({columnId:e.string().describe("The id of the column to order by"),direction:e.nativeEnum(hE).optional().default(hE.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 uD=II`
|
|
1357
1357
|
query GetBoards($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
|
|
1358
1358
|
boards(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
|
|
1359
1359
|
id
|
|
@@ -1361,7 +1361,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1361
1361
|
url
|
|
1362
1362
|
}
|
|
1363
1363
|
}
|
|
1364
|
-
`,
|
|
1364
|
+
`,hD=II`
|
|
1365
1365
|
query GetDocs($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
|
|
1366
1366
|
docs(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
|
|
1367
1367
|
id
|
|
@@ -1369,14 +1369,14 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1369
1369
|
url
|
|
1370
1370
|
}
|
|
1371
1371
|
}
|
|
1372
|
-
`,
|
|
1372
|
+
`,fD=II`
|
|
1373
1373
|
query GetFolders($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
|
|
1374
1374
|
folders(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
|
|
1375
1375
|
id
|
|
1376
1376
|
name
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
|
-
`;var
|
|
1379
|
+
`;var vD,gD;!function(e){e.BOARD="board-",e.DOCUMENT="doc-",e.FOLDER="folder-"}(vD||(vD={})),function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS"}(gD||(gD={}));const yD=100,bD={searchTerm:e.string().optional().describe("The search term to use for the search."),searchType:e.nativeEnum(gD).describe("The type of search to perform."),limit:e.number().max(yD).optional().default(yD).describe("The number of items to get. The max and default value is 100."),page:e.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:e.array(e.number()).optional().describe("The ids of the workspaces to search in. [IMPORTANT] Only pass this param if user explicitly asked to search within specific workspaces.")};const wD=e.object({id:e.string().describe("The ID of the entity to mention"),type:e.nativeEnum(_E).describe("The type of mention: User, Team, Board, or Project")}),_D=e.array(wD),xD={itemId:e.number().describe("The id of the item to which the update will be added"),body:e.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:e.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project')};const ED={action:e.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),toolName:e.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)")};class TD{constructor(){this.name="manage_tools",this.type=qn.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 ED}async execute(e){if(!this.toolkitManager)throw new Error("Toolkit manager not initialized");if(!e)throw new Error("Input parameters are required");const{action:t,toolName:a}=e;switch(t){case"enable":if(!a)throw new Error("Tool name is required for enable action");if(this.toolkitManager.isToolEnabled(a))return{content:`Tool '${a}' is already enabled`};return{content:this.toolkitManager.enableTool(a)?`✅ Tool '${a}' has been enabled and is now available for use`:`❌ Failed to enable tool '${a}' (tool not found)`};case"disable":if(!a)throw new Error("Tool name is required for disable action");return{content:this.toolkitManager.disableTool(a)?`Tool '${a}' has been disabled`:`Failed to disable tool '${a}' (tool not found)`};case"status":if(a){return{content:`Tool '${a}' is ${this.toolkitManager.isToolEnabled(a)?"enabled":"disabled"}`}}{const e=this.toolkitManager.getToolsStatus();return{content:`All tools status:\n${Object.entries(e).map((([e,t])=>`${e}: ${t?"enabled":"disabled"}`)).join("\n")}`}}case"detailed":{const e=this.toolkitManager.getDetailedToolsStatus(),t=Object.entries(e).filter((([,e])=>e.enabled)),a=Object.entries(e).filter((([,e])=>!e.enabled));let n="monday.com Tools Discovery:\n\n";return t.length>0&&(n+="✅ ACTIVE TOOLS (ready to use):\n",n+=t.map((([e,t])=>` • ${e} (default: ${t.enabledByDefault?"enabled":"disabled"})`)).join("\n")),a.length>0&&(n+="\n\n⚠️ INACTIVE TOOLS (need activation):\n",n+=a.map((([e,t])=>` • ${e} (default: ${t.enabledByDefault?"enabled":"disabled"}) - use {"action": "enable", "toolName": "${e}"} to activate`)).join("\n")),{content:n}}case"reset":{if(!a)throw new Error("Tool name is required for reset action");const e=this.toolkitManager.resetToolToDefault(a),t=this.toolkitManager.isToolEnabledByDefault(a);return{content:e?`Tool '${a}' has been reset to its default state (${t?"enabled":"disabled"})`:`Failed to reset tool '${a}' (tool not found)`}}case"list":{const e=this.toolkitManager.getToolsStatus();return{content:`Available tools: ${Object.entries(e).map((([e,t])=>`${e} (${t?"enabled":"disabled"})`)).join(", ")}`}}default:throw new Error("Invalid action. Use: enable, disable, status, list, detailed, or reset")}}}const ID=II`
|
|
1380
1380
|
query getSprintsByIds($ids: [ID!]) {
|
|
1381
1381
|
items(ids: $ids) {
|
|
1382
1382
|
id
|
|
@@ -1411,7 +1411,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
|
-
`,
|
|
1414
|
+
`,SD={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"},ND={...SD,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},AD="BOARD_NOT_FOUND:",DD="SPRINT_NOT_FOUND:",OD="DOCUMENT_NOT_FOUND:",kD="DOCUMENT_INVALID:",RD="DOCUMENT_EMPTY:",CD="EXPORT_FAILED:",PD="INTERNAL_ERROR:",$D="VALIDATION_ERROR:",FD="task_sprint",LD={[ND.SPRINT_TASKS]:"Sprint Tasks",[ND.SPRINT_TIMELINE]:"Sprint Timeline",[ND.SPRINT_COMPLETION]:"Sprint Completion",[ND.SPRINT_START_DATE]:"Sprint Start Date",[ND.SPRINT_END_DATE]:"Sprint End Date",[ND.SPRINT_ACTIVATION]:"Sprint Activation",[ND.SPRINT_SUMMARY]:"Sprint Summary",[ND.SPRINT_CAPACITY]:"Sprint Capacity"},jD=LE,VD={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},UD=(e,t)=>e.column_values?.find((e=>e.id===t)),BD=(e,t)=>{const a=UD(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},MD=(e,t)=>{const a=UD(e,t);return"DateValue"===a?.__typename?a.date??null:null},qD=(e,t)=>{const a=UD(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},HD=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},zD=(e,t)=>{if(!e.columns)return!1;const a=new Set(e.columns.filter((e=>null!==e)).map((e=>e.id)));return t.every((e=>a.has(e)))},GD=e=>zD(e,Object.values(SD)),WD=e=>zD(e,Object.values(VD)),YD=e=>{if(!e?.settings)return null;const t=e.settings;return t.boardIds&&Array.isArray(t.boardIds)&&t.boardIds[0]?.toString()||t.boardId?.toString()||null},KD=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===gN.BoardRelation))||null,QD={sprintId:e.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const JD=II`
|
|
1415
1415
|
query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
|
|
1416
1416
|
boards(ids: [$boardId]) {
|
|
1417
1417
|
items_page(limit: $limit) {
|
|
@@ -1447,7 +1447,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1447
1447
|
}
|
|
1448
1448
|
}
|
|
1449
1449
|
}
|
|
1450
|
-
`,
|
|
1450
|
+
`,XD={sprintsBoardId:e.number().describe("The ID of the monday-dev board containing the sprints"),limit:e.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const ZD=II`
|
|
1451
1451
|
query GetRecentBoards($limit: Int) {
|
|
1452
1452
|
boards(limit: $limit, order_by: used_at, state: active) {
|
|
1453
1453
|
id
|
|
@@ -1463,7 +1463,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1463
1463
|
}
|
|
1464
1464
|
}
|
|
1465
1465
|
}
|
|
1466
|
-
`,ZD={};const eO=[class extends Jg{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=qn.READ,this.annotations=Qg({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 ZD}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(XD,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${ND} No boards found in your account. Please verify you have access to monday.com boards.`};const a=this.extractBoardPairs(t);if(0===a.length)return{content:this.generateNotFoundMessage(t.length)};return{content:this.generateReport(a)}}catch(e){return{content:`${CD} 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,t){return`### Pair ${t+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 t=e.length>1?this.generateMultiplePairsWarning(e.length):"",a=e.map(((e,t)=>this.generatePairDetails(e,t))).join(""),n=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${t}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${a}${n}`}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,t,a){return{id:e,name:t?.name||a,workspaceId:t?.workspace?.id||"unknown",workspaceName:t?.workspace?.name||"Unknown"}}processSprintsBoard(e,t,a){const n=YD(e,ID.SPRINT_TASKS);if(!n)return;const i=WD(n);if(!i)return;const o=`${e.id}:${i}`;if(a.has(o))return;const r=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(i,r,`Tasks Board ${i}`)})}processTasksBoard(e,t,a){const n=YD(e,$D);if(!n)return;const i=WD(n);if(!i)return;const o=`${i}:${e.id}`;if(a.has(o))return;const r=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(i,r,`Sprints Board ${i}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const n of e)n.columns&&(zD(n)&&this.processSprintsBoard(n,a,t),GD(n)&&this.processTasksBoard(n,a,t));return Array.from(t.values())}},class extends Jg{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=qn.READ,this.annotations=Qg({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 JD}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},n=await this.mondayApi.request(QD,a),i=n.boards?.[0],o=i?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${CD} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const t={boardId:e.toString()},a=await this.mondayApi.request(AI,t),n=a.boards?.[0];if(!n)return{success:!1,error:`${ND} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const i=n.columns||[],o=this.validateSprintsBoardSchemaFromColumns(i);return o.isValid?{success:!0}:{success:!1,error:`${PD} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${CD} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const t=new Set(e.filter((e=>null!==e)).map((e=>e.id))),a=Object.values(ID),n=qD(t,a);if(!n.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return n.missingColumns.forEach((t=>{const a=(e=>FD[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let t="# Sprints Metadata Report\n\n";return t+=`**Total Sprints:** ${e.length}\n\n`,t+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",t+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const a=e.name||"Unknown",n=e.id,i=UD(e,SD.SPRINT_ACTIVATION),o=UD(e,SD.SPRINT_COMPLETION),r=BD(e,SD.SPRINT_START_DATE),s=BD(e,SD.SPRINT_END_DATE),p=((e,t)=>{const a=VD(e,t);if("TimelineValue"===a?.__typename&&a.from&&a.to)return{from:a.from.split("T")[0],to:a.to.split("T")[0]};return null})(e,SD.SPRINT_TIMELINE),d=MD(e,SD.SPRINT_SUMMARY);let l=LD.Planned;o?l=LD.Completed:(i||r)&&(l=LD.Active);const c=p?`${p.from} to ${p.to}`:"Not set";t+=`| ${a} | ${n} | ${l} | ${c} | ${r||"Not started"} | ${s||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),t+="\n## Status Definitions:\n",t+=`- **${LD.Planned}**: Sprint not yet started (no activation, no start date)\n`,t+=`- **${LD.Active}**: Sprint is active (activated but not completed)\n`,t+=`- **${LD.Completed}**: Sprint is finished\n\n`,t}},class extends Jg{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=qn.READ,this.annotations=Qg({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 KD}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${CD} Unknown error occurred while getting sprint metadata`};const a=await this.readSprintSummaryDocument(t.documentObjectId);return a.success?{content:a.content}:{content:a.error||`${CD} Unknown error occurred while reading document content`}}catch(e){return{content:`${CD} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const t={ids:[String(e)]},a=(await this.mondayApi.request(TD,t)).items||[];if(0===a.length)return{success:!1,error:`${AD} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const n=a[0];if(!n)return{success:!1,error:`${AD} Sprint with ID ${e} not found.`};const i=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),n=[...Object.values(ID),...t];return qD(a,n)})(n,[SD.SPRINT_SUMMARY]);if(!i.isValid)return{success:!1,error:`${PD} Sprint item is missing required columns: ${i.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=MD(n,SD.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:n.name}:{success:!1,error:`${DD} No sprint summary document found for sprint "${n.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${CD} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const t={object_ids:[e],limit:1},a=(await this.mondayApi.request(VI,t)).docs||[];if(0===a.length)return{success:!1,error:`${DD} Document with object ID ${e} not found or not accessible.`};const n=a[0];if(!n||!n.id)return{success:!1,error:`${OD} Document data is invalid for object ID ${e}.`};const i={docId:n.id,blockIds:[]},o=await this.mondayApi.request(UI,i);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${RD} 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:`${kD} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${CD} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],tO=[class extends Jg{constructor(){super(...arguments),this.name="delete_item",this.type=qn.WRITE,this.annotations=Qg({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return jN}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(SI,t);return{content:`Item ${a.delete_item?.id} successfully deleted`}}},class extends Jg{constructor(){super(...arguments),this.name="get_board_items_page",this.type=qn.READ,this.annotations=Qg({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 tA}async executeInternal(e){const t=!e.cursor;if(t&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch{HS(e,"filters",tA.filters),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems};HS(e,"filters",tA.filters),HS(e,"orderBy",tA.orderBy),t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const n=await this.mondayApi.request(ZN,a),i=this.mapResult(n,e);return{content:JSON.stringify(i,null,2)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:vE.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],n=a?.items_page,i=n?.items||[];return{board:{id:a?.id,name:a?.name},items:i.map((e=>this.mapItem(e,t))),pagination:{has_more:!!n?.cursor,nextCursor:n?.cursor||null,count:i.length}}}mapItem(e,t){const a={id:e.id,name:e.name,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case vN.BoardRelation:return e.linked_items;case vN.Formula:return e.display_value;case vN.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const t={board_ids:[e.boardId.toString()],searchTerm:e.searchTerm},a=await this.mondayApi.request(eA,t),n=a.search_items?.results?.map((e=>Number(e.data.id)))??[];if(0===n.length)throw new Error("No items found for search term or new search is not enabled for this account");const i=e.itemIds??[];if(0===i.length)return n;const o=new Set(i);return n.filter((e=>o.has(e)))}},class extends Jg{constructor(){super(...arguments),this.name="create_item",this.type=qn.WRITE,this.annotations=Qg({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?DN:ON}async executeInternal(e){const t=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,t):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,t)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},n=await this.mondayApi.request(EN,a);if(!n.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let i;try{i=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...i,name:e.name},r=new GI(this.mondayApi,this.apiToken,{boardId:t}),s=await r.execute({itemId:parseInt(n.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 ${n.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){AN(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const a=await this.mondayApi.request(TN,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:`Subitem ${a.create_subitem.id} successfully created under parent item ${e.parentItemId}`}}catch(e){AN(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},n=await this.mondayApi.request(NI,a);return{content:`Item ${n.create_item?.id} successfully created`}}catch(e){AN(e,"create item")}}},class extends Jg{constructor(){super(...arguments),this.name="create_update",this.type=qn.WRITE,this.annotations=Qg({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update."}getInputSchema(){return $N}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),n=PN.safeParse(a);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);t=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},n=await this.mondayApi.request(RN,a);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${n.create_update.id} successfully created on item ${e.itemId}`}}catch(e){AN(e,"create update")}}},class extends Jg{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=qn.WRITE,this.annotations=Qg({title:"Create Update in Monday, after calling this tool you should",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. After calling this tool you should call the full board data tool to get data, and immediately after that call the show table tool to show the data from that tool. IMPORTANT: You MUST use the COMPLETE data from the full board data tool - do NOT cut, truncate, or omit any data. Pass the entire dataset to the show table tool."}getInputSchema(){return _D}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),n=wD.safeParse(a);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);t=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},n=await this.mondayApi.request(RN,a);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${n.create_update.id} successfully created on item ${e.itemId}. Now we want to show the updated data, so call the full board data tool to get data, and then immediately after that call the show table tool to show the data from that tool. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received.`}}catch(e){AN(e,"create update")}}},class extends Jg{constructor(){super(...arguments),this.name="get_board_schema",this.type=qn.READ,this.annotations=Qg({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 aA}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},n=await this.mondayApi.request(AI,a);return{content:`The current schema of the board ${t} is: \n \n\nColumns:\n ${n.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${n.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends Jg{constructor(){super(...arguments),this.name="get_board_activity",this.type=qn.READ,this.annotations=Qg({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 HN}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-NN.MONTH30Days),n=e?.fromDate||a.toISOString(),i=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:n,toDate:i,limit:this.defaultLimit,page:1},r=await this.mondayApi.request(qN,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 (${n} to ${i}).`};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 ${n} to ${i} (${s.length} entries):\n\n${p}`}}},class extends Jg{constructor(){super(...arguments),this.name="get_board_info",this.type=qn.READ,this.annotations=Qg({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return XN}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(zN,t),n=a.boards?.[0];if(!n)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const i=await this.getSubItemsBoardAsync(n);return{content:JSON.stringify(WN(n,i),null,2)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===vN.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],n=await this.mondayApi.request(GN,{boardId:a});return n.boards?.[0]??null}},class extends Jg{constructor(){super(...arguments),this.name="get_full_board_data",this.type=qn.READ,this.annotations=Qg({title:"Get Full Board Data",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"INTERNAL USE ONLY - DO NOT CALL THIS TOOL DIRECTLY. This tool is exclusively triggered by UI components and should never be invoked directly by the agent."}getInputSchema(){return MN}async executeInternal(e){try{const t={boardId:e.boardId.toString(),itemsLimit:7},a=await this.mondayApi.request(UN,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const n=a.boards[0],i=new Set;n.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&i.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&i.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&i.add(e.id)}))}}))}));let o=[];if(i.size>0){const e={userIds:Array.from(i)},t=await this.mondayApi.request(BN,e);o=t.users?.filter((e=>null!==e))||[]}const r=new Map(o.map((e=>[e.id,e]))),s={board:{id:n.id,name:n.name,columns:n.columns,items:n.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&r.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&r.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:o,stats:{total_items:n.items_page.items.length,total_updates:n.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:o.length}};return{content:JSON.stringify(s,null,2)}}catch(e){AN(e,"get full board data")}}},class extends Jg{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=qn.READ,this.annotations=Qg({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Tool to fetch users and/or teams data. \n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs or names when available\n 2. If no ids available, use name search if possible (USERS ONLY)\n 3. Use 'getMe: true' to get current user information\n 4. AVOID broad queries (no parameters) - use only as last resort\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe - STANDALONE\n 2. userIds\n 3. name - STANDALONE (USERS ONLY, NOT for teams)\n 4. teamIds + teamsOnly\n 5. No parameters - LAST RESORT\n\n CRITICAL USAGE RULES:\n • userIds + teamIds requires explicit includeTeams: true flag\n • includeTeams: true fetches both users and teams, do not use this to fetch a specific user's teams rather fetch that user by id and you will get their team memberships.\n • name parameter is for USER search ONLY - it cannot be used to search for teams. Use teamIds to fetch specific teams."}getInputSchema(){return DA}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,n=e.includeTeams||!1,i=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||n||i||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(xA);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]};return{content:IA(s)}}if(r){if(t||a||n||i||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(_A,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(i&&n)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>SA)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(a&&e.teamIds&&e.teamIds.length>NA)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(i||!t&&a&&!n)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(wA,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(bA,t)}else if(n){const t={userIds:e.userIds,teamIds:e.teamIds,limit:AA};s=await this.mondayApi.request(yA,t)}else if(t){const t={userIds:e.userIds,limit:AA};s=await this.mondayApi.request(vA,t)}else{const e={userIds:void 0,limit:AA};s=await this.mondayApi.request(gA,e)}return{content:IA(s)}}},GI,class extends Jg{constructor(){super(...arguments),this.name="move_item_to_group",this.type=qn.WRITE,this.annotations=Qg({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 OA}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(OI,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends Jg{constructor(){super(...arguments),this.name="create_board",this.type=qn.WRITE,this.annotations=Qg({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return WI}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(kI,t);return{content:`Board ${a.create_board?.id} successfully created`}}},class extends Jg{constructor(){super(...arguments),this.name="create_form",this.type=qn.WRITE,this.annotations=Qg({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 TS}async executeInternal(e){const t={destination_workspace_id:e.destination_workspace_id,destination_folder_id:e.destination_folder_id,destination_folder_name:e.destination_folder_name,board_kind:e.board_kind,destination_name:e.destination_name,board_owner_ids:e.board_owner_ids,board_owner_team_ids:e.board_owner_team_ids,board_subscriber_ids:e.board_subscriber_ids,board_subscriber_teams_ids:e.board_subscriber_teams_ids},a=await this.mondayApi.request(aS,t);return{content:`Form created successfully. Board ID: ${a.create_form?.boardId}, Token: ${a.create_form?.token}`}}},class extends Jg{constructor(){super(...arguments),this.name="update_form",this.type=qn.WRITE,this.annotations=Qg({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new hN(this.mondayApi),this.actionHandlers=new Map([[zS.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[zS.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[zS.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[zS.activate,this.helpers.activateForm.bind(this.helpers)],[zS.createTag,this.helpers.createTag.bind(this.helpers)],[zS.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[zS.updateTag,this.helpers.updateTag.bind(this.helpers)],[zS.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[zS.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[zS.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[zS.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[zS.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 uN}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?(HS(e,"tag",uN.tag),HS(e,"form",uN.form),await t(e)):{content:"Received an invalid action for the update form tool."}}},class extends Jg{constructor(){super(...arguments),this.name="get_form",this.type=qn.READ,this.annotations=Qg({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 fN}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(nS,t);return a.form?{content:`The form with the token ${e.formToken} is: ${JSON.stringify(a.form,null,2)}`}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends Jg{constructor(){super(...arguments),this.name="form_questions_editor",this.type=qn.WRITE,this.annotations=Qg({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new qS(this.mondayApi),this.actionHandlers=new Map([[US.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[US.Update,this.helpers.updateQuestion.bind(this.helpers)],[US.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return MS}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?(HS(e,"question",MS.question),await t(e)):{content:`Unknown action: ${e.action}`}}},class extends Jg{constructor(){super(...arguments),this.name="create_column",this.type=qn.WRITE,this.annotations=Qg({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?gN:yN}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},n=await this.mondayApi.request(RI,a);return{content:`Column ${n.create_column?.id} successfully created`}}},class extends Jg{constructor(){super(...arguments),this.name="create_group",this.type=qn.WRITE,this.annotations=Qg({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 xN}async executeInternal(e){const t={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},a=await this.mondayApi.request(wN,t);return{content:`Group "${a.create_group?.title}" (ID: ${a.create_group?.id}) successfully created`}}},class extends Jg{constructor(){super(...arguments),this.name="delete_column",this.type=qn.WRITE,this.annotations=Qg({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?FN:LN}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(CI,t);return{content:`Column ${a.delete_column?.id} successfully deleted`}}},qI,class extends Jg{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=qn.ALL_API,this.annotations=Qg({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 oA}async executeInternal(e){try{const t=await this.mondayApi.request(PI),a=e?.operationType,n=t.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",i=t.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=t.__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 a&&"read"!==a||(s+=`- Query Type: ${t.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${n}\n\n`),a&&"write"!==a||(s+=`- Mutation Type: ${t.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${i}\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 Jg{constructor(){super(...arguments),this.name="get_column_type_info",this.type=qn.READ,this.annotations=Qg({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 iA}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(nA,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const n={schema:a.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(n,null,2)}`}}},class extends Jg{constructor(){super(...arguments),this.name="get_type_details",this.type=qn.ALL_API,this.annotations=Qg({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 rA}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const a=(t=e.typeName,II`
|
|
1466
|
+
`,eO={};const tO=[class extends Jg{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=qn.READ,this.annotations=Qg({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 eO}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(ZD,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${AD} No boards found in your account. Please verify you have access to monday.com boards.`};const a=this.extractBoardPairs(t);if(0===a.length)return{content:this.generateNotFoundMessage(t.length)};return{content:this.generateReport(a)}}catch(e){return{content:`${PD} 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,t){return`### Pair ${t+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 t=e.length>1?this.generateMultiplePairsWarning(e.length):"",a=e.map(((e,t)=>this.generatePairDetails(e,t))).join(""),n=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${t}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${a}${n}`}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,t,a){return{id:e,name:t?.name||a,workspaceId:t?.workspace?.id||"unknown",workspaceName:t?.workspace?.name||"Unknown"}}processSprintsBoard(e,t,a){const n=KD(e,SD.SPRINT_TASKS);if(!n)return;const i=YD(n);if(!i)return;const o=`${e.id}:${i}`;if(a.has(o))return;const r=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(i,r,`Tasks Board ${i}`)})}processTasksBoard(e,t,a){const n=KD(e,FD);if(!n)return;const i=YD(n);if(!i)return;const o=`${i}:${e.id}`;if(a.has(o))return;const r=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(i,r,`Sprints Board ${i}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const n of e)n.columns&&(GD(n)&&this.processSprintsBoard(n,a,t),WD(n)&&this.processTasksBoard(n,a,t));return Array.from(t.values())}},class extends Jg{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=qn.READ,this.annotations=Qg({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 XD}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},n=await this.mondayApi.request(JD,a),i=n.boards?.[0],o=i?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${PD} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const t={boardId:e.toString()},a=await this.mondayApi.request(AI,t),n=a.boards?.[0];if(!n)return{success:!1,error:`${AD} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const i=n.columns||[],o=this.validateSprintsBoardSchemaFromColumns(i);return o.isValid?{success:!0}:{success:!1,error:`${$D} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${PD} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const t=new Set(e.filter((e=>null!==e)).map((e=>e.id))),a=Object.values(SD),n=HD(t,a);if(!n.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return n.missingColumns.forEach((t=>{const a=(e=>LD[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let t="# Sprints Metadata Report\n\n";return t+=`**Total Sprints:** ${e.length}\n\n`,t+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",t+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const a=e.name||"Unknown",n=e.id,i=BD(e,ND.SPRINT_ACTIVATION),o=BD(e,ND.SPRINT_COMPLETION),r=MD(e,ND.SPRINT_START_DATE),s=MD(e,ND.SPRINT_END_DATE),p=((e,t)=>{const a=UD(e,t);if("TimelineValue"===a?.__typename&&a.from&&a.to)return{from:a.from.split("T")[0],to:a.to.split("T")[0]};return null})(e,ND.SPRINT_TIMELINE),d=qD(e,ND.SPRINT_SUMMARY);let l=jD.Planned;o?l=jD.Completed:(i||r)&&(l=jD.Active);const c=p?`${p.from} to ${p.to}`:"Not set";t+=`| ${a} | ${n} | ${l} | ${c} | ${r||"Not started"} | ${s||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),t+="\n## Status Definitions:\n",t+=`- **${jD.Planned}**: Sprint not yet started (no activation, no start date)\n`,t+=`- **${jD.Active}**: Sprint is active (activated but not completed)\n`,t+=`- **${jD.Completed}**: Sprint is finished\n\n`,t}},class extends Jg{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=qn.READ,this.annotations=Qg({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 QD}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${PD} Unknown error occurred while getting sprint metadata`};const a=await this.readSprintSummaryDocument(t.documentObjectId);return a.success?{content:a.content}:{content:a.error||`${PD} Unknown error occurred while reading document content`}}catch(e){return{content:`${PD} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const t={ids:[String(e)]},a=(await this.mondayApi.request(ID,t)).items||[];if(0===a.length)return{success:!1,error:`${DD} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const n=a[0];if(!n)return{success:!1,error:`${DD} Sprint with ID ${e} not found.`};const i=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),n=[...Object.values(SD),...t];return HD(a,n)})(n,[ND.SPRINT_SUMMARY]);if(!i.isValid)return{success:!1,error:`${$D} Sprint item is missing required columns: ${i.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=qD(n,ND.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:n.name}:{success:!1,error:`${OD} No sprint summary document found for sprint "${n.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${PD} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const t={object_ids:[e],limit:1},a=(await this.mondayApi.request(VI,t)).docs||[];if(0===a.length)return{success:!1,error:`${OD} Document with object ID ${e} not found or not accessible.`};const n=a[0];if(!n||!n.id)return{success:!1,error:`${kD} Document data is invalid for object ID ${e}.`};const i={docId:n.id,blockIds:[]},o=await this.mondayApi.request(UI,i);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${CD} 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:`${RD} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${PD} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],aO=[class extends Jg{constructor(){super(...arguments),this.name="delete_item",this.type=qn.WRITE,this.annotations=Qg({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return VN}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(SI,t);return{content:`Item ${a.delete_item?.id} successfully deleted`}}},class extends Jg{constructor(){super(...arguments),this.name="get_board_items_page",this.type=qn.READ,this.annotations=Qg({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 aA}async executeInternal(e){const t=!e.cursor;if(t&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch{zS(e,"filters",aA.filters),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems};zS(e,"filters",aA.filters),zS(e,"orderBy",aA.orderBy),t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const n=await this.mondayApi.request(eA,a),i=this.mapResult(n,e);return{content:JSON.stringify(i,null,2)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:vE.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],n=a?.items_page,i=n?.items||[];return{board:{id:a?.id,name:a?.name},items:i.map((e=>this.mapItem(e,t))),pagination:{has_more:!!n?.cursor,nextCursor:n?.cursor||null,count:i.length}}}mapItem(e,t){const a={id:e.id,name:e.name,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case gN.BoardRelation:return e.linked_items;case gN.Formula:return e.display_value;case gN.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const t={board_ids:[e.boardId.toString()],searchTerm:e.searchTerm},a=await this.mondayApi.request(tA,t),n=a.search_items?.results?.map((e=>Number(e.data.id)))??[];if(0===n.length)throw new Error("No items found for search term or new search is not enabled for this account");const i=e.itemIds??[];if(0===i.length)return n;const o=new Set(i);return n.filter((e=>o.has(e)))}},class extends Jg{constructor(){super(...arguments),this.name="create_item",this.type=qn.WRITE,this.annotations=Qg({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?ON:kN}async executeInternal(e){const t=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,t):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,t)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},n=await this.mondayApi.request(TN,a);if(!n.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let i;try{i=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...i,name:e.name},r=new WI(this.mondayApi,this.apiToken,{boardId:t}),s=await r.execute({itemId:parseInt(n.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 ${n.duplicate_item.id} successfully duplicated from ${e.duplicateFromItemId} and updated`}}catch(e){DN(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const a=await this.mondayApi.request(IN,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:`Subitem ${a.create_subitem.id} successfully created under parent item ${e.parentItemId}`}}catch(e){DN(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},n=await this.mondayApi.request(NI,a);return{content:`Item ${n.create_item?.id} successfully created`}}catch(e){DN(e,"create item")}}},class extends Jg{constructor(){super(...arguments),this.name="create_update",this.type=qn.WRITE,this.annotations=Qg({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update."}getInputSchema(){return FN}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),n=$N.safeParse(a);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);t=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},n=await this.mondayApi.request(CN,a);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${n.create_update.id} successfully created on item ${e.itemId}`}}catch(e){DN(e,"create update")}}},class extends Jg{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=qn.WRITE,this.annotations=Qg({title:"Create Update in Monday, after calling this tool you should",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. After calling this tool you should call the full board data tool to get data, and immediately after that call the show table tool to show the data from that tool. IMPORTANT: You MUST use the COMPLETE data from the full board data tool - do NOT cut, truncate, or omit any data. Pass the entire dataset to the show table tool."}getInputSchema(){return xD}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),n=_D.safeParse(a);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);t=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},n=await this.mondayApi.request(CN,a);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${n.create_update.id} successfully created on item ${e.itemId}. Now we want to show the updated data, so call the full board data tool to get data, and then immediately after that call the show table tool to show the data from that tool. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received.`}}catch(e){DN(e,"create update")}}},class extends Jg{constructor(){super(...arguments),this.name="get_board_schema",this.type=qn.READ,this.annotations=Qg({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 nA}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},n=await this.mondayApi.request(AI,a);return{content:`The current schema of the board ${t} is: \n \n\nColumns:\n ${n.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${n.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends Jg{constructor(){super(...arguments),this.name="get_board_activity",this.type=qn.READ,this.annotations=Qg({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 zN}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-AN.MONTH30Days),n=e?.fromDate||a.toISOString(),i=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:n,toDate:i,limit:this.defaultLimit,page:1},r=await this.mondayApi.request(HN,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 (${n} to ${i}).`};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 ${n} to ${i} (${s.length} entries):\n\n${p}`}}},class extends Jg{constructor(){super(...arguments),this.name="get_board_info",this.type=qn.READ,this.annotations=Qg({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration"}getInputSchema(){return ZN}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(GN,t),n=a.boards?.[0];if(!n)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const i=await this.getSubItemsBoardAsync(n);return{content:JSON.stringify(YN(n,i),null,2)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===gN.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],n=await this.mondayApi.request(WN,{boardId:a});return n.boards?.[0]??null}},class extends Jg{constructor(){super(...arguments),this.name="get_full_board_data",this.type=qn.READ,this.annotations=Qg({title:"Get Full Board Data",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"INTERNAL USE ONLY - DO NOT CALL THIS TOOL DIRECTLY. This tool is exclusively triggered by UI components and should never be invoked directly by the agent."}getInputSchema(){return qN}async executeInternal(e){try{const t={boardId:e.boardId.toString(),itemsLimit:7},a=await this.mondayApi.request(BN,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const n=a.boards[0],i=new Set;n.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&i.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&i.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&i.add(e.id)}))}}))}));let o=[];if(i.size>0){const e={userIds:Array.from(i)},t=await this.mondayApi.request(MN,e);o=t.users?.filter((e=>null!==e))||[]}const r=new Map(o.map((e=>[e.id,e]))),s={board:{id:n.id,name:n.name,columns:n.columns,items:n.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&r.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&r.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:o,stats:{total_items:n.items_page.items.length,total_updates:n.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:o.length}};return{content:JSON.stringify(s,null,2)}}catch(e){DN(e,"get full board data")}}},class extends Jg{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=qn.READ,this.annotations=Qg({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Tool to fetch users and/or teams data. \n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs or names when available\n 2. If no ids available, use name search if possible (USERS ONLY)\n 3. Use 'getMe: true' to get current user information\n 4. AVOID broad queries (no parameters) - use only as last resort\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe - STANDALONE\n 2. userIds\n 3. name - STANDALONE (USERS ONLY, NOT for teams)\n 4. teamIds + teamsOnly\n 5. No parameters - LAST RESORT\n\n CRITICAL USAGE RULES:\n • userIds + teamIds requires explicit includeTeams: true flag\n • includeTeams: true fetches both users and teams, do not use this to fetch a specific user's teams rather fetch that user by id and you will get their team memberships.\n • name parameter is for USER search ONLY - it cannot be used to search for teams. Use teamIds to fetch specific teams."}getInputSchema(){return OA}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,n=e.includeTeams||!1,i=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||n||i||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(EA);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]};return{content:SA(s)}}if(r){if(t||a||n||i||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(xA,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(i&&n)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>NA)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(a&&e.teamIds&&e.teamIds.length>AA)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(i||!t&&a&&!n)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(_A,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(wA,t)}else if(n){const t={userIds:e.userIds,teamIds:e.teamIds,limit:DA};s=await this.mondayApi.request(bA,t)}else if(t){const t={userIds:e.userIds,limit:DA};s=await this.mondayApi.request(gA,t)}else{const e={userIds:void 0,limit:DA};s=await this.mondayApi.request(yA,e)}return{content:SA(s)}}},WI,class extends Jg{constructor(){super(...arguments),this.name="move_item_to_group",this.type=qn.WRITE,this.annotations=Qg({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 kA}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(OI,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends Jg{constructor(){super(...arguments),this.name="create_board",this.type=qn.WRITE,this.annotations=Qg({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return YI}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(kI,t);return{content:`Board ${a.create_board?.id} successfully created`}}},class extends Jg{constructor(){super(...arguments),this.name="create_form",this.type=qn.WRITE,this.annotations=Qg({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 IS}async executeInternal(e){const t={destination_workspace_id:e.destination_workspace_id,destination_folder_id:e.destination_folder_id,destination_folder_name:e.destination_folder_name,board_kind:e.board_kind,destination_name:e.destination_name,board_owner_ids:e.board_owner_ids,board_owner_team_ids:e.board_owner_team_ids,board_subscriber_ids:e.board_subscriber_ids,board_subscriber_teams_ids:e.board_subscriber_teams_ids},a=await this.mondayApi.request(nS,t);return{content:`Form created successfully. Board ID: ${a.create_form?.boardId}, Token: ${a.create_form?.token}`}}},class extends Jg{constructor(){super(...arguments),this.name="update_form",this.type=qn.WRITE,this.annotations=Qg({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new fN(this.mondayApi),this.actionHandlers=new Map([[GS.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[GS.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[GS.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[GS.activate,this.helpers.activateForm.bind(this.helpers)],[GS.createTag,this.helpers.createTag.bind(this.helpers)],[GS.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[GS.updateTag,this.helpers.updateTag.bind(this.helpers)],[GS.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[GS.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[GS.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[GS.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[GS.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 hN}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?(zS(e,"tag",hN.tag),zS(e,"form",hN.form),await t(e)):{content:"Received an invalid action for the update form tool."}}},class extends Jg{constructor(){super(...arguments),this.name="get_form",this.type=qn.READ,this.annotations=Qg({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 vN}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(iS,t);return a.form?{content:`The form with the token ${e.formToken} is: ${JSON.stringify(a.form,null,2)}`}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends Jg{constructor(){super(...arguments),this.name="form_questions_editor",this.type=qn.WRITE,this.annotations=Qg({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new HS(this.mondayApi),this.actionHandlers=new Map([[BS.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[BS.Update,this.helpers.updateQuestion.bind(this.helpers)],[BS.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return qS}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?(zS(e,"question",qS.question),await t(e)):{content:`Unknown action: ${e.action}`}}},class extends Jg{constructor(){super(...arguments),this.name="create_column",this.type=qn.WRITE,this.annotations=Qg({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?yN:bN}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},n=await this.mondayApi.request(RI,a);return{content:`Column ${n.create_column?.id} successfully created`}}},class extends Jg{constructor(){super(...arguments),this.name="create_group",this.type=qn.WRITE,this.annotations=Qg({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 EN}async executeInternal(e){const t={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},a=await this.mondayApi.request(_N,t);return{content:`Group "${a.create_group?.title}" (ID: ${a.create_group?.id}) successfully created`}}},class extends Jg{constructor(){super(...arguments),this.name="delete_column",this.type=qn.WRITE,this.annotations=Qg({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?LN:jN}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(CI,t);return{content:`Column ${a.delete_column?.id} successfully deleted`}}},HI,class extends Jg{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=qn.ALL_API,this.annotations=Qg({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 rA}async executeInternal(e){try{const t=await this.mondayApi.request(PI),a=e?.operationType,n=t.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",i=t.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=t.__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 a&&"read"!==a||(s+=`- Query Type: ${t.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${n}\n\n`),a&&"write"!==a||(s+=`- Mutation Type: ${t.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${i}\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 Jg{constructor(){super(...arguments),this.name="get_column_type_info",this.type=qn.READ,this.annotations=Qg({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 oA}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(iA,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const n={schema:a.get_column_type_schema};return{content:`Column Type Information for "${e.columnType}":\n\n${JSON.stringify(n,null,2)}`}}},class extends Jg{constructor(){super(...arguments),this.name="get_type_details",this.type=qn.ALL_API,this.annotations=Qg({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 sA}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const a=(t=e.typeName,II`
|
|
1467
1467
|
query getTypeDetails {
|
|
1468
1468
|
__type(name: "${t}") {
|
|
1469
1469
|
name
|
|
@@ -1551,5 +1551,5 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1551
1551
|
}
|
|
1552
1552
|
}
|
|
1553
1553
|
}
|
|
1554
|
-
`),n=await this.mondayApi.request(a);if(!n.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let i=`## Type: ${n.__type.name||"Unnamed"} ${e.typeName===n.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${n.__type.kind}\n${n.__type.description?`Description: ${n.__type.description}`:""}\n\n`;return n.__type.fields&&n.__type.fields.length>0&&(i+="## Fields\n",n.__type.fields.forEach((e=>{const t=sA(e.type);i+=`- ${e.name}: ${t}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(i+=" Arguments:\n",e.args.forEach((e=>{const t=sA(e.type);i+=` - ${e.name}: ${t}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),i+="\n"),n.__type.inputFields&&n.__type.inputFields.length>0&&(i+="## Input Fields\n",n.__type.inputFields.forEach((e=>{const t=sA(e.type);i+=`- ${e.name}: ${t}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),i+="\n"),n.__type.interfaces&&n.__type.interfaces.length>0&&(i+="## Implements\n",n.__type.interfaces.forEach((e=>{i+=`- ${e.name}\n`})),i+="\n"),n.__type.enumValues&&n.__type.enumValues.length>0&&(i+="## Enum Values\n",n.__type.enumValues.forEach((e=>{i+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),i+="\n"),n.__type.possibleTypes&&n.__type.possibleTypes.length>0&&(i+="## Possible Types\n",n.__type.possibleTypes.forEach((e=>{i+=`- ${e.name}\n`}))),i+=`\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\\": \\"${n.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:i}}catch(e){const t=e instanceof Error?e.message:"Unknown error",a=t.includes("JSON");return{content:`Error fetching type details: ${t}${a?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var t}},class extends Jg{constructor(){super(...arguments),this.name="create_custom_activity",this.type=qn.WRITE,this.annotations=Qg({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return bN}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(FI,t),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends Jg{constructor(){super(...arguments),this.name="create_timeline_item",this.type=qn.WRITE,this.annotations=Qg({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return kN}async executeInternal(e){const t={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(t.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const a=await this.mondayApi.request(LI,t);return{content:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends Jg{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=qn.READ,this.annotations=Qg({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return VN}async executeInternal(e){const t=await this.mondayApi.request(jI);if(!t.custom_activity||0===t.custom_activity.length)return{content:"No custom activities found"};const a=t.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${a.length} custom activities: ${JSON.stringify(a,null,2)}`}}},class extends Jg{constructor(){super(...arguments),this.name="read_docs",this.type=qn.READ,this.annotations=Qg({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 kA}async executeInternal(e){try{let t,a,n;switch(e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":n=e.ids}const i={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:n};let o=await this.mondayApi.request(VI,i);if((!o.docs||0===o.docs.length)&&t){const a={ids:void 0,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:n};o=await this.mondayApi.request(VI,a)}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,i),s=this.shouldSuggestPagination(o.docs.length,i.limit||25,i.page||1);return{content:r.content+s}}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}shouldSuggestPagination(e,t,a){return e===t?`\n\n🔄 PAGINATION SUGGESTION: You received exactly ${t} documents, which suggests there may be more. Consider calling this tool again with page: ${a+1} to get additional documents.`:""}async enrichDocsWithMarkdown(e,t){const a=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t="";try{const a={docId:e.id},n=await this.mondayApi.request(UI,a);t=n.export_markdown_from_doc.success&&n.export_markdown_from_doc.markdown?n.export_markdown_from_doc.markdown:`Error getting markdown: ${n.export_markdown_from_doc.error||"Unknown error"}`}catch(e){t=`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:t}}))),n=t.page||1,i=t.limit||25,o=a.length,r=o===i;return{content:`Successfully retrieved ${a.length} document${1===a.length?"":"s"}.\n\nPAGINATION INFO:\n- Current page: ${n}\n- Documents per page: ${i}\n- Documents in this response: ${o}\n- Has more pages: ${r?"YES - call again with page: "+(n+1):"NO"}\n\nDOCUMENTS:\n${JSON.stringify(a,null,2)}`}}},class extends Jg{constructor(){super(...arguments),this.name="workspace_info",this.type=qn.READ,this.annotations=Qg({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 RA}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(BI,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const n=function(e){const{workspaces:t,boards:a,docs:n,folders:i}=e,o=t?.[0];if(!o)throw new Error("No workspace found");const r=new Map((i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),s=[];(a||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.board_folder_id&&r.has(e.board_folder_id)?r.get(e.board_folder_id).boards.push(t):s.push(t)}));const p=[];return(n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.doc_folder_id&&r.has(e.doc_folder_id)?r.get(e.doc_folder_id).docs.push(t):p.push(t)})),{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}}}(a);return{content:`Workspace Information:\n\n**Workspace:** ${n.workspace.name} (ID: ${n.workspace.id})\n- Description: ${n.workspace.description||"No description"}\n- Kind: ${n.workspace.kind}\n- State: ${n.workspace.state}\n- Default Workspace: ${n.workspace.is_default_workspace?"Yes":"No"}\n- Created: ${n.workspace.created_at}\n- Owners/Subscribers: ${n.workspace.owners_subscribers.length} users\n\n**Folders (${n.folders.length}):**\n${n.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 (${n.root_items.boards.length}): ${n.root_items.boards.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n- Docs (${n.root_items.docs.length}): ${n.root_items.docs.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n\n**Summary:**\n- Total Folders: ${n.folders.length}\n- Total Boards: ${n.folders.reduce(((e,t)=>e+t.boards.length),0)+n.root_items.boards.length}\n- Total Docs: ${n.folders.reduce(((e,t)=>e+t.docs.length),0)+n.root_items.docs.length}\n\n${JSON.stringify(n,null,2)}`}}},class extends Jg{constructor(){super(...arguments),this.name="list_workspaces",this.type=qn.READ,this.annotations=Qg({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 FA}async executeInternal(e){const t=e.searchTerm?1e4:e.limit,a=e.searchTerm?1:e.page;let n=null;if(e.searchTerm&&(n=$A(e.searchTerm),0===n.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const i={limit:t,page:a},o=await this.mondayApi.request(CA,i),r=o.workspaces?.filter((e=>e));if(!r||0===r.length)return{content:"No workspaces found."};const s=n&&r.length<=PA,p=this.filterWorkspacesIfNeeded(n,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 t=e.description?` - ${e.description}`:"";return`• **${e.name}** (ID: ${e.id})${t}`})).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,t,a){if(!e||t.length<=PA)return t;const n=(a.page-1)*a.limit,i=n+a.limit;return t.filter((t=>$A(t.name).includes(e))).slice(n,i)}},class extends Jg{constructor(){super(...arguments),this.name="create_doc",this.type=qn.WRITE,this.annotations=Qg({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 qA}async executeInternal(e){const t=MA.safeParse({...e,type:e.location});if(!t.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const a=t.data;try{let t,n;if(a.type===BA.enum.workspace){const i={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||bx.Public,folder_id:a.folder_id?.toString()}}},o=await this.mondayApi.request(jA,i);t=o?.create_doc?.id??void 0,n=o?.create_doc?.url??void 0}else if(a.type===BA.enum.item){const i={itemId:a.item_id.toString()},o=await this.mondayApi.request(LA,i),r=o.items?.[0];if(!r)return{content:`Error: Item with id ${a.item_id} not found.`};const s=r.board?.id,p=r.board?.columns?.find((e=>e&&e.type===vN.Doc));let d=a.column_id;if(!d)if(p)d=p.id;else{const e={boardId:s.toString(),columnType:vN.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(RI,e);if(d=t?.create_column?.id,!d)return{content:"Error: Failed to create doc column."}}const l={location:{board:{item_id:a.item_id.toString(),column_id:d}}},c=await this.mondayApi.request(jA,l);if(t=c.create_doc?.id??void 0,n=c.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(UA,a)}catch(e){console.warn("Failed to update doc name:",e)}}if(!t)return{content:"Error: Failed to create document."};const i={docId:t,markdown:e.markdown},o=await this.mondayApi.request(VA,i),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: ${t}). ${n?`\n\nURL: ${n}`:""}`}:{content:`Document ${t} 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 Jg{constructor(){super(...arguments),this.name="update_workspace",this.type=qn.WRITE,this.annotations=Qg({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return QA}async executeInternal(e){const t={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},a=await this.mondayApi.request(KA,t);return{content:`Workspace ${a.update_workspace?.id} successfully updated`}}},class extends Jg{constructor(){super(...arguments),this.name="update_folder",this.type=qn.WRITE,this.annotations=Qg({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return XA}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:n}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const i={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:t?{position_is_after:n,position_object_id:t,position_object_type:a}:void 0},o=await this.mondayApi.request(JA,i);return{content:`Folder ${o.update_folder?.id} successfully updated`}}},class extends Jg{constructor(){super(...arguments),this.name="create_workspace",this.type=qn.WRITE,this.annotations=Qg({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return eD}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(ZA,t);return{content:`Workspace ${a.create_workspace?.id} successfully created`}}},class extends Jg{constructor(){super(...arguments),this.name="create_folder",this.type=qn.WRITE,this.annotations=Qg({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return aD}async executeInternal(e){const t={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},a=await this.mondayApi.request(tD,t);return{content:`Folder ${a.create_folder?.id} successfully created`}}},class extends Jg{constructor(){super(...arguments),this.name="move_object",this.type=qn.WRITE,this.annotations=Qg({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 oD}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const p={folderId:t,position:a?{position_is_after:i,position_object_id:a,position_object_type:n}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},d=await this.mondayApi.request(JA,p);return{content:`Object ${d.update_folder?.id} successfully moved`}}async executeUpdateBoardHierarchy(e){const{id:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const p={boardId:t,attributes:{position:a?{position_is_after:i,position_object_id:a,position_object_type:n}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(nD,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:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const p={overviewId:t,attributes:{position:a?{position_is_after:i,position_object_id:a,position_object_type:n}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(iD,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:t}=e;switch(t){case SE.Folder:return this.executeUpdateFolder(e);case SE.Board:return this.executeUpdateBoardHierarchy(e);case SE.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends Jg{constructor(){super(...arguments),this.name="create_dashboard",this.type=qn.WRITE,this.annotations=Qg({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 WA}async executeInternal(e){try{const t={name:e.name,workspace_id:e.workspace_id.toString(),board_ids:e.board_ids,kind:e.kind,board_folder_id:e.board_folder_id?.toString()},a=await this.mondayApi.request(HA,t);if(!a.create_dashboard)throw new Error("Failed to create dashboard");const n=a.create_dashboard,i=n.board_folder_id?` in folder ${n.board_folder_id}`:" in workspace root",o=n.kind===Lx.Public?"(visible to all workspace members)":"(private - visible only to invited users)";return{content:`✅ Dashboard "${n.name}" successfully created!\n\nDashboard Details:\n• ID: ${n.id}\n• Name: ${n.name}\n• Workspace ID: ${n.workspace_id}${i}\n• Visibility: ${n.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 t=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${t}`)}}},class extends Jg{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=qn.READ,this.annotations=Qg({title:"Get All Widget Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch complete JSON Schema 7 definitions for all available widget types in monday.com.\n \n This tool is essential before creating widgets as it provides:\n - Complete schema definitions for all supported widgets\n - Required and optional fields for each widget type\n - Data type specifications and validation rules\n - Detailed descriptions of widget capabilities\n \n Use this tool when you need to:\n - Understand widget configuration requirements before creating widgets\n - Validate widget settings against official schemas\n - Plan widget implementations with proper data structures\n \n The response includes JSON Schema 7 definitions that describe exactly what settings each widget type accepts."}getInputSchema(){return{}}async executeInternal(){try{const e={},t=await this.mondayApi.request(zA,e);if(!t.all_widgets_schema||0===t.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const a={};let n=0;for(const e of t.all_widgets_schema)if(e?.widget_type&&e?.schema){const t="string"==typeof e.schema?JSON.parse(e.schema):e.schema,i=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:i,schema:e.schema},n++}if(0===n)throw new Error("No valid widget schemas found in API response");return{content:`**Widget Schemas Retrieved Successfully!**\n\n🎯 **Available Widget Types** (${n} schemas found):\n${Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n")}\n\n**Complete JSON Schema 7 Definitions:**\n\n${JSON.stringify(a,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 t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends Jg{constructor(){super(...arguments),this.name="create_widget",this.type=qn.WRITE,this.annotations=Qg({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 YA}async executeInternal(e){if(HS(e,"settings",YA.settings),!e.settings)throw new Error("You must pass either settings or settingsStringified parameter");try{const t={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},a=await this.mondayApi.request(GA,t);if(!a.create_widget)throw new Error("Failed to create widget");const n=a.create_widget,i=n.parent?.kind===nT.Dashboard?`dashboard ${n.parent.id}`:`board view ${n.parent?.id}`;return{content:`✅ Widget "${n.name}" successfully created!\n\n**Widget Details:**\n• **ID**: ${n.id}\n• **Name**: ${n.name}\n• **Type**: ${n.kind}\n• **Location**: Placed in ${i}\n\n**Widget Configuration:**\n• **Settings Applied**: ${JSON.stringify(e.settings,null,2)}`}}catch(t){const a=t instanceof Error?t.message:String(t);throw new Error(`Failed to create ${e.widget_kind} widget: ${a}`)}}},class extends Jg{constructor(){super(...arguments),this.name="board_insights",this.type=qn.READ,this.annotations=Qg({title:"Get Board Insights",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool allows you to calculate insights about board's data by filtering, grouping and aggregating columns. For example, you can get the total number of items in a board, the number of items in each status, the number of items in each column, etc. Use this tool when you need to get a summary of the board's data, for example, you want to know the total number of items in a board, the number of items in each status, the number of items in each column, etc.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available.[IMPORTANT]: For some columns, human-friendly label is returned inside 'LABEL_<column_id' field. E.g. for column with id 'status_123' the label is returned inside 'LABEL_status_123' field."}getInputSchema(){return cD}async executeInternal(e){if(!e.aggregations&&!e.aggregationsStringified)return{content:'Input must contain either the "aggregations" field or the "aggregationsStringified" field.'};HS(e,"aggregations",cD.aggregations),HS(e,"filters",cD.filters),HS(e,"orderBy",cD.orderBy);const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],n=new Set(e.aggregations.filter((e=>e.function===ix.Label)).map((e=>e.columnId))),i=e.groupBy?.filter((e=>!n.has(e))).map((e=>({function:ix.Label,columnId:e})))??[],o=e.aggregations.concat(i).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return dD.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:nx.Function,function:(n=e.function,i=e.columnId,{function:n,params:n===ix.CountItems?[]:[{type:nx.Column,column:lD(i),as:i}]}),as:s}}var n,i;const o={type:nx.Column,column:lD(e.columnId),as:e.columnId};return a.some((t=>t.column_id===e.columnId))||a.push({column_id:e.columnId}),o}));return a.forEach((e=>{o.some((t=>t.as===e.column_id))||o.push({type:nx.Column,column:lD(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),n=function(e){if(!e.filters&&!e.orderBy)return;const t={};return e.filters&&(t.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),t.operator=e.filtersOperator),e.orderBy&&(t.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),t}(e),i=function(e){return{id:e.boardId.toString(),type:ax.Table}}(e),o={query:{from:i,query:n,select:t,group_by:a,limit:e.limit}},r=await this.mondayApi.request(rD,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const n=e.value;if(!n)return void(t[a]=null);const i=n.result??n.value_string??n.value_int??n.value_float??n.value_boolean??null;t[a]=i})),t}));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 Jg{constructor(){super(...arguments),this.name="search",this.type=qn.READ,this.annotations=Qg({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 yD}async executeInternal(e){const t={[vD.BOARD]:this.searchBoardsAsync.bind(this),[vD.DOCUMENTS]:this.searchDocsAsync.bind(this),[vD.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!t)throw new Error(`Unsupported search type: ${e.searchType}`);const a=await t(e),n={disclaimer:a.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",results:a.items};return{content:JSON.stringify(n,null,2)}}async searchFoldersAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(hD,t),n=this.searchAndVirtuallyPaginate(e,a.folders||[],(e=>e.name));return{items:n.items.map((e=>({id:fD.FOLDER+e.id,title:e.name}))),wasFiltered:n.wasFiltered}}async searchDocsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(uD,t),n=this.searchAndVirtuallyPaginate(e,a.docs||[],(e=>e.name));return{items:n.items.map((e=>({id:fD.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:n.wasFiltered}}async searchBoardsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(mD,t),n=this.searchAndVirtuallyPaginate(e,a.boards||[],(e=>e.name));return{items:n.items.map((e=>({id:fD.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:n.wasFiltered}}getPagingParamsForSearch(e){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?1e4:e.limit}}searchAndVirtuallyPaginate(e,t,a){if(t.length<=gD)return{items:t,wasFiltered:!1};const n=$A(e.searchTerm??""),i=(e.page-1)*e.limit,o=i+e.limit;return{items:t.filter((e=>$A(a(e)).includes(n))).slice(i,o),wasFiltered:!0}}}];var aO;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(aO||(aO={}));const nO=(e,t)=>{let a=[];t?.mode===aO.APPS?a=[...Kg]:t?.mode!==aO.API&&t?.mode||(a=[...tO,...eO]);const n=a.map((t=>((e,t)=>e.prototype instanceof Jg?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof hg?new e(t.apiToken):new e)(t,e)));return n.filter((e=>{if(!t)return e.type!==qn.ALL_API;if(t.mode===aO.API&&"only"===t.enableDynamicApiTools)return e.type===qn.ALL_API;let a=!1;return t.mode===aO.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===qn.ALL_API),t.readOnlyMode&&(a=a||e.type!==qn.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))};class iO{constructor(){this.dynamicTools=new Map}registerTool(e,t){const a=e.enabledByDefault??!0,n=a;this.dynamicTools.set(e.name,{instance:e,mcpTool:t,enabled:n,enabledByDefault:a}),a||t.disable()}enableTool(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabled||(t.mcpTool.enable(),t.enabled=!0),!0)}disableTool(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabled&&(t.mcpTool.disable(),t.enabled=!1),!0)}isToolEnabled(e){const t=this.dynamicTools.get(e);return!!t&&t.enabled}isToolEnabledByDefault(e){const t=this.dynamicTools.get(e);return!t||t.enabledByDefault}getToolsStatus(){const e={};return this.dynamicTools.forEach(((t,a)=>{e[a]=t.enabled})),e}getDynamicToolNames(){return Array.from(this.dynamicTools.keys())}getDetailedToolsStatus(){const e={};return this.dynamicTools.forEach(((t,a)=>{e[a]={enabled:t.enabled,enabledByDefault:t.enabledByDefault}})),e}resetToolToDefault(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabledByDefault&&!t.enabled?(t.mcpTool.enable(),t.enabled=!0,!0):!(!t.enabledByDefault&&t.enabled)||(t.mcpTool.disable(),t.enabled=!1,!0))}getAllDynamicTools(){return this.dynamicTools}clear(){this.dynamicTools.clear()}}class oO extends Ln{constructor(e){super({name:"monday.com",version:"1.0.0"},{capabilities:{tools:{listChanged:!0}}}),this.dynamicToolManager=new iO,this.toolInstances=[],this.managementTool=null,this.mondayApiClient=this.createApiClient(e),this.mondayApiToken=e.mondayApiToken,this.context=e.context,this.registerTools(e)}createApiClient(e){return new n({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 ED;e.setToolkitManager(this.dynamicToolManager),this.managementTool=e,this.registerSingleTool(this.managementTool)}initializeTools(e){const t={apiClient:this.mondayApiClient,apiToken:this.mondayApiToken,context:this.context};return nO(t,e.toolsConfiguration)}registerSingleTool(t){const a=t.getInputSchema(),n=this.registerTool(t.name,{...t,title:t.annotations?.title,description:t.getDescription(),inputSchema:a,annotations:t.annotations},(async(n,i)=>{try{let i;if(a){const o=e.object(a).safeParse(n);if(!o.success)throw new Error(`Invalid arguments: ${o.error.message}`);i=await t.execute(o.data)}else i=await t.execute();return this.formatToolResult(i.content)}catch(e){return this.handleToolError(e,t.name)}}));this.dynamicToolManager.registerTool(t,n)}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(),annotations:e.annotations,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(),annotations:e.annotations,handler:this.createMcpToolHandler(e)})))}createToolHandler(t){return async a=>{const n=t.getInputSchema();if(n){const i=e.object(n).safeParse(a);if(!i.success)throw new Error(`Invalid arguments: ${i.error.message}`);return(await t.execute(i.data)).content}return(await t.execute()).content}}createMcpToolHandler(t){return async(a,n)=>{try{const n=t.getInputSchema();if(n){const i=e.object(n).safeParse(a);if(!i.success)throw new Error(`Invalid arguments: ${i.error.message}`);const o=await t.execute(i.data);return{content:[{type:"text",text:String(o.content)}]}}{const e=await t.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,t){return{content:[{type:"text",text:`Failed to execute tool ${t}: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}}export{iO as DynamicToolManager,oO as MondayAgentToolkit};
|
|
1554
|
+
`),n=await this.mondayApi.request(a);if(!n.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let i=`## Type: ${n.__type.name||"Unnamed"} ${e.typeName===n.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${n.__type.kind}\n${n.__type.description?`Description: ${n.__type.description}`:""}\n\n`;return n.__type.fields&&n.__type.fields.length>0&&(i+="## Fields\n",n.__type.fields.forEach((e=>{const t=pA(e.type);i+=`- ${e.name}: ${t}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(i+=" Arguments:\n",e.args.forEach((e=>{const t=pA(e.type);i+=` - ${e.name}: ${t}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),i+="\n"),n.__type.inputFields&&n.__type.inputFields.length>0&&(i+="## Input Fields\n",n.__type.inputFields.forEach((e=>{const t=pA(e.type);i+=`- ${e.name}: ${t}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),i+="\n"),n.__type.interfaces&&n.__type.interfaces.length>0&&(i+="## Implements\n",n.__type.interfaces.forEach((e=>{i+=`- ${e.name}\n`})),i+="\n"),n.__type.enumValues&&n.__type.enumValues.length>0&&(i+="## Enum Values\n",n.__type.enumValues.forEach((e=>{i+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),i+="\n"),n.__type.possibleTypes&&n.__type.possibleTypes.length>0&&(i+="## Possible Types\n",n.__type.possibleTypes.forEach((e=>{i+=`- ${e.name}\n`}))),i+=`\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\\": \\"${n.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:i}}catch(e){const t=e instanceof Error?e.message:"Unknown error",a=t.includes("JSON");return{content:`Error fetching type details: ${t}${a?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var t}},class extends Jg{constructor(){super(...arguments),this.name="create_custom_activity",this.type=qn.WRITE,this.annotations=Qg({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return wN}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(FI,t),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends Jg{constructor(){super(...arguments),this.name="create_timeline_item",this.type=qn.WRITE,this.annotations=Qg({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return RN}async executeInternal(e){const t={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(t.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const a=await this.mondayApi.request(LI,t);return{content:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends Jg{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=qn.READ,this.annotations=Qg({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return UN}async executeInternal(e){const t=await this.mondayApi.request(jI);if(!t.custom_activity||0===t.custom_activity.length)return{content:"No custom activities found"};const a=t.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${a.length} custom activities: ${JSON.stringify(a,null,2)}`}}},class extends Jg{constructor(){super(...arguments),this.name="read_docs",this.type=qn.READ,this.annotations=Qg({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 RA}async executeInternal(e){try{let t,a,n;switch(e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":n=e.ids}const i={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:n};let o=await this.mondayApi.request(VI,i);if((!o.docs||0===o.docs.length)&&t){const a={ids:void 0,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:n};o=await this.mondayApi.request(VI,a)}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,i),s=this.shouldSuggestPagination(o.docs.length,i.limit||25,i.page||1);return{content:r.content+s}}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}shouldSuggestPagination(e,t,a){return e===t?`\n\n🔄 PAGINATION SUGGESTION: You received exactly ${t} documents, which suggests there may be more. Consider calling this tool again with page: ${a+1} to get additional documents.`:""}async enrichDocsWithMarkdown(e,t){const a=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t="";try{const a={docId:e.id},n=await this.mondayApi.request(UI,a);t=n.export_markdown_from_doc.success&&n.export_markdown_from_doc.markdown?n.export_markdown_from_doc.markdown:`Error getting markdown: ${n.export_markdown_from_doc.error||"Unknown error"}`}catch(e){t=`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:t}}))),n=t.page||1,i=t.limit||25,o=a.length,r=o===i;return{content:`Successfully retrieved ${a.length} document${1===a.length?"":"s"}.\n\nPAGINATION INFO:\n- Current page: ${n}\n- Documents per page: ${i}\n- Documents in this response: ${o}\n- Has more pages: ${r?"YES - call again with page: "+(n+1):"NO"}\n\nDOCUMENTS:\n${JSON.stringify(a,null,2)}`}}},class extends Jg{constructor(){super(...arguments),this.name="workspace_info",this.type=qn.READ,this.annotations=Qg({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 CA}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(BI,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const n=function(e){const{workspaces:t,boards:a,docs:n,folders:i}=e,o=t?.[0];if(!o)throw new Error("No workspace found");const r=new Map((i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),s=[];(a||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.board_folder_id&&r.has(e.board_folder_id)?r.get(e.board_folder_id).boards.push(t):s.push(t)}));const p=[];return(n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.doc_folder_id&&r.has(e.doc_folder_id)?r.get(e.doc_folder_id).docs.push(t):p.push(t)})),{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}}}(a);return{content:`Workspace Information:\n\n**Workspace:** ${n.workspace.name} (ID: ${n.workspace.id})\n- Description: ${n.workspace.description||"No description"}\n- Kind: ${n.workspace.kind}\n- State: ${n.workspace.state}\n- Default Workspace: ${n.workspace.is_default_workspace?"Yes":"No"}\n- Created: ${n.workspace.created_at}\n- Owners/Subscribers: ${n.workspace.owners_subscribers.length} users\n\n**Folders (${n.folders.length}):**\n${n.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 (${n.root_items.boards.length}): ${n.root_items.boards.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n- Docs (${n.root_items.docs.length}): ${n.root_items.docs.map((e=>`${e.name} (${e.id})`)).join(", ")||"None"}\n\n**Summary:**\n- Total Folders: ${n.folders.length}\n- Total Boards: ${n.folders.reduce(((e,t)=>e+t.boards.length),0)+n.root_items.boards.length}\n- Total Docs: ${n.folders.reduce(((e,t)=>e+t.docs.length),0)+n.root_items.docs.length}\n\n${JSON.stringify(n,null,2)}`}}},class extends Jg{constructor(){super(...arguments),this.name="list_workspaces",this.type=qn.READ,this.annotations=Qg({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 LA}async executeInternal(e){const t=e.searchTerm?1e4:e.limit,a=e.searchTerm?1:e.page;let n=null;if(e.searchTerm&&(n=FA(e.searchTerm),0===n.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const i={limit:t,page:a},o=await this.mondayApi.request(PA,i),r=o.workspaces?.filter((e=>e));if(!r||0===r.length)return{content:"No workspaces found."};const s=n&&r.length<=$A,p=this.filterWorkspacesIfNeeded(n,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 t=e.description?` - ${e.description}`:"";return`• **${e.name}** (ID: ${e.id})${t}`})).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,t,a){if(!e||t.length<=$A)return t;const n=(a.page-1)*a.limit,i=n+a.limit;return t.filter((t=>FA(t.name).includes(e))).slice(n,i)}},class extends Jg{constructor(){super(...arguments),this.name="create_doc",this.type=qn.WRITE,this.annotations=Qg({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 HA}async executeInternal(e){const t=qA.safeParse({...e,type:e.location});if(!t.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const a=t.data;try{let t,n;if(a.type===MA.enum.workspace){const i={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||bx.Public,folder_id:a.folder_id?.toString()}}},o=await this.mondayApi.request(VA,i);t=o?.create_doc?.id??void 0,n=o?.create_doc?.url??void 0}else if(a.type===MA.enum.item){const i={itemId:a.item_id.toString()},o=await this.mondayApi.request(jA,i),r=o.items?.[0];if(!r)return{content:`Error: Item with id ${a.item_id} not found.`};const s=r.board?.id,p=r.board?.columns?.find((e=>e&&e.type===gN.Doc));let d=a.column_id;if(!d)if(p)d=p.id;else{const e={boardId:s.toString(),columnType:gN.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(RI,e);if(d=t?.create_column?.id,!d)return{content:"Error: Failed to create doc column."}}const l={location:{board:{item_id:a.item_id.toString(),column_id:d}}},c=await this.mondayApi.request(VA,l);if(t=c.create_doc?.id??void 0,n=c.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(BA,a)}catch(e){console.warn("Failed to update doc name:",e)}}if(!t)return{content:"Error: Failed to create document."};const i={docId:t,markdown:e.markdown},o=await this.mondayApi.request(UA,i),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: ${t}). ${n?`\n\nURL: ${n}`:""}`}:{content:`Document ${t} 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 Jg{constructor(){super(...arguments),this.name="update_workspace",this.type=qn.WRITE,this.annotations=Qg({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return JA}async executeInternal(e){const t={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},a=await this.mondayApi.request(QA,t);return{content:`Workspace ${a.update_workspace?.id} successfully updated`}}},class extends Jg{constructor(){super(...arguments),this.name="update_folder",this.type=qn.WRITE,this.annotations=Qg({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return ZA}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:n}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const i={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:t?{position_is_after:n,position_object_id:t,position_object_type:a}:void 0},o=await this.mondayApi.request(XA,i);return{content:`Folder ${o.update_folder?.id} successfully updated`}}},class extends Jg{constructor(){super(...arguments),this.name="create_workspace",this.type=qn.WRITE,this.annotations=Qg({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return tD}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(eD,t);return{content:`Workspace ${a.create_workspace?.id} successfully created`}}},class extends Jg{constructor(){super(...arguments),this.name="create_folder",this.type=qn.WRITE,this.annotations=Qg({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return nD}async executeInternal(e){const t={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},a=await this.mondayApi.request(aD,t);return{content:`Folder ${a.create_folder?.id} successfully created`}}},class extends Jg{constructor(){super(...arguments),this.name="move_object",this.type=qn.WRITE,this.annotations=Qg({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 rD}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const p={folderId:t,position:a?{position_is_after:i,position_object_id:a,position_object_type:n}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},d=await this.mondayApi.request(XA,p);return{content:`Object ${d.update_folder?.id} successfully moved`}}async executeUpdateBoardHierarchy(e){const{id:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const p={boardId:t,attributes:{position:a?{position_is_after:i,position_object_id:a,position_object_type:n}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(iD,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:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const p={overviewId:t,attributes:{position:a?{position_is_after:i,position_object_id:a,position_object_type:n}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(oD,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:t}=e;switch(t){case SE.Folder:return this.executeUpdateFolder(e);case SE.Board:return this.executeUpdateBoardHierarchy(e);case SE.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends Jg{constructor(){super(...arguments),this.name="create_dashboard",this.type=qn.WRITE,this.annotations=Qg({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 YA}async executeInternal(e){try{const t={name:e.name,workspace_id:e.workspace_id.toString(),board_ids:e.board_ids,kind:e.kind,board_folder_id:e.board_folder_id?.toString()},a=await this.mondayApi.request(zA,t);if(!a.create_dashboard)throw new Error("Failed to create dashboard");const n=a.create_dashboard,i=n.board_folder_id?` in folder ${n.board_folder_id}`:" in workspace root",o=n.kind===Lx.Public?"(visible to all workspace members)":"(private - visible only to invited users)";return{content:`✅ Dashboard "${n.name}" successfully created!\n\nDashboard Details:\n• ID: ${n.id}\n• Name: ${n.name}\n• Workspace ID: ${n.workspace_id}${i}\n• Visibility: ${n.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 t=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${t}`)}}},class extends Jg{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=qn.READ,this.annotations=Qg({title:"Get All Widget Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch complete JSON Schema 7 definitions for all available widget types in monday.com.\n \n This tool is essential before creating widgets as it provides:\n - Complete schema definitions for all supported widgets\n - Required and optional fields for each widget type\n - Data type specifications and validation rules\n - Detailed descriptions of widget capabilities\n \n Use this tool when you need to:\n - Understand widget configuration requirements before creating widgets\n - Validate widget settings against official schemas\n - Plan widget implementations with proper data structures\n \n The response includes JSON Schema 7 definitions that describe exactly what settings each widget type accepts."}getInputSchema(){return{}}async executeInternal(){try{const e={},t=await this.mondayApi.request(GA,e);if(!t.all_widgets_schema||0===t.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const a={};let n=0;for(const e of t.all_widgets_schema)if(e?.widget_type&&e?.schema){const t="string"==typeof e.schema?JSON.parse(e.schema):e.schema,i=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:i,schema:e.schema},n++}if(0===n)throw new Error("No valid widget schemas found in API response");return{content:`**Widget Schemas Retrieved Successfully!**\n\n🎯 **Available Widget Types** (${n} schemas found):\n${Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n")}\n\n**Complete JSON Schema 7 Definitions:**\n\n${JSON.stringify(a,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 t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends Jg{constructor(){super(...arguments),this.name="create_widget",this.type=qn.WRITE,this.annotations=Qg({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 KA}async executeInternal(e){if(zS(e,"settings",KA.settings),!e.settings)throw new Error("You must pass either settings or settingsStringified parameter");try{const t={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},a=await this.mondayApi.request(WA,t);if(!a.create_widget)throw new Error("Failed to create widget");const n=a.create_widget,i=n.parent?.kind===nT.Dashboard?`dashboard ${n.parent.id}`:`board view ${n.parent?.id}`;return{content:`✅ Widget "${n.name}" successfully created!\n\n**Widget Details:**\n• **ID**: ${n.id}\n• **Name**: ${n.name}\n• **Type**: ${n.kind}\n• **Location**: Placed in ${i}\n\n**Widget Configuration:**\n• **Settings Applied**: ${JSON.stringify(e.settings,null,2)}`}}catch(t){const a=t instanceof Error?t.message:String(t);throw new Error(`Failed to create ${e.widget_kind} widget: ${a}`)}}},class extends Jg{constructor(){super(...arguments),this.name="board_insights",this.type=qn.READ,this.annotations=Qg({title:"Get Board Insights",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool allows you to calculate insights about board's data by filtering, grouping and aggregating columns. For example, you can get the total number of items in a board, the number of items in each status, the number of items in each column, etc. Use this tool when you need to get a summary of the board's data, for example, you want to know the total number of items in a board, the number of items in each status, the number of items in each column, etc.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available.[IMPORTANT]: For some columns, human-friendly label is returned inside 'LABEL_<column_id' field. E.g. for column with id 'status_123' the label is returned inside 'LABEL_status_123' field."}getInputSchema(){return mD}async executeInternal(e){if(!e.aggregations&&!e.aggregationsStringified)return{content:'Input must contain either the "aggregations" field or the "aggregationsStringified" field.'};zS(e,"aggregations",mD.aggregations),zS(e,"filters",mD.filters),zS(e,"orderBy",mD.orderBy);const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],n=new Set(e.aggregations.filter((e=>e.function===ix.Label)).map((e=>e.columnId))),i=e.groupBy?.filter((e=>!n.has(e))).map((e=>({function:ix.Label,columnId:e})))??[],o=e.aggregations.concat(i).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return lD.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:nx.Function,function:(n=e.function,i=e.columnId,{function:n,params:n===ix.CountItems?[]:[{type:nx.Column,column:cD(i),as:i}]}),as:s}}var n,i;const o={type:nx.Column,column:cD(e.columnId),as:e.columnId};return a.some((t=>t.column_id===e.columnId))||a.push({column_id:e.columnId}),o}));return a.forEach((e=>{o.some((t=>t.as===e.column_id))||o.push({type:nx.Column,column:cD(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),n=function(e){if(!e.filters&&!e.orderBy)return;const t={};return e.filters&&(t.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),t.operator=e.filtersOperator),e.orderBy&&(t.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),t}(e),i=function(e){return{id:e.boardId.toString(),type:ax.Table}}(e),o={query:{from:i,query:n,select:t,group_by:a,limit:e.limit}},r=await this.mondayApi.request(sD,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const n=e.value;if(!n)return void(t[a]=null);const i=n.result??n.value_string??n.value_int??n.value_float??n.value_boolean??null;t[a]=i})),t}));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 Jg{constructor(){super(...arguments),this.name="search",this.type=qn.READ,this.annotations=Qg({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 bD}async executeInternal(e){const t={[gD.BOARD]:this.searchBoardsAsync.bind(this),[gD.DOCUMENTS]:this.searchDocsAsync.bind(this),[gD.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!t)throw new Error(`Unsupported search type: ${e.searchType}`);const a=await t(e),n={disclaimer:a.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",results:a.items};return{content:JSON.stringify(n,null,2)}}async searchFoldersAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(fD,t),n=this.searchAndVirtuallyPaginate(e,a.folders||[],(e=>e.name));return{items:n.items.map((e=>({id:vD.FOLDER+e.id,title:e.name}))),wasFiltered:n.wasFiltered}}async searchDocsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(hD,t),n=this.searchAndVirtuallyPaginate(e,a.docs||[],(e=>e.name));return{items:n.items.map((e=>({id:vD.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:n.wasFiltered}}async searchBoardsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(uD,t),n=this.searchAndVirtuallyPaginate(e,a.boards||[],(e=>e.name));return{items:n.items.map((e=>({id:vD.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:n.wasFiltered}}getPagingParamsForSearch(e){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?1e4:e.limit}}searchAndVirtuallyPaginate(e,t,a){if(t.length<=yD)return{items:t,wasFiltered:!1};const n=FA(e.searchTerm??""),i=(e.page-1)*e.limit,o=i+e.limit;return{items:t.filter((e=>FA(a(e)).includes(n))).slice(i,o),wasFiltered:!0}}}];var nO;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(nO||(nO={}));const iO=(e,t)=>{let a=[];t?.mode===nO.APPS?a=[...Kg]:t?.mode!==nO.API&&t?.mode||(a=[...aO,...tO]);const n=a.map((t=>((e,t)=>e.prototype instanceof Jg?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof hg?new e(t.apiToken):new e)(t,e)));return n.filter((e=>{if(!t)return e.type!==qn.ALL_API;if(t.mode===nO.API&&"only"===t.enableDynamicApiTools)return e.type===qn.ALL_API;let a=!1;return t.mode===nO.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===qn.ALL_API),t.readOnlyMode&&(a=a||e.type!==qn.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))};class oO{constructor(){this.dynamicTools=new Map}registerTool(e,t){const a=e.enabledByDefault??!0,n=a;this.dynamicTools.set(e.name,{instance:e,mcpTool:t,enabled:n,enabledByDefault:a}),a||t.disable()}enableTool(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabled||(t.mcpTool.enable(),t.enabled=!0),!0)}disableTool(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabled&&(t.mcpTool.disable(),t.enabled=!1),!0)}isToolEnabled(e){const t=this.dynamicTools.get(e);return!!t&&t.enabled}isToolEnabledByDefault(e){const t=this.dynamicTools.get(e);return!t||t.enabledByDefault}getToolsStatus(){const e={};return this.dynamicTools.forEach(((t,a)=>{e[a]=t.enabled})),e}getDynamicToolNames(){return Array.from(this.dynamicTools.keys())}getDetailedToolsStatus(){const e={};return this.dynamicTools.forEach(((t,a)=>{e[a]={enabled:t.enabled,enabledByDefault:t.enabledByDefault}})),e}resetToolToDefault(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabledByDefault&&!t.enabled?(t.mcpTool.enable(),t.enabled=!0,!0):!(!t.enabledByDefault&&t.enabled)||(t.mcpTool.disable(),t.enabled=!1,!0))}getAllDynamicTools(){return this.dynamicTools}clear(){this.dynamicTools.clear()}}class rO extends Ln{constructor(e){super({name:"monday.com",version:"1.0.0"},{capabilities:{tools:{listChanged:!0}}}),this.dynamicToolManager=new oO,this.toolInstances=[],this.managementTool=null,this.mondayApiClient=this.createApiClient(e),this.mondayApiToken=e.mondayApiToken,this.context={...e.context,apiVersion:e.mondayApiVersion??MI},this.registerTools(e)}createApiClient(e){return new n({token:e.mondayApiToken,apiVersion:e.mondayApiVersion??MI,endpoint:e.mondayApiEndpoint,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 TD;e.setToolkitManager(this.dynamicToolManager),this.managementTool=e,this.registerSingleTool(this.managementTool)}initializeTools(e){const t={apiClient:this.mondayApiClient,apiToken:this.mondayApiToken,context:this.context};return iO(t,e.toolsConfiguration)}registerSingleTool(t){const a=t.getInputSchema(),n=this.registerTool(t.name,{...t,title:t.annotations?.title,description:t.getDescription(),inputSchema:a,annotations:t.annotations},(async(n,i)=>{try{let i;if(a){const o=e.object(a).safeParse(n);if(!o.success)throw new Error(`Invalid arguments: ${o.error.message}`);i=await t.execute(o.data)}else i=await t.execute();return this.formatToolResult(i.content)}catch(e){return this.handleToolError(e,t.name)}}));this.dynamicToolManager.registerTool(t,n)}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(),annotations:e.annotations,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(),annotations:e.annotations,handler:this.createMcpToolHandler(e)})))}createToolHandler(t){return async a=>{const n=t.getInputSchema();if(n){const i=e.object(n).safeParse(a);if(!i.success)throw new Error(`Invalid arguments: ${i.error.message}`);return(await t.execute(i.data)).content}return(await t.execute()).content}}createMcpToolHandler(t){return async(a,n)=>{try{const n=t.getInputSchema();if(n){const i=e.object(n).safeParse(a);if(!i.success)throw new Error(`Invalid arguments: ${i.error.message}`);const o=await t.execute(i.data);return{content:[{type:"text",text:String(o.content)}]}}{const e=await t.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,t){return{content:[{type:"text",text:`Failed to execute tool ${t}: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}}export{oO as DynamicToolManager,rO as MondayAgentToolkit};
|
|
1555
1555
|
//# sourceMappingURL=index.js.map
|