@mondaydotcomorg/agent-toolkit 5.78.0 → 5.78.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -534,7 +534,7 @@
534
534
  }
535
535
  }
536
536
  }
537
- `,Jc="INVALID_TOOL_ARGS",Xc="TOOL_EXECUTION_FAILED",Zc="GRAPHQL_ERROR",em="INVALID_OPERATION_TYPE",tm="EMPTY_API_RESPONSE",am="MISSING_REQUIRED_PARAMETER";class im extends Error{constructor(e,t,a){super(e),this.name="ToolValidationError",this.code=t,this.errors=a}}function nm(e,t){if(e instanceof im)throw e;const a=e?.response?.errors?.map((e=>{const{code:t,error_data:a}=e.extensions??{},i=Object.fromEntries(Object.entries({code:t,error_data:a}).filter((([,e])=>void 0!==e)));return Object.keys(i).length>0?`${e.message} (details: ${JSON.stringify(i)})`:e.message}))?.join(", ");if(a){const i=new Error(`Failed to ${t}: ${a}`);throw i.response=e.response,i}const i=e instanceof Error?e.message:"Unknown error";throw new im(`Failed to ${t}: ${i}`,Xc)}function om(e){if(e instanceof Error&&"AbortError"===e.name)throw new im("Search has timed out, try providing alternative search term","SEARCH_TIMEOUT")}function rm(e){const t=e?.response;return 429===t?.status}function sm(t){if(!(t instanceof e.ApiClient))return t;const{token:a,defaultApiVersion:i,defaultEndpoint:n,requestConfig:o}=t;return new e.ApiClient({token:a,apiVersion:i,endpoint:n,requestConfig:{...o,headers:{...o?.headers,"x-api-schema":"public"}}})}const dm={query:i.z.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:i.z.string().default("{}").describe("JSON string containing the variables for the GraphQL operation")};class pm extends ue{constructor(e,t){super("function"==typeof e?()=>sm(e()):sm(e),t),this.name="all_monday_api",this.type=b.ALL_API,this.annotations=me({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 dm}async loadSchema(e){if(pm.schemaCache[e])return pm.schemaCache[e];try{const t=await this.mondayApi.rawRequest(jc),{data:a}=t,i=gn(a);return pm.schemaCache[e]=i,i}catch(e){throw new im(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`,"GRAPHQL_SCHEMA_LOAD_FAILED")}}countGraphqlOperations(e){const t={},a={};for(const i of e.definitions){if("OperationDefinition"!==i.kind)continue;const e=i.operation===Oe.MUTATION?a:i.operation===Oe.QUERY?t:null;if(e)for(const t of i.selectionSet.selections){if("Field"!==t.kind)continue;const a=t.name.value;e[a]=(e[a]??0)+1}}return{graphql_queries:t,graphql_mutations:a}}recordGraphqlOperationCounts(e){const{graphql_queries:t,graphql_mutations:a}=this.countGraphqlOperations(e);this.sessionContext.metadata??={},this.sessionContext.metadata.graphql_queries=t,this.sessionContext.metadata.graphql_mutations=a}async validateOperation(e,t){return _n(await this.loadSchema(t),e).map((e=>e.message))}async executeInternal(e){const{query:t,variables:a}=e;let i={};try{i=JSON.parse(a)}catch(e){throw new im(`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`,"INVALID_VARIABLES_JSON")}const n=pt(t);this.recordGraphqlOperationCounts(n);const o=await this.validateOperation(n,this.context?.apiVersion??B);if(o.length>0)throw new im(o.join(", "),"GRAPHQL_VALIDATION_FAILED");try{return{content:await this.mondayApi.request(t,i)}}catch(e){nm(e,"execute GraphQL operation")}}}pm.schemaCache={};const lm=1e3;var cm,mm;!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"}(cm||(cm={})),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=lm]="SECOND"}(mm||(mm={}));const um=10*mm.SECOND;async function hm(e,t){const a={value:!1},i=t.isRateLimitError??rm;return async function(e,t,a){if(t<1)throw new RangeError("limit must be at least 1");if(a&&a.limitPerGroup<1)throw new RangeError("limitPerGroup must be at least 1");const i=new Array(e.length),n=e.map(((e,t)=>t)),o=e.map(((e,t)=>a?.getGroup(t))),r=new Map;let s=0;return await new Promise((d=>{const p=()=>{for(;s<t;){const t=n.findIndex((e=>{const t=o[e];return void 0===t||void 0===a||(r.get(t)??0)<a.limitPerGroup}));if(-1===t)break;const[d]=n.splice(t,1),l=o[d];void 0!==l&&r.set(l,(r.get(l)??0)+1),s++,Promise.resolve().then(e[d]).then((e=>{i[d]=e})).catch((()=>{})).then((()=>{if(s--,void 0!==l){const e=(r.get(l)??1)-1;0===e?r.delete(l):r.set(l,e)}p()}))}0===n.length&&0===s&&d()};p()})),i}(e.map(((e,n)=>async()=>{if(a.value)return t.onSkipped(n);try{return await e()}catch(e){return i(e)&&(a.value=!0),t.onError(e,n)}})),t.limit,t.concurrencyGroups)}const fm='Pass a JSON object serialized once as a string, keyed by column id — not a JSON string of a JSON string. Column ids and labels must come from get_board_info for this board, people ids from list_users_and_teams, never guessed. Formats by column type: text and numbers: "value". long_text: {"text": "..."}. status: {"label": "Done"} or {"index": 1}, and the label must already exist unless createLabelsIfMissing is true. dropdown: {"labels": ["A"]} or {"ids": [1]} — always an array, even for one value. date: {"date": "YYYY-MM-DD"}. timeline: {"from": "YYYY-MM-DD", "to": "YYYY-MM-DD"}. people: {"personsAndTeams": [{"id": 123, "kind": "person"}]}, where kind is "person", "team" or "agent". An AI agent takes kind "agent" with its user id from list_users_and_teams, never "person". board_relation: {"item_ids": [123]}. tags: {"tag_ids": [123]}. checkbox: {"checked": "true"}. link: {"url": "https://...", "text": "..."}. location: {"lat": "40.7", "lng": "-74.0", "address": "..."}, lat and lng are required strings, an address alone fails. email: {"email": "a@b.com", "text": "a@b.com"}. phone: {"phone": "+12125551234", "countryShortName": "US"}, digits only with an optional leading + and no spaces or dashes, uppercase ISO-2 country code. Plain strings fail for email and phone. null clears a column. Example: {"text_col": "New text", "status_col": {"label": "Done"}, "dropdown_col": {"labels": ["A"]}, "date_col": {"date": "2023-05-25"}}',_m=e=>{try{const t=JSON.parse(e);return"string"==typeof t?t:e}catch{return e}},bm=Object.fromEntries(Object.entries(Yo).filter((([e])=>"Person"!==e))),gm=1e3,ym={itemId:i.z.number().describe("The ID of the item to be updated"),columnValues:i.z.string().describe(`The new column values for the item. Multiple columns can be changed at once. ${fm}`),createLabelsIfMissing:i.z.boolean().optional().describe("If true, create missing Status/Dropdown labels when setting those columns. Requires permission to change board structure. Omit or false to only use existing labels.")},vm={boardId:i.z.number().describe("The ID of the board that contains the item to be updated"),...ym};class Im extends ue{constructor(){super(...arguments),this.name="change_item_column_values",this.type=b.WRITE,this.annotations=me({title:"Change Item Column Values",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Change the column values of a single item on a monday.com board. [IMPORTANT] If you need to update multiple items in one call, use update_items instead of calling this tool in a loop. Otherwise: change the column values of a single item in a monday.com board. [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 with filters.columns.only to get column metadata without fetching views. This is essential for constructing valid column values. For board-relation linking tasks, call link_board_items_workflow before using this tool. Board-relation and dependency responses include linked item IDs up to 1000. Larger lists are omitted with a count and a message confirming the update succeeded."}getInputSchema(){return this.context?.boardId?ym:vm}async executeInternal(e){const t=this.context?.boardId??e.boardId,a=_m(e.columnValues),i={boardId:t.toString(),itemId:e.itemId.toString(),columnValues:a,...void 0!==e.createLabelsIfMissing&&{createLabelsIfMissing:e.createLabelsIfMissing}};let n;try{n=JSON.parse(a)}catch(e){throw new im(`Invalid columnValues JSON: ${e.message}`,"INVALID_COLUMN_VALUES_JSON")}if(null===n||"object"!=typeof n||Array.isArray(n))throw new im("Invalid columnValues JSON: expected a JSON object keyed by column id","INVALID_COLUMN_VALUES_JSON");const o=Object.keys(n);let r;try{r=await this.mondayApi.request(Uc,{...i,columnIds:o})}catch(e){nm(e,"change column values")}const s=r.change_multiple_column_values?.column_values?.reduce(((e,t)=>{if(t.type===bm.BoardRelation||t.type===bm.Dependency){const a=t.linked_item_ids;e[t.id]=a.length<=gm?{linked_item_ids:a}:{linked_item_count:a.length,linked_item_ids_omitted:!0,message:`Update succeeded, but ${a.length} linked item IDs were omitted because the response limit is 1000. Fetch the item to retrieve its current linked items.`}}else e[t.id]=t.value??null;return e}),{});return{content:{message:`Item ${r.change_multiple_column_values?.id} successfully updated`,item_id:r.change_multiple_column_values?.id,item_name:r.change_multiple_column_values?.name,item_url:r.change_multiple_column_values?.url,column_values:s}}}}const wm=Nc`
537
+ `,Jc="INVALID_TOOL_ARGS",Xc="TOOL_EXECUTION_FAILED",Zc="GRAPHQL_ERROR",em="INVALID_OPERATION_TYPE",tm="EMPTY_API_RESPONSE",am="MISSING_REQUIRED_PARAMETER";class im extends Error{constructor(e,t,a){super(e),this.name="ToolValidationError",this.code=t,this.errors=a}}function nm(e,t){if(e instanceof im)throw e;const a=e?.response?.errors?.map((e=>{const{code:t,error_data:a}=e.extensions??{},i=Object.fromEntries(Object.entries({code:t,error_data:a}).filter((([,e])=>void 0!==e)));return Object.keys(i).length>0?`${e.message} (details: ${JSON.stringify(i)})`:e.message}))?.join(", ");if(a){const i=new Error(`Failed to ${t}: ${a}`);throw i.response=e.response,i}const i=e instanceof Error?e.message:"Unknown error";throw new im(`Failed to ${t}: ${i}`,Xc)}function om(e){if(e instanceof Error&&"AbortError"===e.name)throw new im("Search has timed out, try providing alternative search term","SEARCH_TIMEOUT")}function rm(e){const t=e?.response;return 429===t?.status}function sm(e,t){const a=e?.response,i=e instanceof Error?e.message:String(e);if(e instanceof im)return{message:i,tool:t?.toolName,errors:e.errors?.length?e.errors.map((t=>({code:e.code,...t}))):[{code:e.code,message:i,path:[]}]};if(a?.errors?.length){const e=Object.keys(a.headers||{}).length>0?a.headers:void 0;return{message:i,tool:t?.toolName,...a.extensions??{},status:a.status,headers:e,...null!=a.data?{partial_success:!0}:{},errors:a.errors.map((e=>({message:e.message,path:e.path,...e.extensions??{},code:e.extensions?.code??Zc})))}}return{message:i,tool:t?.toolName,errors:[{code:Xc,message:i,path:[]}]}}function dm(t){if(!(t instanceof e.ApiClient))return t;const{token:a,defaultApiVersion:i,defaultEndpoint:n,requestConfig:o}=t;return new e.ApiClient({token:a,apiVersion:i,endpoint:n,requestConfig:{...o,headers:{...o?.headers,"x-api-schema":"public"}}})}const pm={query:i.z.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:i.z.string().default("{}").describe("JSON string containing the variables for the GraphQL operation")};class lm extends ue{constructor(e,t){super("function"==typeof e?()=>dm(e()):dm(e),t),this.name="all_monday_api",this.type=b.ALL_API,this.annotations=me({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 pm}async loadSchema(e){if(lm.schemaCache[e])return lm.schemaCache[e];try{const t=await this.mondayApi.rawRequest(jc),{data:a}=t,i=gn(a);return lm.schemaCache[e]=i,i}catch(e){throw new im(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`,"GRAPHQL_SCHEMA_LOAD_FAILED")}}countGraphqlOperations(e){const t={},a={};for(const i of e.definitions){if("OperationDefinition"!==i.kind)continue;const e=i.operation===Oe.MUTATION?a:i.operation===Oe.QUERY?t:null;if(e)for(const t of i.selectionSet.selections){if("Field"!==t.kind)continue;const a=t.name.value;e[a]=(e[a]??0)+1}}return{graphql_queries:t,graphql_mutations:a}}recordGraphqlOperationCounts(e){const{graphql_queries:t,graphql_mutations:a}=this.countGraphqlOperations(e);this.sessionContext.metadata??={},this.sessionContext.metadata.graphql_queries=t,this.sessionContext.metadata.graphql_mutations=a}async validateOperation(e,t){return _n(await this.loadSchema(t),e).map((e=>e.message))}async executeInternal(e){const{query:t,variables:a}=e;let i={};try{i=JSON.parse(a)}catch(e){throw new im(`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`,"INVALID_VARIABLES_JSON")}const n=pt(t);this.recordGraphqlOperationCounts(n);const o=await this.validateOperation(n,this.context?.apiVersion??B);if(o.length>0)throw new im(o.join(", "),"GRAPHQL_VALIDATION_FAILED");try{return{content:await this.mondayApi.request(t,i)}}catch(e){nm(e,"execute GraphQL operation")}}}lm.schemaCache={};const cm=1e3;var mm,um;!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"}(mm||(mm={})),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=cm]="SECOND"}(um||(um={}));const hm=10*um.SECOND;async function fm(e,t){const a={value:!1},i=t.isRateLimitError??rm;return async function(e,t,a){if(t<1)throw new RangeError("limit must be at least 1");if(a&&a.limitPerGroup<1)throw new RangeError("limitPerGroup must be at least 1");const i=new Array(e.length),n=e.map(((e,t)=>t)),o=e.map(((e,t)=>a?.getGroup(t))),r=new Map;let s=0;return await new Promise((d=>{const p=()=>{for(;s<t;){const t=n.findIndex((e=>{const t=o[e];return void 0===t||void 0===a||(r.get(t)??0)<a.limitPerGroup}));if(-1===t)break;const[d]=n.splice(t,1),l=o[d];void 0!==l&&r.set(l,(r.get(l)??0)+1),s++,Promise.resolve().then(e[d]).then((e=>{i[d]=e})).catch((()=>{})).then((()=>{if(s--,void 0!==l){const e=(r.get(l)??1)-1;0===e?r.delete(l):r.set(l,e)}p()}))}0===n.length&&0===s&&d()};p()})),i}(e.map(((e,n)=>async()=>{if(a.value)return t.onSkipped(n);try{return await e()}catch(e){return i(e)&&(a.value=!0),t.onError(e,n)}})),t.limit,t.concurrencyGroups)}const _m='Pass a JSON object serialized once as a string, keyed by column id — not a JSON string of a JSON string. Column ids and labels must come from get_board_info for this board, people ids from list_users_and_teams, never guessed. Formats by column type: text and numbers: "value". long_text: {"text": "..."}. status: {"label": "Done"} or {"index": 1}, and the label must already exist unless createLabelsIfMissing is true. dropdown: {"labels": ["A"]} or {"ids": [1]} — always an array, even for one value. date: {"date": "YYYY-MM-DD"}. timeline: {"from": "YYYY-MM-DD", "to": "YYYY-MM-DD"}. people: {"personsAndTeams": [{"id": 123, "kind": "person"}]}, where kind is "person", "team" or "agent". An AI agent takes kind "agent" with its user id from list_users_and_teams, never "person". board_relation: {"item_ids": [123]}. tags: {"tag_ids": [123]}. checkbox: {"checked": "true"}. link: {"url": "https://...", "text": "..."}. location: {"lat": "40.7", "lng": "-74.0", "address": "..."}, lat and lng are required strings, an address alone fails. email: {"email": "a@b.com", "text": "a@b.com"}. phone: {"phone": "+12125551234", "countryShortName": "US"}, digits only with an optional leading + and no spaces or dashes, uppercase ISO-2 country code. Plain strings fail for email and phone. null clears a column. Example: {"text_col": "New text", "status_col": {"label": "Done"}, "dropdown_col": {"labels": ["A"]}, "date_col": {"date": "2023-05-25"}}',bm=e=>{try{const t=JSON.parse(e);return"string"==typeof t?t:e}catch{return e}},gm=Object.fromEntries(Object.entries(Yo).filter((([e])=>"Person"!==e))),ym=1e3,vm={itemId:i.z.number().describe("The ID of the item to be updated"),columnValues:i.z.string().describe(`The new column values for the item. Multiple columns can be changed at once. ${_m}`),createLabelsIfMissing:i.z.boolean().optional().describe("If true, create missing Status/Dropdown labels when setting those columns. Requires permission to change board structure. Omit or false to only use existing labels.")},Im={boardId:i.z.number().describe("The ID of the board that contains the item to be updated"),...vm};class wm extends ue{constructor(){super(...arguments),this.name="change_item_column_values",this.type=b.WRITE,this.annotations=me({title:"Change Item Column Values",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Change the column values of a single item on a monday.com board. [IMPORTANT] If you need to update multiple items in one call, use update_items instead of calling this tool in a loop. Otherwise: change the column values of a single item in a monday.com board. [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 with filters.columns.only to get column metadata without fetching views. This is essential for constructing valid column values. For board-relation linking tasks, call link_board_items_workflow before using this tool. Board-relation and dependency responses include linked item IDs up to 1000. Larger lists are omitted with a count and a message confirming the update succeeded."}getInputSchema(){return this.context?.boardId?vm:Im}async executeInternal(e){const t=this.context?.boardId??e.boardId,a=bm(e.columnValues),i={boardId:t.toString(),itemId:e.itemId.toString(),columnValues:a,...void 0!==e.createLabelsIfMissing&&{createLabelsIfMissing:e.createLabelsIfMissing}};let n;try{n=JSON.parse(a)}catch(e){throw new im(`Invalid columnValues JSON: ${e.message}`,"INVALID_COLUMN_VALUES_JSON")}if(null===n||"object"!=typeof n||Array.isArray(n))throw new im("Invalid columnValues JSON: expected a JSON object keyed by column id","INVALID_COLUMN_VALUES_JSON");const o=Object.keys(n);let r;try{r=await this.mondayApi.request(Uc,{...i,columnIds:o})}catch(e){nm(e,"change column values")}const s=r.change_multiple_column_values?.column_values?.reduce(((e,t)=>{if(t.type===gm.BoardRelation||t.type===gm.Dependency){const a=t.linked_item_ids;e[t.id]=a.length<=ym?{linked_item_ids:a}:{linked_item_count:a.length,linked_item_ids_omitted:!0,message:`Update succeeded, but ${a.length} linked item IDs were omitted because the response limit is 1000. Fetch the item to retrieve its current linked items.`}}else e[t.id]=t.value??null;return e}),{});return{content:{message:`Item ${r.change_multiple_column_values?.id} successfully updated`,item_id:r.change_multiple_column_values?.id,item_name:r.change_multiple_column_values?.name,item_url:r.change_multiple_column_values?.url,column_values:s}}}}const Tm=Nc`
538
538
  query GetItemsBoardIds($itemIds: [ID!]!, $limit: Int!) {
539
539
  items(ids: $itemIds, limit: $limit) {
540
540
  id
@@ -543,7 +543,7 @@
543
543
  }
544
544
  }
545
545
  }
546
- `,Tm="For a subitem, this is the subitems board, not the parent item's board: get it from the parent board's subitems column via get_board_info.",Em=e=>i.z.array(i.z.object({itemId:i.z.number().optional().describe("Required. The id of the item to update."),columnValues:i.z.string().default("{}").describe(`The new column values for this item, keyed by column id. Defaults to "{}" (no column values). To change the item name include a "name" key. ${fm}`),boardId:i.z.number().optional().describe(e),createLabelsIfMissing:i.z.boolean().optional().describe("When true, missing status or dropdown labels referenced in this update columnValues are auto-created on the board instead of erroring with ColumnValueException. Requires permission to change board structure.")})).min(1,"updates must not be empty").max(40,"updates must not exceed 40 per call").describe("The item updates to apply, up to 40 per call. Each entry updates one item and returns its own result on success or a raw error message on failure. Each entry independently chooses its boardId, columnValues, and createLabelsIfMissing."),Am={updates:Em(`Optional. The id of the board that contains this item, when it is not the board in context. ${Tm}`)},Sm={boardId:i.z.number().optional().describe(`Required unless every update sets its own boardId. The id of the board that contains the items, used for every update that does not set its own boardId. ${Tm}`),updates:Em(`Required unless the batch-level boardId is set. The id of the board that contains this item. Set it to target a different board than the batch boardId. ${Tm}`)};function Dm(e,t){if(e instanceof im)return{code:e.code,message:e.message,path:["results",t]};const a=e?.response?.errors?.[0],i=e instanceof Error?e.message:String(e),n=a?.extensions??{};return{...n,code:n.code??Zc,message:a?.message??i,path:["results",t]}}const Nm=Nc`
546
+ `,Em="For a subitem, this is the subitems board, not the parent item's board: get it from the parent board's subitems column via get_board_info.",Am=e=>i.z.array(i.z.object({itemId:i.z.number().optional().describe("Required. The id of the item to update."),columnValues:i.z.string().default("{}").describe(`The new column values for this item, keyed by column id. Defaults to "{}" (no column values). To change the item name include a "name" key. ${_m}`),boardId:i.z.number().optional().describe(e),createLabelsIfMissing:i.z.boolean().optional().describe("When true, missing status or dropdown labels referenced in this update columnValues are auto-created on the board instead of erroring with ColumnValueException. Requires permission to change board structure.")})).min(1,"updates must not be empty").max(40,"updates must not exceed 40 per call").describe("The item updates to apply, up to 40 per call. Each entry updates one item and returns its own result on success or a raw error message on failure. Each entry independently chooses its boardId, columnValues, and createLabelsIfMissing."),Sm={updates:Am(`Optional. The id of the board that contains this item, when it is not the board in context. ${Em}`)},Dm={boardId:i.z.number().optional().describe(`Required unless every update sets its own boardId. The id of the board that contains the items, used for every update that does not set its own boardId. ${Em}`),updates:Am(`Required unless the batch-level boardId is set. The id of the board that contains this item. Set it to target a different board than the batch boardId. ${Em}`)};function Nm(e,t){if(e instanceof im)return{code:e.code,message:e.message,path:["results",t]};const a=e?.response?.errors?.[0],i=e instanceof Error?e.message:String(e),n=a?.extensions??{};return{...n,code:n.code??Zc,message:a?.message??i,path:["results",t]}}const Om=Nc`
547
547
  query GetObjectSchemas($ids: [ID!], $names: [String!], $limit: Int, $page: Int, $excludeCreatedByMonday: Boolean) {
548
548
  get_object_schemas(ids: $ids, names: $names, limit: $limit, page: $page, exclude_created_by_monday: $excludeCreatedByMonday) {
549
549
  id
@@ -555,7 +555,7 @@
555
555
  connected_boards_count
556
556
  }
557
557
  }
558
- `,Om={ids:i.z.array(i.z.string()).optional().describe("List of object schema IDs to retrieve. Mutually exclusive with names."),names:i.z.array(i.z.string()).optional().describe("List of object schema names to retrieve. Mutually exclusive with ids."),limit:i.z.number().optional().describe("Number of results per page. Default 25, max 100."),page:i.z.number().optional().describe("1-indexed page number. Default 1."),excludeCreatedByMonday:i.z.boolean().optional().describe("If true, returns only user-created schemas and excludes default monday.com schemas.")};const km=Nc`
558
+ `,km={ids:i.z.array(i.z.string()).optional().describe("List of object schema IDs to retrieve. Mutually exclusive with names."),names:i.z.array(i.z.string()).optional().describe("List of object schema names to retrieve. Mutually exclusive with ids."),limit:i.z.number().optional().describe("Number of results per page. Default 25, max 100."),page:i.z.number().optional().describe("1-indexed page number. Default 1."),excludeCreatedByMonday:i.z.boolean().optional().describe("If true, returns only user-created schemas and excludes default monday.com schemas.")};const Rm=Nc`
559
559
  mutation CreateObjectSchema($name: String!, $parentId: ID, $description: String) {
560
560
  create_object_schema(name: $name, parent_id: $parentId, description: $description) {
561
561
  id
@@ -565,7 +565,7 @@
565
565
  revision
566
566
  }
567
567
  }
568
- `,Rm={name:i.z.string().describe("A unique human-readable name for this object schema. Must be 3-15 characters, contain only lowercase letters, numbers, and underscores, and include at least one letter."),parentId:i.z.string().optional().describe("The ID of the parent object schema."),description:i.z.string().optional().describe("The description for this object schema.")};const Cm=Nc`
568
+ `,Cm={name:i.z.string().describe("A unique human-readable name for this object schema. Must be 3-15 characters, contain only lowercase letters, numbers, and underscores, and include at least one letter."),parentId:i.z.string().optional().describe("The ID of the parent object schema."),description:i.z.string().optional().describe("The description for this object schema.")};const $m=Nc`
569
569
  mutation UpdateObjectSchema($id: ID!, $revision: Int!, $parentId: ID, $description: String) {
570
570
  update_object_schema(id: $id, revision: $revision, parent_id: $parentId, description: $description) {
571
571
  id
@@ -575,14 +575,14 @@
575
575
  revision
576
576
  }
577
577
  }
578
- `,$m={id:i.z.string().describe("The ID of the object schema to update."),revision:i.z.number().describe("The current revision number for optimistic locking. Retrieve it first via get_object_schemas."),parentId:i.z.string().optional().describe("The ID of the parent object schema."),description:i.z.string().optional().describe("The new description for this object schema.")};const xm=Nc`
578
+ `,xm={id:i.z.string().describe("The ID of the object schema to update."),revision:i.z.number().describe("The current revision number for optimistic locking. Retrieve it first via get_object_schemas."),parentId:i.z.string().optional().describe("The ID of the parent object schema."),description:i.z.string().optional().describe("The new description for this object schema.")};const Lm=Nc`
579
579
  mutation DeleteObjectSchema($id: ID, $name: String) {
580
580
  delete_object_schema(id: $id, name: $name) {
581
581
  id
582
582
  name
583
583
  }
584
584
  }
585
- `,Lm={id:i.z.string().optional().describe("The ID of the object schema to delete. Either id or name must be provided."),name:i.z.string().optional().describe("The name of the object schema to delete. Either id or name must be provided.")};const Um=Nc`
585
+ `,Um={id:i.z.string().optional().describe("The ID of the object schema to delete. Either id or name must be provided."),name:i.z.string().optional().describe("The name of the object schema to delete. Either id or name must be provided.")};const Pm=Nc`
586
586
  mutation DeleteObjectSchemaColumns($objectSchemaId: ID, $objectSchemaName: String, $columnIds: [ID!]!) {
587
587
  delete_object_schema_columns(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, column_ids: $columnIds) {
588
588
  id
@@ -592,14 +592,14 @@
592
592
  revision
593
593
  }
594
594
  }
595
- `,Pm={objectSchemaId:i.z.string().optional().describe("The ID of the object schema to delete columns from. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:i.z.string().optional().describe("The name of the object schema to delete columns from. Either objectSchemaId or objectSchemaName must be provided."),columnIds:i.z.array(i.z.string()).describe("IDs of the columns to permanently delete. Only allowed when no boards are connected to the schema.")};const Vm=Nc`
595
+ `,Vm={objectSchemaId:i.z.string().optional().describe("The ID of the object schema to delete columns from. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:i.z.string().optional().describe("The name of the object schema to delete columns from. Either objectSchemaId or objectSchemaName must be provided."),columnIds:i.z.array(i.z.string()).describe("IDs of the columns to permanently delete. Only allowed when no boards are connected to the schema.")};const Mm=Nc`
596
596
  mutation ConnectBoardToObjectSchema($boardId: ID!, $objectSchemaId: ID, $objectSchemaName: String) {
597
597
  connect_board_to_object_schema(board_id: $boardId, object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName) {
598
598
  id
599
599
  object_schema_id
600
600
  }
601
601
  }
602
- `,Mm=Nc`
602
+ `,Fm=Nc`
603
603
  mutation DetachBoardsFromObjectSchema($boardIds: [ID!]!) {
604
604
  detach_boards_from_object_schema(board_ids: $boardIds) {
605
605
  board_id
@@ -607,7 +607,7 @@
607
607
  error
608
608
  }
609
609
  }
610
- `,Fm={action:i.z.enum(["connect","detach"]).describe("The operation to perform. connect: attaches a board to an object schema so it inherits the schema column structure. detach: removes one or more boards from their object schema."),boardId:i.z.string().optional().describe("Required for action=connect. The ID of the board to connect."),boardIds:i.z.array(i.z.string()).optional().describe("Required for action=detach. The IDs of the boards to detach."),objectSchemaId:i.z.string().optional().describe("Required for action=connect. The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:i.z.string().optional().describe("Required for action=connect. The name of the object schema. Either objectSchemaId or objectSchemaName must be provided.")};var Bm;!function(e){e.Schema="schema",e.Guidelines="guidelines"}(Bm||(Bm={}));const zm=Nc`
610
+ `,Bm={action:i.z.enum(["connect","detach"]).describe("The operation to perform. connect: attaches a board to an object schema so it inherits the schema column structure. detach: removes one or more boards from their object schema."),boardId:i.z.string().optional().describe("Required for action=connect. The ID of the board to connect."),boardIds:i.z.array(i.z.string()).optional().describe("Required for action=detach. The IDs of the boards to detach."),objectSchemaId:i.z.string().optional().describe("Required for action=connect. The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:i.z.string().optional().describe("Required for action=connect. The name of the object schema. Either objectSchemaId or objectSchemaName must be provided.")};var zm;!function(e){e.Schema="schema",e.Guidelines="guidelines"}(zm||(zm={}));const jm=Nc`
611
611
  mutation CreateObjectSchemaColumns($objectSchemaId: ID, $objectSchemaName: String, $columns: [CreateObjectSchemaColumnInput!]!) {
612
612
  create_object_schema_columns(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, columns: $columns) {
613
613
  id
@@ -617,7 +617,7 @@
617
617
  revision
618
618
  }
619
619
  }
620
- `,jm=Nc`
620
+ `,qm=Nc`
621
621
  mutation UpdateObjectSchemaColumns($objectSchemaId: ID, $objectSchemaName: String, $columns: [UpdateObjectSchemaColumnInput!]!) {
622
622
  update_object_schema_columns(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, columns: $columns) {
623
623
  id
@@ -627,7 +627,7 @@
627
627
  revision
628
628
  }
629
629
  }
630
- `,qm=i.z.object({can_override:i.z.array(i.z.enum(["title","description","settings"])).optional().describe("Fields that boards can override. Allowed values: title, description, settings."),cannot_delete:i.z.boolean().optional().describe("If true, the column cannot be deleted from boards.")}).optional().describe("Controls board-level permissions for this column. If omitted, defaults to: no field overrides allowed, column can be deleted by boards."),Gm=i.z.object({type:i.z.string().describe(`Column type (e.g. text, status, numbers, date, dropdown, people). Call get_column_type_info with fetchMode "${Bm.Schema}" for a type's settings schema.`),title:i.z.string().describe("Column title."),description:i.z.string().optional().describe("Column description."),defaults:i.z.record(i.z.unknown()).optional().describe(`Type-specific column settings. Call get_column_type_info with fetchMode "${Bm.Schema}" before populating this field to understand the valid structure.`),policy:qm,opt_out_by_default:i.z.boolean().optional().describe("If true, the column will not be automatically added to boards connected to this schema.")}),Hm=i.z.object({column_id:i.z.string().describe("The ID of the column to update."),title:i.z.string().optional().describe("New column title."),description:i.z.string().optional().describe("New column description."),defaults:i.z.record(i.z.unknown()).optional().describe(`Type-specific column settings. Call get_column_type_info with fetchMode "${Bm.Schema}" before populating this field.`),opt_out_by_default:i.z.boolean().optional().describe("If true, the column will not be automatically added to boards connected to this schema."),policy:qm}),Wm={action:i.z.enum(["create","update"]).describe(`The operation to perform on columns. create: adds new columns to the schema. Each column requires type and title. Call get_column_type_info with fetchMode "${Bm.Schema}" first to understand valid defaults per column type. update: modifies existing columns. Each entry must include column_id — call get_object_schemas first to resolve the schema id and the exact column ids. Only send the columns you want to modify — other columns are unaffected. Use opt_out_by_default=true to opt a column out (stop auto-adding to boards), or opt_out_by_default=false to opt in (restore auto-adding).`),objectSchemaId:i.z.string().optional().describe("The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:i.z.string().optional().describe("The name of the object schema. Either objectSchemaId or objectSchemaName must be provided."),columns:i.z.array(i.z.union([Gm,Hm])).describe("Array of columns to create or update.")};const Ym=Nc`
630
+ `,Gm=i.z.object({can_override:i.z.array(i.z.enum(["title","description","settings"])).optional().describe("Fields that boards can override. Allowed values: title, description, settings."),cannot_delete:i.z.boolean().optional().describe("If true, the column cannot be deleted from boards.")}).optional().describe("Controls board-level permissions for this column. If omitted, defaults to: no field overrides allowed, column can be deleted by boards."),Hm=i.z.object({type:i.z.string().describe(`Column type (e.g. text, status, numbers, date, dropdown, people). Call get_column_type_info with fetchMode "${zm.Schema}" for a type's settings schema.`),title:i.z.string().describe("Column title."),description:i.z.string().optional().describe("Column description."),defaults:i.z.record(i.z.unknown()).optional().describe(`Type-specific column settings. Call get_column_type_info with fetchMode "${zm.Schema}" before populating this field to understand the valid structure.`),policy:Gm,opt_out_by_default:i.z.boolean().optional().describe("If true, the column will not be automatically added to boards connected to this schema.")}),Wm=i.z.object({column_id:i.z.string().describe("The ID of the column to update."),title:i.z.string().optional().describe("New column title."),description:i.z.string().optional().describe("New column description."),defaults:i.z.record(i.z.unknown()).optional().describe(`Type-specific column settings. Call get_column_type_info with fetchMode "${zm.Schema}" before populating this field.`),opt_out_by_default:i.z.boolean().optional().describe("If true, the column will not be automatically added to boards connected to this schema."),policy:Gm}),Ym={action:i.z.enum(["create","update"]).describe(`The operation to perform on columns. create: adds new columns to the schema. Each column requires type and title. Call get_column_type_info with fetchMode "${zm.Schema}" first to understand valid defaults per column type. update: modifies existing columns. Each entry must include column_id — call get_object_schemas first to resolve the schema id and the exact column ids. Only send the columns you want to modify — other columns are unaffected. Use opt_out_by_default=true to opt a column out (stop auto-adding to boards), or opt_out_by_default=false to opt in (restore auto-adding).`),objectSchemaId:i.z.string().optional().describe("The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:i.z.string().optional().describe("The name of the object schema. Either objectSchemaId or objectSchemaName must be provided."),columns:i.z.array(i.z.union([Hm,Wm])).describe("Array of columns to create or update.")};const Qm=Nc`
631
631
  mutation SetObjectSchemaColumnActiveState($objectSchemaId: ID, $objectSchemaName: String, $columnId: ID!, $action: ColumnActiveStateAction!) {
632
632
  set_object_schema_column_active_state(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, column_id: $columnId, action: $action) {
633
633
  id
@@ -637,7 +637,7 @@
637
637
  revision
638
638
  }
639
639
  }
640
- `,Qm={action:i.z.enum(["deactivate","reactivate"]).describe("The operation to perform on the column. deactivate: soft-disables the column. It is marked inactive but not deleted. Reversible. reactivate: re-enables a previously deactivated column."),objectSchemaId:i.z.string().optional().describe("The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:i.z.string().optional().describe("The name of the object schema. Either objectSchemaId or objectSchemaName must be provided."),columnId:i.z.string().describe("The ID of the column to deactivate or reactivate.")};const Km={boardName:i.z.string().describe("The name of the board to create"),boardKind:i.z.nativeEnum(ho).default(ho.Public).describe("The kind of board to create"),boardDescription:i.z.string().optional().describe("The description of the board to create"),workspaceId:i.z.string().optional().describe("The ID of the workspace to create the board in"),boardOwnerIds:i.z.array(i.z.string()).optional().describe("Optional list of user IDs to set as board owners"),useMlsTemplate:i.z.boolean().optional().describe("Set to true to create a multi-level board using the MLS template"),useDatasetTemplate:i.z.boolean().optional().describe("Set to true to create a board from the dataset template")};const Jm={templateId:i.z.coerce.number().int().positive().describe("The template ID to apply."),destinationWorkspaceId:i.z.coerce.number().int().positive().optional().describe("Target workspace ID."),destinationName:i.z.string().optional().describe("Name for the created instance or folder."),boardKind:i.z.nativeEnum(ho).optional().describe("Visibility applied to all boards created by the template. public = visible to all account members (API default). private = visible only to owner and explicitly added members. share = accessible to guests outside the account via a link. For workspace templates this setting applies to every board in the installation. Omit to use the API default (public).")};const Xm={processId:i.z.string().describe("The process_id returned by use_template.")};const Zm=Nc`
640
+ `,Km={action:i.z.enum(["deactivate","reactivate"]).describe("The operation to perform on the column. deactivate: soft-disables the column. It is marked inactive but not deleted. Reversible. reactivate: re-enables a previously deactivated column."),objectSchemaId:i.z.string().optional().describe("The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:i.z.string().optional().describe("The name of the object schema. Either objectSchemaId or objectSchemaName must be provided."),columnId:i.z.string().describe("The ID of the column to deactivate or reactivate.")};const Jm={boardName:i.z.string().describe("The name of the board to create"),boardKind:i.z.nativeEnum(ho).default(ho.Public).describe("The kind of board to create"),boardDescription:i.z.string().optional().describe("The description of the board to create"),workspaceId:i.z.string().optional().describe("The ID of the workspace to create the board in"),boardOwnerIds:i.z.array(i.z.string()).optional().describe("Optional list of user IDs to set as board owners"),useMlsTemplate:i.z.boolean().optional().describe("Set to true to create a multi-level board using the MLS template"),useDatasetTemplate:i.z.boolean().optional().describe("Set to true to create a board from the dataset template")};const Xm={templateId:i.z.coerce.number().int().positive().describe("The template ID to apply."),destinationWorkspaceId:i.z.coerce.number().int().positive().optional().describe("Target workspace ID."),destinationName:i.z.string().optional().describe("Name for the created instance or folder."),boardKind:i.z.nativeEnum(ho).optional().describe("Visibility applied to all boards created by the template. public = visible to all account members (API default). private = visible only to owner and explicitly added members. share = accessible to guests outside the account via a link. For workspace templates this setting applies to every board in the installation. Omit to use the API default (public).")};const Zm={processId:i.z.string().describe("The process_id returned by use_template.")};const eu=Nc`
641
641
  mutation createView(
642
642
  $boardId: ID!
643
643
  $type: ViewKind!
@@ -659,7 +659,7 @@
659
659
  type
660
660
  }
661
661
  }
662
- `,eu={boardId:i.z.string().describe("The board ID to create the view on"),type:i.z.nativeEnum(Hp).default(Hp.Table).describe("The type of board view to create. Use TABLE for standard board views."),name:i.z.string().optional().describe('The name of the view (e.g. "High Priority Items", "My Tasks")'),filter:i.z.object({rules:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to filter by"),compare_value:i.z.any().default([]).describe("The value(s) to compare against"),operator:i.z.nativeEnum(ks).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:i.z.nativeEnum(Os).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration for the view"),sort:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to sort by"),direction:i.z.nativeEnum(Es).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),settings:i.z.any().optional().describe("Type-specific view settings as a JSON object (e.g. column visibility, group_by for TABLE). The shape varies by view type — call get_view_schema_by_type with the same ViewKind to discover the supported structure. For TABLE views, prefer the dedicated create_view_table tool which exposes a strongly-typed settings field.")};const tu=Nc`
662
+ `,tu={boardId:i.z.string().describe("The board ID to create the view on"),type:i.z.nativeEnum(Hp).default(Hp.Table).describe("The type of board view to create. Use TABLE for standard board views."),name:i.z.string().optional().describe('The name of the view (e.g. "High Priority Items", "My Tasks")'),filter:i.z.object({rules:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to filter by"),compare_value:i.z.any().default([]).describe("The value(s) to compare against"),operator:i.z.nativeEnum(ks).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:i.z.nativeEnum(Os).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration for the view"),sort:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to sort by"),direction:i.z.nativeEnum(Es).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),settings:i.z.any().optional().describe("Type-specific view settings as a JSON object (e.g. column visibility, group_by for TABLE). The shape varies by view type — call get_view_schema_by_type with the same ViewKind to discover the supported structure. For TABLE views, prefer the dedicated create_view_table tool which exposes a strongly-typed settings field.")};const au=Nc`
663
663
  mutation updateView(
664
664
  $viewId: ID!
665
665
  $boardId: ID!
@@ -683,7 +683,7 @@
683
683
  type
684
684
  }
685
685
  }
686
- `,au={viewId:i.z.string().describe("The ID of the view to update"),boardId:i.z.string().describe("The board ID the view belongs to"),type:i.z.nativeEnum(Hp).default(Hp.Table).describe("The type of the board view being updated. Use TABLE for standard board views."),name:i.z.string().optional().describe("New name for the view (omit to leave unchanged)"),filter:i.z.object({rules:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to filter by"),compare_value:i.z.any().default([]).describe("The value(s) to compare against"),operator:i.z.nativeEnum(ks).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:i.z.nativeEnum(Os).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration to apply to the view"),sort:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to sort by"),direction:i.z.nativeEnum(Es).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),settings:i.z.any().optional().describe("Type-specific view settings as a JSON object (e.g. column visibility, group_by for TABLE). The shape varies by view type — call get_view_schema_by_type with the same ViewKind to discover the supported structure. For TABLE views, prefer the dedicated update_view_table tool which exposes a strongly-typed settings field.")};const iu=Nc`
686
+ `,iu={viewId:i.z.string().describe("The ID of the view to update"),boardId:i.z.string().describe("The board ID the view belongs to"),type:i.z.nativeEnum(Hp).default(Hp.Table).describe("The type of the board view being updated. Use TABLE for standard board views."),name:i.z.string().optional().describe("New name for the view (omit to leave unchanged)"),filter:i.z.object({rules:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to filter by"),compare_value:i.z.any().default([]).describe("The value(s) to compare against"),operator:i.z.nativeEnum(ks).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:i.z.nativeEnum(Os).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration to apply to the view"),sort:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to sort by"),direction:i.z.nativeEnum(Es).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),settings:i.z.any().optional().describe("Type-specific view settings as a JSON object (e.g. column visibility, group_by for TABLE). The shape varies by view type — call get_view_schema_by_type with the same ViewKind to discover the supported structure. For TABLE views, prefer the dedicated update_view_table tool which exposes a strongly-typed settings field.")};const nu=Nc`
687
687
  mutation createViewTable(
688
688
  $boardId: ID!
689
689
  $name: String
@@ -705,7 +705,7 @@
705
705
  type
706
706
  }
707
707
  }
708
- `,nu=i.z.object({column_id:i.z.string().describe("The ID of the column"),visible:i.z.boolean().describe("Whether the column is visible")}),ou=i.z.object({columns:i.z.object({column_properties:i.z.array(nu).optional().describe("Visibility configuration for main board columns"),subitems_column_properties:i.z.array(nu).optional().describe("Visibility configuration for subitem columns"),floating_columns_count:i.z.number().int().optional().describe("Number of floating columns to display"),column_order:i.z.array(i.z.string()).optional().describe("Ordered list of column IDs")}).optional().describe("Column visibility and order configuration"),group_by:i.z.object({conditions:i.z.array(i.z.object({columnId:i.z.string().describe("ID of the column to group by"),config:i.z.object({sortSettings:i.z.object({direction:i.z.nativeEnum(Bd).describe("Sort direction (ASC or DESC)"),type:i.z.string().optional().describe("Type of sorting to apply")}).optional()}).optional()})).describe("Group-by conditions"),hideEmptyGroups:i.z.boolean().optional().describe("Whether to hide groups with no items")}).optional().describe("Group-by configuration for the table view")}).optional().describe("Table-specific view settings (column visibility/order, group-by)"),ru={boardId:i.z.string().describe("The board ID to create the table view on"),name:i.z.string().optional().describe('The name of the view (e.g. "High Priority Items", "My Tasks")'),filter:i.z.object({rules:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to filter by"),compare_value:i.z.any().default([]).describe("The value(s) to compare against"),operator:i.z.nativeEnum(ks).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:i.z.nativeEnum(Os).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration for the view"),sort:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to sort by"),direction:i.z.nativeEnum(Es).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),tags:i.z.array(i.z.string()).optional().describe("Tags to apply to the view"),settings:ou};const su=Nc`
708
+ `,ou=i.z.object({column_id:i.z.string().describe("The ID of the column"),visible:i.z.boolean().describe("Whether the column is visible")}),ru=i.z.object({columns:i.z.object({column_properties:i.z.array(ou).optional().describe("Visibility configuration for main board columns"),subitems_column_properties:i.z.array(ou).optional().describe("Visibility configuration for subitem columns"),floating_columns_count:i.z.number().int().optional().describe("Number of floating columns to display"),column_order:i.z.array(i.z.string()).optional().describe("Ordered list of column IDs")}).optional().describe("Column visibility and order configuration"),group_by:i.z.object({conditions:i.z.array(i.z.object({columnId:i.z.string().describe("ID of the column to group by"),config:i.z.object({sortSettings:i.z.object({direction:i.z.nativeEnum(Bd).describe("Sort direction (ASC or DESC)"),type:i.z.string().optional().describe("Type of sorting to apply")}).optional()}).optional()})).describe("Group-by conditions"),hideEmptyGroups:i.z.boolean().optional().describe("Whether to hide groups with no items")}).optional().describe("Group-by configuration for the table view")}).optional().describe("Table-specific view settings (column visibility/order, group-by)"),su={boardId:i.z.string().describe("The board ID to create the table view on"),name:i.z.string().optional().describe('The name of the view (e.g. "High Priority Items", "My Tasks")'),filter:i.z.object({rules:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to filter by"),compare_value:i.z.any().default([]).describe("The value(s) to compare against"),operator:i.z.nativeEnum(ks).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:i.z.nativeEnum(Os).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration for the view"),sort:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to sort by"),direction:i.z.nativeEnum(Es).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),tags:i.z.array(i.z.string()).optional().describe("Tags to apply to the view"),settings:ru};const du=Nc`
709
709
  mutation updateViewTable(
710
710
  $viewId: ID!
711
711
  $boardId: ID!
@@ -729,7 +729,7 @@
729
729
  type
730
730
  }
731
731
  }
732
- `,du=i.z.object({column_id:i.z.string().describe("The ID of the column"),visible:i.z.boolean().describe("Whether the column is visible")}),pu=i.z.object({columns:i.z.object({column_properties:i.z.array(du).optional().describe("Visibility configuration for main board columns"),subitems_column_properties:i.z.array(du).optional().describe("Visibility configuration for subitem columns"),floating_columns_count:i.z.number().int().optional().describe("Number of floating columns to display"),column_order:i.z.array(i.z.string()).optional().describe("Ordered list of column IDs")}).optional().describe("Column visibility and order configuration"),group_by:i.z.object({conditions:i.z.array(i.z.object({columnId:i.z.string().describe("ID of the column to group by"),config:i.z.object({sortSettings:i.z.object({direction:i.z.nativeEnum(Bd).describe("Sort direction (ASC or DESC)"),type:i.z.string().optional().describe("Type of sorting to apply")}).optional()}).optional()})).describe("Group-by conditions"),hideEmptyGroups:i.z.boolean().optional().describe("Whether to hide groups with no items")}).optional().describe("Group-by configuration for the table view")}).optional().describe("Table-specific view settings (column visibility/order, group-by)"),lu={viewId:i.z.string().describe("The ID of the table view to update"),boardId:i.z.string().describe("The board ID the view belongs to"),name:i.z.string().optional().describe("New name for the view (omit to leave unchanged)"),filter:i.z.object({rules:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to filter by"),compare_value:i.z.any().default([]).describe("The value(s) to compare against"),operator:i.z.nativeEnum(ks).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:i.z.nativeEnum(Os).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration to apply to the view"),sort:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to sort by"),direction:i.z.nativeEnum(Es).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),tags:i.z.array(i.z.string()).optional().describe("Tags to apply to the view"),settings:pu};const cu=Nc`
732
+ `,pu=i.z.object({column_id:i.z.string().describe("The ID of the column"),visible:i.z.boolean().describe("Whether the column is visible")}),lu=i.z.object({columns:i.z.object({column_properties:i.z.array(pu).optional().describe("Visibility configuration for main board columns"),subitems_column_properties:i.z.array(pu).optional().describe("Visibility configuration for subitem columns"),floating_columns_count:i.z.number().int().optional().describe("Number of floating columns to display"),column_order:i.z.array(i.z.string()).optional().describe("Ordered list of column IDs")}).optional().describe("Column visibility and order configuration"),group_by:i.z.object({conditions:i.z.array(i.z.object({columnId:i.z.string().describe("ID of the column to group by"),config:i.z.object({sortSettings:i.z.object({direction:i.z.nativeEnum(Bd).describe("Sort direction (ASC or DESC)"),type:i.z.string().optional().describe("Type of sorting to apply")}).optional()}).optional()})).describe("Group-by conditions"),hideEmptyGroups:i.z.boolean().optional().describe("Whether to hide groups with no items")}).optional().describe("Group-by configuration for the table view")}).optional().describe("Table-specific view settings (column visibility/order, group-by)"),cu={viewId:i.z.string().describe("The ID of the table view to update"),boardId:i.z.string().describe("The board ID the view belongs to"),name:i.z.string().optional().describe("New name for the view (omit to leave unchanged)"),filter:i.z.object({rules:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to filter by"),compare_value:i.z.any().default([]).describe("The value(s) to compare against"),operator:i.z.nativeEnum(ks).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:i.z.nativeEnum(Os).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration to apply to the view"),sort:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID to sort by"),direction:i.z.nativeEnum(Es).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),tags:i.z.array(i.z.string()).optional().describe("Tags to apply to the view"),settings:lu};const mu=Nc`
733
733
  fragment QuestionBasic on FormQuestion {
734
734
  id
735
735
  type
@@ -739,7 +739,7 @@
739
739
  required
740
740
  page_block_id
741
741
  }
742
- `,mu=Nc`
742
+ `,uu=Nc`
743
743
  fragment QuestionOptions on FormQuestion {
744
744
  options {
745
745
  label
@@ -748,7 +748,7 @@
748
748
  active
749
749
  }
750
750
  }
751
- `,uu=Nc`
751
+ `,hu=Nc`
752
752
  fragment QuestionSettings on FormQuestion {
753
753
  settings {
754
754
  prefill {
@@ -774,17 +774,17 @@
774
774
  default_answer
775
775
  }
776
776
  }
777
- `,hu=Nc`
777
+ `,fu=Nc`
778
778
  fragment QuestionComplete on FormQuestion {
779
779
  ...QuestionBasic
780
780
  ...QuestionOptions
781
781
  ...QuestionSettings
782
782
  show_if_rules
783
783
  }
784
- ${cu}
785
784
  ${mu}
786
785
  ${uu}
787
- `,fu=Nc`
786
+ ${hu}
787
+ `,_u=Nc`
788
788
  fragment FormFeatures on FormFeatures {
789
789
  isInternal
790
790
  reCaptchaChallenge
@@ -840,7 +840,7 @@
840
840
  enabled
841
841
  }
842
842
  }
843
- `,_u=Nc`
843
+ `,bu=Nc`
844
844
  fragment FormAppearance on FormAppearance {
845
845
  hideBranding
846
846
  showProgressBar
@@ -868,18 +868,18 @@
868
868
  text
869
869
  }
870
870
  }
871
- `,bu=Nc`
871
+ `,gu=Nc`
872
872
  fragment FormAccessibility on FormAccessibility {
873
873
  language
874
874
  logoAltText
875
875
  }
876
- `,gu=Nc`
876
+ `,yu=Nc`
877
877
  fragment FormTag on FormTag {
878
878
  id
879
879
  name
880
880
  columnId
881
881
  }
882
- `,yu=Nc`
882
+ `,vu=Nc`
883
883
  mutation createForm(
884
884
  $destination_workspace_id: ID!
885
885
  $destination_folder_id: ID
@@ -906,7 +906,7 @@
906
906
  token
907
907
  }
908
908
  }
909
- `,vu=Nc`
909
+ `,Iu=Nc`
910
910
  query getForm($formToken: String!) {
911
911
  form(formToken: $formToken) {
912
912
  id
@@ -935,16 +935,16 @@
935
935
  }
936
936
  }
937
937
  }
938
- ${hu}
939
938
  ${fu}
940
939
  ${_u}
941
940
  ${bu}
942
941
  ${gu}
943
- `,Iu=Nc`
942
+ ${yu}
943
+ `,wu=Nc`
944
944
  mutation deleteFormQuestion($formToken: String!, $questionId: String!) {
945
945
  delete_question(formToken: $formToken, questionId: $questionId)
946
946
  }
947
- `,wu=Nc`
947
+ `,Tu=Nc`
948
948
  mutation createFormQuestion($formToken: String!, $question: CreateQuestionInput!) {
949
949
  create_form_question(formToken: $formToken, question: $question) {
950
950
  ...QuestionBasic
@@ -952,10 +952,10 @@
952
952
  ...QuestionSettings
953
953
  }
954
954
  }
955
- ${cu}
956
955
  ${mu}
957
956
  ${uu}
958
- `,Tu=Nc`
957
+ ${hu}
958
+ `,Eu=Nc`
959
959
  mutation updateFormQuestion($formToken: String!, $questionId: String!, $question: UpdateQuestionInput!) {
960
960
  update_form_question(formToken: $formToken, questionId: $questionId, question: $question) {
961
961
  ...QuestionBasic
@@ -963,9 +963,9 @@
963
963
  ...QuestionSettings
964
964
  }
965
965
  }
966
- ${cu}
967
966
  ${mu}
968
967
  ${uu}
968
+ ${hu}
969
969
  `;Nc`
970
970
  mutation updateForm($formToken: String!, $input: UpdateFormInput!) {
971
971
  update_form(formToken: $formToken, input: $input) {
@@ -990,42 +990,42 @@
990
990
  }
991
991
  }
992
992
  }
993
- ${fu}
994
993
  ${_u}
995
994
  ${bu}
996
- `;const Eu=Nc`
995
+ ${gu}
996
+ `;const Au=Nc`
997
997
  mutation setFormPassword($formToken: String!, $input: SetFormPasswordInput!) {
998
998
  set_form_password(formToken: $formToken, input: $input) {
999
999
  id
1000
1000
  }
1001
1001
  }
1002
- `,Au=Nc`
1002
+ `,Su=Nc`
1003
1003
  mutation shortenFormUrl($formToken: String!) {
1004
1004
  shorten_form_url(formToken: $formToken) {
1005
1005
  enabled
1006
1006
  url
1007
1007
  }
1008
1008
  }
1009
- `,Su=Nc`
1009
+ `,Du=Nc`
1010
1010
  mutation deactivateForm($formToken: String!) {
1011
1011
  deactivate_form(formToken: $formToken)
1012
1012
  }
1013
- `,Du=Nc`
1013
+ `,Nu=Nc`
1014
1014
  mutation activateForm($formToken: String!) {
1015
1015
  activate_form(formToken: $formToken)
1016
1016
  }
1017
- `,Nu=Nc`
1017
+ `,Ou=Nc`
1018
1018
  mutation deleteFormTag($formToken: String!, $tagId: String!) {
1019
1019
  delete_form_tag(formToken: $formToken, tagId: $tagId)
1020
1020
  }
1021
- `,Ou=Nc`
1021
+ `,ku=Nc`
1022
1022
  mutation createFormTag($formToken: String!, $tag: CreateFormTagInput!) {
1023
1023
  create_form_tag(formToken: $formToken, tag: $tag) {
1024
1024
  ...FormTag
1025
1025
  }
1026
1026
  }
1027
- ${gu}
1028
- `,ku=Nc`
1027
+ ${yu}
1028
+ `,Ru=Nc`
1029
1029
  mutation updateFormAppearance($formToken: String!, $appearance: FormAppearanceInput!) {
1030
1030
  update_form_settings(formToken: $formToken, settings: { appearance: $appearance }) {
1031
1031
  appearance {
@@ -1033,8 +1033,8 @@
1033
1033
  }
1034
1034
  }
1035
1035
  }
1036
- ${_u}
1037
- `,Ru=Nc`
1036
+ ${bu}
1037
+ `,Cu=Nc`
1038
1038
  mutation updateFormAccessibility($formToken: String!, $accessibility: FormAccessibilityInput!) {
1039
1039
  update_form_settings(formToken: $formToken, settings: { accessibility: $accessibility }) {
1040
1040
  accessibility {
@@ -1042,8 +1042,8 @@
1042
1042
  }
1043
1043
  }
1044
1044
  }
1045
- ${bu}
1046
- `,Cu=Nc`
1045
+ ${gu}
1046
+ `,$u=Nc`
1047
1047
  mutation updateFormFeatures($formToken: String!, $features: FormFeaturesInput!, $is_anonymous: Boolean) {
1048
1048
  update_form_settings(formToken: $formToken, settings: { features: $features, is_anonymous: $is_anonymous }) {
1049
1049
  features {
@@ -1051,8 +1051,8 @@
1051
1051
  }
1052
1052
  }
1053
1053
  }
1054
- ${fu}
1055
- `,$u=Nc`
1054
+ ${_u}
1055
+ `,xu=Nc`
1056
1056
  mutation updateFormQuestionOrder($formToken: String!, $questions: [QuestionOrderInput!]!) {
1057
1057
  update_form(formToken: $formToken, input: { questions: $questions }) {
1058
1058
  questions {
@@ -1061,14 +1061,14 @@
1061
1061
  }
1062
1062
  }
1063
1063
  }
1064
- `,xu=Nc`
1064
+ `,Lu=Nc`
1065
1065
  mutation updateFormHeader($formToken: String!, $title: String, $description: String) {
1066
1066
  update_form(formToken: $formToken, input: { title: $title, description: $description }) {
1067
1067
  title
1068
1068
  description
1069
1069
  }
1070
1070
  }
1071
- `,Lu={questionId:"Question ID. Required for update/delete."},Uu={operations:{createForm:"Create a new form with specified configuration. Returns the created form with its unique token.",updateForm:{action:"Action to execute on the form. Each action requires different fields — check field descriptions to know what to include."},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:"Hides submitter identity.",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:"Required for delete. Auto-generated.",name:"Required for create. Cannot be updated.",columnId:"Auto-generated. Cannot be updated."}},inputs:{title:"Required for updateFormHeader.",description:"Required for updateFormHeader.",input:"Complete form configuration object containing properties to create or update.",questions:"All question IDs in order. Must include every existing ID. Required for updateQuestionOrder.",questionId:"Question ID. Required for update/delete.",tag:"Tag to create/delete. Delete: id only. Create: name (id/columnId auto-generated).",form:{describe:"Form data to update (patch semantics).",appearance:"Patch. Required for updateAppearance.",accessibility:"Patch. Required for updateAccessibility.",features:"Patch. Required for updateFeatures.",questionOrder:"Patch. Required for updateQuestionOrder.",formHeader:"Patch. Required for updateFormHeader."}},args:{destinationName:"Board name (stores form responses).",boardSubscriberIds:"User IDs to notify on board activity.",boardSubscriberTeamsIds:"Team IDs to notify on board activity."}},Pu={operations:{updateFormSettings:"Update form configuration including features, appearance, and accessibility options.",setFormPassword:"Required for setFormPassword action.",shortenUrl:"Shorten a URL for a form and store it in the form settings. Returns the shortened link object."},properties:{passwordEnabled:"Can only be set to false. Use setFormPassword to enable.",closeDateValue:"ISO timestamp.",includeNameQuestion:"Adds name column as a form question.",includeUpdateQuestion:"Adds updates/comments field linked to the board item.",syncQuestionAndColumnsTitles:"Syncs question titles with board column names.",allowCreateItem:"Shows 'Create Item' button on the board to open this form.",backgroundValue:"Hex color or image URL (depends on type).",logoSize:"Logo size for the form header.",language:"Form locale, 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."}},Vu={actions:{type:"Action to perform on the question of a form. create requires question. update requires questionId and question with type always included. delete requires questionId.",question:"The question to create or update. Always include type, then only the fields you want to set or change."},properties:{title:"Question text. Required when creating.",type:"Question type. Always required. Cannot be changed after creation — always send the existing type when updating.",position:"Integer specifying the display order of the question within the form (zero-based).",description:"Help text shown under 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:"Options for select questions. Always include all options — omitting an existing option will delete it. To update safely, call get_form first to retrieve existing option values, then include all options you want to keep with their original value fields.",selectOptionsValue:"Unique identifier for the option. If this option was used in existing submissions, it must keep its original value to preserve data integrity.",blockType:"The kind of block to create. Includes all question types and content block types.",insertAfterQuestionId:"ID to insert after. Omit to append. Null for first position.",pageBlockId:"Page block ID to group this question within. Set to null to remove from page block. Omit to leave unchanged."},showIfRules:"Conditional visibility. All operators must be OR.",showIfConditionBuildingBlockId:"Question ID to evaluate.",showIfConditionValues:"Answer values that satisfy the condition.",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."}},Mu={properties:{validation:"Validation rules applied to the question response",prefill:"Auto-populates from account data or URL query params.",prefillLookup:"Field name (e.g. 'email') or URL param name.",prefixAutofilled:"Phone only. Auto-detects country prefix.",prefixPredefined:"Phone only. Sets a default country prefix.",prefixPredefinedPrefix:"Country code, e.g. 'US', 'IL'.",checkedByDefault:"Boolean question type only.",defaultCurrentDate:"Date question type only.",includeTime:"Date only. Adds time picker.",display:"SingleSelect/MultiSelect only.",optionsOrder:"SingleSelect/MultiSelect only.",locationAutofilled:"Location only. Auto-fills current location.",limit:"Rating questions only: Maximum rating value that users can select.",skipValidation:"Link only. Skips URL format validation.",labelLimitCount:"MultiSelect only. Max selections. Pair with labelLimitCountEnabled.",labelLimitCountEnabled:"MultiSelect only. Enables selection limit.",defaultAnswer:"ShortText/LongText/Name/Link only. Pre-filled default value."},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"}},Fu={destination_workspace_id:i.z.string(),destination_folder_id:i.z.string().optional(),destination_folder_name:i.z.string().optional(),board_kind:i.z.nativeEnum(ho).optional(),destination_name:i.z.string().optional().describe(Uu.args.destinationName),board_owner_ids:i.z.array(i.z.string()).optional(),board_owner_team_ids:i.z.array(i.z.string()).optional(),board_subscriber_ids:i.z.array(i.z.string()).optional().describe(Uu.args.boardSubscriberIds),board_subscriber_teams_ids:i.z.array(i.z.string()).optional().describe(Uu.args.boardSubscriberTeamsIds)};var Bu,zu,ju,qu,Gu,Hu,Wu,Yu,Qu,Ku,Ju,Xu,Zu,eh,th,ah;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(Bu||(Bu={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(zu||(zu={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(ju||(ju={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(qu||(qu={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(Gu||(Gu={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(Hu||(Hu={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(Wu||(Wu={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(Yu||(Yu={})),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"}(Qu||(Qu={})),function(e){e.Account="account",e.QueryParam="queryParam"}(Ku||(Ku={})),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"}(Ju||(Ju={})),function(e){e.Or="OR"}(Xu||(Xu={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(Zu||(Zu={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(eh||(eh={})),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"}(th||(th={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(ah||(ah={}));const ih=i.z.object({type:i.z.nativeEnum(ns).describe(Vu.properties.type),title:i.z.string().describe(Vu.properties.title).optional(),description:i.z.string().describe(Vu.properties.description).optional(),visible:i.z.boolean().optional(),required:i.z.boolean().optional(),insert_after_question_id:i.z.string().nullish().describe(Vu.properties.insertAfterQuestionId),page_block_id:i.z.string().nullish().describe(Vu.properties.pageBlockId),show_if_rules:i.z.object({operator:i.z.nativeEnum(Ko),rules:i.z.array(i.z.object({operator:i.z.nativeEnum(Ko),conditions:i.z.array(i.z.object({building_block_id:i.z.string().describe(Vu.showIfConditionBuildingBlockId),operator:i.z.nativeEnum(Ko),values:i.z.array(i.z.string()).describe(Vu.showIfConditionValues)}))}))}).describe(Vu.showIfRules).optional(),options:i.z.array(i.z.object({label:i.z.string(),value:i.z.string().optional().describe(Vu.properties.selectOptionsValue),visible:i.z.boolean().optional()})).describe(Vu.properties.selectOptions).optional(),settings:i.z.object({checkedByDefault:i.z.boolean().describe(Mu.properties.checkedByDefault).optional(),defaultCurrentDate:i.z.boolean().describe(Mu.properties.defaultCurrentDate).optional(),display:i.z.nativeEnum(as).describe(Mu.properties.display).optional(),includeTime:i.z.boolean().describe(Mu.properties.includeTime).optional(),locationAutofilled:i.z.boolean().describe(Mu.properties.locationAutofilled).optional(),optionsOrder:i.z.nativeEnum(is).describe(Mu.properties.optionsOrder).optional(),prefixAutofilled:i.z.boolean().describe(Mu.properties.prefixAutofilled).optional(),prefixPredefined:i.z.object({enabled:i.z.boolean(),prefix:i.z.string().describe(Mu.properties.prefixPredefinedPrefix).optional()}).describe(Mu.properties.prefixPredefined).optional(),skipValidation:i.z.boolean().describe(Mu.properties.skipValidation).optional(),labelLimitCount:i.z.number().int().describe(Mu.properties.labelLimitCount).optional(),label_limit_count_enabled:i.z.boolean().describe(Mu.properties.labelLimitCountEnabled).optional(),default_answer:i.z.string().describe(Mu.properties.defaultAnswer).optional(),prefill:i.z.object({enabled:i.z.boolean(),lookup:i.z.string().describe(Mu.properties.prefillLookup).optional(),source:i.z.nativeEnum(ts).optional()}).describe(Mu.properties.prefill).optional()}).describe("Type-specific question settings. Check each field description to see which question type it applies to.").optional()}),nh={action:i.z.nativeEnum(ah).describe(Vu.actions.type),formToken:i.z.string(),questionId:i.z.string().describe(Lu.questionId).optional(),question:ih.describe(Vu.actions.question).optional()};class oh{constructor(e){this.getMondayApi=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.getMondayApi().request(Iu,a),{content:{message:"Question deleted",question_id:t,action_name:"delete"}}}async updateQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when updating a question."};const a=e.question;if(!a)return{content:"Must provide updated patch props for the question when updating."};const i={formToken:e.formToken,questionId:t,question:a};return await this.getMondayApi().request(Tu,i),{content:{message:"Question updated",question_id:t,action_name:"update"}}}async createQuestion(e){const t=e.question;if(!t)return{content:"Must provide a full question payload when creating a question."};if(!t.title)return{content:"Must provide a title for the question when creating a question."};const a={formToken:e.formToken,question:{...t,title:t.title}},i=await this.getMondayApi().request(wu,a);return{content:{message:"Question created",question_id:i.create_form_question?.id,action_name:"create"}}}}var rh;!function(e){e.activate="activate",e.deactivate="deactivate",e.shortenFormUrl="shortenFormUrl",e.setFormPassword="setFormPassword",e.createTag="createTag",e.deleteTag="deleteTag",e.updateAppearance="updateAppearance",e.updateAccessibility="updateAccessibility",e.updateFeatures="updateFeatures",e.updateQuestionOrder="updateQuestionOrder",e.updateFormHeader="updateFormHeader"}(rh||(rh={}));const sh=i.z.object({id:i.z.string().describe(Uu.properties.tags.id).optional(),name:i.z.string().describe(Uu.properties.tags.name).optional(),columnId:i.z.string().describe(Uu.properties.tags.columnId).optional()}),dh=i.z.object({type:i.z.nativeEnum(qu).optional(),value:i.z.string().describe(Pu.properties.backgroundValue).optional()}),ph=i.z.object({format:i.z.nativeEnum(Hu).optional(),alignment:i.z.nativeEnum(Wu).optional(),direction:i.z.nativeEnum(Gu).optional()}),lh=i.z.object({position:i.z.nativeEnum(ju).optional(),size:i.z.nativeEnum(zu).describe(Pu.properties.logoSize).optional()}),ch=i.z.object({text:i.z.string().optional()}),mh=i.z.object({font:i.z.string().optional(),color:i.z.string().optional(),size:i.z.nativeEnum(Yu).optional()}),uh=i.z.object({enabled:i.z.boolean().optional(),redirectUrl:i.z.string().optional()}),hh=i.z.object({allowEditSubmission:i.z.boolean().optional(),allowResubmit:i.z.boolean().optional(),allowViewSubmission:i.z.boolean().optional(),description:i.z.string().optional(),redirectAfterSubmission:uh.optional(),showSuccessImage:i.z.boolean().optional(),title:i.z.string().optional()}),fh=i.z.object({enabled:i.z.boolean().optional(),date:i.z.string().describe(Pu.properties.closeDateValue).optional()}),_h=i.z.object({enabled:i.z.boolean().optional()}),bh=i.z.object({itemGroupId:i.z.string().optional(),includeNameQuestion:i.z.boolean().describe(Pu.properties.includeNameQuestion).optional(),includeUpdateQuestion:i.z.boolean().describe(Pu.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:i.z.boolean().describe(Pu.properties.syncQuestionAndColumnsTitles).optional(),allow_create_item:i.z.boolean().describe(Pu.properties.allowCreateItem).optional()}),gh=i.z.object({enabled:i.z.boolean().describe(Pu.properties.passwordEnabled).optional()}),yh=i.z.object({text:i.z.string().optional()}),vh=i.z.object({enabled:i.z.boolean().optional(),title:i.z.string().optional(),description:i.z.string().optional(),startButton:yh.optional()}),Ih=i.z.object({enabled:i.z.boolean().optional(),redirectToLogin:i.z.boolean().optional()}),wh=i.z.object({enabled:i.z.boolean().optional(),limit:i.z.number().optional()}),Th=i.z.object({background:dh.optional(),hideBranding:i.z.boolean().optional(),layout:ph.optional(),logo:lh.optional(),primaryColor:i.z.string().optional(),showProgressBar:i.z.boolean().optional(),submitButton:ch.optional(),text:mh.optional()}),Eh=i.z.object({language:i.z.string().describe(Pu.properties.language).optional(),logoAltText:i.z.string().optional()}),Ah=i.z.object({enabled:i.z.boolean().optional()}),Sh=i.z.object({afterSubmissionView:hh.optional(),ai_translate:Ah.optional(),closeDate:fh.optional(),draftSubmission:_h.optional(),monday:bh.optional(),password:gh.optional(),preSubmissionView:vh.optional(),reCaptchaChallenge:i.z.boolean().optional(),requireLogin:Ih.optional(),responseLimit:wh.optional(),is_anonymous:i.z.boolean().describe(Uu.properties.isAnonymous).optional()}),Dh=i.z.object({id:i.z.string().describe(Uu.inputs.questionId),page_block_id:i.z.string().describe(Vu.properties.pageBlockId).optional()}),Nh=i.z.object({appearance:Th.describe(Uu.inputs.form.appearance).optional(),accessibility:Eh.describe(Uu.inputs.form.accessibility).optional(),features:Sh.describe(Uu.inputs.form.features).optional(),title:i.z.string().describe(Uu.inputs.title).optional(),description:i.z.string().describe(Uu.inputs.description).optional(),questions:i.z.array(Dh).describe(Uu.inputs.questions).optional()}),Oh={formToken:i.z.string(),action:i.z.nativeEnum(rh).describe(Uu.operations.updateForm.action),formPassword:i.z.string().describe(Pu.operations.setFormPassword).optional(),tag:sh.describe(Uu.inputs.tag).optional(),form:Nh.describe(Uu.inputs.form.describe).optional()};class kh{constructor(e){this.getMondayApi=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.getMondayApi().request(Eu,t),{content:{message:"Form password successfully set",form_token:e.formToken,action_name:"setFormPassword"}}}async shortenFormUrl(e){const t={formToken:e.formToken};return await this.getMondayApi().request(Au,t),{content:{message:"Form URL successfully shortened",form_token:e.formToken,action_name:"shortenFormUrl"}}}async deactivateForm(e){const t={formToken:e.formToken};return await this.getMondayApi().request(Su,t),{content:{message:"Form successfully deactivated",form_token:e.formToken,action_name:"deactivateForm"}}}async activateForm(e){const t={formToken:e.formToken};return await this.getMondayApi().request(Du,t),{content:{message:"Form successfully activated",form_token:e.formToken,action_name:"activateForm"}}}async createTag(e){if(!e.tag)return{content:'Tag is required for the action "createTag" in the update form tool.'};if(!e.tag.name)return{content:'Tag name is required for the action "createTag" in the update form tool.'};const t={formToken:e.formToken,tag:{name:e.tag.name}},a=await this.getMondayApi().request(Ou,t);return{content:{message:"Tag successfully added",form_token:e.formToken,action_name:"createTag",data:a.create_form_tag}}}async deleteTag(e){if(!e.tag)return{content:'Tag is required for the action "deleteTag" in the update form tool.'};if(!e.tag.id)return{content:'Tag id is required for the action "deleteTag" in the update form tool.'};const t={formToken:e.formToken,tagId:e.tag.id};return await this.getMondayApi().request(Nu,t),{content:{message:"Tag deleted",form_token:e.formToken,tag_id:e.tag.id,action_name:"deleteTag"}}}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.getMondayApi().request(ku,t);return{content:{message:"Appearance successfully updated",form_token:e.formToken,action_name:"updateAppearance",data:a.update_form_settings?.appearance}}}async updateAccessibility(e){if(!e.form?.accessibility)return{content:'Accessibility is required for the action "updateAccessibility" in the update form tool.'};const t={formToken:e.formToken,accessibility:e.form.accessibility},a=await this.getMondayApi().request(Ru,t);return{content:{message:"Accessibility successfully updated",form_token:e.formToken,action_name:"updateAccessibility",data:a.update_form_settings?.accessibility}}}async updateFeatures(e){if(!e.form?.features)return{content:'Features is required for the action "updateFeatures" in the update form tool.'};const{is_anonymous:t,...a}=e.form.features,i={formToken:e.formToken,features:a,is_anonymous:t},n=await this.getMondayApi().request(Cu,i);return{content:{message:"Features successfully updated",form_token:e.formToken,action_name:"updateFeatures",data:n.update_form_settings?.features}}}async updateQuestionOrder(e){if(!e.form?.questions)return{content:'List of dehydrated questions is required for the action "updateQuestionOrder" in the update form tool.'};const t={formToken:e.formToken,questions:e.form.questions},a=await this.getMondayApi().request($u,t);return{content:{message:"Question order successfully updated",form_token:e.formToken,action_name:"updateQuestionOrder",data:a.update_form?.questions}}}async updateFormHeader(e){if(!e.form?.title&&!e.form?.description)return{content:'Title or description is required for the action "updateFormHeader" in the update form tool.'};const t={formToken:e.formToken,title:e.form.title,description:e.form.description},a=await this.getMondayApi().request(xu,t);return{content:{message:"Form header updated",form_token:e.formToken,action_name:"updateFormHeader",data:a.update_form}}}}const Rh={formToken:i.z.string()};const Ch=Nc`
1071
+ `,Uu={questionId:"Question ID. Required for update/delete."},Pu={operations:{createForm:"Create a new form with specified configuration. Returns the created form with its unique token.",updateForm:{action:"Action to execute on the form. Each action requires different fields — check field descriptions to know what to include."},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:"Hides submitter identity.",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:"Required for delete. Auto-generated.",name:"Required for create. Cannot be updated.",columnId:"Auto-generated. Cannot be updated."}},inputs:{title:"Required for updateFormHeader.",description:"Required for updateFormHeader.",input:"Complete form configuration object containing properties to create or update.",questions:"All question IDs in order. Must include every existing ID. Required for updateQuestionOrder.",questionId:"Question ID. Required for update/delete.",tag:"Tag to create/delete. Delete: id only. Create: name (id/columnId auto-generated).",form:{describe:"Form data to update (patch semantics).",appearance:"Patch. Required for updateAppearance.",accessibility:"Patch. Required for updateAccessibility.",features:"Patch. Required for updateFeatures.",questionOrder:"Patch. Required for updateQuestionOrder.",formHeader:"Patch. Required for updateFormHeader."}},args:{destinationName:"Board name (stores form responses).",boardSubscriberIds:"User IDs to notify on board activity.",boardSubscriberTeamsIds:"Team IDs to notify on board activity."}},Vu={operations:{updateFormSettings:"Update form configuration including features, appearance, and accessibility options.",setFormPassword:"Required for setFormPassword action.",shortenUrl:"Shorten a URL for a form and store it in the form settings. Returns the shortened link object."},properties:{passwordEnabled:"Can only be set to false. Use setFormPassword to enable.",closeDateValue:"ISO timestamp.",includeNameQuestion:"Adds name column as a form question.",includeUpdateQuestion:"Adds updates/comments field linked to the board item.",syncQuestionAndColumnsTitles:"Syncs question titles with board column names.",allowCreateItem:"Shows 'Create Item' button on the board to open this form.",backgroundValue:"Hex color or image URL (depends on type).",logoSize:"Logo size for the form header.",language:"Form locale, 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."}},Mu={actions:{type:"Action to perform on the question of a form. create requires question. update requires questionId and question with type always included. delete requires questionId.",question:"The question to create or update. Always include type, then only the fields you want to set or change."},properties:{title:"Question text. Required when creating.",type:"Question type. Always required. Cannot be changed after creation — always send the existing type when updating.",position:"Integer specifying the display order of the question within the form (zero-based).",description:"Help text shown under 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:"Options for select questions. Always include all options — omitting an existing option will delete it. To update safely, call get_form first to retrieve existing option values, then include all options you want to keep with their original value fields.",selectOptionsValue:"Unique identifier for the option. If this option was used in existing submissions, it must keep its original value to preserve data integrity.",blockType:"The kind of block to create. Includes all question types and content block types.",insertAfterQuestionId:"ID to insert after. Omit to append. Null for first position.",pageBlockId:"Page block ID to group this question within. Set to null to remove from page block. Omit to leave unchanged."},showIfRules:"Conditional visibility. All operators must be OR.",showIfConditionBuildingBlockId:"Question ID to evaluate.",showIfConditionValues:"Answer values that satisfy the condition.",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."}},Fu={properties:{validation:"Validation rules applied to the question response",prefill:"Auto-populates from account data or URL query params.",prefillLookup:"Field name (e.g. 'email') or URL param name.",prefixAutofilled:"Phone only. Auto-detects country prefix.",prefixPredefined:"Phone only. Sets a default country prefix.",prefixPredefinedPrefix:"Country code, e.g. 'US', 'IL'.",checkedByDefault:"Boolean question type only.",defaultCurrentDate:"Date question type only.",includeTime:"Date only. Adds time picker.",display:"SingleSelect/MultiSelect only.",optionsOrder:"SingleSelect/MultiSelect only.",locationAutofilled:"Location only. Auto-fills current location.",limit:"Rating questions only: Maximum rating value that users can select.",skipValidation:"Link only. Skips URL format validation.",labelLimitCount:"MultiSelect only. Max selections. Pair with labelLimitCountEnabled.",labelLimitCountEnabled:"MultiSelect only. Enables selection limit.",defaultAnswer:"ShortText/LongText/Name/Link only. Pre-filled default value."},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"}},Bu={destination_workspace_id:i.z.string(),destination_folder_id:i.z.string().optional(),destination_folder_name:i.z.string().optional(),board_kind:i.z.nativeEnum(ho).optional(),destination_name:i.z.string().optional().describe(Pu.args.destinationName),board_owner_ids:i.z.array(i.z.string()).optional(),board_owner_team_ids:i.z.array(i.z.string()).optional(),board_subscriber_ids:i.z.array(i.z.string()).optional().describe(Pu.args.boardSubscriberIds),board_subscriber_teams_ids:i.z.array(i.z.string()).optional().describe(Pu.args.boardSubscriberTeamsIds)};var zu,ju,qu,Gu,Hu,Wu,Yu,Qu,Ku,Ju,Xu,Zu,eh,th,ah,ih;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(zu||(zu={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(ju||(ju={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(qu||(qu={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(Gu||(Gu={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(Hu||(Hu={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(Wu||(Wu={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(Yu||(Yu={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(Qu||(Qu={})),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"}(Ku||(Ku={})),function(e){e.Account="account",e.QueryParam="queryParam"}(Ju||(Ju={})),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"}(Xu||(Xu={})),function(e){e.Or="OR"}(Zu||(Zu={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(eh||(eh={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(th||(th={})),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"}(ah||(ah={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(ih||(ih={}));const nh=i.z.object({type:i.z.nativeEnum(ns).describe(Mu.properties.type),title:i.z.string().describe(Mu.properties.title).optional(),description:i.z.string().describe(Mu.properties.description).optional(),visible:i.z.boolean().optional(),required:i.z.boolean().optional(),insert_after_question_id:i.z.string().nullish().describe(Mu.properties.insertAfterQuestionId),page_block_id:i.z.string().nullish().describe(Mu.properties.pageBlockId),show_if_rules:i.z.object({operator:i.z.nativeEnum(Ko),rules:i.z.array(i.z.object({operator:i.z.nativeEnum(Ko),conditions:i.z.array(i.z.object({building_block_id:i.z.string().describe(Mu.showIfConditionBuildingBlockId),operator:i.z.nativeEnum(Ko),values:i.z.array(i.z.string()).describe(Mu.showIfConditionValues)}))}))}).describe(Mu.showIfRules).optional(),options:i.z.array(i.z.object({label:i.z.string(),value:i.z.string().optional().describe(Mu.properties.selectOptionsValue),visible:i.z.boolean().optional()})).describe(Mu.properties.selectOptions).optional(),settings:i.z.object({checkedByDefault:i.z.boolean().describe(Fu.properties.checkedByDefault).optional(),defaultCurrentDate:i.z.boolean().describe(Fu.properties.defaultCurrentDate).optional(),display:i.z.nativeEnum(as).describe(Fu.properties.display).optional(),includeTime:i.z.boolean().describe(Fu.properties.includeTime).optional(),locationAutofilled:i.z.boolean().describe(Fu.properties.locationAutofilled).optional(),optionsOrder:i.z.nativeEnum(is).describe(Fu.properties.optionsOrder).optional(),prefixAutofilled:i.z.boolean().describe(Fu.properties.prefixAutofilled).optional(),prefixPredefined:i.z.object({enabled:i.z.boolean(),prefix:i.z.string().describe(Fu.properties.prefixPredefinedPrefix).optional()}).describe(Fu.properties.prefixPredefined).optional(),skipValidation:i.z.boolean().describe(Fu.properties.skipValidation).optional(),labelLimitCount:i.z.number().int().describe(Fu.properties.labelLimitCount).optional(),label_limit_count_enabled:i.z.boolean().describe(Fu.properties.labelLimitCountEnabled).optional(),default_answer:i.z.string().describe(Fu.properties.defaultAnswer).optional(),prefill:i.z.object({enabled:i.z.boolean(),lookup:i.z.string().describe(Fu.properties.prefillLookup).optional(),source:i.z.nativeEnum(ts).optional()}).describe(Fu.properties.prefill).optional()}).describe("Type-specific question settings. Check each field description to see which question type it applies to.").optional()}),oh={action:i.z.nativeEnum(ih).describe(Mu.actions.type),formToken:i.z.string(),questionId:i.z.string().describe(Uu.questionId).optional(),question:nh.describe(Mu.actions.question).optional()};class rh{constructor(e){this.getMondayApi=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.getMondayApi().request(wu,a),{content:{message:"Question deleted",question_id:t,action_name:"delete"}}}async updateQuestion(e){const t=e.questionId;if(!t)return{content:"Question ID is required when updating a question."};const a=e.question;if(!a)return{content:"Must provide updated patch props for the question when updating."};const i={formToken:e.formToken,questionId:t,question:a};return await this.getMondayApi().request(Eu,i),{content:{message:"Question updated",question_id:t,action_name:"update"}}}async createQuestion(e){const t=e.question;if(!t)return{content:"Must provide a full question payload when creating a question."};if(!t.title)return{content:"Must provide a title for the question when creating a question."};const a={formToken:e.formToken,question:{...t,title:t.title}},i=await this.getMondayApi().request(Tu,a);return{content:{message:"Question created",question_id:i.create_form_question?.id,action_name:"create"}}}}var sh;!function(e){e.activate="activate",e.deactivate="deactivate",e.shortenFormUrl="shortenFormUrl",e.setFormPassword="setFormPassword",e.createTag="createTag",e.deleteTag="deleteTag",e.updateAppearance="updateAppearance",e.updateAccessibility="updateAccessibility",e.updateFeatures="updateFeatures",e.updateQuestionOrder="updateQuestionOrder",e.updateFormHeader="updateFormHeader"}(sh||(sh={}));const dh=i.z.object({id:i.z.string().describe(Pu.properties.tags.id).optional(),name:i.z.string().describe(Pu.properties.tags.name).optional(),columnId:i.z.string().describe(Pu.properties.tags.columnId).optional()}),ph=i.z.object({type:i.z.nativeEnum(Gu).optional(),value:i.z.string().describe(Vu.properties.backgroundValue).optional()}),lh=i.z.object({format:i.z.nativeEnum(Wu).optional(),alignment:i.z.nativeEnum(Yu).optional(),direction:i.z.nativeEnum(Hu).optional()}),ch=i.z.object({position:i.z.nativeEnum(qu).optional(),size:i.z.nativeEnum(ju).describe(Vu.properties.logoSize).optional()}),mh=i.z.object({text:i.z.string().optional()}),uh=i.z.object({font:i.z.string().optional(),color:i.z.string().optional(),size:i.z.nativeEnum(Qu).optional()}),hh=i.z.object({enabled:i.z.boolean().optional(),redirectUrl:i.z.string().optional()}),fh=i.z.object({allowEditSubmission:i.z.boolean().optional(),allowResubmit:i.z.boolean().optional(),allowViewSubmission:i.z.boolean().optional(),description:i.z.string().optional(),redirectAfterSubmission:hh.optional(),showSuccessImage:i.z.boolean().optional(),title:i.z.string().optional()}),_h=i.z.object({enabled:i.z.boolean().optional(),date:i.z.string().describe(Vu.properties.closeDateValue).optional()}),bh=i.z.object({enabled:i.z.boolean().optional()}),gh=i.z.object({itemGroupId:i.z.string().optional(),includeNameQuestion:i.z.boolean().describe(Vu.properties.includeNameQuestion).optional(),includeUpdateQuestion:i.z.boolean().describe(Vu.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:i.z.boolean().describe(Vu.properties.syncQuestionAndColumnsTitles).optional(),allow_create_item:i.z.boolean().describe(Vu.properties.allowCreateItem).optional()}),yh=i.z.object({enabled:i.z.boolean().describe(Vu.properties.passwordEnabled).optional()}),vh=i.z.object({text:i.z.string().optional()}),Ih=i.z.object({enabled:i.z.boolean().optional(),title:i.z.string().optional(),description:i.z.string().optional(),startButton:vh.optional()}),wh=i.z.object({enabled:i.z.boolean().optional(),redirectToLogin:i.z.boolean().optional()}),Th=i.z.object({enabled:i.z.boolean().optional(),limit:i.z.number().optional()}),Eh=i.z.object({background:ph.optional(),hideBranding:i.z.boolean().optional(),layout:lh.optional(),logo:ch.optional(),primaryColor:i.z.string().optional(),showProgressBar:i.z.boolean().optional(),submitButton:mh.optional(),text:uh.optional()}),Ah=i.z.object({language:i.z.string().describe(Vu.properties.language).optional(),logoAltText:i.z.string().optional()}),Sh=i.z.object({enabled:i.z.boolean().optional()}),Dh=i.z.object({afterSubmissionView:fh.optional(),ai_translate:Sh.optional(),closeDate:_h.optional(),draftSubmission:bh.optional(),monday:gh.optional(),password:yh.optional(),preSubmissionView:Ih.optional(),reCaptchaChallenge:i.z.boolean().optional(),requireLogin:wh.optional(),responseLimit:Th.optional(),is_anonymous:i.z.boolean().describe(Pu.properties.isAnonymous).optional()}),Nh=i.z.object({id:i.z.string().describe(Pu.inputs.questionId),page_block_id:i.z.string().describe(Mu.properties.pageBlockId).optional()}),Oh=i.z.object({appearance:Eh.describe(Pu.inputs.form.appearance).optional(),accessibility:Ah.describe(Pu.inputs.form.accessibility).optional(),features:Dh.describe(Pu.inputs.form.features).optional(),title:i.z.string().describe(Pu.inputs.title).optional(),description:i.z.string().describe(Pu.inputs.description).optional(),questions:i.z.array(Nh).describe(Pu.inputs.questions).optional()}),kh={formToken:i.z.string(),action:i.z.nativeEnum(sh).describe(Pu.operations.updateForm.action),formPassword:i.z.string().describe(Vu.operations.setFormPassword).optional(),tag:dh.describe(Pu.inputs.tag).optional(),form:Oh.describe(Pu.inputs.form.describe).optional()};class Rh{constructor(e){this.getMondayApi=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.getMondayApi().request(Au,t),{content:{message:"Form password successfully set",form_token:e.formToken,action_name:"setFormPassword"}}}async shortenFormUrl(e){const t={formToken:e.formToken};return await this.getMondayApi().request(Su,t),{content:{message:"Form URL successfully shortened",form_token:e.formToken,action_name:"shortenFormUrl"}}}async deactivateForm(e){const t={formToken:e.formToken};return await this.getMondayApi().request(Du,t),{content:{message:"Form successfully deactivated",form_token:e.formToken,action_name:"deactivateForm"}}}async activateForm(e){const t={formToken:e.formToken};return await this.getMondayApi().request(Nu,t),{content:{message:"Form successfully activated",form_token:e.formToken,action_name:"activateForm"}}}async createTag(e){if(!e.tag)return{content:'Tag is required for the action "createTag" in the update form tool.'};if(!e.tag.name)return{content:'Tag name is required for the action "createTag" in the update form tool.'};const t={formToken:e.formToken,tag:{name:e.tag.name}},a=await this.getMondayApi().request(ku,t);return{content:{message:"Tag successfully added",form_token:e.formToken,action_name:"createTag",data:a.create_form_tag}}}async deleteTag(e){if(!e.tag)return{content:'Tag is required for the action "deleteTag" in the update form tool.'};if(!e.tag.id)return{content:'Tag id is required for the action "deleteTag" in the update form tool.'};const t={formToken:e.formToken,tagId:e.tag.id};return await this.getMondayApi().request(Ou,t),{content:{message:"Tag deleted",form_token:e.formToken,tag_id:e.tag.id,action_name:"deleteTag"}}}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.getMondayApi().request(Ru,t);return{content:{message:"Appearance successfully updated",form_token:e.formToken,action_name:"updateAppearance",data:a.update_form_settings?.appearance}}}async updateAccessibility(e){if(!e.form?.accessibility)return{content:'Accessibility is required for the action "updateAccessibility" in the update form tool.'};const t={formToken:e.formToken,accessibility:e.form.accessibility},a=await this.getMondayApi().request(Cu,t);return{content:{message:"Accessibility successfully updated",form_token:e.formToken,action_name:"updateAccessibility",data:a.update_form_settings?.accessibility}}}async updateFeatures(e){if(!e.form?.features)return{content:'Features is required for the action "updateFeatures" in the update form tool.'};const{is_anonymous:t,...a}=e.form.features,i={formToken:e.formToken,features:a,is_anonymous:t},n=await this.getMondayApi().request($u,i);return{content:{message:"Features successfully updated",form_token:e.formToken,action_name:"updateFeatures",data:n.update_form_settings?.features}}}async updateQuestionOrder(e){if(!e.form?.questions)return{content:'List of dehydrated questions is required for the action "updateQuestionOrder" in the update form tool.'};const t={formToken:e.formToken,questions:e.form.questions},a=await this.getMondayApi().request(xu,t);return{content:{message:"Question order successfully updated",form_token:e.formToken,action_name:"updateQuestionOrder",data:a.update_form?.questions}}}async updateFormHeader(e){if(!e.form?.title&&!e.form?.description)return{content:'Title or description is required for the action "updateFormHeader" in the update form tool.'};const t={formToken:e.formToken,title:e.form.title,description:e.form.description},a=await this.getMondayApi().request(Lu,t);return{content:{message:"Form header updated",form_token:e.formToken,action_name:"updateFormHeader",data:a.update_form}}}}const Ch={formToken:i.z.string()};const $h=Nc`
1072
1072
  mutation CreateFormSubmission(
1073
1073
  $form_token: String!
1074
1074
  $answers: [FormAnswerInput!]!
@@ -1086,14 +1086,14 @@
1086
1086
  id
1087
1087
  }
1088
1088
  }
1089
- `,$h=i.z.object({phone:i.z.string().describe("The phone number."),country_short_name:i.z.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),xh=i.z.object({country_name:i.z.string().describe('The full country name (e.g. "United States").'),country_code:i.z.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Lh=i.z.object({date:i.z.string().describe("The date in YYYY-MM-DD format."),zone_diff:i.z.number().int().optional().describe("UTC offset in minutes.")}),Uh=i.z.object({from:i.z.string().describe("Start date in YYYY-MM-DD format."),to:i.z.string().describe("End date in YYYY-MM-DD format.")}),Ph=i.z.object({lat:i.z.number().describe("Latitude."),lng:i.z.number().describe("Longitude."),place_id:i.z.string().describe("Google Maps place ID."),address:i.z.string().describe("Full formatted address."),country:i.z.object({long_name:i.z.string().describe("Full country name."),short_name:i.z.string().describe("ISO 3166-1 alpha-2 country code.")}),city:i.z.object({long_name:i.z.string().describe("Full city name."),short_name:i.z.string().describe("Abbreviated city name.")}),street:i.z.object({long_name:i.z.string().describe("Full street name."),short_name:i.z.string().describe("Abbreviated street name.")}),street_number:i.z.object({long_name:i.z.string().describe("Full street number."),short_name:i.z.string().describe("Abbreviated street number.")})}),Vh=i.z.object({id:i.z.string().describe("The file ID returned by the workforms upload endpoint."),name:i.z.string().describe('Original file name (e.g. "image.png").'),extension:i.z.string().optional().describe('File extension (e.g. "pdf", "png").'),is_image:i.z.boolean().optional().describe("Whether the file is an image.")}),Mh=i.z.object({question_id:i.z.string().describe("The ID of the question being answered."),name:i.z.string().optional().describe("Answer for name questions."),email:i.z.string().optional().describe("Answer for email questions."),short_text:i.z.string().optional().describe("Answer for short text questions."),long_text:i.z.string().optional().describe("Answer for long text questions."),link:i.z.string().optional().describe("Answer for link questions."),updates:i.z.string().optional().describe("Answer for updates questions."),boolean:i.z.boolean().optional().describe("Answer for boolean questions."),number:i.z.number().optional().describe("Answer for number questions."),rating:i.z.number().min(1).optional().describe("Answer for rating questions. Must be a positive number within the question's configured limit."),single_select:i.z.string().optional().describe("Answer for single-select questions — the selected option ID."),multi_select:i.z.array(i.z.number()).optional().describe("Answer for multi-select questions — list of selected option IDs."),people:i.z.array(i.z.string()).optional().describe("Answer for people questions — list of user IDs. Obtain user IDs via the list_users_and_teams tool."),connected_boards:i.z.array(i.z.string()).optional().describe("Answer for connected boards questions — list of connected item IDs."),phone:$h.optional().describe("Answer for phone questions."),country:xh.optional().describe("Answer for country questions."),date:Lh.optional().describe("Answer for date questions."),date_range:Uh.optional().describe("Answer for date range questions."),location:Ph.optional().describe("Answer for location questions. Requires a Google Maps place ID and structured address components."),file:i.z.array(Vh).optional().describe("Answer for file questions. Each file must be uploaded first to obtain a file ID. Up to the question's configured limit."),signature:Vh.optional().describe("Answer for signature questions. The file must be uploaded first to obtain a file ID.")}).describe("An answer for a single form question. Set question_id and exactly one answer field matching the question type. Subitems questions are not supported."),Fh={form_token:i.z.string().describe("The unique token identifying the WorkForm. Can be a bare token, a full WorkForm URL (e.g. https://forms.monday.com/forms/abc123?r=use1), or a shortened wkf.ms URL (e.g. https://wkf.ms/4tqP28t). Shortened URLs are automatically resolved by following the redirect."),answers:i.z.array(Mh).describe("Array of answers to submit. Each answer specifies a question_id and the value for that question type."),form_timezone_offset:i.z.number().int().min(-840).max(840).describe("The timezone offset of the submitter in minutes (e.g. -120 for UTC-2, 0 for UTC)."),password:i.z.string().optional().describe("The password for the WorkForm. Only required if the WorkForm has password protection enabled (check features.password.enabled from get_form). If required, ask the user for the password before submitting."),tags:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID this tag maps to."),value:i.z.string().describe("The tag value to submit.")})).optional().describe("Tags to attach to the submission — each tag maps a value to a specific board column.")};const Bh={columnType:i.z.nativeEnum(bm).describe("The type of the column to be created"),columnTitle:i.z.string().describe("The title of the column to be created"),columnDescription:i.z.string().optional().describe("The description of the column to be created"),columnSettings:i.z.string().optional().describe("Column-specific configuration settings as a JSON string. Shape depends on columnType — see tool description for how to obtain it.")},zh={boardId:i.z.number().describe("The id of the board to which the new column will be added"),...Bh};const jh={columnId:i.z.string().describe("The id of the column to update"),columnType:i.z.nativeEnum(bm).describe("The type of the column being updated. Must match the existing column type."),revision:i.z.string().describe("The current revision of the column. Get it from get_board_schema (preferred) or get_board_info. Used for optimistic concurrency control — if the column changed since you read it, the request fails and you must re-fetch the latest revision before retrying. After a successful update_column, use the new revision from the response for any further update to this column, not the one you started with."),columnTitle:i.z.string().optional().describe("The new title of the column. If omitted, the title is unchanged."),columnDescription:i.z.string().optional().describe("The new description of the column. If omitted, the description is unchanged."),columnSettings:i.z.string().optional().describe("Type-specific configuration as a JSON string. If omitted, settings are unchanged. Shape depends on columnType — see tool description for how to obtain it."),rollupFunction:i.z.enum(["MIN","MAX","SUM","MIN_MAX","COUNT_KEYS","NONE"]).nullable().optional().describe("Controls the column rollup (calculated capability), which applies to columns on multi-level boards. Omit to leave it unchanged. Pass a function to turn rollup on or change it, or null to turn it off. Allowed functions per columnType: numbers MIN/MAX/SUM/NONE, date MIN/MAX, timeline MIN_MAX, status COUNT_KEYS, dropdown rollup is not supported by this tool. NONE (numbers only) keeps the capability without calculating anything.")},qh={boardId:i.z.number().describe("The id of the board containing the column"),...jh};const Gh={color:i.z.nativeEnum(nr).describe("The color of the custom activity"),icon_id:i.z.nativeEnum(or).describe("The icon ID of the custom activity"),name:i.z.string().describe("The name of the custom activity")};const Hh=Nc`
1089
+ `,xh=i.z.object({phone:i.z.string().describe("The phone number."),country_short_name:i.z.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Lh=i.z.object({country_name:i.z.string().describe('The full country name (e.g. "United States").'),country_code:i.z.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Uh=i.z.object({date:i.z.string().describe("The date in YYYY-MM-DD format."),zone_diff:i.z.number().int().optional().describe("UTC offset in minutes.")}),Ph=i.z.object({from:i.z.string().describe("Start date in YYYY-MM-DD format."),to:i.z.string().describe("End date in YYYY-MM-DD format.")}),Vh=i.z.object({lat:i.z.number().describe("Latitude."),lng:i.z.number().describe("Longitude."),place_id:i.z.string().describe("Google Maps place ID."),address:i.z.string().describe("Full formatted address."),country:i.z.object({long_name:i.z.string().describe("Full country name."),short_name:i.z.string().describe("ISO 3166-1 alpha-2 country code.")}),city:i.z.object({long_name:i.z.string().describe("Full city name."),short_name:i.z.string().describe("Abbreviated city name.")}),street:i.z.object({long_name:i.z.string().describe("Full street name."),short_name:i.z.string().describe("Abbreviated street name.")}),street_number:i.z.object({long_name:i.z.string().describe("Full street number."),short_name:i.z.string().describe("Abbreviated street number.")})}),Mh=i.z.object({id:i.z.string().describe("The file ID returned by the workforms upload endpoint."),name:i.z.string().describe('Original file name (e.g. "image.png").'),extension:i.z.string().optional().describe('File extension (e.g. "pdf", "png").'),is_image:i.z.boolean().optional().describe("Whether the file is an image.")}),Fh=i.z.object({question_id:i.z.string().describe("The ID of the question being answered."),name:i.z.string().optional().describe("Answer for name questions."),email:i.z.string().optional().describe("Answer for email questions."),short_text:i.z.string().optional().describe("Answer for short text questions."),long_text:i.z.string().optional().describe("Answer for long text questions."),link:i.z.string().optional().describe("Answer for link questions."),updates:i.z.string().optional().describe("Answer for updates questions."),boolean:i.z.boolean().optional().describe("Answer for boolean questions."),number:i.z.number().optional().describe("Answer for number questions."),rating:i.z.number().min(1).optional().describe("Answer for rating questions. Must be a positive number within the question's configured limit."),single_select:i.z.string().optional().describe("Answer for single-select questions — the selected option ID."),multi_select:i.z.array(i.z.number()).optional().describe("Answer for multi-select questions — list of selected option IDs."),people:i.z.array(i.z.string()).optional().describe("Answer for people questions — list of user IDs. Obtain user IDs via the list_users_and_teams tool."),connected_boards:i.z.array(i.z.string()).optional().describe("Answer for connected boards questions — list of connected item IDs."),phone:xh.optional().describe("Answer for phone questions."),country:Lh.optional().describe("Answer for country questions."),date:Uh.optional().describe("Answer for date questions."),date_range:Ph.optional().describe("Answer for date range questions."),location:Vh.optional().describe("Answer for location questions. Requires a Google Maps place ID and structured address components."),file:i.z.array(Mh).optional().describe("Answer for file questions. Each file must be uploaded first to obtain a file ID. Up to the question's configured limit."),signature:Mh.optional().describe("Answer for signature questions. The file must be uploaded first to obtain a file ID.")}).describe("An answer for a single form question. Set question_id and exactly one answer field matching the question type. Subitems questions are not supported."),Bh={form_token:i.z.string().describe("The unique token identifying the WorkForm. Can be a bare token, a full WorkForm URL (e.g. https://forms.monday.com/forms/abc123?r=use1), or a shortened wkf.ms URL (e.g. https://wkf.ms/4tqP28t). Shortened URLs are automatically resolved by following the redirect."),answers:i.z.array(Fh).describe("Array of answers to submit. Each answer specifies a question_id and the value for that question type."),form_timezone_offset:i.z.number().int().min(-840).max(840).describe("The timezone offset of the submitter in minutes (e.g. -120 for UTC-2, 0 for UTC)."),password:i.z.string().optional().describe("The password for the WorkForm. Only required if the WorkForm has password protection enabled (check features.password.enabled from get_form). If required, ask the user for the password before submitting."),tags:i.z.array(i.z.object({column_id:i.z.string().describe("The column ID this tag maps to."),value:i.z.string().describe("The tag value to submit.")})).optional().describe("Tags to attach to the submission — each tag maps a value to a specific board column.")};const zh={columnType:i.z.nativeEnum(gm).describe("The type of the column to be created"),columnTitle:i.z.string().describe("The title of the column to be created"),columnDescription:i.z.string().optional().describe("The description of the column to be created"),columnSettings:i.z.string().optional().describe("Column-specific configuration settings as a JSON string. Shape depends on columnType — see tool description for how to obtain it.")},jh={boardId:i.z.number().describe("The id of the board to which the new column will be added"),...zh};const qh={columnId:i.z.string().describe("The id of the column to update"),columnType:i.z.nativeEnum(gm).describe("The type of the column being updated. Must match the existing column type."),revision:i.z.string().describe("The current revision of the column. Get it from get_board_schema (preferred) or get_board_info. Used for optimistic concurrency control — if the column changed since you read it, the request fails and you must re-fetch the latest revision before retrying. After a successful update_column, use the new revision from the response for any further update to this column, not the one you started with."),columnTitle:i.z.string().optional().describe("The new title of the column. If omitted, the title is unchanged."),columnDescription:i.z.string().optional().describe("The new description of the column. If omitted, the description is unchanged."),columnSettings:i.z.string().optional().describe("Type-specific configuration as a JSON string. If omitted, settings are unchanged. Shape depends on columnType — see tool description for how to obtain it."),rollupFunction:i.z.enum(["MIN","MAX","SUM","MIN_MAX","COUNT_KEYS","NONE"]).nullable().optional().describe("Controls the column rollup (calculated capability), which applies to columns on multi-level boards. Omit to leave it unchanged. Pass a function to turn rollup on or change it, or null to turn it off. Allowed functions per columnType: numbers MIN/MAX/SUM/NONE, date MIN/MAX, timeline MIN_MAX, status COUNT_KEYS, dropdown rollup is not supported by this tool. NONE (numbers only) keeps the capability without calculating anything.")},Gh={boardId:i.z.number().describe("The id of the board containing the column"),...qh};const Hh={color:i.z.nativeEnum(nr).describe("The color of the custom activity"),icon_id:i.z.nativeEnum(or).describe("The icon ID of the custom activity"),name:i.z.string().describe("The name of the custom activity")};const Wh=Nc`
1090
1090
  mutation createNotification($user_id: ID!, $target_id: ID!, $text: String!, $target_type: NotificationTargetType!) {
1091
1091
  create_notification(user_id: $user_id, target_id: $target_id, text: $text, target_type: $target_type) {
1092
1092
  id
1093
1093
  text
1094
1094
  }
1095
1095
  }
1096
- `,Wh={user_id:i.z.string().describe("The user ID to send the notification to"),target_id:i.z.string().describe("The target ID (update/reply ID for Post type, item/board ID for Project type)"),text:i.z.string().describe("The notification text"),target_type:i.z.nativeEnum(td).describe("The target type (Post for update/reply, Project for item/board)")};const Yh=Nc`
1096
+ `,Yh={user_id:i.z.string().describe("The user ID to send the notification to"),target_id:i.z.string().describe("The target ID (update/reply ID for Post type, item/board ID for Project type)"),text:i.z.string().describe("The notification text"),target_type:i.z.nativeEnum(td).describe("The target type (Post for update/reply, Project for item/board)")};const Qh=Nc`
1097
1097
  mutation createGroup(
1098
1098
  $boardId: ID!
1099
1099
  $groupName: String!
@@ -1112,7 +1112,7 @@
1112
1112
  title
1113
1113
  }
1114
1114
  }
1115
- `,Qh=["#037f4c","#00c875","#9cd326","#cab641","#ffcb00","#784bd1","#9d50dd","#007eb5","#579bfc","#66ccff","#bb3354","#df2f4a","#ff007f","#ff5ac4","#ff642e","#fdab3d","#7f5347","#c4c4c4","#757575"],Kh={boardId:i.z.string().describe("The ID of the board to create the group in"),groupName:i.z.string().max(255).describe("The name of the new group (maximum 255 characters)"),groupColor:i.z.enum(Qh).optional().describe(`The color for the group. Must be one of the predefined Monday.com group colors: ${Qh.join(", ")}`),relativeTo:i.z.string().optional().describe("The ID of the group to position this new group relative to"),positionRelativeMethod:i.z.nativeEnum(hd).optional().describe("Whether to position the new group before or after the relativeTo group")};const Jh=Nc`
1115
+ `,Kh=["#037f4c","#00c875","#9cd326","#cab641","#ffcb00","#784bd1","#9d50dd","#007eb5","#579bfc","#66ccff","#bb3354","#df2f4a","#ff007f","#ff5ac4","#ff642e","#fdab3d","#7f5347","#c4c4c4","#757575"],Jh={boardId:i.z.string().describe("The ID of the board to create the group in"),groupName:i.z.string().max(255).describe("The name of the new group (maximum 255 characters)"),groupColor:i.z.enum(Kh).optional().describe(`The color for the group. Must be one of the predefined Monday.com group colors: ${Kh.join(", ")}`),relativeTo:i.z.string().optional().describe("The ID of the group to position this new group relative to"),positionRelativeMethod:i.z.nativeEnum(hd).optional().describe("Whether to position the new group before or after the relativeTo group")};const Xh=Nc`
1116
1116
  mutation duplicateItem($boardId: ID!, $itemId: ID!, $withUpdates: Boolean) {
1117
1117
  duplicate_item(board_id: $boardId, item_id: $itemId, with_updates: $withUpdates) {
1118
1118
  id
@@ -1120,7 +1120,7 @@
1120
1120
  url
1121
1121
  }
1122
1122
  }
1123
- `,Xh=Nc`
1123
+ `,Zh=Nc`
1124
1124
  mutation createSubitem(
1125
1125
  $parentItemId: ID!
1126
1126
  $itemName: String!
@@ -1141,7 +1141,7 @@
1141
1141
  }
1142
1142
  }
1143
1143
  }
1144
- `,Zh={name:i.z.string().min(1,"Item name cannot be empty").max(255,"Item name must be 255 characters or fewer").describe("The name of the new item to be created, must be relevant to the user's request. 1–255 characters."),groupId:i.z.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:i.z.string().describe(fm),createLabelsIfMissing:i.z.boolean().optional().describe("When true, missing status/dropdown labels referenced in columnValues will be auto-created on the board instead of erroring with ColumnValueException. Requires permission to change board structure. Use when the caller specifies label names that may not yet exist on the board."),parentItemId:i.z.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:i.z.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},ef={boardId:i.z.number().describe("The id of the board to which the new item will be added"),...Zh};class tf extends ue{constructor(){super(...arguments),this.name="create_item",this.type=b.WRITE,this.annotations=me({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a single item or subitem on a monday.com board, or duplicate an existing item. [IMPORTANT] If you need to create multiple items in one call, use create_items instead of calling this tool in a loop. Otherwise: 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 with filters.columns.only to get column metadata without fetching views. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?Zh:ef}async executeInternal(e){const t={...e,columnValues:_m(e.columnValues)},a=this.context?.boardId??t.boardId;if(t.duplicateFromItemId&&t.parentItemId)throw new im("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.","INVALID_ARGUMENTS_COMBINATION");return t.duplicateFromItemId?await this.duplicateAndUpdateItem(t,a):t.parentItemId?await this.createSubitem(t):await this.createNewItem(t,a)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(Jh,a);if(!i.duplicate_item?.id)throw new im("Failed to duplicate item: no item duplicated","EMPTY_API_RESPONSE");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new im("Invalid columnValues JSON: expected a JSON object keyed by column id","INVALID_COLUMN_VALUES_JSON")}const o={...n,name:e.name},r=new Im(this.mondayApi,{boardId:t});return await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o),createLabelsIfMissing:e.createLabelsIfMissing}),{content:{message:`Item ${i.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:i.duplicate_item.id,item_name:i.duplicate_item.name,item_url:i.duplicate_item.url,board_id:t}}}catch(e){nm(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing};try{const a=await this.mondayApi.request(Xh,t);if(!a.create_subitem?.id)throw new im("Failed to create subitem: no subitem created","EMPTY_API_RESPONSE");return{content:{message:`Subitem ${a.create_subitem.id} created under ${e.parentItemId}`,item_id:a.create_subitem.id,item_name:a.create_subitem.name,item_url:a.create_subitem.url}}}catch(e){nm(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing},i=await this.mondayApi.request(xc,a);return{content:{message:`Item ${i.create_item?.id} successfully created`,item_id:i.create_item?.id,item_name:i.create_item?.name,item_url:i.create_item?.url,board_id:t}}}catch(e){nm(e,"create item")}}}const af={items:i.z.array(i.z.object({name:i.z.string().min(1,"Item name cannot be empty").max(255,"Item name must be 255 characters or fewer").optional().describe("Required. The name of the item to be created. 1-255 characters."),columnValues:i.z.string().default("{}").describe(`Column values for this item, keyed by column id. Defaults to "{}" (no column values). ${fm}`),groupId:i.z.string().optional().describe("The id of the group to add this item to. Ignored when parentItemId is set (subitems inherit their parent group). If neither is set, the board default group is used."),parentItemId:i.z.number().optional().describe("If provided, this item is created as a subitem of this parent (uses create_subitem mutation) and groupId is ignored. Mutually exclusive with duplicateFromItemId."),duplicateFromItemId:i.z.number().optional().describe("The id of an existing item to duplicate and then patch with this item name and columnValues. Use for bulk templating (e.g., duplicate a template item N times with different overrides). Mutually exclusive with parentItemId."),createLabelsIfMissing:i.z.boolean().optional().describe("When true, missing status/dropdown labels referenced in this item's columnValues will be auto-created on the board instead of erroring with ColumnValueException. Requires permission to change board structure.")})).min(1,"items must not be empty").max(20,"items must not exceed 20 per call").describe("The items to create, up to 20 per call. Each item returns its own item_id and item_url on success, or a raw error message on failure. Each item independently chooses its groupId, parentItemId, and createLabelsIfMissing.")},nf={boardId:i.z.number().describe("The id of the board to which the new items will be added"),...af};function of(e){return e?.response?.errors?.[0]}function rf(e,t){const a=e instanceof Error?e.message:String(e);return void 0!==t&&function(e,t){const a=of(e),i=`failed to acquire lock on '${t}|subitems__`;return"ColumnValueException"===a?.extensions?.code&&!0===a.message?.toLowerCase().startsWith(i.toLowerCase())}(e,t)?`${a}\nAn item-link update hit a temporary concurrency limit. Wait a few seconds, then retry only the failed items in one create_items call.`:a}function sf(e,t){const a=of(e),i=e instanceof Error?e.message:String(e);return{...e instanceof im?{code:e.code}:{},...a?.extensions??{},message:a?.message??i,path:["results",t]}}const df={item_id:i.z.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:i.z.string().describe("The ID of the custom activity for the timeline item"),title:i.z.string().describe("The title of the new timeline item"),summary:i.z.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:i.z.string().optional().describe("The content of the new timeline item"),timestamp:i.z.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:i.z.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:i.z.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:i.z.string().optional().describe("The location to add to the new timeline item"),phone:i.z.string().optional().describe("The phone number to add to the new timeline item"),url:i.z.string().optional().describe("The URL to add to the new timeline item")};const pf=Nc`
1144
+ `,ef={name:i.z.string().min(1,"Item name cannot be empty").max(255,"Item name must be 255 characters or fewer").describe("The name of the new item to be created, must be relevant to the user's request. 1–255 characters."),groupId:i.z.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:i.z.string().describe(_m),createLabelsIfMissing:i.z.boolean().optional().describe("When true, missing status/dropdown labels referenced in columnValues will be auto-created on the board instead of erroring with ColumnValueException. Requires permission to change board structure. Use when the caller specifies label names that may not yet exist on the board."),parentItemId:i.z.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:i.z.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},tf={boardId:i.z.number().describe("The id of the board to which the new item will be added"),...ef};class af extends ue{constructor(){super(...arguments),this.name="create_item",this.type=b.WRITE,this.annotations=me({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a single item or subitem on a monday.com board, or duplicate an existing item. [IMPORTANT] If you need to create multiple items in one call, use create_items instead of calling this tool in a loop. Otherwise: 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 with filters.columns.only to get column metadata without fetching views. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?ef:tf}async executeInternal(e){const t={...e,columnValues:bm(e.columnValues)},a=this.context?.boardId??t.boardId;if(t.duplicateFromItemId&&t.parentItemId)throw new im("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.","INVALID_ARGUMENTS_COMBINATION");return t.duplicateFromItemId?await this.duplicateAndUpdateItem(t,a):t.parentItemId?await this.createSubitem(t):await this.createNewItem(t,a)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(Xh,a);if(!i.duplicate_item?.id)throw new im("Failed to duplicate item: no item duplicated","EMPTY_API_RESPONSE");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new im("Invalid columnValues JSON: expected a JSON object keyed by column id","INVALID_COLUMN_VALUES_JSON")}const o={...n,name:e.name},r=new wm(this.mondayApi,{boardId:t});return await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o),createLabelsIfMissing:e.createLabelsIfMissing}),{content:{message:`Item ${i.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:i.duplicate_item.id,item_name:i.duplicate_item.name,item_url:i.duplicate_item.url,board_id:t}}}catch(e){nm(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing};try{const a=await this.mondayApi.request(Zh,t);if(!a.create_subitem?.id)throw new im("Failed to create subitem: no subitem created","EMPTY_API_RESPONSE");return{content:{message:`Subitem ${a.create_subitem.id} created under ${e.parentItemId}`,item_id:a.create_subitem.id,item_name:a.create_subitem.name,item_url:a.create_subitem.url}}}catch(e){nm(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing},i=await this.mondayApi.request(xc,a);return{content:{message:`Item ${i.create_item?.id} successfully created`,item_id:i.create_item?.id,item_name:i.create_item?.name,item_url:i.create_item?.url,board_id:t}}}catch(e){nm(e,"create item")}}}const nf={items:i.z.array(i.z.object({name:i.z.string().min(1,"Item name cannot be empty").max(255,"Item name must be 255 characters or fewer").optional().describe("Required. The name of the item to be created. 1-255 characters."),columnValues:i.z.string().default("{}").describe(`Column values for this item, keyed by column id. Defaults to "{}" (no column values). ${_m}`),groupId:i.z.string().optional().describe("The id of the group to add this item to. Ignored when parentItemId is set (subitems inherit their parent group). If neither is set, the board default group is used."),parentItemId:i.z.number().optional().describe("If provided, this item is created as a subitem of this parent (uses create_subitem mutation) and groupId is ignored. Mutually exclusive with duplicateFromItemId."),duplicateFromItemId:i.z.number().optional().describe("The id of an existing item to duplicate and then patch with this item name and columnValues. Use for bulk templating (e.g., duplicate a template item N times with different overrides). Mutually exclusive with parentItemId."),createLabelsIfMissing:i.z.boolean().optional().describe("When true, missing status/dropdown labels referenced in this item's columnValues will be auto-created on the board instead of erroring with ColumnValueException. Requires permission to change board structure.")})).min(1,"items must not be empty").max(20,"items must not exceed 20 per call").describe("The items to create, up to 20 per call. Each item returns its own item_id and item_url on success, or a raw error message on failure. Each item independently chooses its groupId, parentItemId, and createLabelsIfMissing.")},of={boardId:i.z.number().describe("The id of the board to which the new items will be added"),...nf};function rf(e){return e?.response?.errors?.[0]}function sf(e,t){const a=e instanceof Error?e.message:String(e);return void 0!==t&&function(e,t){const a=rf(e),i=`failed to acquire lock on '${t}|subitems__`;return"ColumnValueException"===a?.extensions?.code&&!0===a.message?.toLowerCase().startsWith(i.toLowerCase())}(e,t)?`${a}\nAn item-link update hit a temporary concurrency limit. Wait a few seconds, then retry only the failed items in one create_items call.`:a}function df(e,t){const a=rf(e),i=e instanceof Error?e.message:String(e);return{...e instanceof im?{code:e.code}:{},...a?.extensions??{},message:a?.message??i,path:["results",t]}}const pf={item_id:i.z.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:i.z.string().describe("The ID of the custom activity for the timeline item"),title:i.z.string().describe("The title of the new timeline item"),summary:i.z.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:i.z.string().optional().describe("The content of the new timeline item"),timestamp:i.z.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:i.z.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:i.z.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:i.z.string().optional().describe("The location to add to the new timeline item"),phone:i.z.string().optional().describe("The phone number to add to the new timeline item"),url:i.z.string().optional().describe("The URL to add to the new timeline item")};const lf=Nc`
1145
1145
  mutation createUpdate($itemId: ID!, $body: String!, $mentionsList: [UpdateMention], $parentId: ID) {
1146
1146
  create_update(body: $body, item_id: $itemId, mentions_list: $mentionsList, parent_id: $parentId) {
1147
1147
  id
@@ -1152,7 +1152,7 @@
1152
1152
  }
1153
1153
  }
1154
1154
  }
1155
- `,lf=Nc`
1155
+ `,cf=Nc`
1156
1156
  query getItemUpdateReplyIds($itemId: ID!) {
1157
1157
  items(ids: [$itemId], limit: 1) {
1158
1158
  updates(limit: 100) {
@@ -1163,13 +1163,13 @@
1163
1163
  }
1164
1164
  }
1165
1165
  }
1166
- `,cf=i.z.object({id:i.z.string().describe("The ID of the entity to mention"),type:i.z.nativeEnum(Gs).describe("The type of mention: User, Team, Board, or Project. Mention an AI agent as User, not Agent")}),mf=i.z.array(cf),uf={itemId:i.z.number().describe("The id of the item to which the update will be added"),body:i.z.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead. use html tags to format the text, dont use markdown."),mentionsList:i.z.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. To mention an AI agent, use type User with the agent\'s user id from list_users_and_teams. Type Agent adds no mention'),parentId:i.z.number().optional().describe("The ID of the update to reply to. Use this parameter when you want to reply on an existing update leave it empty if you want to create a new update. Replies cannot be nested: if this is the ID of a reply, the reply is posted on its parent update instead.")};class hf extends ue{constructor(){super(...arguments),this.name="create_update",this.type=b.WRITE,this.annotations=me({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. You can also reply to an existing update by using the parentId parameter."}getInputSchema(){return uf}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=mf.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t,parentId:e.parentId?.toString()},i=await this.createUpdate(a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,item_name:i.create_update.item?.name,item_url:i.create_update.item?.url}}}catch(e){nm(e,"create update")}}async createUpdate(e){try{return await this.mondayApi.request(pf,e)}catch(t){if(!e.parentId||!function(e){return!!e?.response?.errors?.some((e=>"REPLY_TO_REPLY_NOT_ALLOWED"===e.extensions?.code))}(t))throw t;const a=await this.findParentUpdateId(e.itemId,e.parentId);if(!a)throw t;return this.mondayApi.request(pf,{...e,parentId:a})}}async findParentUpdateId(e,t){const a=await this.mondayApi.request(lf,{itemId:e});return a.items?.[0]?.updates?.find((e=>e.replies?.some((e=>e.id===t))))?.id}}const ff={updates:i.z.array(i.z.object(uf)).min(1,"updates must not be empty").max(40,"updates must not exceed 40 per call").describe("The updates to post, up to 40 per call. Each entry posts one update (or reply, via parentId) on one item and returns its own result on success or a raw error message on failure.")};function _f(e,t){if(e instanceof im)return{code:e.code,message:e.message,path:["results",t]};const a=e?.response?.errors?.[0],i=e instanceof Error?e.message:String(e),n=a?.extensions??{};return{...n,code:n.code??Zc,message:a?.message??i,path:["results",t]}}const bf=Nc`
1166
+ `,mf=i.z.object({id:i.z.string().describe("The ID of the entity to mention"),type:i.z.nativeEnum(Gs).describe("The type of mention: User, Team, Board, or Project. Mention an AI agent as User, not Agent")}),uf=i.z.array(mf),hf={itemId:i.z.number().describe("The id of the item to which the update will be added"),body:i.z.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead. use html tags to format the text, dont use markdown."),mentionsList:i.z.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. To mention an AI agent, use type User with the agent\'s user id from list_users_and_teams. Type Agent adds no mention'),parentId:i.z.number().optional().describe("The ID of the update to reply to. Use this parameter when you want to reply on an existing update leave it empty if you want to create a new update. Replies cannot be nested: if this is the ID of a reply, the reply is posted on its parent update instead.")};class ff extends ue{constructor(){super(...arguments),this.name="create_update",this.type=b.WRITE,this.annotations=me({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. You can also reply to an existing update by using the parentId parameter."}getInputSchema(){return hf}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=uf.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t,parentId:e.parentId?.toString()},i=await this.createUpdate(a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,item_name:i.create_update.item?.name,item_url:i.create_update.item?.url}}}catch(e){nm(e,"create update")}}async createUpdate(e){try{return await this.mondayApi.request(lf,e)}catch(t){if(!e.parentId||!function(e){return!!e?.response?.errors?.some((e=>"REPLY_TO_REPLY_NOT_ALLOWED"===e.extensions?.code))}(t))throw t;const a=await this.findParentUpdateId(e.itemId,e.parentId);if(!a)throw t;return this.mondayApi.request(lf,{...e,parentId:a})}}async findParentUpdateId(e,t){const a=await this.mondayApi.request(cf,{itemId:e});return a.items?.[0]?.updates?.find((e=>e.replies?.some((e=>e.id===t))))?.id}}const _f={updates:i.z.array(i.z.object(hf)).min(1,"updates must not be empty").max(40,"updates must not exceed 40 per call").describe("The updates to post, up to 40 per call. Each entry posts one update (or reply, via parentId) on one item and returns its own result on success or a raw error message on failure.")};function bf(e,t){if(e instanceof im)return{code:e.code,message:e.message,path:["results",t]};const a=e?.response?.errors?.[0],i=e instanceof Error?e.message:String(e),n=a?.extensions??{};return{...n,code:n.code??Zc,message:a?.message??i,path:["results",t]}}const gf=Nc`
1167
1167
  mutation DeleteUpdate($id: ID!) {
1168
1168
  delete_update(id: $id) {
1169
1169
  id
1170
1170
  }
1171
1171
  }
1172
- `,gf={id:i.z.number().describe("The unique identifier of the update to delete")};const yf=Nc`
1172
+ `,yf={id:i.z.number().describe("The unique identifier of the update to delete")};const vf=Nc`
1173
1173
  query GetItemsUpdates($itemIds: [ID!]!, $itemsLimit: Int, $limit: Int, $page: Int, $includeReplies: Boolean!, $includeAssets: Boolean!) {
1174
1174
  items(ids: $itemIds, limit: $itemsLimit) {
1175
1175
  id
@@ -1205,7 +1205,7 @@
1205
1205
  }
1206
1206
  }
1207
1207
  }
1208
- `,vf=Nc`
1208
+ `,If=Nc`
1209
1209
  query GetBoardUpdates($boardId: ID!, $limit: Int, $page: Int, $includeReplies: Boolean!, $includeAssets: Boolean!, $fromDate: ISO8601DateTime, $toDate: ISO8601DateTime, $boardUpdatesOnly: Boolean) {
1210
1210
  boards(ids: [$boardId], limit: 1) {
1211
1211
  id
@@ -1241,7 +1241,7 @@
1241
1241
  }
1242
1242
  }
1243
1243
  }
1244
- `;var If;!function(e){e.Item="Item",e.Board="Board"}(If||(If={}));const wf=2e3,Tf={objectIds:i.z.array(i.z.string()).min(1).max(25).optional().describe("The IDs to get updates from. For Item, up to 25 item IDs in one call, with limit and page applied to each item. For Board, exactly one board ID."),objectId:i.z.string().optional().describe("A single item or board ID. Same as passing it alone in objectIds, which is preferred."),objectType:i.z.enum([If.Item,If.Board]).describe("Type of object the IDs in objectIds belong to"),limit:i.z.number().min(1).max(100).optional().describe("Number of updates per page (default: 25, or 10 per item when reading several items, max: 100)"),page:i.z.number().min(1).optional().default(1).describe("Page number for pagination (default: 1)"),includeReplies:i.z.boolean().optional().default(!1).describe("Include update replies in the response"),includeAssets:i.z.boolean().optional().default(!1).describe("Include file attachments in the response"),includeFullText:i.z.boolean().optional().default(!1).describe("Leave this off by default. Set it only to re-read one item whose update came back with text_body_truncated and whose full body you need. It returns every update and reply body in full, which can make the response very large, so pass only that item's ID."),fromDate:i.z.string().optional().describe('Start of date range filter (e.g. "2025-01-01" or "2025-01-01T00:00:00Z"). Must be used together with toDate. For Item queries it filters the updates in the fetched page by creation time, so raise limit to cover the range.'),toDate:i.z.string().optional().describe('End of date range filter (e.g. "2025-06-01" or "2025-06-01T23:59:59Z"). Must be used together with fromDate.'),includeItemUpdates:i.z.boolean().optional().default(!1).describe("When objectType is Board, also include updates on individual items. Defaults to false, returning only board discussion. Set to true to retrieve all updates on a board, including updates on individual items.")};function Ef(e,t=!1){return/^\d{4}-\d{2}-\d{2}$/.test(e)?t?`${e}T23:59:59Z`:`${e}T00:00:00Z`:e}function Af(e,t){return t||!e||e.length<=wf?{text_body:e}:{text_body:e.slice(0,wf),text_body_truncated:!0}}function Sf(e,t){const a={id:e.id,...Af(e.text_body,t.includeFullText??!1),created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null,item_id:e.item_id};return t.includeReplies&&e.replies&&(a.replies=e.replies.map((e=>({id:e.id,...Af(e.text_body,t.includeFullText??!1),created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),t.includeAssets&&e.assets&&(a.assets=e.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),a}const Df={columnId:i.z.string().describe("The id of the column to be deleted")},Nf={boardId:i.z.number().describe("The id of the board to which the new column will be added"),...Df};const Of={itemId:i.z.number()};const kf={};const Rf=Nc`
1244
+ `;var wf;!function(e){e.Item="Item",e.Board="Board"}(wf||(wf={}));const Tf=2e3,Ef={objectIds:i.z.array(i.z.string()).min(1).max(25).optional().describe("The IDs to get updates from. For Item, up to 25 item IDs in one call, with limit and page applied to each item. For Board, exactly one board ID."),objectId:i.z.string().optional().describe("A single item or board ID. Same as passing it alone in objectIds, which is preferred."),objectType:i.z.enum([wf.Item,wf.Board]).describe("Type of object the IDs in objectIds belong to"),limit:i.z.number().min(1).max(100).optional().describe("Number of updates per page (default: 25, or 10 per item when reading several items, max: 100)"),page:i.z.number().min(1).optional().default(1).describe("Page number for pagination (default: 1)"),includeReplies:i.z.boolean().optional().default(!1).describe("Include update replies in the response"),includeAssets:i.z.boolean().optional().default(!1).describe("Include file attachments in the response"),includeFullText:i.z.boolean().optional().default(!1).describe("Leave this off by default. Set it only to re-read one item whose update came back with text_body_truncated and whose full body you need. It returns every update and reply body in full, which can make the response very large, so pass only that item's ID."),fromDate:i.z.string().optional().describe('Start of date range filter (e.g. "2025-01-01" or "2025-01-01T00:00:00Z"). Must be used together with toDate. For Item queries it filters the updates in the fetched page by creation time, so raise limit to cover the range.'),toDate:i.z.string().optional().describe('End of date range filter (e.g. "2025-06-01" or "2025-06-01T23:59:59Z"). Must be used together with fromDate.'),includeItemUpdates:i.z.boolean().optional().default(!1).describe("When objectType is Board, also include updates on individual items. Defaults to false, returning only board discussion. Set to true to retrieve all updates on a board, including updates on individual items.")};function Af(e,t=!1){return/^\d{4}-\d{2}-\d{2}$/.test(e)?t?`${e}T23:59:59Z`:`${e}T00:00:00Z`:e}function Sf(e,t){return t||!e||e.length<=Tf?{text_body:e}:{text_body:e.slice(0,Tf),text_body_truncated:!0}}function Df(e,t){const a={id:e.id,...Sf(e.text_body,t.includeFullText??!1),created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null,item_id:e.item_id};return t.includeReplies&&e.replies&&(a.replies=e.replies.map((e=>({id:e.id,...Sf(e.text_body,t.includeFullText??!1),created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),t.includeAssets&&e.assets&&(a.assets=e.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),a}const Nf={columnId:i.z.string().describe("The id of the column to be deleted")},Of={boardId:i.z.number().describe("The id of the board to which the new column will be added"),...Nf};const kf={itemId:i.z.number()};const Rf={};const Cf=Nc`
1245
1245
  query getBoardData($boardId: ID!, $itemsLimit: Int!, $queryParams: ItemsQuery) {
1246
1246
  boards(ids: [$boardId], limit: 1) {
1247
1247
  id
@@ -1284,7 +1284,7 @@
1284
1284
  }
1285
1285
  }
1286
1286
  }
1287
- `,Cf=Nc`
1287
+ `,$f=Nc`
1288
1288
  query getUsersByIds($userIds: [ID!]!) {
1289
1289
  users(ids: $userIds) {
1290
1290
  id
@@ -1294,7 +1294,7 @@
1294
1294
  }
1295
1295
  }
1296
1296
  }
1297
- `,$f=i.z.array(i.z.object({columnId:i.z.string().describe('Ordinary column ids are board-specific. Use get_board_info with filters.columns.only to get them for the current board. Also accepts four virtual columns that get_board_info does not return: "group" (the group id goes in compareValue, e.g. "group_mm6wsvcc" - the columnId itself is always the literal "group"), "__creation_log__", "__last_updated__" and "__item_id__".'),compareAttribute:i.z.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:i.z.union([i.z.string(),i.z.number(),i.z.boolean(),i.z.array(i.z.union([i.z.string(),i.z.number()]))]).describe('The value to compare the attribute to. This can be a string or index value depending on the column type. The operators within_the_last and within_the_next are the exception: they take a two item array of [UNIT, AMOUNT] such as ["DAYS", 7].'),operator:i.z.nativeEnum(ks).optional().default(ks.AnyOf).describe("The operator to use for the filter")})).optional().describe(`The configuration of filters to apply on the items. Use get_board_info with filters.columns.only for column ids and types on the board. Before sending the filters, use get_column_type_info with fetchMode "${Bm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules).`),xf=i.z.nativeEnum(Os).optional().default(Os.And).describe("The operator to use for the filters"),Lf={boardId:i.z.string().describe("The ID of the board to fetch complete data for"),filters:$f,filtersOperator:xf};const Uf=Nc`
1297
+ `,xf=i.z.array(i.z.object({columnId:i.z.string().describe('Ordinary column ids are board-specific. Use get_board_info with filters.columns.only to get them for the current board. Also accepts four virtual columns that get_board_info does not return: "group" (the group id goes in compareValue, e.g. "group_mm6wsvcc" - the columnId itself is always the literal "group"), "__creation_log__", "__last_updated__" and "__item_id__".'),compareAttribute:i.z.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:i.z.union([i.z.string(),i.z.number(),i.z.boolean(),i.z.array(i.z.union([i.z.string(),i.z.number()]))]).describe('The value to compare the attribute to. This can be a string or index value depending on the column type. The operators within_the_last and within_the_next are the exception: they take a two item array of [UNIT, AMOUNT] such as ["DAYS", 7].'),operator:i.z.nativeEnum(ks).optional().default(ks.AnyOf).describe("The operator to use for the filter")})).optional().describe(`The configuration of filters to apply on the items. Use get_board_info with filters.columns.only for column ids and types on the board. Before sending the filters, use get_column_type_info with fetchMode "${zm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules).`),Lf=i.z.nativeEnum(Os).optional().default(Os.And).describe("The operator to use for the filters"),Uf={boardId:i.z.string().describe("The ID of the board to fetch complete data for"),filters:xf,filtersOperator:Lf};const Pf=Nc`
1298
1298
  query GetBoardActivity(
1299
1299
  $boardId: ID!
1300
1300
  $itemIds: [ID!]
@@ -1319,7 +1319,7 @@
1319
1319
  }
1320
1320
  }
1321
1321
  }
1322
- `,Pf={boardId:i.z.number().describe("The id of the board to get activity for"),itemIds:i.z.array(i.z.number()).optional().describe("Filter activity to specific item ids. Omit to get activity for the whole board."),userIds:i.z.array(i.z.number()).optional().describe("Filter activity to actions performed by specific user ids."),fromDate:i.z.string().optional().describe("Start date for activity range (ISO8601DateTime format). Defaults to 30 days ago. Limited to the last 90 days. Older dates are clamped to 90 days ago"),toDate:i.z.string().optional().describe("End date for activity range (ISO8601DateTime format). Defaults to now"),includeData:i.z.boolean().optional().default(!1).describe("Whether to include the raw data payload for each activity entry. The data field contains the full before/after state of changes and can be very large. Only set to true when you need the detailed change data.")};const Vf=Nc`
1322
+ `,Vf={boardId:i.z.number().describe("The id of the board to get activity for"),itemIds:i.z.array(i.z.number()).optional().describe("Filter activity to specific item ids. Omit to get activity for the whole board."),userIds:i.z.array(i.z.number()).optional().describe("Filter activity to actions performed by specific user ids."),fromDate:i.z.string().optional().describe("Start date for activity range (ISO8601DateTime format). Defaults to 30 days ago. Limited to the last 90 days. Older dates are clamped to 90 days ago"),toDate:i.z.string().optional().describe("End date for activity range (ISO8601DateTime format). Defaults to now"),includeData:i.z.boolean().optional().default(!1).describe("Whether to include the raw data payload for each activity entry. The data field contains the full before/after state of changes and can be very large. Only set to true when you need the detailed change data.")};const Mf=Nc`
1323
1323
  query GetBoardInfo(
1324
1324
  $boardId: ID!
1325
1325
  $columnIds: [String]
@@ -1427,7 +1427,7 @@
1427
1427
  }
1428
1428
  }
1429
1429
  }
1430
- `,Mf=Nc`
1430
+ `,Ff=Nc`
1431
1431
  query GetBoardInfoViewIndex($boardId: ID!) {
1432
1432
  boards(ids: [$boardId], limit: 1) {
1433
1433
  id
@@ -1437,7 +1437,7 @@
1437
1437
  }
1438
1438
  }
1439
1439
  }
1440
- `,Ff=Nc`
1440
+ `,Bf=Nc`
1441
1441
  query GetBoardInfoJustColumns($boardId: ID!) {
1442
1442
  boards(ids: [$boardId], limit: 1) {
1443
1443
  columns {
@@ -1450,7 +1450,7 @@
1450
1450
  }
1451
1451
  }
1452
1452
  }
1453
- `,Bf=Nc`
1453
+ `,zf=Nc`
1454
1454
  query GetBoardKnowledge($boardId: ID!) {
1455
1455
  entity_knowledge(entity_type: BOARD, entity_id: $boardId) {
1456
1456
  summary
@@ -1466,7 +1466,7 @@
1466
1466
  }
1467
1467
  }
1468
1468
  }
1469
- `,zf=(e,t,a,i,n=!0)=>({board:{...e,columns:e.columns??[],views:e.views??[],subItemColumns:t?.columns??void 0},...n?{knowledge:i??null}:{},...a&&a.length>0?{unmatchedViewNames:a}:{}}),jf=e=>e.trim().toLowerCase().replace(/\\&/g,"&"),qf={boardId:i.z.number().describe("The id of the board to get information for"),includeKnowledge:i.z.boolean().optional().describe("Optional. Returns generated business context: workflow and status meanings, column purposes, people roles, related boards. Set it when you must interpret the board, e.g. pick a status from the user's intent rather than an exact label name. Leave it off for structural lookups. Adds latency and may be null while being generated. Defaults to false."),includeSubscribers:i.z.boolean().optional().describe("Optional. Set to true to also return the board subscribers and team subscribers (id and name). Subscribers include both people and AI agents subscribed to the board (agents appear with their agent user id). Omitted by default because the subscriber list can be long on large boards. Defaults to false."),filters:i.z.object({views:i.z.object({ids:i.z.array(i.z.string()).optional().describe("Optional. Restrict returned views to these view ids."),names:i.z.array(i.z.string()).optional().describe("Optional. Restrict returned views to these view names (case-insensitive). The tool resolves names via a lean id/name index query first to avoid downloading every view on large boards."),only:i.z.boolean().optional().describe("Optional. When true, omit columns and return only views plus the board metadata needed around them.")}).optional().describe("Optional view selection controls."),columns:i.z.object({ids:i.z.array(i.z.string()).optional().describe("Optional. Restrict returned columns to these column ids."),only:i.z.boolean().optional().describe("Optional. When true, omit views and return only columns plus the board metadata needed around them.")}).optional().describe("Optional column selection controls.")}).optional().describe("Optional response-shaping filters for large boards. Omit to return the full board info payload.")};const Gf=Nc`
1469
+ `,jf=(e,t,a,i,n=!0)=>({board:{...e,columns:e.columns??[],views:e.views??[],subItemColumns:t?.columns??void 0},...n?{knowledge:i??null}:{},...a&&a.length>0?{unmatchedViewNames:a}:{}}),qf=e=>e.trim().toLowerCase().replace(/\\&/g,"&"),Gf={boardId:i.z.number().describe("The id of the board to get information for"),includeKnowledge:i.z.boolean().optional().describe("Optional. Returns generated business context: workflow and status meanings, column purposes, people roles, related boards. Set it when you must interpret the board, e.g. pick a status from the user's intent rather than an exact label name. Leave it off for structural lookups. Adds latency and may be null while being generated. Defaults to false."),includeSubscribers:i.z.boolean().optional().describe("Optional. Set to true to also return the board subscribers and team subscribers (id and name). Subscribers include both people and AI agents subscribed to the board (agents appear with their agent user id). Omitted by default because the subscriber list can be long on large boards. Defaults to false."),filters:i.z.object({views:i.z.object({ids:i.z.array(i.z.string()).optional().describe("Optional. Restrict returned views to these view ids."),names:i.z.array(i.z.string()).optional().describe("Optional. Restrict returned views to these view names (case-insensitive). The tool resolves names via a lean id/name index query first to avoid downloading every view on large boards."),only:i.z.boolean().optional().describe("Optional. When true, omit columns and return only views plus the board metadata needed around them.")}).optional().describe("Optional view selection controls."),columns:i.z.object({ids:i.z.array(i.z.string()).optional().describe("Optional. Restrict returned columns to these column ids."),only:i.z.boolean().optional().describe("Optional. When true, omit views and return only columns plus the board metadata needed around them.")}).optional().describe("Optional column selection controls.")}).optional().describe("Optional response-shaping filters for large boards. Omit to return the full board info payload.")};const Hf=Nc`
1470
1470
  fragment ItemDataFragment on Item {
1471
1471
  id
1472
1472
  name
@@ -1546,7 +1546,7 @@
1546
1546
  }
1547
1547
  }
1548
1548
  }
1549
- `,Hf=Nc`
1549
+ `,Wf=Nc`
1550
1550
  query SearchItemsDev($query: String!, $limit: Int, $boardIds: [ID!]) {
1551
1551
  search {
1552
1552
  items(query: $query, limit: $limit, board_ids: $boardIds) {
@@ -1556,11 +1556,11 @@
1556
1556
  }
1557
1557
  }
1558
1558
  }
1559
- `;var Wf;!function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS",e.WORKSPACES="WORKSPACES",e.UPDATES="UPDATES",e.ITEMS="ITEMS",e.TIMELINE_ITEMS="TIMELINE_ITEMS",e.DASHBOARDS="DASHBOARDS"}(Wf||(Wf={}));const Yf=Object.values(Wf).join(", ");function Qf(e){return e.trim().toUpperCase().replace(/[\s\-/]+/g,"_").replace(/^_+|_+$/g,"")}const Kf={BOARDS:Wf.BOARD,DOCS:Wf.DOCUMENTS,DOC:Wf.DOCUMENTS,DOCUMENT:Wf.DOCUMENTS,FOLDER:Wf.FOLDERS,WORKSPACE:Wf.WORKSPACES,UPDATE:Wf.UPDATES,ITEM:Wf.ITEMS,PULSE:Wf.ITEMS,PULSES:Wf.ITEMS,TIMELINE_ITEM:Wf.TIMELINE_ITEMS,TIMELINE:Wf.TIMELINE_ITEMS,DASHBOARD:Wf.DASHBOARDS,OVERVIEW:Wf.DASHBOARDS,OVERVIEWS:Wf.DASHBOARDS},Jf={USER:"To search for users or teams, use the list_users_and_teams tool.",USERS:"To search for users or teams, use the list_users_and_teams tool.",PERSON:"To search for users or teams, use the list_users_and_teams tool.",PEOPLE:"To search for users or teams, use the list_users_and_teams tool.",TEAM:"To search for users or teams, use the list_users_and_teams tool.",TEAMS:"To search for users or teams, use the list_users_and_teams tool.",USER_OR_TEAM:"To search for users or teams, use the list_users_and_teams tool.",USER_TEAM:"To search for users or teams, use the list_users_and_teams tool.",USERS_AND_TEAMS:"To search for users or teams, use the list_users_and_teams tool.",BOARD_ITEM:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS_PAGE:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',GET_BOARD_ITEMS_PAGE:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS_OR_GROUPS:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS_AND_GROUPS:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',GROUP:"To list groups within a board, use the get_board_info tool.",GROUPS:"To list groups within a board, use the get_board_info tool.",FORM:"Forms are not searchable.",FORMS:"Forms are not searchable."},Xf={boardId:i.z.number().describe("The id of the board to get items from"),itemIds:i.z.array(i.z.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:i.z.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:i.z.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:i.z.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:i.z.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeGroup:i.z.boolean().optional().default(!0).describe("Whether to include each item's board group (id and title) in the response. Set to false to reduce token usage when group membership is not needed."),includeItemDescription:i.z.boolean().optional().default(!1).describe("Whether to include the item's description in the response. The item description is the rich-text body content that appears inside a monday.com item (similar to a task description or issue body). Set this to true when the user asks about an item's description, details, body, or notes. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the item description content."),includeSubItems:i.z.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:i.z.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filters:$f,filtersOperator:xf,columnIds:i.z.array(i.z.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderBy:i.z.array(i.z.object({columnId:i.z.string().describe('Ordinary column ids are board-specific. Use get_board_info with filters.columns.only to get them for the current board. Also accepts four virtual columns that get_board_info does not return: "group", "__creation_log__", "__last_updated__" and "__item_id__".'),direction:i.z.nativeEnum(Es).optional().default(Es.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 Zf={boardId:i.z.number().describe("The id of the board to get the schema of")};const e_=Nc`
1559
+ `;var Yf;!function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS",e.WORKSPACES="WORKSPACES",e.UPDATES="UPDATES",e.ITEMS="ITEMS",e.TIMELINE_ITEMS="TIMELINE_ITEMS",e.DASHBOARDS="DASHBOARDS"}(Yf||(Yf={}));const Qf=Object.values(Yf).join(", ");function Kf(e){return e.trim().toUpperCase().replace(/[\s\-/]+/g,"_").replace(/^_+|_+$/g,"")}const Jf={BOARDS:Yf.BOARD,DOCS:Yf.DOCUMENTS,DOC:Yf.DOCUMENTS,DOCUMENT:Yf.DOCUMENTS,FOLDER:Yf.FOLDERS,WORKSPACE:Yf.WORKSPACES,UPDATE:Yf.UPDATES,ITEM:Yf.ITEMS,PULSE:Yf.ITEMS,PULSES:Yf.ITEMS,TIMELINE_ITEM:Yf.TIMELINE_ITEMS,TIMELINE:Yf.TIMELINE_ITEMS,DASHBOARD:Yf.DASHBOARDS,OVERVIEW:Yf.DASHBOARDS,OVERVIEWS:Yf.DASHBOARDS},Xf={USER:"To search for users or teams, use the list_users_and_teams tool.",USERS:"To search for users or teams, use the list_users_and_teams tool.",PERSON:"To search for users or teams, use the list_users_and_teams tool.",PEOPLE:"To search for users or teams, use the list_users_and_teams tool.",TEAM:"To search for users or teams, use the list_users_and_teams tool.",TEAMS:"To search for users or teams, use the list_users_and_teams tool.",USER_OR_TEAM:"To search for users or teams, use the list_users_and_teams tool.",USER_TEAM:"To search for users or teams, use the list_users_and_teams tool.",USERS_AND_TEAMS:"To search for users or teams, use the list_users_and_teams tool.",BOARD_ITEM:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS_PAGE:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',GET_BOARD_ITEMS_PAGE:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS_OR_GROUPS:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS_AND_GROUPS:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',GROUP:"To list groups within a board, use the get_board_info tool.",GROUPS:"To list groups within a board, use the get_board_info tool.",FORM:"Forms are not searchable.",FORMS:"Forms are not searchable."},Zf={boardId:i.z.number().describe("The id of the board to get items from"),itemIds:i.z.array(i.z.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:i.z.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:i.z.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:i.z.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:i.z.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeGroup:i.z.boolean().optional().default(!0).describe("Whether to include each item's board group (id and title) in the response. Set to false to reduce token usage when group membership is not needed."),includeItemDescription:i.z.boolean().optional().default(!1).describe("Whether to include the item's description in the response. The item description is the rich-text body content that appears inside a monday.com item (similar to a task description or issue body). Set this to true when the user asks about an item's description, details, body, or notes. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the item description content."),includeSubItems:i.z.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:i.z.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filters:xf,filtersOperator:Lf,columnIds:i.z.array(i.z.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderBy:i.z.array(i.z.object({columnId:i.z.string().describe('Ordinary column ids are board-specific. Use get_board_info with filters.columns.only to get them for the current board. Also accepts four virtual columns that get_board_info does not return: "group", "__creation_log__", "__last_updated__" and "__item_id__".'),direction:i.z.nativeEnum(Es).optional().default(Es.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 e_={boardId:i.z.number().describe("The id of the board to get the schema of")};const t_=Nc`
1560
1560
  query GetColumnTypeSchema($type: ColumnType!) {
1561
1561
  get_column_type_schema(type: $type)
1562
1562
  }
1563
- `,t_="https://developer.monday.com/api-reference",a_={group:'Filters items by the board group they belong to. The columnId is the literal string "group" - a group id such as "group_mm6wsvcc" is NEVER a valid columnId. For filtering by group id, use any_of or not_any_of. Use an array of group ids, as returned in an item\'s group.id or by get_board_info.\nEXAMPLES:\n ✅ Correct: {"columnId": "group", "compareValue": ["group_mm6wsvcc"], "operator": "any_of"} // group id goes in compareValue\n ✅ Correct: {"columnId": "group", "compareValue": ["group_mm6wsvcc", "group_mm4w1e0n"], "operator": "any_of"} // several groups\n ❌ Wrong: {"columnId": "group_mm6wsvcc", "compareValue": "group_mm6wsvcc"} // group id used as the columnId\n ❌ Wrong: {"columnId": "__group__", "compareValue": ["group_mm6wsvcc"], "operator": "any_of"} // the columnId is exactly "group", with no surrounding underscores\n ❌ Wrong: {"columnId": "group_id", "compareValue": ["group_mm6wsvcc"], "operator": "any_of"} // use the virtual column id "group" for board-group membership\n ❌ Wrong: {"columnId": "group", "compareValue": "Backlog", "operator": "any_of"} // group title instead of group id',last_updated:'The columnId is the literal string "__last_updated__", with two underscores before and after. Supported operators: any_of, not_any_of, within_the_last, between. With any_of and not_any_of, use compareAttribute "UPDATED_AT" and a compareValue array holding one of "TODAY", "YESTERDAY", "THIS_WEEK", "THIS_MONTH". With within_the_last, use compareAttribute "UPDATED_AT" and a [UNIT, AMOUNT] window. With between, use compareAttribute "UPDATED_AT" and a two item array of "YYYY-MM-DD" dates [FROM, TO].\nThis id is also the correct one to use in orderBy to sort items by when they were last updated.\nEXAMPLES:\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // updated today\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "UPDATED_AT"} // using THIS_WEEK with not_any_of\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["DAYS", 7], "operator": "within_the_last", "compareAttribute": "UPDATED_AT"} // updated in the last 7 days\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["WEEKS", 1], "operator": "within_the_last", "compareAttribute": "UPDATED_AT"} // updated in the last week\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "UPDATED_AT"} // updated in Q1\n ❌ Wrong: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // missing the underscores around last_updated\n ❌ Wrong: {"columnId": "__last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // missing one trailing underscore\n ❌ Wrong: {"columnId": "updated_at", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // use __last_updated__ for the item\'s update time\n ❌ Wrong: {"columnId": "__last_updated__", "compareValue": ["LAST_MONTH"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // LAST_MONTH and LAST_WEEK match no items, use within_the_last with ["MONTHS", 1] or ["WEEKS", 1]\n ❌ Wrong: {"columnId": "__last_updated__", "compareValue": "TODAY", "operator": "any_of", "compareAttribute": "UPDATED_AT"} // not using array for any_of operator\n ❌ Wrong: {"columnId": "__last_updated__", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between"} // missing UPDATED_AT',creation_log:'The columnId is the literal string "__creation_log__", with two underscores before and after. Supported operators: any_of, not_any_of, within_the_last, between. With any_of and not_any_of, use compareAttribute "CREATED_AT" and a compareValue array holding one of "TODAY", "YESTERDAY", "THIS_WEEK", "THIS_MONTH". With within_the_last, use compareAttribute "CREATED_AT" and a [UNIT, AMOUNT] window. With between, use compareAttribute "CREATED_AT" and a two item array of "YYYY-MM-DD" dates [FROM, TO].\nThis id is also the correct one to use in orderBy to sort items by creation time.\nEXAMPLES:\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // items created today\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "CREATED_AT"} // items not created this week\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["DAYS", 30], "operator": "within_the_last", "compareAttribute": "CREATED_AT"} // created in the last 30 days\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "CREATED_AT"} // created in Q1\n ❌ Wrong: {"columnId": "creation_log", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // missing the underscores around creation_log\n ❌ Wrong: {"columnId": "created_at", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // use __creation_log__ for the item\'s creation time\n ❌ Wrong: {"columnId": "__creation_log__", "compareValue": ["LAST_MONTH"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // LAST_MONTH and LAST_WEEK match no items, use within_the_last with ["MONTHS", 1] or ["WEEKS", 1]\n ❌ Wrong: {"columnId": "__creation_log__", "compareValue": ["PAST_DATETIME", "14"], "operator": "within_the_last"} // PAST_DATETIME is not a unit, use ["DAYS", 14]\n ❌ Wrong: {"columnId": "__creation_log__", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between"} // missing CREATED_AT',item_id:'The columnId is the literal string "__item_id__", with two underscores before and after. Prefer the tool\'s own itemIds argument when you simply want a known set of items - use this filter only when combining an item-id restriction with other filter rules. Supported operators: any_of, not_any_of. CompareValue is an array of item ids as strings.\nEXAMPLES:\n ✅ Correct: {"columnId": "__item_id__", "compareValue": ["3208003201"], "operator": "any_of"} // filtering by a single item id\n ✅ Correct: {"columnId": "__item_id__", "compareValue": ["3208003201", "3208003202"], "operator": "not_any_of"} // excluding several item ids\n ❌ Wrong: {"columnId": "item_id", "compareValue": ["3208003201"], "operator": "any_of"} // missing the underscores around item_id\n ❌ Wrong: {"columnId": "parent_item_id", "compareValue": ["3208003201"], "operator": "any_of"} // parent_item_id describes item hierarchy in the response\n ❌ Wrong: {"columnId": "pulse_id", "compareValue": ["3208003201"], "operator": "any_of"} // pulse_id is an internal name, not a filterable id',date:'Supported operators: any_of, not_any_of, between, greater_than, greater_than_or_equals, lower_than, lower_than_or_equal, within_the_last, within_the_next, is_empty, is_not_empty. CompareValue should be either:\n - Date in "YYYY-MM-DD" format with "EXACT" e.g. compareValue:["EXACT", "2025-01-01"]\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\n - A two item array of plain "YYYY-MM-DD" dates [FROM, TO] with the between operator, e.g. ["2025-01-01", "2025-03-31"]\nFor a date range, use a single between rule.\nEXAMPLES:\n ✅ Correct: {"columnId": "date", "compareValue": ["EXACT", "2025-01-01"], "operator": "any_of"} // using exact date format with EXACT\n ✅ Correct: {"columnId": "date", "compareValue": "TODAY", "operator": "greater_than"} // using TODAY with greater_than\n ✅ Correct: {"columnId": "date", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between"} // a date range, no compareAttribute\n ✅ Correct: {"columnId": "date", "compareValue": ["DAYS", 7], "operator": "within_the_last"} // due in the last 7 days\n ✅ Correct: {"columnId": "date", "compareValue": ["WEEKS", 2], "operator": "within_the_next"} // due in the next 2 weeks\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\n ❌ Wrong: {"columnId": "date", "compareValue": 7, "operator": "within_the_last"} // a bare number is not a valid window, use ["DAYS", 7]\n ❌ Wrong: {"columnId": "date", "compareValue": ["EXACT", "2025-01-01"], "operator": "within_the_next"} // within_the_next takes a [UNIT, AMOUNT] window, never an exact date\n ❌ Wrong: {"columnId": "date", "compareValue": "one_week", "compareAttribute": "WEEKS", "operator": "within_the_last"} // the unit belongs inside compareValue, never in compareAttribute\n ❌ Wrong: {"columnId": "date", "compareValue": ["2025-01-01", "2025-03-31"], "compareAttribute": "EXACT", "operator": "between"} // a date column takes no compareAttribute, "EXACT" belongs inside compareValue\n ❌ Wrong: {"columnId": "date", "compareValue": ["2025-01-01", "2025-03-31"], "compareAttribute": "START_DATE", "operator": "between"} // START_DATE/END_DATE apply to timeline columns, never to date columns\n ❌ Wrong: {"columnId": "date", "compareValue": ["EXACT", "2025-01-01", "2025-03-31"], "operator": "between"} // between takes exactly two plain dates, with no EXACT prefix',timeline:'A timeline column holds a start and an end date. Supported operators without compareAttribute: any_of, not_any_of, is_empty, is_not_empty. Supported operators with compareAttribute "START_DATE" or "END_DATE": between, greater_than, greater_than_or_equals, lower_than, lower_than_or_equal. With between, compareValue is a two item array of plain "YYYY-MM-DD" dates [FROM, TO].\nEXAMPLES:\n ✅ Correct: {"columnId": "timeline", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "START_DATE"} // timelines starting in Q1\n ✅ Correct: {"columnId": "timeline", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "END_DATE"} // timelines ending in Q1\n ✅ Correct: {"columnId": "timeline", "compareValue": "2025-06-01", "operator": "greater_than", "compareAttribute": "START_DATE"} // starts after a date\n ✅ Correct: {"columnId": "timeline", "compareValue": [], "operator": "is_empty"} // no timeline set\n ❌ Wrong: {"columnId": "timeline", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between"} // between on a timeline requires compareAttribute START_DATE or END_DATE\n ❌ Wrong: {"columnId": "timeline", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "EXACT"} // EXACT is not a timeline compareAttribute, use START_DATE or END_DATE\n ❌ Wrong: {"columnId": "timeline", "compareValue": "2025-06-01", "operator": "contains_text"} // timeline columns hold dates, not text\n ❌ Wrong: {"columnId": "timeline", "compareValue": ["DAYS", 30], "operator": "within_the_next"} // within_the_next does not exist for timeline, use between with START_DATE\n ❌ Wrong: {"columnId": "timeline", "compareValue": "2025-06-01", "operator": "greater_than_or_equals"} // missing the required compareAttribute',location:'Supported operators: is_empty, is_not_empty. CompareValue is an empty array.\nEXAMPLES:\n ✅ Correct: {"columnId": "location", "compareValue": [], "operator": "is_not_empty"} // items that have a location\n ✅ Correct: {"columnId": "location", "compareValue": [], "operator": "is_empty"} // items missing a location\n ❌ Wrong: {"columnId": "location", "compareValue": "New York", "operator": "contains_text"} // location columns cannot be text filtered\n ❌ Wrong: {"columnId": "location", "compareValue": ["New York"], "operator": "any_of"} // any_of is not supported for location',board_relation:'A connect boards column. Supported operators: any_of, not_any_of, contains_text, not_contains_text, starts_with, is_empty, is_not_empty. With any_of and not_any_of, compareValue is an array of the linked item ids as numbers. With the text operators, compareValue is a single string matched against the linked items\' names.\nEXAMPLES:\n ✅ Correct: {"columnId": "board_relation", "compareValue": [3208003201], "operator": "any_of"} // linked to a specific item\n ✅ Correct: {"columnId": "board_relation", "compareValue": "Acme", "operator": "contains_text"} // linked item name contains text\n ✅ Correct: {"columnId": "board_relation", "compareValue": [], "operator": "is_empty"} // nothing linked\n ❌ Wrong: {"columnId": "board_relation", "compareValue": 3208003201, "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "board_relation", "compareValue": "Acme", "operator": "ends_with"} // ends_with is not supported for this column',subtasks:'Supported operators: is_empty, is_not_empty. CompareValue is an empty array. To filter on subitem values, query the subitems board directly using its own boardId.\nEXAMPLES:\n ✅ Correct: {"columnId": "subitems", "compareValue": [], "operator": "is_not_empty"} // items that have subitems\n ✅ Correct: {"columnId": "subitems", "compareValue": [], "operator": "is_empty"} // items without subitems\n ❌ Wrong: {"columnId": "subitems", "compareValue": "Design", "operator": "contains_text"} // subitem content is not filterable from the parent board\n ❌ Wrong: {"columnId": "subitems", "compareValue": ["3208003201"], "operator": "any_of"} // any_of is not supported for subitems',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'};function i_(e){const t=a_[e];return t?`# 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 operators\n- CompareValue MUST BE SENT AS A TWO ITEM ARRAY OF [UNIT, AMOUNT] WHEN USED WITH within_the_last, within_the_next operators, where UNIT is one of "DAYS", "WORKDAYS", "WEEKS", "MONTHS" and AMOUNT is a number, e.g. ["DAYS", 7] for the last or next 7 days\n- CompareValue MUST BE SENT AS A TWO ITEM ARRAY OF plain "YYYY-MM-DD" dates [FROM, TO] WHEN USED WITH between\n\n## [IMPORTANT] Column type: ${e}\n${t}\n`:null}const n_={columnType:i.z.nativeEnum(bm).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")'),fetchMode:i.z.nativeEnum(Bm).optional().default(Bm.Schema).describe(`fetchMode "${Bm.Schema}": JSON settings schema only (GraphQL). fetchMode "${Bm.Guidelines}": guidelines.filter and guidelines.aggregation only — no GraphQL round-trip.`)};const o_={random_string:i.z.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:i.z.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const r_={typeName:i.z.string().describe("The name of the GraphQL type to get details for")};const s_=Nc`
1563
+ `,a_="https://developer.monday.com/api-reference",i_={group:'Filters items by the board group they belong to. The columnId is the literal string "group" - a group id such as "group_mm6wsvcc" is NEVER a valid columnId. For filtering by group id, use any_of or not_any_of. Use an array of group ids, as returned in an item\'s group.id or by get_board_info.\nEXAMPLES:\n ✅ Correct: {"columnId": "group", "compareValue": ["group_mm6wsvcc"], "operator": "any_of"} // group id goes in compareValue\n ✅ Correct: {"columnId": "group", "compareValue": ["group_mm6wsvcc", "group_mm4w1e0n"], "operator": "any_of"} // several groups\n ❌ Wrong: {"columnId": "group_mm6wsvcc", "compareValue": "group_mm6wsvcc"} // group id used as the columnId\n ❌ Wrong: {"columnId": "__group__", "compareValue": ["group_mm6wsvcc"], "operator": "any_of"} // the columnId is exactly "group", with no surrounding underscores\n ❌ Wrong: {"columnId": "group_id", "compareValue": ["group_mm6wsvcc"], "operator": "any_of"} // use the virtual column id "group" for board-group membership\n ❌ Wrong: {"columnId": "group", "compareValue": "Backlog", "operator": "any_of"} // group title instead of group id',last_updated:'The columnId is the literal string "__last_updated__", with two underscores before and after. Supported operators: any_of, not_any_of, within_the_last, between. With any_of and not_any_of, use compareAttribute "UPDATED_AT" and a compareValue array holding one of "TODAY", "YESTERDAY", "THIS_WEEK", "THIS_MONTH". With within_the_last, use compareAttribute "UPDATED_AT" and a [UNIT, AMOUNT] window. With between, use compareAttribute "UPDATED_AT" and a two item array of "YYYY-MM-DD" dates [FROM, TO].\nThis id is also the correct one to use in orderBy to sort items by when they were last updated.\nEXAMPLES:\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // updated today\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "UPDATED_AT"} // using THIS_WEEK with not_any_of\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["DAYS", 7], "operator": "within_the_last", "compareAttribute": "UPDATED_AT"} // updated in the last 7 days\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["WEEKS", 1], "operator": "within_the_last", "compareAttribute": "UPDATED_AT"} // updated in the last week\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "UPDATED_AT"} // updated in Q1\n ❌ Wrong: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // missing the underscores around last_updated\n ❌ Wrong: {"columnId": "__last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // missing one trailing underscore\n ❌ Wrong: {"columnId": "updated_at", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // use __last_updated__ for the item\'s update time\n ❌ Wrong: {"columnId": "__last_updated__", "compareValue": ["LAST_MONTH"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // LAST_MONTH and LAST_WEEK match no items, use within_the_last with ["MONTHS", 1] or ["WEEKS", 1]\n ❌ Wrong: {"columnId": "__last_updated__", "compareValue": "TODAY", "operator": "any_of", "compareAttribute": "UPDATED_AT"} // not using array for any_of operator\n ❌ Wrong: {"columnId": "__last_updated__", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between"} // missing UPDATED_AT',creation_log:'The columnId is the literal string "__creation_log__", with two underscores before and after. Supported operators: any_of, not_any_of, within_the_last, between. With any_of and not_any_of, use compareAttribute "CREATED_AT" and a compareValue array holding one of "TODAY", "YESTERDAY", "THIS_WEEK", "THIS_MONTH". With within_the_last, use compareAttribute "CREATED_AT" and a [UNIT, AMOUNT] window. With between, use compareAttribute "CREATED_AT" and a two item array of "YYYY-MM-DD" dates [FROM, TO].\nThis id is also the correct one to use in orderBy to sort items by creation time.\nEXAMPLES:\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // items created today\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "CREATED_AT"} // items not created this week\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["DAYS", 30], "operator": "within_the_last", "compareAttribute": "CREATED_AT"} // created in the last 30 days\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "CREATED_AT"} // created in Q1\n ❌ Wrong: {"columnId": "creation_log", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // missing the underscores around creation_log\n ❌ Wrong: {"columnId": "created_at", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // use __creation_log__ for the item\'s creation time\n ❌ Wrong: {"columnId": "__creation_log__", "compareValue": ["LAST_MONTH"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // LAST_MONTH and LAST_WEEK match no items, use within_the_last with ["MONTHS", 1] or ["WEEKS", 1]\n ❌ Wrong: {"columnId": "__creation_log__", "compareValue": ["PAST_DATETIME", "14"], "operator": "within_the_last"} // PAST_DATETIME is not a unit, use ["DAYS", 14]\n ❌ Wrong: {"columnId": "__creation_log__", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between"} // missing CREATED_AT',item_id:'The columnId is the literal string "__item_id__", with two underscores before and after. Prefer the tool\'s own itemIds argument when you simply want a known set of items - use this filter only when combining an item-id restriction with other filter rules. Supported operators: any_of, not_any_of. CompareValue is an array of item ids as strings.\nEXAMPLES:\n ✅ Correct: {"columnId": "__item_id__", "compareValue": ["3208003201"], "operator": "any_of"} // filtering by a single item id\n ✅ Correct: {"columnId": "__item_id__", "compareValue": ["3208003201", "3208003202"], "operator": "not_any_of"} // excluding several item ids\n ❌ Wrong: {"columnId": "item_id", "compareValue": ["3208003201"], "operator": "any_of"} // missing the underscores around item_id\n ❌ Wrong: {"columnId": "parent_item_id", "compareValue": ["3208003201"], "operator": "any_of"} // parent_item_id describes item hierarchy in the response\n ❌ Wrong: {"columnId": "pulse_id", "compareValue": ["3208003201"], "operator": "any_of"} // pulse_id is an internal name, not a filterable id',date:'Supported operators: any_of, not_any_of, between, greater_than, greater_than_or_equals, lower_than, lower_than_or_equal, within_the_last, within_the_next, is_empty, is_not_empty. CompareValue should be either:\n - Date in "YYYY-MM-DD" format with "EXACT" e.g. compareValue:["EXACT", "2025-01-01"]\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\n - A two item array of plain "YYYY-MM-DD" dates [FROM, TO] with the between operator, e.g. ["2025-01-01", "2025-03-31"]\nFor a date range, use a single between rule.\nEXAMPLES:\n ✅ Correct: {"columnId": "date", "compareValue": ["EXACT", "2025-01-01"], "operator": "any_of"} // using exact date format with EXACT\n ✅ Correct: {"columnId": "date", "compareValue": "TODAY", "operator": "greater_than"} // using TODAY with greater_than\n ✅ Correct: {"columnId": "date", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between"} // a date range, no compareAttribute\n ✅ Correct: {"columnId": "date", "compareValue": ["DAYS", 7], "operator": "within_the_last"} // due in the last 7 days\n ✅ Correct: {"columnId": "date", "compareValue": ["WEEKS", 2], "operator": "within_the_next"} // due in the next 2 weeks\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\n ❌ Wrong: {"columnId": "date", "compareValue": 7, "operator": "within_the_last"} // a bare number is not a valid window, use ["DAYS", 7]\n ❌ Wrong: {"columnId": "date", "compareValue": ["EXACT", "2025-01-01"], "operator": "within_the_next"} // within_the_next takes a [UNIT, AMOUNT] window, never an exact date\n ❌ Wrong: {"columnId": "date", "compareValue": "one_week", "compareAttribute": "WEEKS", "operator": "within_the_last"} // the unit belongs inside compareValue, never in compareAttribute\n ❌ Wrong: {"columnId": "date", "compareValue": ["2025-01-01", "2025-03-31"], "compareAttribute": "EXACT", "operator": "between"} // a date column takes no compareAttribute, "EXACT" belongs inside compareValue\n ❌ Wrong: {"columnId": "date", "compareValue": ["2025-01-01", "2025-03-31"], "compareAttribute": "START_DATE", "operator": "between"} // START_DATE/END_DATE apply to timeline columns, never to date columns\n ❌ Wrong: {"columnId": "date", "compareValue": ["EXACT", "2025-01-01", "2025-03-31"], "operator": "between"} // between takes exactly two plain dates, with no EXACT prefix',timeline:'A timeline column holds a start and an end date. Supported operators without compareAttribute: any_of, not_any_of, is_empty, is_not_empty. Supported operators with compareAttribute "START_DATE" or "END_DATE": between, greater_than, greater_than_or_equals, lower_than, lower_than_or_equal. With between, compareValue is a two item array of plain "YYYY-MM-DD" dates [FROM, TO].\nEXAMPLES:\n ✅ Correct: {"columnId": "timeline", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "START_DATE"} // timelines starting in Q1\n ✅ Correct: {"columnId": "timeline", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "END_DATE"} // timelines ending in Q1\n ✅ Correct: {"columnId": "timeline", "compareValue": "2025-06-01", "operator": "greater_than", "compareAttribute": "START_DATE"} // starts after a date\n ✅ Correct: {"columnId": "timeline", "compareValue": [], "operator": "is_empty"} // no timeline set\n ❌ Wrong: {"columnId": "timeline", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between"} // between on a timeline requires compareAttribute START_DATE or END_DATE\n ❌ Wrong: {"columnId": "timeline", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "EXACT"} // EXACT is not a timeline compareAttribute, use START_DATE or END_DATE\n ❌ Wrong: {"columnId": "timeline", "compareValue": "2025-06-01", "operator": "contains_text"} // timeline columns hold dates, not text\n ❌ Wrong: {"columnId": "timeline", "compareValue": ["DAYS", 30], "operator": "within_the_next"} // within_the_next does not exist for timeline, use between with START_DATE\n ❌ Wrong: {"columnId": "timeline", "compareValue": "2025-06-01", "operator": "greater_than_or_equals"} // missing the required compareAttribute',location:'Supported operators: is_empty, is_not_empty. CompareValue is an empty array.\nEXAMPLES:\n ✅ Correct: {"columnId": "location", "compareValue": [], "operator": "is_not_empty"} // items that have a location\n ✅ Correct: {"columnId": "location", "compareValue": [], "operator": "is_empty"} // items missing a location\n ❌ Wrong: {"columnId": "location", "compareValue": "New York", "operator": "contains_text"} // location columns cannot be text filtered\n ❌ Wrong: {"columnId": "location", "compareValue": ["New York"], "operator": "any_of"} // any_of is not supported for location',board_relation:'A connect boards column. Supported operators: any_of, not_any_of, contains_text, not_contains_text, starts_with, is_empty, is_not_empty. With any_of and not_any_of, compareValue is an array of the linked item ids as numbers. With the text operators, compareValue is a single string matched against the linked items\' names.\nEXAMPLES:\n ✅ Correct: {"columnId": "board_relation", "compareValue": [3208003201], "operator": "any_of"} // linked to a specific item\n ✅ Correct: {"columnId": "board_relation", "compareValue": "Acme", "operator": "contains_text"} // linked item name contains text\n ✅ Correct: {"columnId": "board_relation", "compareValue": [], "operator": "is_empty"} // nothing linked\n ❌ Wrong: {"columnId": "board_relation", "compareValue": 3208003201, "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "board_relation", "compareValue": "Acme", "operator": "ends_with"} // ends_with is not supported for this column',subtasks:'Supported operators: is_empty, is_not_empty. CompareValue is an empty array. To filter on subitem values, query the subitems board directly using its own boardId.\nEXAMPLES:\n ✅ Correct: {"columnId": "subitems", "compareValue": [], "operator": "is_not_empty"} // items that have subitems\n ✅ Correct: {"columnId": "subitems", "compareValue": [], "operator": "is_empty"} // items without subitems\n ❌ Wrong: {"columnId": "subitems", "compareValue": "Design", "operator": "contains_text"} // subitem content is not filterable from the parent board\n ❌ Wrong: {"columnId": "subitems", "compareValue": ["3208003201"], "operator": "any_of"} // any_of is not supported for subitems',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'};function n_(e){const t=i_[e];return t?`# 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 operators\n- CompareValue MUST BE SENT AS A TWO ITEM ARRAY OF [UNIT, AMOUNT] WHEN USED WITH within_the_last, within_the_next operators, where UNIT is one of "DAYS", "WORKDAYS", "WEEKS", "MONTHS" and AMOUNT is a number, e.g. ["DAYS", 7] for the last or next 7 days\n- CompareValue MUST BE SENT AS A TWO ITEM ARRAY OF plain "YYYY-MM-DD" dates [FROM, TO] WHEN USED WITH between\n\n## [IMPORTANT] Column type: ${e}\n${t}\n`:null}const o_={columnType:i.z.nativeEnum(gm).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")'),fetchMode:i.z.nativeEnum(zm).optional().default(zm.Schema).describe(`fetchMode "${zm.Schema}": JSON settings schema only (GraphQL). fetchMode "${zm.Guidelines}": guidelines.filter and guidelines.aggregation only — no GraphQL round-trip.`)};const r_={random_string:i.z.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:i.z.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const s_={typeName:i.z.string().describe("The name of the GraphQL type to get details for")};const d_=Nc`
1564
1564
  fragment UserDetails on User {
1565
1565
  # Basic User Information
1566
1566
  id
@@ -1591,31 +1591,31 @@
1591
1591
  time_zone_identifier
1592
1592
  utc_hours_diff
1593
1593
  }
1594
- `,d_=Nc`
1594
+ `,p_=Nc`
1595
1595
  fragment UserTeamMembership on Team {
1596
1596
  id
1597
1597
  name
1598
1598
  is_guest
1599
1599
  picture_url
1600
1600
  }
1601
- `,p_=Nc`
1601
+ `,l_=Nc`
1602
1602
  fragment TeamBasicInfo on Team {
1603
1603
  id
1604
1604
  name
1605
1605
  }
1606
- `,l_=Nc`
1606
+ `,c_=Nc`
1607
1607
  fragment TeamExtendedInfo on Team {
1608
1608
  ...TeamBasicInfo
1609
1609
  is_guest
1610
1610
  picture_url
1611
1611
  }
1612
- `,c_=Nc`
1612
+ `,m_=Nc`
1613
1613
  fragment TeamOwner on User {
1614
1614
  id
1615
1615
  name
1616
1616
  email
1617
1617
  }
1618
- `,m_=Nc`
1618
+ `,u_=Nc`
1619
1619
  fragment TeamMember on User {
1620
1620
  id
1621
1621
  name
@@ -1635,7 +1635,7 @@
1635
1635
  time_zone_identifier
1636
1636
  utc_hours_diff
1637
1637
  }
1638
- `,u_=Nc`
1638
+ `,h_=Nc`
1639
1639
  fragment TeamMemberSimplified on User {
1640
1640
  id
1641
1641
  name
@@ -1643,15 +1643,15 @@
1643
1643
  title
1644
1644
  kind
1645
1645
  }
1646
- `,h_=Nc`
1646
+ `,f_=Nc`
1647
1647
  fragment UserTeamMembershipSimplified on Team {
1648
1648
  id
1649
1649
  name
1650
1650
  is_guest
1651
1651
  }
1652
- `,f_=Nc`
1653
- ${s_}
1652
+ `,__=Nc`
1654
1653
  ${d_}
1654
+ ${p_}
1655
1655
 
1656
1656
  query listUsersWithTeams($userIds: [ID!], $limit: Int = 1000) {
1657
1657
  users(ids: $userIds, limit: $limit) {
@@ -1663,21 +1663,21 @@
1663
1663
  }
1664
1664
  }
1665
1665
  }
1666
- `,__=Nc`
1667
- ${s_}
1666
+ `,b_=Nc`
1667
+ ${d_}
1668
1668
 
1669
1669
  query listUsersOnly($userIds: [ID!], $limit: Int = 1000) {
1670
1670
  users(ids: $userIds, limit: $limit) {
1671
1671
  ...UserDetails
1672
1672
  }
1673
1673
  }
1674
- `,b_=Nc`
1675
- ${s_}
1676
- ${h_}
1677
- ${l_}
1678
- ${p_}
1674
+ `,g_=Nc`
1675
+ ${d_}
1676
+ ${f_}
1679
1677
  ${c_}
1680
- ${u_}
1678
+ ${l_}
1679
+ ${m_}
1680
+ ${h_}
1681
1681
 
1682
1682
  query listUsersAndTeams($userIds: [ID!], $teamIds: [ID!], $limit: Int = 1000) {
1683
1683
  users(ids: $userIds, limit: $limit) {
@@ -1703,19 +1703,19 @@
1703
1703
  }
1704
1704
  }
1705
1705
  }
1706
- `,g_=Nc`
1707
- ${p_}
1706
+ `,y_=Nc`
1707
+ ${l_}
1708
1708
 
1709
1709
  query listTeamsOnly($teamIds: [ID!]) {
1710
1710
  teams(ids: $teamIds) {
1711
1711
  ...TeamBasicInfo
1712
1712
  }
1713
1713
  }
1714
- `,y_=Nc`
1715
- ${l_}
1716
- ${p_}
1714
+ `,v_=Nc`
1717
1715
  ${c_}
1716
+ ${l_}
1718
1717
  ${m_}
1718
+ ${u_}
1719
1719
 
1720
1720
  query listTeamsWithMembers($teamIds: [ID!]) {
1721
1721
  teams(ids: $teamIds) {
@@ -1732,9 +1732,9 @@
1732
1732
  }
1733
1733
  }
1734
1734
  }
1735
- `,v_=Nc`
1736
- ${s_}
1735
+ `,I_=Nc`
1737
1736
  ${d_}
1737
+ ${p_}
1738
1738
 
1739
1739
  query getUserByName($name: String) {
1740
1740
  users(name: $name) {
@@ -1746,7 +1746,7 @@
1746
1746
  }
1747
1747
  }
1748
1748
  }
1749
- `,I_=Nc`
1749
+ `,w_=Nc`
1750
1750
  query getCurrentUser {
1751
1751
  me {
1752
1752
  id
@@ -1759,7 +1759,7 @@
1759
1759
  }
1760
1760
  }
1761
1761
  }
1762
- `;const w_=[["is_email_confirmed","Email Confirmed"],["became_active_at","Became Active At"],["last_activity","Last Activity"],["location","Location"],["mobile_phone","Mobile Phone"],["phone","Phone"],["time_zone_identifier","Timezone"],["utc_hours_diff","UTC Hours Diff"]];function T_(e,t=""){const a=w_.filter((([t])=>{const a=e[t];return null!=a})).map((([a,i])=>`${t}${i}: ${e[a]}`)),i=e.photo_url?.thumb;return i&&a.push(`${t}Photo Thumb: ${i}`),a}const E_=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(` Status: ${e.status||"N/A"}`),t.push(` Kind: ${e.kind||"N/A"}`),t.push(...T_(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"}`,`Kind: ${e.kind||"N/A"}`,...T_(e)];t.push(` - ${a.join(", ")}`)}})))),t.push(""))}))),0===t.length?"No users or teams found with the specified filters.":t.join("\n").trim()},A_=500,S_=500,D_=1e3,N_=Nc`
1762
+ `;const T_=[["is_email_confirmed","Email Confirmed"],["became_active_at","Became Active At"],["last_activity","Last Activity"],["location","Location"],["mobile_phone","Mobile Phone"],["phone","Phone"],["time_zone_identifier","Timezone"],["utc_hours_diff","UTC Hours Diff"]];function E_(e,t=""){const a=T_.filter((([t])=>{const a=e[t];return null!=a})).map((([a,i])=>`${t}${i}: ${e[a]}`)),i=e.photo_url?.thumb;return i&&a.push(`${t}Photo Thumb: ${i}`),a}const A_=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(` Status: ${e.status||"N/A"}`),t.push(` Kind: ${e.kind||"N/A"}`),t.push(...E_(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"}`,`Kind: ${e.kind||"N/A"}`,...E_(e)];t.push(` - ${a.join(", ")}`)}})))),t.push(""))}))),0===t.length?"No users or teams found with the specified filters.":t.join("\n").trim()},S_=500,D_=500,N_=1e3,O_=Nc`
1763
1763
  query getAccountSlug {
1764
1764
  me {
1765
1765
  account {
@@ -1767,11 +1767,11 @@
1767
1767
  }
1768
1768
  }
1769
1769
  }
1770
- `;async function O_(e){const t=await e.request(N_);return t.me?.account?.slug??null}function k_(e,t){return`https://${e}.monday.com/workspaces/${t}`}const R_={userIds:i.z.array(i.z.string()).max(A_).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:i.z.array(i.z.string()).max(S_).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:i.z.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:i.z.boolean().optional().describe('[TOP PRIORITY] Use ALWAYS when requesting current user information. Examples of when it should be used: ["get my user" or "get my teams"].\n This parameter CONFLICTS with all others. '),includeTeams:i.z.boolean().optional().describe("[AVOID] This fetches all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get their team memberships."),teamsOnly:i.z.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:i.z.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const C_={itemId:i.z.number().describe("The id of the item to move"),groupId:i.z.string().describe("The id of the group to which the item will be moved. Must be a group on the item's board, read from get_board_info in this run — never guessed from the group title.")};const $_=Nc`
1770
+ `;async function k_(e){const t=await e.request(O_);return t.me?.account?.slug??null}function R_(e,t){return`https://${e}.monday.com/workspaces/${t}`}const C_={userIds:i.z.array(i.z.string()).max(S_).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:i.z.array(i.z.string()).max(D_).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:i.z.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:i.z.boolean().optional().describe('[TOP PRIORITY] Use ALWAYS when requesting current user information. Examples of when it should be used: ["get my user" or "get my teams"].\n This parameter CONFLICTS with all others. '),includeTeams:i.z.boolean().optional().describe("[AVOID] This fetches all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get their team memberships."),teamsOnly:i.z.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:i.z.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const $_={itemId:i.z.number().describe("The id of the item to move"),groupId:i.z.string().describe("The id of the group to which the item will be moved. Must be a group on the item's board, read from get_board_info in this run — never guessed from the group title.")};const x_=Nc`
1771
1771
  mutation updateDocName($docId: ID!, $name: String!) {
1772
1772
  update_doc_name(docId: $docId, name: $name)
1773
1773
  }
1774
- `,x_=Nc`
1774
+ `,L_=Nc`
1775
1775
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1776
1776
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1777
1777
  success
@@ -1779,13 +1779,13 @@
1779
1779
  error
1780
1780
  }
1781
1781
  }
1782
- `,L_=Nc`
1782
+ `,U_=Nc`
1783
1783
  query getDocIdByObjectId($objectId: ID!) {
1784
1784
  docs(object_ids: [$objectId], limit: 1) {
1785
1785
  id
1786
1786
  }
1787
1787
  }
1788
- `,U_=Nc`
1788
+ `,P_=Nc`
1789
1789
  mutation updateDocBlock($blockId: String!, $content: JSON!) {
1790
1790
  update_doc_block(block_id: $blockId, content: $content) {
1791
1791
  id
@@ -1793,26 +1793,26 @@
1793
1793
  created_at
1794
1794
  }
1795
1795
  }
1796
- `,P_=Nc`
1796
+ `,V_=Nc`
1797
1797
  mutation deleteDocBlock($blockId: String!) {
1798
1798
  delete_doc_block(block_id: $blockId) {
1799
1799
  id
1800
1800
  }
1801
1801
  }
1802
- `,V_=Nc`
1802
+ `,M_=Nc`
1803
1803
  mutation deleteDocBlocks($blockIds: [ID!]!) {
1804
1804
  delete_doc_blocks(block_ids: $blockIds) {
1805
1805
  id
1806
1806
  }
1807
1807
  }
1808
- `,M_=Nc`
1808
+ `,F_=Nc`
1809
1809
  query getDocObjectIdByDocId($docId: ID!) {
1810
1810
  docs(ids: [$docId], limit: 1) {
1811
1811
  id
1812
1812
  object_id
1813
1813
  }
1814
1814
  }
1815
- `,F_=Nc`
1815
+ `,B_=Nc`
1816
1816
  query getDocBoardItem($boardId: ID!) {
1817
1817
  boards(ids: [$boardId]) {
1818
1818
  items_page(limit: 1) {
@@ -1822,7 +1822,7 @@
1822
1822
  }
1823
1823
  }
1824
1824
  }
1825
- `,B_=Nc`
1825
+ `,z_=Nc`
1826
1826
  query getDocBlockContent($docId: ID!) {
1827
1827
  docs(ids: [$docId], limit: 1) {
1828
1828
  blocks {
@@ -1832,7 +1832,7 @@
1832
1832
  }
1833
1833
  }
1834
1834
  }
1835
- `,z_=Nc`
1835
+ `,j_=Nc`
1836
1836
  mutation createDocComment($itemId: ID!, $body: String!, $parentId: ID, $mentionsList: [UpdateMention]) {
1837
1837
  create_update(body: $body, item_id: $itemId, parent_id: $parentId, mentions_list: $mentionsList) {
1838
1838
  id
@@ -1840,7 +1840,7 @@
1840
1840
  created_at
1841
1841
  }
1842
1842
  }
1843
- `,j_=Nc`
1843
+ `,q_=Nc`
1844
1844
  mutation createDocBlocks($docId: ID!, $afterBlockId: String, $blocksInput: [CreateBlockInput!]!) {
1845
1845
  create_doc_blocks(docId: $docId, afterBlockId: $afterBlockId, blocksInput: $blocksInput) {
1846
1846
  id
@@ -1908,7 +1908,7 @@
1908
1908
  }
1909
1909
  }
1910
1910
  }
1911
- `,q_=Nc`
1911
+ `,G_=Nc`
1912
1912
  query boardViewDocs(
1913
1913
  $boardId: ID!
1914
1914
  $viewId: ID
@@ -1944,7 +1944,7 @@
1944
1944
  }
1945
1945
  }
1946
1946
  }
1947
- `;async function G_(e,t,a,i={}){return((await e.request(q_,{boardId:t,viewId:a,includeBlocks:i.includeBlocks??!1,blocksLimit:i.blocksLimit,blocksPage:i.blocksPage},{versionOverride:"2027-01"})).board_view_docs??[]).filter((e=>null!=e))}async function H_(e,t,a){let i;try{i=await G_(e,t,a)}catch(e){return{ok:!1,error:`Failed to resolve the doc of board ${t}${a?` view ${a}`:""}: ${e instanceof Error?e.message:"Unknown error"}`}}if(0===i.length)return{ok:!1,error:W_(t,a)};if(i.length>1){const e=i.map((e=>e.name)).join(", ");return{ok:!1,error:`Board ${t} has ${i.length} doc views (${e}). Pass view_id to pick one — it is the <view_id> in https://<slug>.monday.com/boards/${t}/views/<view_id>.`}}return{ok:!0,doc:i[0]}}function W_(e,t){return t?`No doc found for view ${t} on board ${e}. The view may not be a doc view, or the doc may not have been opened yet.`:`Board ${e} has no doc views.`}const Y_="content",Q_="version_history",K_=i.z.enum(["ids","object_ids","workspace_ids"]),J_={mode:i.z.enum([Y_,Q_]).optional().default(Y_).describe('The operation mode. "content" (default) fetches documents with their markdown content. "version_history" fetches the edit history of a single document.'),type:K_.optional().describe('Query type for content mode: "ids", "object_ids", or "workspace_ids". Required when mode is "content", unless board_id is provided. Default to "object_ids" — the number in a doc URL is an object_id. Use "ids" only for the internal doc id field returned by read_docs, and "workspace_ids" only to list all docs in a workspace.'),board_id:i.z.string().min(1).optional().describe("For docs that live as a board view: the <board_id> in https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Use this instead of type/ids when all you have is a board view URL. Only used in content mode."),view_id:i.z.string().min(1).optional().describe("For a doc that lives as a board view: the <view_id> in https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Requires board_id. Omit to read every doc view of the board."),ids:i.z.array(i.z.string()).optional().describe('Array of ID values. In content mode: matches the query type (ids/object_ids/workspace_ids). In version_history mode: provide the single document object_id here (e.g., ids: ["5001466606"]).'),limit:i.z.number().optional().describe("Number of docs per page (default: 25). Only used in content mode."),order_by:i.z.nativeEnum(Er).optional().describe("Order in which to retrieve docs. Only used in content mode."),page:i.z.number().optional().describe("Page number to return (starts at 1). Only used in content mode."),include_blocks:i.z.boolean().optional().default(!1).describe("If true, includes the blocks array (block IDs, types, positions, content) in the response. Required when you plan to call update_doc. Defaults to false to reduce response size. Only used in content mode."),blocks_limit:i.z.number().optional().describe("Maximum number of blocks to return per document (default: 25). Only used in content mode when include_blocks is true."),blocks_page:i.z.number().optional().describe("Page number for block pagination, starting at 1. Omit to use the API default. Use with blocks_limit to page through documents with more than 25 blocks. Only used in content mode when include_blocks is true."),include_comments:i.z.boolean().optional().default(!1).describe("If true, fetches all comments and replies on the document. Comments are stored at the item level within the doc backing board. Defaults to false. Only used in content mode."),comments_limit:i.z.number().optional().default(50).describe("Maximum number of comments (updates) to fetch per item when include_comments is true. Defaults to 50. Only used in content mode."),version_history_limit:i.z.number().optional().describe('Maximum number of restoring points to return. Use this when the user asks for "last N changes". Only used in version_history mode.'),since:i.z.string().optional().describe('ISO 8601 date string to filter version history from (e.g., "2026-03-15T00:00:00Z"). If omitted, returns the full history. Only used in version_history mode.'),until:i.z.string().optional().describe('ISO 8601 date string to filter version history until (e.g., "2026-03-16T23:59:59Z"). Defaults to now. Only used in version_history mode.'),include_diff:i.z.boolean().optional().default(!1).describe("If true, fetches content diffs between consecutive restoring points. May be slower due to additional API calls. Only used in version_history mode.")};const X_={workspace_id:i.z.number().describe("The ID of the workspace to get information for")};const Z_=Nc`
1947
+ `;async function H_(e,t,a,i={}){return((await e.request(G_,{boardId:t,viewId:a,includeBlocks:i.includeBlocks??!1,blocksLimit:i.blocksLimit,blocksPage:i.blocksPage},{versionOverride:"2027-01"})).board_view_docs??[]).filter((e=>null!=e))}async function W_(e,t,a){let i;try{i=await H_(e,t,a)}catch(e){return{ok:!1,error:`Failed to resolve the doc of board ${t}${a?` view ${a}`:""}: ${e instanceof Error?e.message:"Unknown error"}`}}if(0===i.length)return{ok:!1,error:Y_(t,a)};if(i.length>1){const e=i.map((e=>e.name)).join(", ");return{ok:!1,error:`Board ${t} has ${i.length} doc views (${e}). Pass view_id to pick one — it is the <view_id> in https://<slug>.monday.com/boards/${t}/views/<view_id>.`}}return{ok:!0,doc:i[0]}}function Y_(e,t){return t?`No doc found for view ${t} on board ${e}. The view may not be a doc view, or the doc may not have been opened yet.`:`Board ${e} has no doc views.`}const Q_="content",K_="version_history",J_=i.z.enum(["ids","object_ids","workspace_ids"]),X_={mode:i.z.enum([Q_,K_]).optional().default(Q_).describe('The operation mode. "content" (default) fetches documents with their markdown content. "version_history" fetches the edit history of a single document.'),type:J_.optional().describe('Query type for content mode: "ids", "object_ids", or "workspace_ids". Required when mode is "content", unless board_id is provided. Default to "object_ids" — the number in a doc URL is an object_id. Use "ids" only for the internal doc id field returned by read_docs, and "workspace_ids" only to list all docs in a workspace.'),board_id:i.z.string().min(1).optional().describe("For docs that live as a board view: the <board_id> in https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Use this instead of type/ids when all you have is a board view URL. Only used in content mode."),view_id:i.z.string().min(1).optional().describe("For a doc that lives as a board view: the <view_id> in https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Requires board_id. Omit to read every doc view of the board."),ids:i.z.array(i.z.string()).optional().describe('Array of ID values. In content mode: matches the query type (ids/object_ids/workspace_ids). In version_history mode: provide the single document object_id here (e.g., ids: ["5001466606"]).'),limit:i.z.number().optional().describe("Number of docs per page (default: 25). Only used in content mode."),order_by:i.z.nativeEnum(Er).optional().describe("Order in which to retrieve docs. Only used in content mode."),page:i.z.number().optional().describe("Page number to return (starts at 1). Only used in content mode."),include_blocks:i.z.boolean().optional().default(!1).describe("If true, includes the blocks array (block IDs, types, positions, content) in the response. Required when you plan to call update_doc. Defaults to false to reduce response size. Only used in content mode."),blocks_limit:i.z.number().optional().describe("Maximum number of blocks to return per document (default: 25). Only used in content mode when include_blocks is true."),blocks_page:i.z.number().optional().describe("Page number for block pagination, starting at 1. Omit to use the API default. Use with blocks_limit to page through documents with more than 25 blocks. Only used in content mode when include_blocks is true."),include_comments:i.z.boolean().optional().default(!1).describe("If true, fetches all comments and replies on the document. Comments are stored at the item level within the doc backing board. Defaults to false. Only used in content mode."),comments_limit:i.z.number().optional().default(50).describe("Maximum number of comments (updates) to fetch per item when include_comments is true. Defaults to 50. Only used in content mode."),version_history_limit:i.z.number().optional().describe('Maximum number of restoring points to return. Use this when the user asks for "last N changes". Only used in version_history mode.'),since:i.z.string().optional().describe('ISO 8601 date string to filter version history from (e.g., "2026-03-15T00:00:00Z"). If omitted, returns the full history. Only used in version_history mode.'),until:i.z.string().optional().describe('ISO 8601 date string to filter version history until (e.g., "2026-03-16T23:59:59Z"). Defaults to now. Only used in version_history mode.'),include_diff:i.z.boolean().optional().default(!1).describe("If true, fetches content diffs between consecutive restoring points. May be slower due to additional API calls. Only used in version_history mode.")};const Z_={workspace_id:i.z.number().describe("The ID of the workspace to get information for")};const eb=Nc`
1948
1948
  query listWorkspaces($limit: Int!, $page: Int!, $membershipKind: WorkspaceMembershipKind!) {
1949
1949
  workspaces(limit: $limit, page: $page, membership_kind: $membershipKind) {
1950
1950
  id
@@ -1952,7 +1952,7 @@
1952
1952
  description
1953
1953
  }
1954
1954
  }
1955
- `;function eb(e){const t=e.workspaces?.filter((e=>null!==e));return t||[]}function tb(e){return Array.isArray(e)&&e.length>0}const ab={limit:i.z.number().min(1).max(100).default(100).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:i.z.number().min(1).default(1).describe("Page number to return. Default is 1.")};const ib=Nc`
1955
+ `;function tb(e){const t=e.workspaces?.filter((e=>null!==e));return t||[]}function ab(e){return Array.isArray(e)&&e.length>0}const ib={limit:i.z.number().min(1).max(100).default(100).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:i.z.number().min(1).default(1).describe("Page number to return. Default is 1.")};const nb=Nc`
1956
1956
  query getItemBoard($itemId: ID!) {
1957
1957
  items(ids: [$itemId], limit: 1) {
1958
1958
  id
@@ -1965,7 +1965,27 @@
1965
1965
  }
1966
1966
  }
1967
1967
  }
1968
- `,nb=Nc`
1968
+ `,ob=Nc`
1969
+ query getItemDocColumnValue($itemId: ID!, $columnId: String!) {
1970
+ items(ids: [$itemId], limit: 1) {
1971
+ column_values(ids: [$columnId]) {
1972
+ __typename
1973
+ id
1974
+ type
1975
+ ... on DocValue {
1976
+ file {
1977
+ doc {
1978
+ id
1979
+ object_id
1980
+ url
1981
+ name
1982
+ }
1983
+ }
1984
+ }
1985
+ }
1986
+ }
1987
+ }
1988
+ `,rb=Nc`
1969
1989
  mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {
1970
1990
  create_doc(location: $location, doc_owner_ids: $docOwnerIds) {
1971
1991
  id
@@ -1974,7 +1994,7 @@
1974
1994
  name
1975
1995
  }
1976
1996
  }
1977
- `,ob=Nc`
1997
+ `,sb=Nc`
1978
1998
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1979
1999
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1980
2000
  success
@@ -1982,11 +2002,11 @@
1982
2002
  error
1983
2003
  }
1984
2004
  }
1985
- `,rb=Nc`
2005
+ `,db=Nc`
1986
2006
  mutation updateDocName($docId: ID!, $name: String!) {
1987
2007
  update_doc_name(docId: $docId, name: $name)
1988
2008
  }
1989
- `,sb=i.z.enum(["workspace","item"]),db=i.z.discriminatedUnion("type",[i.z.object({type:i.z.literal(sb.enum.workspace).describe("Create document in workspace"),workspace_id:i.z.number().describe("Workspace ID under which to create the new document"),doc_kind:i.z.nativeEnum(ho).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:i.z.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),i.z.object({type:i.z.literal(sb.enum.item).describe("Create document attached to item"),item_id:i.z.number().describe("Item ID to attach the new document to"),column_id:i.z.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]),pb={doc_name:i.z.string().describe("Name for the new document."),markdown:i.z.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:i.z.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),docOwnerIds:i.z.array(i.z.string()).min(1).optional().describe("Optional list of user IDs to set as document owners at creation time. Use this to add the agent owner so they retain access to the document. Ownership is set inside the creation mutation itself, bypassing the permission checks that would block a subsequent add_subscribers_to_object call."),workspace_id:i.z.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:i.z.nativeEnum(ho).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:i.z.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:i.z.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:i.z.string().optional().describe('[OPTIONAL - use only when location="item"] ID of an existing "doc" column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.')};const lb=Nc`
2009
+ `,pb=i.z.enum(["workspace","item"]),lb=i.z.discriminatedUnion("type",[i.z.object({type:i.z.literal(pb.enum.workspace).describe("Create document in workspace"),workspace_id:i.z.number().describe("Workspace ID under which to create the new document"),doc_kind:i.z.nativeEnum(ho).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:i.z.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),i.z.object({type:i.z.literal(pb.enum.item).describe("Create document attached to item"),item_id:i.z.number().describe("Item ID to attach the new document to"),column_id:i.z.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]),cb={doc_name:i.z.string().describe("Name for the new document."),markdown:i.z.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:i.z.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),docOwnerIds:i.z.array(i.z.string()).min(1).optional().describe("Optional list of user IDs to set as document owners at creation time. Use this to add the agent owner so they retain access to the document. Ownership is set inside the creation mutation itself, bypassing the permission checks that would block a subsequent add_subscribers_to_object call."),workspace_id:i.z.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:i.z.nativeEnum(ho).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:i.z.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:i.z.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:i.z.string().optional().describe('[OPTIONAL - use only when location="item"] ID of an existing "doc" column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.')};const mb=Nc`
1990
2010
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1991
2011
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1992
2012
  success
@@ -1994,7 +2014,7 @@
1994
2014
  error
1995
2015
  }
1996
2016
  }
1997
- `,cb=Nc`
2017
+ `,ub=Nc`
1998
2018
  query getDocByObjectId($objectId: ID!) {
1999
2019
  docs(object_ids: [$objectId], limit: 1) {
2000
2020
  id
@@ -2002,7 +2022,7 @@
2002
2022
  url
2003
2023
  }
2004
2024
  }
2005
- `,mb=Nc`
2025
+ `,hb=Nc`
2006
2026
  query getDocById($docId: ID!) {
2007
2027
  docs(ids: [$docId], limit: 1) {
2008
2028
  id
@@ -2010,7 +2030,7 @@
2010
2030
  url
2011
2031
  }
2012
2032
  }
2013
- `,ub={doc_id:i.z.string().min(1).optional().describe("The document ID (the id field returned by read_docs). Provide this OR object_id. Takes priority if both are provided."),object_id:i.z.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id. Provide this OR doc_id."),board_id:i.z.string().min(1).optional().describe("For a doc that lives as a board view: the <board_id> in https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Pair with view_id. Use this instead of doc_id/object_id when all you have is a board view URL."),view_id:i.z.string().min(1).optional().describe("For a doc that lives as a board view: the <view_id> in https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Requires board_id."),markdown:i.z.string().describe("Markdown content to add to the document."),after_block_id:i.z.string().optional().describe("Block ID after which to insert the new content. If omitted, content is appended at the end. To insert at the beginning, pass the first block ID from read_docs. Block IDs can be obtained from read_docs or from a previous add_content_to_doc response.")};function hb(e){if(e)return e}function fb(e){if(e)return e}function _b(e){if(e)return{bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,code:e.code,link:e.link,color:e.color,background:e.background}}function bb(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{blot:{mention:{id:String(t),type:e.insert.mention.type}}}}}return"column_value"in e.insert?{insert:{blot:{column_value:{item_id:String(e.insert.column_value.item_id),column_id:e.insert.column_value.column_id}}}}:{insert:{text:e.insert.text},attributes:_b(e.attributes)}}))}function gb(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{mention:{id:t,type:e.insert.mention.type}}}}return"column_value"in e.insert?{insert:{macro:{type:"COLUMN_VALUE",macroId:l.randomUUID(),macroData:{itemId:Number(e.insert.column_value.item_id),columnId:e.insert.column_value.column_id}}}}:{insert:e.insert.text,attributes:_b(e.attributes)}}))}function yb(e,t){const a=e.attributes||{},i=a.comments||[];return{...e,attributes:{...a,comments:[...i,t]}}}function vb(e,t,a,i){const n=a+i;let o=0;const r=[];for(const i of e){const e=i.insert;if(null==e)throw new Error(`Unexpected delta op at position ${o}: op has no 'insert' field. Block content may be from an unsupported block type.`);const s=o,d=s+("string"==typeof e?e.length:1),p=Math.max(s,a),l=Math.min(d,n);p>=l?r.push(i):"string"!=typeof e?r.push(yb(i,t)):(p>s&&r.push({...i,insert:e.slice(0,p-s)}),r.push(yb({...i,insert:e.slice(p-s,l-s)},t)),l<d&&r.push({...i,insert:e.slice(l-s)})),o=d}return r}const Ib=i.z.object({bold:i.z.boolean().optional(),italic:i.z.boolean().optional(),underline:i.z.boolean().optional(),strike:i.z.boolean().optional(),code:i.z.boolean().optional(),link:i.z.string().optional(),color:i.z.string().optional(),background:i.z.string().optional()}).optional(),wb=i.z.object({mention:i.z.object({id:i.z.union([i.z.string(),i.z.number()]).describe("User, doc, or board ID. Get user IDs from list_users_and_teams."),type:i.z.enum(["USER","DOC","BOARD"]).default("USER").describe("Mention type. USER is most common.")}).describe("Mention blot — tags a user, doc, or board inline. Do not set attributes on mention ops.")}),Tb=i.z.object({column_value:i.z.object({item_id:i.z.union([i.z.string(),i.z.number()]).describe("The board item ID."),column_id:i.z.string().describe('The column ID (e.g. "status", "date4"). Get column IDs from get_board_schema.')}).describe("Column value blot — embeds a live board column value inline in the doc.")}),Eb=i.z.object({insert:i.z.union([i.z.string().transform((e=>({text:e}))),i.z.object({text:i.z.string()}),wb,Tb]).describe('Content to insert. Use {text: "..."} for plain text, {mention: {id, type}} to tag a user/doc/board, or {column_value: {item_id, column_id}} to embed a live column value. The last operation in the array must be {text: "\\n"}.'),attributes:Ib.describe("Optional formatting: bold, italic, underline, strike, code, link, color, background. Not applicable to mention or column_value ops.")}),Ab=i.z.object({block_content_type:i.z.literal("text"),delta_format:i.z.array(Eb).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:i.z.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:i.z.enum(["LTR","RTL"]).optional()}),Sb=i.z.object({block_content_type:i.z.literal("code"),delta_format:i.z.array(Eb).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:i.z.string().optional().describe('Programming language (e.g. "javascript", "python").')}),Db=i.z.object({block_content_type:i.z.literal("list_item"),delta_format:i.z.array(Eb).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),checked:i.z.boolean().optional().describe("Check state for CHECK_LIST items."),indentation:i.z.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),Nb=i.z.discriminatedUnion("block_content_type",[Ab,Sb,Db]),Ob=i.z.object({block_type:i.z.literal("text"),text_block_type:i.z.enum(["NORMAL_TEXT","LARGE_TITLE","MEDIUM_TITLE","SMALL_TITLE","QUOTE"]).optional().describe("Block subtype. LARGE_TITLE=H1, MEDIUM_TITLE=H2, SMALL_TITLE=H3."),delta_format:i.z.array(Eb).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:i.z.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:i.z.enum(["LTR","RTL"]).optional()}),kb=i.z.object({block_type:i.z.literal("list_item"),list_block_type:i.z.enum(["BULLETED_LIST","NUMBERED_LIST","CHECK_LIST"]).optional().describe("List type. Defaults to BULLETED_LIST."),delta_format:i.z.array(Eb).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),indentation:i.z.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),Rb=i.z.object({block_type:i.z.literal("code"),delta_format:i.z.array(Eb).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:i.z.string().optional().describe('Programming language (e.g. "javascript", "python").')}),Cb=i.z.object({block_type:i.z.literal("divider")}),$b=i.z.object({block_type:i.z.literal("page_break")}),xb=i.z.object({block_type:i.z.literal("image"),public_url:i.z.string().url().optional().describe("Publicly accessible image URL. Provide either public_url or asset_id."),asset_id:i.z.union([i.z.number().int(),i.z.string().regex(/^\d+$/).transform(Number)]).optional().describe("monday.com asset ID for the image. The image block will reference the asset directly. Provide either public_url or asset_id."),width:i.z.number().int().min(1).optional().describe("Width in pixels.")}),Lb=i.z.object({block_type:i.z.literal("video"),raw_url:i.z.string().url().describe("Video URL (YouTube, Vimeo, or direct video URL)."),width:i.z.number().int().min(1).optional().describe("Width in pixels.")}),Ub=i.z.object({block_type:i.z.literal("notice_box"),theme:i.z.enum(["INFO","TIPS","WARNING","GENERAL"]).describe("Visual style of the notice box.")}),Pb=i.z.object({block_type:i.z.literal("table"),row_count:i.z.number().int().min(1).max(25).describe("Number of rows (1–25)."),column_count:i.z.number().int().min(1).max(10).describe("Number of columns (1–10)."),width:i.z.number().int().optional().describe("Table width in pixels."),column_style:i.z.array(i.z.object({width:i.z.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),Vb=i.z.object({block_type:i.z.literal("layout"),column_count:i.z.number().int().min(2).max(6).describe("Number of columns (2–6)."),column_style:i.z.array(i.z.object({width:i.z.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),Mb=i.z.discriminatedUnion("block_type",[Ob,kb,Rb,Cb,$b,xb,Lb,Ub,Pb,Vb]),Fb=i.z.object({operation_type:i.z.literal("set_name"),name:i.z.string().min(1).describe("New document name.")}),Bb=i.z.object({operation_type:i.z.literal("add_markdown_content"),markdown:i.z.string().describe("Markdown content to convert and append (or insert) as blocks."),after_block_id:i.z.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs.")}),zb=i.z.object({operation_type:i.z.literal("update_block"),block_id:i.z.string().describe("ID of the block to update. Get block IDs from read_docs."),content:Nb.describe("New content for the block. Use block_content_type to select: text (updates text/heading/quote content), code (updates code content), list_item (updates bullets/numbered/todo content). Cannot change block subtype — use replace_block for that.")}),jb=i.z.object({operation_type:i.z.literal("create_block"),after_block_id:i.z.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs."),parent_block_id:i.z.string().optional().describe("Parent block ID for nested blocks. Only works for notice_box containers — use the notice_box block ID directly. Table/layout cell nesting is NOT supported by the API. IMPORTANT: A notice_box created in the same call cannot be referenced — use a separate call first to create it, then a second call to nest content inside it."),block:Mb.describe("The block to create. Use block_type to select the block type.")}),qb=i.z.object({operation_type:i.z.literal("delete_blocks"),block_ids:i.z.array(i.z.string()).min(1).max(100).describe("Block IDs to permanently delete (1–100 per call). Put ALL IDs for the delete into this single array — do NOT emit multiple delete_blocks operations back-to-back. Works for all block types including BOARD, WIDGET, DOC embed, GIPHY.")}),Gb=i.z.object({operation_type:i.z.literal("replace_block"),block_id:i.z.string().describe("ID of the block to delete."),after_block_id:i.z.string().optional().describe("Insert replacement after this block ID. Provide the ID of the block that precedes the deleted block."),parent_block_id:i.z.string().optional().describe("Parent block ID for the replacement block."),block:Mb.describe("The new block to create in place of the deleted one.")}),Hb=i.z.object({operation_type:i.z.literal("add_comment"),body:i.z.string().min(1).describe("The comment text. Use HTML tags for formatting (not markdown). Do not use @ to mention users — use mentions_list instead."),parent_update_id:i.z.number().optional().describe("The ID of an existing comment (update) to reply to. Omit to create a new top-level comment. Get comment IDs from read_docs with include_comments: true."),mentions_list:i.z.string().optional().describe('Optional JSON array of mentions: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types: User, Team, Board, Project. To mention an AI agent, use type User with the agent\'s user id from list_users_and_teams. Type Agent adds no mention.'),block_id:i.z.union([i.z.string(),i.z.array(i.z.string()).min(1)]).optional().describe("Block ID (string) or array of block IDs to anchor the comment to. When an array is provided, the same comment highlights all specified blocks. Only works on text-content blocks (text, code, list_item, title, quote) — not on divider, table, layout, notice_box, image, video, or giphy. Get block IDs from read_docs with include_blocks: true. Omit to create a general doc-level comment. Pair with selection_from + selection_length (single block_id only) to comment on a specific text range."),selection_from:i.z.number().int().min(0).optional().describe("Start character offset (0-indexed) of the selected text within the block. Requires block_id. Omit to comment on the entire block."),selection_length:i.z.number().int().min(1).optional().describe("Number of characters in the text selection. Requires block_id and selection_from. Only works for text, code, and list_item blocks that have a delta format.")}),Wb=i.z.discriminatedUnion("operation_type",[Fb,Bb,zb,jb,qb,Gb,Hb]),Yb={doc_id:i.z.string().min(1).optional().describe("The document ID (the id field from read_docs). Takes priority over object_id if both are provided."),object_id:i.z.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, visible in the document URL). Resolved to doc_id."),board_id:i.z.string().min(1).optional().describe("For a doc that lives as a board view: the <board_id> in https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Pair with view_id. Use this instead of doc_id/object_id when all you have is a board view URL."),view_id:i.z.string().min(1).optional().describe("For a doc that lives as a board view: the <view_id> in https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Requires board_id."),operations:i.z.array(Wb).min(1).max(25).describe('Ordered list of operations to perform. Executed sequentially. Stops at first failure.\n\nOperation types:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (simplest for text/lists/tables).\n- update_block: Change content of an existing text/code/list/divider block.\n- create_block: Create a new block at a specific position (supports text, list_item, code, divider, page_break, image, video, notice_box, table, layout).\n- delete_blocks: Permanently delete 1–100 blocks in one call. Provide all block IDs in the block_ids array. Works for all block types including BOARD, WIDGET, DOC embed, and GIPHY.\n- replace_block: Delete a block and create a new one in its place. Use for: changing image/video source, table restructure, notice_box theme change.\n- add_comment: Create a new comment or reply on the document. Use parent_update_id to reply to an existing comment. Format text with HTML. Uses the doc\'s backing board item.\n\nWHEN TO USE WHICH:\n- Adding new text sections → add_markdown_content\n- Adding asset-based images → create_block with block_type "image" and asset_id (add_markdown_content does NOT support asset images)\n- Mixed content with asset images → alternate add_markdown_content (for text) and create_block (for each image) in sequence\n- Editing existing text block → update_block\n- Changing an image URL → replace_block (image URL is immutable after creation)\n- Changing video URL → replace_block\n- Restructuring a table → replace_block\n- BOARD/WIDGET/DOC/GIPHY blocks → delete_blocks only (no public API to create these)\n\nNESTING CONTENT IN CONTAINERS:\n- notice_box: Fully supported. Create the notice_box first, then in a separate call create child blocks with parent_block_id set to the notice_box ID. You cannot reference a block ID created in the same call.\n- table: Cell-level API nesting is NOT supported. To create a table with content, use add_markdown_content with a markdown table (e.g. "| H1 | H2 |\\n| --- | --- |\\n| A | B |"). This creates a pre-populated table in one shot. Empty tables created via create_block cannot have their cells populated through the API.\n- layout: Cell-level API nesting is NOT supported and there is no markdown equivalent. Layouts can only be created empty via create_block. No workaround exists to populate layout columns through the API.\nDeleting a container does NOT delete its children — delete children first for clean removal.\n\nBATCHING: delete_blocks accepts 1..100 IDs. Put ALL IDs in one operation\'s block_ids array. Never emit multiple delete_blocks operations in a row.\n\nBlock IDs are available in the blocks array returned by read_docs.')};const Qb=Nc`
2033
+ `,fb={doc_id:i.z.string().min(1).optional().describe("The document ID (the id field returned by read_docs). Provide this OR object_id. Takes priority if both are provided."),object_id:i.z.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id. Provide this OR doc_id."),board_id:i.z.string().min(1).optional().describe("For a doc that lives as a board view: the <board_id> in https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Pair with view_id. Use this instead of doc_id/object_id when all you have is a board view URL."),view_id:i.z.string().min(1).optional().describe("For a doc that lives as a board view: the <view_id> in https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Requires board_id."),markdown:i.z.string().describe("Markdown content to add to the document."),after_block_id:i.z.string().optional().describe("Block ID after which to insert the new content. If omitted, content is appended at the end. To insert at the beginning, pass the first block ID from read_docs. Block IDs can be obtained from read_docs or from a previous add_content_to_doc response.")};function _b(e){if(e)return e}function bb(e){if(e)return e}function gb(e){if(e)return{bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,code:e.code,link:e.link,color:e.color,background:e.background}}function yb(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{blot:{mention:{id:String(t),type:e.insert.mention.type}}}}}return"column_value"in e.insert?{insert:{blot:{column_value:{item_id:String(e.insert.column_value.item_id),column_id:e.insert.column_value.column_id}}}}:{insert:{text:e.insert.text},attributes:gb(e.attributes)}}))}function vb(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{mention:{id:t,type:e.insert.mention.type}}}}return"column_value"in e.insert?{insert:{macro:{type:"COLUMN_VALUE",macroId:l.randomUUID(),macroData:{itemId:Number(e.insert.column_value.item_id),columnId:e.insert.column_value.column_id}}}}:{insert:e.insert.text,attributes:gb(e.attributes)}}))}function Ib(e,t){const a=e.attributes||{},i=a.comments||[];return{...e,attributes:{...a,comments:[...i,t]}}}function wb(e,t,a,i){const n=a+i;let o=0;const r=[];for(const i of e){const e=i.insert;if(null==e)throw new Error(`Unexpected delta op at position ${o}: op has no 'insert' field. Block content may be from an unsupported block type.`);const s=o,d=s+("string"==typeof e?e.length:1),p=Math.max(s,a),l=Math.min(d,n);p>=l?r.push(i):"string"!=typeof e?r.push(Ib(i,t)):(p>s&&r.push({...i,insert:e.slice(0,p-s)}),r.push(Ib({...i,insert:e.slice(p-s,l-s)},t)),l<d&&r.push({...i,insert:e.slice(l-s)})),o=d}return r}const Tb=i.z.object({bold:i.z.boolean().optional(),italic:i.z.boolean().optional(),underline:i.z.boolean().optional(),strike:i.z.boolean().optional(),code:i.z.boolean().optional(),link:i.z.string().optional(),color:i.z.string().optional(),background:i.z.string().optional()}).optional(),Eb=i.z.object({mention:i.z.object({id:i.z.union([i.z.string(),i.z.number()]).describe("User, doc, or board ID. Get user IDs from list_users_and_teams."),type:i.z.enum(["USER","DOC","BOARD"]).default("USER").describe("Mention type. USER is most common.")}).describe("Mention blot — tags a user, doc, or board inline. Do not set attributes on mention ops.")}),Ab=i.z.object({column_value:i.z.object({item_id:i.z.union([i.z.string(),i.z.number()]).describe("The board item ID."),column_id:i.z.string().describe('The column ID (e.g. "status", "date4"). Get column IDs from get_board_schema.')}).describe("Column value blot — embeds a live board column value inline in the doc.")}),Sb=i.z.object({insert:i.z.union([i.z.string().transform((e=>({text:e}))),i.z.object({text:i.z.string()}),Eb,Ab]).describe('Content to insert. Use {text: "..."} for plain text, {mention: {id, type}} to tag a user/doc/board, or {column_value: {item_id, column_id}} to embed a live column value. The last operation in the array must be {text: "\\n"}.'),attributes:Tb.describe("Optional formatting: bold, italic, underline, strike, code, link, color, background. Not applicable to mention or column_value ops.")}),Db=i.z.object({block_content_type:i.z.literal("text"),delta_format:i.z.array(Sb).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:i.z.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:i.z.enum(["LTR","RTL"]).optional()}),Nb=i.z.object({block_content_type:i.z.literal("code"),delta_format:i.z.array(Sb).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:i.z.string().optional().describe('Programming language (e.g. "javascript", "python").')}),Ob=i.z.object({block_content_type:i.z.literal("list_item"),delta_format:i.z.array(Sb).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),checked:i.z.boolean().optional().describe("Check state for CHECK_LIST items."),indentation:i.z.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),kb=i.z.discriminatedUnion("block_content_type",[Db,Nb,Ob]),Rb=i.z.object({block_type:i.z.literal("text"),text_block_type:i.z.enum(["NORMAL_TEXT","LARGE_TITLE","MEDIUM_TITLE","SMALL_TITLE","QUOTE"]).optional().describe("Block subtype. LARGE_TITLE=H1, MEDIUM_TITLE=H2, SMALL_TITLE=H3."),delta_format:i.z.array(Sb).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:i.z.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:i.z.enum(["LTR","RTL"]).optional()}),Cb=i.z.object({block_type:i.z.literal("list_item"),list_block_type:i.z.enum(["BULLETED_LIST","NUMBERED_LIST","CHECK_LIST"]).optional().describe("List type. Defaults to BULLETED_LIST."),delta_format:i.z.array(Sb).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),indentation:i.z.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),$b=i.z.object({block_type:i.z.literal("code"),delta_format:i.z.array(Sb).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:i.z.string().optional().describe('Programming language (e.g. "javascript", "python").')}),xb=i.z.object({block_type:i.z.literal("divider")}),Lb=i.z.object({block_type:i.z.literal("page_break")}),Ub=i.z.object({block_type:i.z.literal("image"),public_url:i.z.string().url().optional().describe("Publicly accessible image URL. Provide either public_url or asset_id."),asset_id:i.z.union([i.z.number().int(),i.z.string().regex(/^\d+$/).transform(Number)]).optional().describe("monday.com asset ID for the image. The image block will reference the asset directly. Provide either public_url or asset_id."),width:i.z.number().int().min(1).optional().describe("Width in pixels.")}),Pb=i.z.object({block_type:i.z.literal("video"),raw_url:i.z.string().url().describe("Video URL (YouTube, Vimeo, or direct video URL)."),width:i.z.number().int().min(1).optional().describe("Width in pixels.")}),Vb=i.z.object({block_type:i.z.literal("notice_box"),theme:i.z.enum(["INFO","TIPS","WARNING","GENERAL"]).describe("Visual style of the notice box.")}),Mb=i.z.object({block_type:i.z.literal("table"),row_count:i.z.number().int().min(1).max(25).describe("Number of rows (1–25)."),column_count:i.z.number().int().min(1).max(10).describe("Number of columns (1–10)."),width:i.z.number().int().optional().describe("Table width in pixels."),column_style:i.z.array(i.z.object({width:i.z.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),Fb=i.z.object({block_type:i.z.literal("layout"),column_count:i.z.number().int().min(2).max(6).describe("Number of columns (2–6)."),column_style:i.z.array(i.z.object({width:i.z.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),Bb=i.z.discriminatedUnion("block_type",[Rb,Cb,$b,xb,Lb,Ub,Pb,Vb,Mb,Fb]),zb=i.z.object({operation_type:i.z.literal("set_name"),name:i.z.string().min(1).describe("New document name.")}),jb=i.z.object({operation_type:i.z.literal("add_markdown_content"),markdown:i.z.string().describe("Markdown content to convert and append (or insert) as blocks."),after_block_id:i.z.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs.")}),qb=i.z.object({operation_type:i.z.literal("update_block"),block_id:i.z.string().describe("ID of the block to update. Get block IDs from read_docs."),content:kb.describe("New content for the block. Use block_content_type to select: text (updates text/heading/quote content), code (updates code content), list_item (updates bullets/numbered/todo content). Cannot change block subtype — use replace_block for that.")}),Gb=i.z.object({operation_type:i.z.literal("create_block"),after_block_id:i.z.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs."),parent_block_id:i.z.string().optional().describe("Parent block ID for nested blocks. Only works for notice_box containers — use the notice_box block ID directly. Table/layout cell nesting is NOT supported by the API. IMPORTANT: A notice_box created in the same call cannot be referenced — use a separate call first to create it, then a second call to nest content inside it."),block:Bb.describe("The block to create. Use block_type to select the block type.")}),Hb=i.z.object({operation_type:i.z.literal("delete_blocks"),block_ids:i.z.array(i.z.string()).min(1).max(100).describe("Block IDs to permanently delete (1–100 per call). Put ALL IDs for the delete into this single array — do NOT emit multiple delete_blocks operations back-to-back. Works for all block types including BOARD, WIDGET, DOC embed, GIPHY.")}),Wb=i.z.object({operation_type:i.z.literal("replace_block"),block_id:i.z.string().describe("ID of the block to delete."),after_block_id:i.z.string().optional().describe("Insert replacement after this block ID. Provide the ID of the block that precedes the deleted block."),parent_block_id:i.z.string().optional().describe("Parent block ID for the replacement block."),block:Bb.describe("The new block to create in place of the deleted one.")}),Yb=i.z.object({operation_type:i.z.literal("add_comment"),body:i.z.string().min(1).describe("The comment text. Use HTML tags for formatting (not markdown). Do not use @ to mention users — use mentions_list instead."),parent_update_id:i.z.number().optional().describe("The ID of an existing comment (update) to reply to. Omit to create a new top-level comment. Get comment IDs from read_docs with include_comments: true."),mentions_list:i.z.string().optional().describe('Optional JSON array of mentions: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types: User, Team, Board, Project. To mention an AI agent, use type User with the agent\'s user id from list_users_and_teams. Type Agent adds no mention.'),block_id:i.z.union([i.z.string(),i.z.array(i.z.string()).min(1)]).optional().describe("Block ID (string) or array of block IDs to anchor the comment to. When an array is provided, the same comment highlights all specified blocks. Only works on text-content blocks (text, code, list_item, title, quote) — not on divider, table, layout, notice_box, image, video, or giphy. Get block IDs from read_docs with include_blocks: true. Omit to create a general doc-level comment. Pair with selection_from + selection_length (single block_id only) to comment on a specific text range."),selection_from:i.z.number().int().min(0).optional().describe("Start character offset (0-indexed) of the selected text within the block. Requires block_id. Omit to comment on the entire block."),selection_length:i.z.number().int().min(1).optional().describe("Number of characters in the text selection. Requires block_id and selection_from. Only works for text, code, and list_item blocks that have a delta format.")}),Qb=i.z.discriminatedUnion("operation_type",[zb,jb,qb,Gb,Hb,Wb,Yb]),Kb={doc_id:i.z.string().min(1).optional().describe("The document ID (the id field from read_docs). Takes priority over object_id if both are provided."),object_id:i.z.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, visible in the document URL). Resolved to doc_id."),board_id:i.z.string().min(1).optional().describe("For a doc that lives as a board view: the <board_id> in https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Pair with view_id. Use this instead of doc_id/object_id when all you have is a board view URL."),view_id:i.z.string().min(1).optional().describe("For a doc that lives as a board view: the <view_id> in https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Requires board_id."),operations:i.z.array(Qb).min(1).max(25).describe('Ordered list of operations to perform. Executed sequentially. Stops at first failure.\n\nOperation types:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (simplest for text/lists/tables).\n- update_block: Change content of an existing text/code/list/divider block.\n- create_block: Create a new block at a specific position (supports text, list_item, code, divider, page_break, image, video, notice_box, table, layout).\n- delete_blocks: Permanently delete 1–100 blocks in one call. Provide all block IDs in the block_ids array. Works for all block types including BOARD, WIDGET, DOC embed, and GIPHY.\n- replace_block: Delete a block and create a new one in its place. Use for: changing image/video source, table restructure, notice_box theme change.\n- add_comment: Create a new comment or reply on the document. Use parent_update_id to reply to an existing comment. Format text with HTML. Uses the doc\'s backing board item.\n\nWHEN TO USE WHICH:\n- Adding new text sections → add_markdown_content\n- Adding asset-based images → create_block with block_type "image" and asset_id (add_markdown_content does NOT support asset images)\n- Mixed content with asset images → alternate add_markdown_content (for text) and create_block (for each image) in sequence\n- Editing existing text block → update_block\n- Changing an image URL → replace_block (image URL is immutable after creation)\n- Changing video URL → replace_block\n- Restructuring a table → replace_block\n- BOARD/WIDGET/DOC/GIPHY blocks → delete_blocks only (no public API to create these)\n\nNESTING CONTENT IN CONTAINERS:\n- notice_box: Fully supported. Create the notice_box first, then in a separate call create child blocks with parent_block_id set to the notice_box ID. You cannot reference a block ID created in the same call.\n- table: Cell-level API nesting is NOT supported. To create a table with content, use add_markdown_content with a markdown table (e.g. "| H1 | H2 |\\n| --- | --- |\\n| A | B |"). This creates a pre-populated table in one shot. Empty tables created via create_block cannot have their cells populated through the API.\n- layout: Cell-level API nesting is NOT supported and there is no markdown equivalent. Layouts can only be created empty via create_block. No workaround exists to populate layout columns through the API.\nDeleting a container does NOT delete its children — delete children first for clean removal.\n\nBATCHING: delete_blocks accepts 1..100 IDs. Put ALL IDs in one operation\'s block_ids array. Never emit multiple delete_blocks operations in a row.\n\nBlock IDs are available in the blocks array returned by read_docs.')};const Jb=Nc`
2014
2034
  mutation CreateDashboard(
2015
2035
  $name: String!
2016
2036
  $workspace_id: ID!
@@ -2032,14 +2052,14 @@
2032
2052
  board_folder_id
2033
2053
  }
2034
2054
  }
2035
- `,Kb=Nc`
2055
+ `,Xb=Nc`
2036
2056
  query GetAllWidgetsSchema {
2037
2057
  all_widgets_schema {
2038
2058
  widget_type
2039
2059
  schema
2040
2060
  }
2041
2061
  }
2042
- `,Jb=Nc`
2062
+ `,Zb=Nc`
2043
2063
  mutation CreateWidget($parent: WidgetParentInput!, $kind: ExternalWidget!, $name: String!, $settings: JSON!) {
2044
2064
  create_widget(parent: $parent, kind: $kind, name: $name, settings: $settings) {
2045
2065
  id
@@ -2051,14 +2071,14 @@
2051
2071
  }
2052
2072
  }
2053
2073
  }
2054
- `,Xb={name:i.z.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:i.z.string().describe("ID of the workspace that will own the dashboard"),board_ids:i.z.array(i.z.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:i.z.nativeEnum(sr).default(sr.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:i.z.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const Zb={parent_container_id:i.z.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:i.z.nativeEnum(Kp).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:i.z.nativeEnum(Lr).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:i.z.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:i.z.record(i.z.unknown()).optional().describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const eg=Nc`
2074
+ `,eg={name:i.z.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:i.z.string().describe("ID of the workspace that will own the dashboard"),board_ids:i.z.array(i.z.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:i.z.nativeEnum(sr).default(sr.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:i.z.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const tg={parent_container_id:i.z.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:i.z.nativeEnum(Kp).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:i.z.nativeEnum(Lr).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:i.z.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:i.z.record(i.z.unknown()).optional().describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const ag=Nc`
2055
2075
  mutation updateWorkspace($id: ID!, $attributes: UpdateWorkspaceAttributesInput!) {
2056
2076
  update_workspace(id: $id, attributes: $attributes) {
2057
2077
  id
2058
2078
  name
2059
2079
  }
2060
2080
  }
2061
- `,tg={id:i.z.string().describe("The ID of the workspace to update"),attributeAccountProductId:i.z.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:i.z.string().optional().describe("The description of the workspace to update"),attributeKind:i.z.nativeEnum(il).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:i.z.string().optional().describe("The name of the workspace to update")};const ag=Nc`
2081
+ `,ig={id:i.z.string().describe("The ID of the workspace to update"),attributeAccountProductId:i.z.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:i.z.string().optional().describe("The description of the workspace to update"),attributeKind:i.z.nativeEnum(il).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:i.z.string().optional().describe("The name of the workspace to update")};const ng=Nc`
2062
2082
  mutation updateFolder(
2063
2083
  $folderId: ID!
2064
2084
  $name: String
@@ -2085,7 +2105,7 @@
2085
2105
  name
2086
2106
  }
2087
2107
  }
2088
- `,ig={folderId:i.z.string().describe("The ID of the folder to update"),name:i.z.string().optional().describe("The new name of the folder"),color:i.z.nativeEnum(jr).optional().describe("The new color of the folder"),fontWeight:i.z.nativeEnum(Gr).optional().describe("The new font weight of the folder"),customIcon:i.z.nativeEnum(qr).optional().describe("The new custom icon of the folder"),parentFolderId:i.z.string().optional().describe("The ID of the new parent folder"),workspaceId:i.z.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:i.z.string().optional().describe("The account product ID associated with the folder"),position_object_id:i.z.string().optional().describe("The ID of the object to position the folder relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:i.z.nativeEnum(sd).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:i.z.boolean().optional().describe("Whether to position the folder after the object")};const ng=Nc`
2108
+ `,og={folderId:i.z.string().describe("The ID of the folder to update"),name:i.z.string().optional().describe("The new name of the folder"),color:i.z.nativeEnum(jr).optional().describe("The new color of the folder"),fontWeight:i.z.nativeEnum(Gr).optional().describe("The new font weight of the folder"),customIcon:i.z.nativeEnum(qr).optional().describe("The new custom icon of the folder"),parentFolderId:i.z.string().optional().describe("The ID of the new parent folder"),workspaceId:i.z.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:i.z.string().optional().describe("The account product ID associated with the folder"),position_object_id:i.z.string().optional().describe("The ID of the object to position the folder relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:i.z.nativeEnum(sd).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:i.z.boolean().optional().describe("Whether to position the folder after the object")};const rg=Nc`
2089
2109
  mutation createWorkspace(
2090
2110
  $name: String!
2091
2111
  $workspaceKind: WorkspaceKind!
@@ -2102,7 +2122,7 @@
2102
2122
  name
2103
2123
  }
2104
2124
  }
2105
- `,og={name:i.z.string().describe("The name of the new workspace to be created"),workspaceKind:i.z.nativeEnum(il).describe("The kind of workspace to create"),description:i.z.string().optional().describe("The description of the new workspace"),accountProductId:i.z.string().optional().describe("The account product ID associated with the workspace")};const rg=Nc`
2125
+ `,sg={name:i.z.string().describe("The name of the new workspace to be created"),workspaceKind:i.z.nativeEnum(il).describe("The kind of workspace to create"),description:i.z.string().optional().describe("The description of the new workspace"),accountProductId:i.z.string().optional().describe("The account product ID associated with the workspace")};const dg=Nc`
2106
2126
  mutation createFolder(
2107
2127
  $workspaceId: ID!
2108
2128
  $name: String!
@@ -2123,7 +2143,7 @@
2123
2143
  name
2124
2144
  }
2125
2145
  }
2126
- `,sg={workspaceId:i.z.string().describe("The ID of the workspace where the folder will be created"),name:i.z.string().describe("The name of the folder to be created"),color:i.z.nativeEnum(jr).optional().describe("The color of the folder"),fontWeight:i.z.nativeEnum(Gr).optional().describe("The font weight of the folder"),customIcon:i.z.nativeEnum(qr).optional().describe("The custom icon of the folder"),parentFolderId:i.z.string().optional().describe("The ID of the parent folder")};const dg=Nc`
2146
+ `,pg={workspaceId:i.z.string().describe("The ID of the workspace where the folder will be created"),name:i.z.string().describe("The name of the folder to be created"),color:i.z.nativeEnum(jr).optional().describe("The color of the folder"),fontWeight:i.z.nativeEnum(Gr).optional().describe("The font weight of the folder"),customIcon:i.z.nativeEnum(qr).optional().describe("The custom icon of the folder"),parentFolderId:i.z.string().optional().describe("The ID of the parent folder")};const lg=Nc`
2127
2147
  mutation updateBoardHierarchy($boardId: ID!, $attributes: UpdateBoardHierarchyAttributesInput!) {
2128
2148
  update_board_hierarchy(board_id: $boardId, attributes: $attributes) {
2129
2149
  success
@@ -2133,7 +2153,7 @@
2133
2153
  }
2134
2154
  }
2135
2155
  }
2136
- `,pg=Nc`
2156
+ `,cg=Nc`
2137
2157
  mutation updateOverviewHierarchy($overviewId: ID!, $attributes: UpdateOverviewHierarchyAttributesInput!) {
2138
2158
  update_overview_hierarchy(overview_id: $overviewId, attributes: $attributes) {
2139
2159
  success
@@ -2143,7 +2163,7 @@
2143
2163
  }
2144
2164
  }
2145
2165
  }
2146
- `,lg={objectType:i.z.nativeEnum(sd).describe("The type of object to move"),id:i.z.string().describe("The ID of the object to move"),position_object_id:i.z.string().optional().describe("The ID of the object to position the object relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:i.z.nativeEnum(sd).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:i.z.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:i.z.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:i.z.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:i.z.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const cg=Nc`
2166
+ `,mg={objectType:i.z.nativeEnum(sd).describe("The type of object to move"),id:i.z.string().describe("The ID of the object to move"),position_object_id:i.z.string().optional().describe("The ID of the object to position the object relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:i.z.nativeEnum(sd).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:i.z.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:i.z.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:i.z.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:i.z.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const ug=Nc`
2147
2167
  query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {
2148
2168
  boards(ids: [$boardId], limit: 1) {
2149
2169
  name
@@ -2165,14 +2185,14 @@
2165
2185
  }
2166
2186
  }
2167
2187
  }
2168
- `,mg=new Set([xn.Case,xn.Between,xn.Left,xn.Raw,xn.None,xn.CountKeys]),ug=Object.values(xn).filter((e=>!mg.has(e))),hg=new Set([xn.Left,xn.Trim,xn.Upper,xn.Lower,xn.DateTruncDay,xn.DateTruncWeek,xn.DateTruncMonth,xn.DateTruncQuarter,xn.DateTruncYear,xn.Color,xn.Label,xn.EndDate,xn.StartDate,xn.Hour,xn.PhoneCountryShortName,xn.Person,xn.Upper,xn.Lower,xn.Order,xn.Length,xn.Flatten,xn.IsDone]);function fg(e){return{column_id:e}}new Set([xn.Count,xn.CountDistinct,xn.CountSubitems,xn.CountItems,xn.First,xn.Sum,xn.Average,xn.Median,xn.Min,xn.Max,xn.MinMax]);const _g={boardId:i.z.number().describe("The id of the board to get insights for"),aggregations:i.z.array(i.z.object({function:i.z.enum(ug).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:i.z.string().describe(`The id of the column to aggregate. Required for every function except ${xn.CountItems}, which counts items and takes no column.`).optional()})).describe(`The aggregations to get. Before sending the aggregations, read guidelines.aggregation from get_column_type_info with fetchMode "${Bm.Guidelines}" for a relevant column type on this board. Transformative functions and plain columns (no function) must be in group by.`).optional(),groupBy:i.z.array(i.z.string()).describe("The columns to group by. All columns in the group by must be in the aggregations as well without a function.").optional(),limit:i.z.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:$f,filtersOperator:xf,orderBy:i.z.array(i.z.object({columnId:i.z.string().describe("The id of the column to order by"),direction:i.z.nativeEnum(Es).optional().default(Es.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 bg=Nc`
2188
+ `,hg=new Set([xn.Case,xn.Between,xn.Left,xn.Raw,xn.None,xn.CountKeys]),fg=Object.values(xn).filter((e=>!hg.has(e))),_g=new Set([xn.Left,xn.Trim,xn.Upper,xn.Lower,xn.DateTruncDay,xn.DateTruncWeek,xn.DateTruncMonth,xn.DateTruncQuarter,xn.DateTruncYear,xn.Color,xn.Label,xn.EndDate,xn.StartDate,xn.Hour,xn.PhoneCountryShortName,xn.Person,xn.Upper,xn.Lower,xn.Order,xn.Length,xn.Flatten,xn.IsDone]);function bg(e){return{column_id:e}}new Set([xn.Count,xn.CountDistinct,xn.CountSubitems,xn.CountItems,xn.First,xn.Sum,xn.Average,xn.Median,xn.Min,xn.Max,xn.MinMax]);const gg={boardId:i.z.number().describe("The id of the board to get insights for"),aggregations:i.z.array(i.z.object({function:i.z.enum(fg).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:i.z.string().describe(`The id of the column to aggregate. Required for every function except ${xn.CountItems}, which counts items and takes no column.`).optional()})).describe(`The aggregations to get. Before sending the aggregations, read guidelines.aggregation from get_column_type_info with fetchMode "${zm.Guidelines}" for a relevant column type on this board. Transformative functions and plain columns (no function) must be in group by.`).optional(),groupBy:i.z.array(i.z.string()).describe("The columns to group by. All columns in the group by must be in the aggregations as well without a function.").optional(),limit:i.z.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:xf,filtersOperator:Lf,orderBy:i.z.array(i.z.object({columnId:i.z.string().describe("The id of the column to order by"),direction:i.z.nativeEnum(Es).optional().default(Es.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 yg=Nc`
2169
2189
  query GetFolders($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
2170
2190
  folders(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
2171
2191
  id
2172
2192
  name
2173
2193
  }
2174
2194
  }
2175
- `,gg=Nc`
2195
+ `,vg=Nc`
2176
2196
  query SearchItems($query: String!, $limit: Int, $workspaceIds: [ID!], $boardIds: [ID!]) {
2177
2197
  search {
2178
2198
  items(query: $query, limit: $limit, workspace_ids: $workspaceIds, board_ids: $boardIds) {
@@ -2189,7 +2209,7 @@
2189
2209
  }
2190
2210
  }
2191
2211
  }
2192
- `,yg=Nc`
2212
+ `,Ig=Nc`
2193
2213
  query SearchBoards($query: String!, $limit: Int, $workspaceIds: [ID!], $boardIds: [ID!]) {
2194
2214
  search {
2195
2215
  boards(query: $query, limit: $limit, workspace_ids: $workspaceIds, board_ids: $boardIds) {
@@ -2205,7 +2225,7 @@
2205
2225
  }
2206
2226
  }
2207
2227
  }
2208
- `,vg=Nc`
2228
+ `,wg=Nc`
2209
2229
  query SearchDocs($query: String!, $limit: Int, $workspaceIds: [ID!], $docIds: [ID!]) {
2210
2230
  search {
2211
2231
  docs(query: $query, limit: $limit, workspace_ids: $workspaceIds, ids: $docIds) {
@@ -2224,7 +2244,7 @@
2224
2244
  }
2225
2245
  }
2226
2246
  }
2227
- `,Ig=Nc`
2247
+ `,Tg=Nc`
2228
2248
  query SearchWorkspaces($query: String!, $limit: Int) {
2229
2249
  search {
2230
2250
  workspaces(query: $query, limit: $limit) {
@@ -2239,7 +2259,7 @@
2239
2259
  }
2240
2260
  }
2241
2261
  }
2242
- `,wg=Nc`
2262
+ `,Eg=Nc`
2243
2263
  query SearchUpdates(
2244
2264
  $query: String!
2245
2265
  $limit: Int
@@ -2268,7 +2288,7 @@
2268
2288
  }
2269
2289
  }
2270
2290
  }
2271
- `,Tg=Nc`
2291
+ `,Ag=Nc`
2272
2292
  query SearchTimelineItems($query: String!, $limit: Int, $workspaceIds: [ID!], $boardIds: [ID!]) {
2273
2293
  search {
2274
2294
  timeline_items(query: $query, limit: $limit, workspace_ids: $workspaceIds, board_ids: $boardIds) {
@@ -2286,7 +2306,7 @@
2286
2306
  }
2287
2307
  }
2288
2308
  }
2289
- `,Eg=Nc`
2309
+ `,Sg=Nc`
2290
2310
  query SearchItemsByCreatorDev(
2291
2311
  $query: String!
2292
2312
  $limit: Int
@@ -2315,7 +2335,7 @@
2315
2335
  }
2316
2336
  }
2317
2337
  }
2318
- `,Ag=Nc`
2338
+ `,Dg=Nc`
2319
2339
  query SearchOverviewsDev($query: String!, $limit: Int, $workspaceIds: [ID!], $creatorIds: [ID!]) {
2320
2340
  search {
2321
2341
  overviews(query: $query, limit: $limit, workspace_ids: $workspaceIds, creator_ids: $creatorIds) {
@@ -2330,14 +2350,14 @@
2330
2350
  }
2331
2351
  }
2332
2352
  }
2333
- `,Sg=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,""),Dg=new Set(Object.values(Wf));function Ng(e){if(null!=e)return Array.isArray(e)?e:[e]}function Og(e){return i.z.preprocess(Ng,i.z.array(i.z.coerce.number().finite()).optional()).describe(e)}function kg(e){return e&&e.length>0?e:void 0}function Rg(e){if(!e)return;const t=Object.entries(e).filter((([,e])=>e&&e.length>0)).map((([e,t])=>({field:e,fragments:[...t]})));return t.length>0?t:void 0}const Cg=i.z.preprocess((function(e){if("string"!=typeof e)return e;const t=Qf(e),a=Kf[t]??t;return Dg.has(a)?a:e}),i.z.nativeEnum(Wf,{errorMap:function(e,t){if(e.code===i.z.ZodIssueCode.invalid_type)return"undefined"===e.received||"null"===e.received?{message:`searchType is required. Valid values: ${Yf}.`}:{message:`searchType must be a string. Valid values: ${Yf}.`};if(e.code===i.z.ZodIssueCode.invalid_enum_value){const t=String(e.received),a=Jf[Qf(t)],i=`Invalid searchType "${t}". Valid values: ${Yf}.`;return{message:a?`${i} ${a}`:i}}return{message:t.defaultError}}})).describe(`The type of search to perform. Valid values: ${Yf}.`),$g=i.z.preprocess((function(e){return null==e?20:e}),i.z.coerce.number().finite().transform((e=>Math.min(Math.max(Math.trunc(e),1),20)))).optional().default(20).describe("The number of items to get. Maximum is 20."),xg={searchTerm:i.z.string().trim().min(1,{message:"searchTerm must be a non-empty search string."}).optional().describe("The search phrase — the text the search matches results against (e.g. a board name, item title, or keywords). Required and must be non-empty. This is NOT a filter or an id — pass the words to look for."),searchType:Cg,limit:$g,workspaceIds:Og("Array of workspace IDs (numbers) to search in. Optional for FOLDERS search (searches all accessible workspaces when omitted). For ITEMS, BOARD, DOCUMENTS, DASHBOARDS, UPDATES, and TIMELINE_ITEMS search, only pass this if the user explicitly asked to search within specific workspaces. Example: [12345, 67890]."),boardIds:Og("Array of board IDs (numbers) to scope the search to. Applies to BOARD, ITEMS, UPDATES, and TIMELINE_ITEMS search. Only pass it if the user explicitly asked to search within specific boards. Example: [12345, 67890]."),creatorIds:Og("Array of user IDs (numbers) to filter by creator. Applies to ITEMS (filters by item creator), UPDATES (filters by update author), and DASHBOARDS (filters by dashboard creator). Only pass it if the user explicitly asked to filter by specific creators. Example: [12345, 67890]."),docIds:Og("Array of document IDs (numbers), as they appear in document URLs, to scope the search to. Applies to DOCUMENTS search, with at most 512 ids. Use it to search within a known set of documents, for example to find which of them mention a term. Only pass it if the user explicitly asked to search within specific documents. Example: [12345, 67890].")};const Lg=i.z.object({id:i.z.string().describe("The ID of the entity to mention"),type:i.z.nativeEnum(Gs).describe("The type of mention: User, Team, Board, or Project. Mention an AI agent as User, not Agent")}),Ug=i.z.array(Lg),Pg={itemId:i.z.number().describe("The id of the item to which the update will be added"),body:i.z.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:i.z.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. To mention an AI agent, use type User with the agent\'s user id from list_users_and_teams. Type Agent adds no mention')};const Vg=Nc`
2353
+ `,Ng=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,""),Og=new Set(Object.values(Yf));function kg(e){if(null!=e)return Array.isArray(e)?e:[e]}function Rg(e){return i.z.preprocess(kg,i.z.array(i.z.coerce.number().finite()).optional()).describe(e)}function Cg(e){return e&&e.length>0?e:void 0}function $g(e){if(!e)return;const t=Object.entries(e).filter((([,e])=>e&&e.length>0)).map((([e,t])=>({field:e,fragments:[...t]})));return t.length>0?t:void 0}const xg=i.z.preprocess((function(e){if("string"!=typeof e)return e;const t=Kf(e),a=Jf[t]??t;return Og.has(a)?a:e}),i.z.nativeEnum(Yf,{errorMap:function(e,t){if(e.code===i.z.ZodIssueCode.invalid_type)return"undefined"===e.received||"null"===e.received?{message:`searchType is required. Valid values: ${Qf}.`}:{message:`searchType must be a string. Valid values: ${Qf}.`};if(e.code===i.z.ZodIssueCode.invalid_enum_value){const t=String(e.received),a=Xf[Kf(t)],i=`Invalid searchType "${t}". Valid values: ${Qf}.`;return{message:a?`${i} ${a}`:i}}return{message:t.defaultError}}})).describe(`The type of search to perform. Valid values: ${Qf}.`),Lg=i.z.preprocess((function(e){return null==e?20:e}),i.z.coerce.number().finite().transform((e=>Math.min(Math.max(Math.trunc(e),1),20)))).optional().default(20).describe("The number of items to get. Maximum is 20."),Ug={searchTerm:i.z.string().trim().min(1,{message:"searchTerm must be a non-empty search string."}).optional().describe("The search phrase — the text the search matches results against (e.g. a board name, item title, or keywords). Required and must be non-empty. This is NOT a filter or an id — pass the words to look for."),searchType:xg,limit:Lg,workspaceIds:Rg("Array of workspace IDs (numbers) to search in. Optional for FOLDERS search (searches all accessible workspaces when omitted). For ITEMS, BOARD, DOCUMENTS, DASHBOARDS, UPDATES, and TIMELINE_ITEMS search, only pass this if the user explicitly asked to search within specific workspaces. Example: [12345, 67890]."),boardIds:Rg("Array of board IDs (numbers) to scope the search to. Applies to BOARD, ITEMS, UPDATES, and TIMELINE_ITEMS search. Only pass it if the user explicitly asked to search within specific boards. Example: [12345, 67890]."),creatorIds:Rg("Array of user IDs (numbers) to filter by creator. Applies to ITEMS (filters by item creator), UPDATES (filters by update author), and DASHBOARDS (filters by dashboard creator). Only pass it if the user explicitly asked to filter by specific creators. Example: [12345, 67890]."),docIds:Rg("Array of document IDs (numbers), as they appear in document URLs, to scope the search to. Applies to DOCUMENTS search, with at most 512 ids. Use it to search within a known set of documents, for example to find which of them mention a term. Only pass it if the user explicitly asked to search within specific documents. Example: [12345, 67890].")};const Pg=i.z.object({id:i.z.string().describe("The ID of the entity to mention"),type:i.z.nativeEnum(Gs).describe("The type of mention: User, Team, Board, or Project. Mention an AI agent as User, not Agent")}),Vg=i.z.array(Pg),Mg={itemId:i.z.number().describe("The id of the item to which the update will be added"),body:i.z.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:i.z.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. To mention an AI agent, use type User with the agent\'s user id from list_users_and_teams. Type Agent adds no mention')};const Fg=Nc`
2334
2354
  mutation updateAssetsOnItem($boardId: ID!, $itemId: ID!, $columnId: String!, $files: [FileInput!]!) {
2335
2355
  update_assets_on_item(board_id: $boardId, item_id: $itemId, column_id: $columnId, files: $files) {
2336
2356
  id
2337
2357
  name
2338
2358
  }
2339
2359
  }
2340
- `,Mg=i.z.object({fileType:i.z.enum(["google_drive","dropbox","box","onedrive","link","asset","doc"]).describe('The type of file: "asset" for uploaded files (requires assetId), "doc" for monday docs (requires objectId), "link" for generic links, "google_drive", "dropbox", "box", "onedrive" for cloud storage links (all link types require linkToFile)'),name:i.z.string().describe("File display name"),linkToFile:i.z.string().optional().describe("File link URL. Required for link, google_drive, dropbox, box, and onedrive file types"),assetId:i.z.number().optional().describe("The asset's ID. Required when fileType is 'asset'"),objectId:i.z.number().optional().describe("The doc's ID. Required when fileType is 'doc'")}),Fg={boardId:i.z.string().describe("The board's unique identifier"),itemId:i.z.string().describe("The item's unique identifier"),columnId:i.z.string().describe("The file or doc column's unique identifier"),files:i.z.array(Mg).describe("Array of file values to set on the column")};const Bg=Nc`
2360
+ `,Bg=i.z.object({fileType:i.z.enum(["google_drive","dropbox","box","onedrive","link","asset","doc"]).describe('The type of file: "asset" for uploaded files (requires assetId), "doc" for monday docs (requires objectId), "link" for generic links, "google_drive", "dropbox", "box", "onedrive" for cloud storage links (all link types require linkToFile)'),name:i.z.string().describe("File display name"),linkToFile:i.z.string().optional().describe("File link URL. Required for link, google_drive, dropbox, box, and onedrive file types"),assetId:i.z.number().optional().describe("The asset's ID. Required when fileType is 'asset'"),objectId:i.z.number().optional().describe("The doc's ID. Required when fileType is 'doc'")}),zg={boardId:i.z.string().describe("The board's unique identifier"),itemId:i.z.string().describe("The item's unique identifier"),columnId:i.z.string().describe("The file or doc column's unique identifier"),files:i.z.array(Bg).describe("Array of file values to set on the column")};const jg=Nc`
2341
2361
  query getAssets($ids: [ID!]!) {
2342
2362
  assets(ids: $ids) {
2343
2363
  id
@@ -2355,7 +2375,7 @@
2355
2375
  }
2356
2376
  }
2357
2377
  }
2358
- `,zg={ids:i.z.array(i.z.string()).min(1).describe("Array of asset IDs to fetch")};const jg=Nc`
2378
+ `,qg={ids:i.z.array(i.z.string()).min(1).describe("Array of asset IDs to fetch")};const Gg=Nc`
2359
2379
  query getUserContext {
2360
2380
  me {
2361
2381
  id
@@ -2399,7 +2419,7 @@
2399
2419
  }
2400
2420
  }
2401
2421
  }
2402
- `,qg=Nc`
2422
+ `,Hg=Nc`
2403
2423
  query getFavoriteDetails(
2404
2424
  $boardIds: [ID!]
2405
2425
  $folderIds: [ID!]
@@ -2423,13 +2443,13 @@
2423
2443
  name
2424
2444
  }
2425
2445
  }
2426
- `,Gg={[rs.Board]:"boardIds",[rs.Folder]:"folderIds",[rs.Workspace]:"workspaceIds",[rs.Dashboard]:"dashboardIds"},Hg={[rs.Board]:"boards",[rs.Folder]:"folders",[rs.Workspace]:"workspaces",[rs.Dashboard]:"dashboards"};const Wg=Nc`
2446
+ `,Wg={[rs.Board]:"boardIds",[rs.Folder]:"folderIds",[rs.Workspace]:"workspaceIds",[rs.Dashboard]:"dashboardIds"},Yg={[rs.Board]:"boards",[rs.Folder]:"folders",[rs.Workspace]:"workspaces",[rs.Dashboard]:"dashboards"};const Qg=Nc`
2427
2447
  mutation BatchUndo($boardId: ID!, $undoRecordId: ID!) {
2428
2448
  batch_undo(board_id: $boardId, undo_record_id: $undoRecordId) {
2429
2449
  success
2430
2450
  }
2431
2451
  }
2432
- `,Yg={boardId:i.z.number().describe("The id of the board where the action was performed"),undoRecordId:i.z.string().describe("The undo record ID (action_record_uuid) from the activity log data field. Use get_board_activity with includeData=true to find this value.")};const Qg=Nc`
2452
+ `,Kg={boardId:i.z.number().describe("The id of the board where the action was performed"),undoRecordId:i.z.string().describe("The undo record ID (action_record_uuid) from the activity log data field. Use get_board_activity with includeData=true to find this value.")};const Jg=Nc`
2433
2453
  mutation CreateUpload($input: CreateUploadInput!) {
2434
2454
  create_upload(input: $input) {
2435
2455
  upload_id
@@ -2443,7 +2463,7 @@
2443
2463
  expires_at
2444
2464
  }
2445
2465
  }
2446
- `,Kg={fileName:i.z.string().describe('The name of the file to upload, including extension (e.g. "report.pdf")'),contentType:i.z.string().describe('The MIME type of the file (e.g. "application/pdf", "image/png", "text/plain")'),fileSize:i.z.number().int().min(1).max(524288e3).describe("The file size in bytes. Maximum 500MB (524288000 bytes)")};const Jg=Nc`
2466
+ `,Xg={fileName:i.z.string().describe('The name of the file to upload, including extension (e.g. "report.pdf")'),contentType:i.z.string().describe('The MIME type of the file (e.g. "application/pdf", "image/png", "text/plain")'),fileSize:i.z.number().int().min(1).max(524288e3).describe("The file size in bytes. Maximum 500MB (524288000 bytes)")};const Zg=Nc`
2447
2467
  mutation CompleteUpload($input: CompleteUploadInput!) {
2448
2468
  complete_upload(input: $input) {
2449
2469
  id
@@ -2455,13 +2475,13 @@
2455
2475
  filelink
2456
2476
  }
2457
2477
  }
2458
- `,Xg=Nc`
2478
+ `,ey=Nc`
2459
2479
  mutation ChangeColumnValue($boardId: ID!, $itemId: ID!, $columnId: String!, $value: JSON!) {
2460
2480
  change_column_value(board_id: $boardId, item_id: $itemId, column_id: $columnId, value: $value) {
2461
2481
  id
2462
2482
  }
2463
2483
  }
2464
- `,Zg={uploadId:i.z.string().describe("The upload_id returned by get_asset_upload_url"),etag:i.z.string().describe("The ETag header value from the PUT response when uploading to the presigned URL"),boardId:i.z.string().describe("The board's unique identifier"),itemId:i.z.string().describe("The item's unique identifier"),columnId:i.z.string().describe("The file or doc column's unique identifier to attach the uploaded asset to")};const ey="\n**Board-relation linking — do in order**\n\n1. **Fetch (target board, one query)**\n- **has_more: true** (and under **~500** items / **~5** pages for this pass) → your **only** next action is\n **get_board_items_page** with **cursor=nextCursor**; same **boardId** and the same **searchTerm** / **filters**\n / **itemIds** — **do not** change **filters** on a cursor call. **No** user turn until **has_more** is false\n or you stop at the cap. The first page alone is never “the whole board” while **has_more** is still true.\n- **Shrink the query first** when you can: **columnIds**;\n **filters**; **searchTerm**; or **itemIds** (max **100** per call, split big lists). Search **timeout** or\n error → **narrower** **searchTerm** or smaller **limit** / columns, then continue with **nextCursor** as\n in the first bullet.\n\n2. **Match (after the fetch for that pass is done)**\n- Apply a **clear** rule to names/values you already loaded (e.g. same name as source, or value user gave).\n- One unambiguous match → link without asking. **No** vague “best” pick without a rule.\n\n3. **If the user must be involved (only after step 1 is done for that query)**\n- If step 1 is incomplete, **no** questions (see step 1’s first bullet).\n- **True tie** (2+ items match the rule equally) → show **only those tied rows** (or a tiny shortlist),\n not the full result set and never all ~500.\n- **No way to name a target yet** (not a tie) → ask **once** for a **name** or **search phrase** to use in\n **searchTerm** / **filters**, not a menu of the board.\n\n4. **Write** — On the owning board’s board-relation column using change_item_column_values\n".trim(),ty={};const ay=Nc`
2484
+ `,ty={uploadId:i.z.string().describe("The upload_id returned by get_asset_upload_url"),etag:i.z.string().describe("The ETag header value from the PUT response when uploading to the presigned URL"),boardId:i.z.string().describe("The board's unique identifier"),itemId:i.z.string().describe("The item's unique identifier"),columnId:i.z.string().describe("The file or doc column's unique identifier to attach the uploaded asset to")};const ay="\n**Board-relation linking — do in order**\n\n1. **Fetch (target board, one query)**\n- **has_more: true** (and under **~500** items / **~5** pages for this pass) → your **only** next action is\n **get_board_items_page** with **cursor=nextCursor**; same **boardId** and the same **searchTerm** / **filters**\n / **itemIds** — **do not** change **filters** on a cursor call. **No** user turn until **has_more** is false\n or you stop at the cap. The first page alone is never “the whole board” while **has_more** is still true.\n- **Shrink the query first** when you can: **columnIds**;\n **filters**; **searchTerm**; or **itemIds** (max **100** per call, split big lists). Search **timeout** or\n error → **narrower** **searchTerm** or smaller **limit** / columns, then continue with **nextCursor** as\n in the first bullet.\n\n2. **Match (after the fetch for that pass is done)**\n- Apply a **clear** rule to names/values you already loaded (e.g. same name as source, or value user gave).\n- One unambiguous match → link without asking. **No** vague “best” pick without a rule.\n\n3. **If the user must be involved (only after step 1 is done for that query)**\n- If step 1 is incomplete, **no** questions (see step 1’s first bullet).\n- **True tie** (2+ items match the rule equally) → show **only those tied rows** (or a tiny shortlist),\n not the full result set and never all ~500.\n- **No way to name a target yet** (not a tie) → ask **once** for a **name** or **search phrase** to use in\n **searchTerm** / **filters**, not a menu of the board.\n\n4. **Write** — On the owning board’s board-relation column using change_item_column_values\n".trim(),iy={};const ny=Nc`
2465
2485
  query GetItemAssets($itemId: ID!, $columnId: String!) {
2466
2486
  items(ids: [$itemId], limit: 1) {
2467
2487
  assets(column_ids: [$columnId]) {
@@ -2471,7 +2491,7 @@
2471
2491
  }
2472
2492
  }
2473
2493
  }
2474
- `,iy=["xl/_rels/workbook.xml.rels","xl/workbook.xml","xl/sharedStrings.xml","xl/styles.xml"],ny="xl/sharedStrings.xml";const oy={worksheets:"emit",sharedStrings:"cache",styles:"cache",hyperlinks:"ignore",entries:"ignore"};function ry(e){if(null==e)return"";if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return String(e);if(e instanceof Date)return e.toISOString();if("object"==typeof e){if("result"in e)return ry(e.result);if("richText"in e)return e.richText.map((e=>e.text)).join("");if("hyperlink"in e)return e.text??""}return""}function sy(e){const t=e.values.slice(1);let a=t.length;for(;a>0&&""===ry(t[a-1]);)a--;return t.slice(0,a).map(ry).join(",")}async function dy(e,{maxTextLength:t=5e6,deadlineMs:a=2e4,now:i=Date.now}={}){const o=i(),r=[];let s=0;const d=e=>{r.push(e),s+=e.length+1},p=n.Readable.from(await async function(e){const t=await R.default.loadAsync(e).catch((()=>{}));if(!t)return e;const a=Object.keys(t.files).length;if(a>5e3)throw new Error(`Workbook has too many parts to read (${a})`);t.files[ny]||t.file(ny,'<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="0" uniqueCount="0"/>',{createFolders:!1});const i=Object.keys(t.files),n=[...iy.filter((e=>e in t.files)),...i.filter((e=>!iy.includes(e)))],o=Object.create(null);for(const e of n)o[e]=t.files[e];return t.files=o,t.generateAsync({type:"nodebuffer",compression:"DEFLATE"})}(e)),l=new k.default.stream.xlsx.WorkbookReader(p,oy);let c;try{e:for await(const e of l){r.length>0&&d(""),d(`=== Sheet: ${e.name} ===`);for await(const n of e){if(i()-o>a){c="time";break e}const e=sy(n);if(""!==e&&(d(e),s>=t)){c="size";break e}}}}finally{p.destroy()}const m=r.join("\n");return c?{text:m.slice(0,t),truncatedBy:c}:{text:m}}async function py(e){const t=new k.default.Workbook;await t.xlsx.load(e);const a=[];return t.eachSheet((e=>{const t=[];e.eachRow((e=>{const a=e.values.slice(1);t.push(a.map(ry).join(","))})),a.push(`=== Sheet: ${e.name} ===\n${t.join("\n")}`)})),{text:a.join("\n\n")}}const ly=10485760,cy=5e4,my=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico"]),uy=new Set([".pdf"]),hy=new Set([".docx"]),fy=new Set([".xlsx"]),_y=new Set([".xls"]),by=new Set([".txt",".md",".csv",".json"]),gy={item_id:i.z.string().describe("The ID of the item that contains the file. Obtained from get_board_items_page results."),column_id:i.z.string().describe("The ID of the files column containing the file. Obtained from the board schema."),file_name:i.z.string().optional().describe('Optional file name hint used to determine the file type when the asset name is ambiguous. Include the extension (e.g. "report.pdf").'),offset:i.z.number().int().min(0).optional().describe("Character offset to start reading from. Use when a previous response indicated the content was truncated (has_more: true). Defaults to 0.")};function yy(e){const t=e.lastIndexOf(".");return-1===t?"":e.slice(t).toLowerCase()}async function vy(e,t,a,i){const n=function(e,t){if(t){const e=yy(t);if(e)return e}return e.file_extension?e.file_extension.startsWith(".")?e.file_extension.toLowerCase():`.${e.file_extension.toLowerCase()}`:yy(e.name)}(e,i);try{if(my.has(n))return{file_name:e.name,file_extension:n,content_type:"image",public_url:e.public_url,message:"Image file — use the public_url to view or analyze its content."};if(_y.has(n))return{file_name:e.name,file_extension:n,message:"Legacy .xls format is not supported. Please convert the file to .xlsx and re-upload."};const i=await async function(e){const t=await fetch(e,{signal:AbortSignal.timeout(3e4)});if(!t.ok)throw new Error(`Failed to download file: HTTP ${t.status}`);const a=t.headers.get("content-length");if(a&&parseInt(a,10)>ly)throw new Error(`File exceeds the 10 MB size limit (Content-Length: ${a} bytes)`);if(!t.body)throw new Error("Response body is empty");const i=t.body.getReader(),n=[];let o=0;try{let e=await i.read();for(;!e.done;){const{value:t}=e;if(o+=t.byteLength,o>ly)throw await i.cancel().catch((()=>{})),new Error("File exceeds the 10 MB size limit");n.push(t),e=await i.read()}}catch(e){throw await i.cancel().catch((()=>{})),e}return Buffer.concat(n)}(e.public_url);let o,r,s;uy.has(n)?(o=await async function(e){const t=await m.getDocumentProxy(new Uint8Array(e)),{text:a}=await m.extractText(t,{mergePages:!0});return a}(i),r="pdf"):hy.has(n)?(o=await async function(e){return(await O.default.extractRawText({buffer:e})).value}(i),r="word"):fy.has(n)?(({text:o,truncatedBy:s}=await a(i)),r="excel"):by.has(n)?(o=i.toString("utf-8"),r="text"):(o=i.toString("utf-8"),r="unknown");const d=o.slice(t,t+cy),p=o.length>t+cy;return{file_name:e.name,file_extension:n,content_type:r,text:d,total_length:o.length,...uy.has(n)&&{public_url:e.public_url},...s&&{extraction_truncated:!0,message:"size"===s?`Workbook is too large to extract fully; text was cut at ${o.length} characters.`:`Workbook extraction stopped after the 20-second time limit; text was cut at ${o.length} characters.`},...p&&{has_more:!0,next_offset:t+cy}}}catch(t){return{message:`Failed to fetch file content: ${t instanceof Error?t.message:String(t)}`,file_name:e.name,file_extension:n}}}const Iy=Nc`
2494
+ `,oy=["xl/_rels/workbook.xml.rels","xl/workbook.xml","xl/sharedStrings.xml","xl/styles.xml"],ry="xl/sharedStrings.xml";const sy={worksheets:"emit",sharedStrings:"cache",styles:"cache",hyperlinks:"ignore",entries:"ignore"};function dy(e){if(null==e)return"";if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return String(e);if(e instanceof Date)return e.toISOString();if("object"==typeof e){if("result"in e)return dy(e.result);if("richText"in e)return e.richText.map((e=>e.text)).join("");if("hyperlink"in e)return e.text??""}return""}function py(e){const t=e.values.slice(1);let a=t.length;for(;a>0&&""===dy(t[a-1]);)a--;return t.slice(0,a).map(dy).join(",")}async function ly(e,{maxTextLength:t=5e6,deadlineMs:a=2e4,now:i=Date.now}={}){const o=i(),r=[];let s=0;const d=e=>{r.push(e),s+=e.length+1},p=n.Readable.from(await async function(e){const t=await R.default.loadAsync(e).catch((()=>{}));if(!t)return e;const a=Object.keys(t.files).length;if(a>5e3)throw new Error(`Workbook has too many parts to read (${a})`);t.files[ry]||t.file(ry,'<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="0" uniqueCount="0"/>',{createFolders:!1});const i=Object.keys(t.files),n=[...oy.filter((e=>e in t.files)),...i.filter((e=>!oy.includes(e)))],o=Object.create(null);for(const e of n)o[e]=t.files[e];return t.files=o,t.generateAsync({type:"nodebuffer",compression:"DEFLATE"})}(e)),l=new k.default.stream.xlsx.WorkbookReader(p,sy);let c;try{e:for await(const e of l){r.length>0&&d(""),d(`=== Sheet: ${e.name} ===`);for await(const n of e){if(i()-o>a){c="time";break e}const e=py(n);if(""!==e&&(d(e),s>=t)){c="size";break e}}}}finally{p.destroy()}const m=r.join("\n");return c?{text:m.slice(0,t),truncatedBy:c}:{text:m}}async function cy(e){const t=new k.default.Workbook;await t.xlsx.load(e);const a=[];return t.eachSheet((e=>{const t=[];e.eachRow((e=>{const a=e.values.slice(1);t.push(a.map(dy).join(","))})),a.push(`=== Sheet: ${e.name} ===\n${t.join("\n")}`)})),{text:a.join("\n\n")}}const my=10485760,uy=5e4,hy=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico"]),fy=new Set([".pdf"]),_y=new Set([".docx"]),by=new Set([".xlsx"]),gy=new Set([".xls"]),yy=new Set([".txt",".md",".csv",".json"]),vy={item_id:i.z.string().describe("The ID of the item that contains the file. Obtained from get_board_items_page results."),column_id:i.z.string().describe("The ID of the files column containing the file. Obtained from the board schema."),file_name:i.z.string().optional().describe('Optional file name hint used to determine the file type when the asset name is ambiguous. Include the extension (e.g. "report.pdf").'),offset:i.z.number().int().min(0).optional().describe("Character offset to start reading from. Use when a previous response indicated the content was truncated (has_more: true). Defaults to 0.")};function Iy(e){const t=e.lastIndexOf(".");return-1===t?"":e.slice(t).toLowerCase()}async function wy(e,t,a,i){const n=function(e,t){if(t){const e=Iy(t);if(e)return e}return e.file_extension?e.file_extension.startsWith(".")?e.file_extension.toLowerCase():`.${e.file_extension.toLowerCase()}`:Iy(e.name)}(e,i);try{if(hy.has(n))return{file_name:e.name,file_extension:n,content_type:"image",public_url:e.public_url,message:"Image file — use the public_url to view or analyze its content."};if(gy.has(n))return{file_name:e.name,file_extension:n,message:"Legacy .xls format is not supported. Please convert the file to .xlsx and re-upload."};const i=await async function(e){const t=await fetch(e,{signal:AbortSignal.timeout(3e4)});if(!t.ok)throw new Error(`Failed to download file: HTTP ${t.status}`);const a=t.headers.get("content-length");if(a&&parseInt(a,10)>my)throw new Error(`File exceeds the 10 MB size limit (Content-Length: ${a} bytes)`);if(!t.body)throw new Error("Response body is empty");const i=t.body.getReader(),n=[];let o=0;try{let e=await i.read();for(;!e.done;){const{value:t}=e;if(o+=t.byteLength,o>my)throw await i.cancel().catch((()=>{})),new Error("File exceeds the 10 MB size limit");n.push(t),e=await i.read()}}catch(e){throw await i.cancel().catch((()=>{})),e}return Buffer.concat(n)}(e.public_url);let o,r,s;fy.has(n)?(o=await async function(e){const t=await m.getDocumentProxy(new Uint8Array(e)),{text:a}=await m.extractText(t,{mergePages:!0});return a}(i),r="pdf"):_y.has(n)?(o=await async function(e){return(await O.default.extractRawText({buffer:e})).value}(i),r="word"):by.has(n)?(({text:o,truncatedBy:s}=await a(i)),r="excel"):yy.has(n)?(o=i.toString("utf-8"),r="text"):(o=i.toString("utf-8"),r="unknown");const d=o.slice(t,t+uy),p=o.length>t+uy;return{file_name:e.name,file_extension:n,content_type:r,text:d,total_length:o.length,...fy.has(n)&&{public_url:e.public_url},...s&&{extraction_truncated:!0,message:"size"===s?`Workbook is too large to extract fully; text was cut at ${o.length} characters.`:`Workbook extraction stopped after the 20-second time limit; text was cut at ${o.length} characters.`},...p&&{has_more:!0,next_offset:t+uy}}}catch(t){return{message:`Failed to fetch file content: ${t instanceof Error?t.message:String(t)}`,file_name:e.name,file_extension:n}}}const Ty=Nc`
2475
2495
  query getBoardAutomations($boardIds: [ID!], $limit: Int, $cursor: String, $includeLegacy: Boolean!) {
2476
2496
  board_automations(board_ids: $boardIds, limit: $limit, cursor: $cursor) {
2477
2497
  cursor
@@ -2493,39 +2513,39 @@
2493
2513
  }
2494
2514
  }
2495
2515
  }
2496
- `;function wy(e){if("string"!=typeof e)return e;const t=Number(e);return Number.isNaN(t)?e:t}function Ty(e){const{active:t,user_id:a,...i}=e;return{...i,user_id:wy(a),is_active:t??!1}}const Ey={boardId:i.z.string().trim().min(1,"boardId must be a non-empty string").describe("The numeric board ID as a string."),limit:i.z.number().int().min(1).max(100).optional().describe("Maximum number of automations to return. Default: 100."),cursor:i.z.string().optional().describe("Pagination cursor from a previous response. Pass to retrieve the next page of automations.")};const Ay=Nc`
2516
+ `;function Ey(e){if("string"!=typeof e)return e;const t=Number(e);return Number.isNaN(t)?e:t}function Ay(e){const{active:t,user_id:a,...i}=e;return{...i,user_id:Ey(a),is_active:t??!1}}const Sy={boardId:i.z.string().trim().min(1,"boardId must be a non-empty string").describe("The numeric board ID as a string."),limit:i.z.number().int().min(1).max(100).optional().describe("Maximum number of automations to return. Default: 100."),cursor:i.z.string().optional().describe("Pagination cursor from a previous response. Pass to retrieve the next page of automations.")};const Dy=Nc`
2497
2517
  mutation activateLiveWorkflow($id: ID!) {
2498
2518
  activate_live_workflow(id: $id) {
2499
2519
  is_success
2500
2520
  }
2501
2521
  }
2502
- `,Sy=Nc`
2522
+ `,Ny=Nc`
2503
2523
  mutation deactivateLiveWorkflow($id: ID!) {
2504
2524
  deactivate_live_workflow(id: $id) {
2505
2525
  is_success
2506
2526
  }
2507
2527
  }
2508
- `,Dy=Nc`
2528
+ `,Oy=Nc`
2509
2529
  mutation deleteLiveWorkflow($id: ID!) {
2510
2530
  delete_live_workflow(id: $id) {
2511
2531
  is_success
2512
2532
  }
2513
2533
  }
2514
- `,Ny={action:i.z.enum(["activate","deactivate","delete"]).describe("The operation to perform. activate: enables a paused automation so it responds to its trigger. deactivate: pauses an automation without deleting it. delete: permanently removes an automation (irreversible)."),workflowId:i.z.string().trim().min(1,"workflowId must be a non-empty string").describe("The automation ID to operate on. Obtain from list_automations.")};const Oy=({path:e,method:t,headers:a,body:i,signal:n})=>fetch(`https://api.monday.com${e}`,{method:t,headers:a,body:i,signal:n}),ky={userPrompt:i.z.string().trim().min(1,"userPrompt must be a non-empty string").describe("Structured description of the automation to create."),boardId:i.z.string().trim().min(1,"boardId must be a non-empty string").describe("The numeric board ID as a string.")};const Ry="\n triggerUuid\n eventState\n eventKind\n triggerStartedAt\n createdAt\n triggerDuration\n errorReason\n entityKind\n hostType\n hostInstanceId\n billingActionsCount\n creatorAppFeatureReferenceId\n waitingForTriggerName\n reignitionSubscriptionId\n",Cy=Nc`
2534
+ `,ky={action:i.z.enum(["activate","deactivate","delete"]).describe("The operation to perform. activate: enables a paused automation so it responds to its trigger. deactivate: pauses an automation without deleting it. delete: permanently removes an automation (irreversible)."),workflowId:i.z.string().trim().min(1,"workflowId must be a non-empty string").describe("The automation ID to operate on. Obtain from list_automations.")};const Ry=({path:e,method:t,headers:a,body:i,signal:n})=>fetch(`https://api.monday.com${e}`,{method:t,headers:a,body:i,signal:n}),Cy={userPrompt:i.z.string().trim().min(1,"userPrompt must be a non-empty string").describe("Structured description of the automation to create."),boardId:i.z.string().trim().min(1,"boardId must be a non-empty string").describe("The numeric board ID as a string.")};const $y="\n triggerUuid\n eventState\n eventKind\n triggerStartedAt\n createdAt\n triggerDuration\n errorReason\n entityKind\n hostType\n hostInstanceId\n billingActionsCount\n creatorAppFeatureReferenceId\n waitingForTriggerName\n reignitionSubscriptionId\n",xy=Nc`
2515
2535
  query GetTriggerEvents($nextPageOffset: Int, $filters: TriggerEventsFiltersInput) {
2516
2536
  trigger_events(nextPageOffset: $nextPageOffset, filters: $filters) {
2517
2537
  triggerEvents {
2518
- ${Ry}
2538
+ ${$y}
2519
2539
  }
2520
2540
  }
2521
2541
  }
2522
- `,$y=Nc`
2542
+ `,Ly=Nc`
2523
2543
  query GetTriggerEvent($triggerUuid: String!) {
2524
2544
  trigger_event(triggerUuid: $triggerUuid) {
2525
- ${Ry}
2545
+ ${$y}
2526
2546
  }
2527
2547
  }
2528
- `,xy=Nc`
2548
+ `,Uy=Nc`
2529
2549
  query GetBlockEvents($triggerUuid: String!, $nextPageOffset: Int) {
2530
2550
  block_events(triggerUuid: $triggerUuid, nextPageOffset: $nextPageOffset) {
2531
2551
  blockEvents {
@@ -2545,7 +2565,7 @@
2545
2565
  }
2546
2566
  }
2547
2567
  }
2548
- `,Ly=Nc`
2568
+ `,Py=Nc`
2549
2569
  query GetToolEvents($triggerUuid: String!, $nextPageOffset: Int) {
2550
2570
  tool_events(trigger_uuid: $triggerUuid, next_page_offset: $nextPageOffset) {
2551
2571
  tool_events {
@@ -2561,7 +2581,7 @@
2561
2581
  }
2562
2582
  }
2563
2583
  }
2564
- `,Uy=i.z.object({dateRange:i.z.object({startDate:i.z.string().min(1).describe('Start date (ISO 8601 or date-only, e.g. "2026-05-01")'),endDate:i.z.string().min(1).describe("End date (ISO 8601 or date-only)")}).optional().describe("Date range filter"),stateFilter:i.z.array(i.z.string()).optional().describe('Filter by event state (e.g. ["success", "failure"])'),automationIds:i.z.array(i.z.number().int()).optional().describe("Filter by automation IDs"),workflowEntityIds:i.z.array(i.z.number().int()).optional().describe("Filter by workflow entity IDs"),itemId:i.z.string().optional().describe("Filter by item identifier"),entityKind:i.z.string().optional().describe("Filter by entity kind"),hostType:i.z.string().optional().describe("Filter by host type")}).optional(),Py={mode:i.z.enum(["history","detail"]).describe("history = paginated run feed, detail = single run by triggerUuid"),boardId:i.z.string().min(1).optional().describe("Target a specific board by numeric ID"),accountWide:i.z.boolean().optional().describe("Set true to query account-wide (required if no boardId)"),nextPageOffset:i.z.number().int().nonnegative().optional().describe("history: page offset (offset-only pagination)"),filters:Uy.describe("history: run filters"),triggerUuid:i.z.string().optional().describe("detail: required — the run UUID to inspect"),includeToolEvents:i.z.boolean().optional().describe("detail: include MCP tool calls (default true)"),blockEventsOffset:i.z.number().int().nonnegative().optional().describe("detail: block-events page offset"),toolEventsOffset:i.z.number().int().nonnegative().optional().describe("detail: tool-events page offset")};const Vy=Nc`
2584
+ `,Vy=i.z.object({dateRange:i.z.object({startDate:i.z.string().min(1).describe('Start date (ISO 8601 or date-only, e.g. "2026-05-01")'),endDate:i.z.string().min(1).describe("End date (ISO 8601 or date-only)")}).optional().describe("Date range filter"),stateFilter:i.z.array(i.z.string()).optional().describe('Filter by event state (e.g. ["success", "failure"])'),automationIds:i.z.array(i.z.number().int()).optional().describe("Filter by automation IDs"),workflowEntityIds:i.z.array(i.z.number().int()).optional().describe("Filter by workflow entity IDs"),itemId:i.z.string().optional().describe("Filter by item identifier"),entityKind:i.z.string().optional().describe("Filter by entity kind"),hostType:i.z.string().optional().describe("Filter by host type")}).optional(),My={mode:i.z.enum(["history","detail"]).describe("history = paginated run feed, detail = single run by triggerUuid"),boardId:i.z.string().min(1).optional().describe("Target a specific board by numeric ID"),accountWide:i.z.boolean().optional().describe("Set true to query account-wide (required if no boardId)"),nextPageOffset:i.z.number().int().nonnegative().optional().describe("history: page offset (offset-only pagination)"),filters:Vy.describe("history: run filters"),triggerUuid:i.z.string().optional().describe("detail: required — the run UUID to inspect"),includeToolEvents:i.z.boolean().optional().describe("detail: include MCP tool calls (default true)"),blockEventsOffset:i.z.number().int().nonnegative().optional().describe("detail: block-events page offset"),toolEventsOffset:i.z.number().int().nonnegative().optional().describe("detail: tool-events page offset")};const Fy=Nc`
2565
2585
  query GetAccountTriggerStatistics($filters: AccountTriggerStatisticsFiltersInput) {
2566
2586
  account_trigger_statistics(filters: $filters) {
2567
2587
  id
@@ -2570,7 +2590,7 @@
2570
2590
  total
2571
2591
  }
2572
2592
  }
2573
- `,My=Nc`
2593
+ `,By=Nc`
2574
2594
  query GetAccountTriggersByEntity($runStatus: TriggerEventState!, $filters: AccountTriggersByEntityIdFiltersInput) {
2575
2595
  account_triggers_statistics_by_entity_id(run_status: $runStatus, filters: $filters) {
2576
2596
  id
@@ -2578,7 +2598,7 @@
2578
2598
  workflow_statistics
2579
2599
  }
2580
2600
  }
2581
- `,Fy={breakdown:i.z.enum(["totals","by_entity"]).describe("totals = success/failure/total counts, by_entity = per automation/workflow"),boardId:i.z.string().min(1).optional().describe("Target a specific board by numeric ID"),accountWide:i.z.boolean().optional().describe("Set true to query account-wide (required if no boardId)"),userIds:i.z.array(i.z.number().int()).optional().describe("Narrow to specific creator user IDs"),runStatus:i.z.enum(["success","failure","exhausted"]).optional().describe("by_entity: required run status to break down"),excludeAutomationIds:i.z.array(i.z.number().int()).optional().describe("by_entity: automation IDs to exclude from breakdown")};const By=Nc`
2601
+ `,zy={breakdown:i.z.enum(["totals","by_entity"]).describe("totals = success/failure/total counts, by_entity = per automation/workflow"),boardId:i.z.string().min(1).optional().describe("Target a specific board by numeric ID"),accountWide:i.z.boolean().optional().describe("Set true to query account-wide (required if no boardId)"),userIds:i.z.array(i.z.number().int()).optional().describe("Narrow to specific creator user IDs"),runStatus:i.z.enum(["success","failure","exhausted"]).optional().describe("by_entity: required run status to break down"),excludeAutomationIds:i.z.array(i.z.number().int()).optional().describe("by_entity: automation IDs to exclude from breakdown")};const jy=Nc`
2582
2602
  mutation ConfigureCategorizeAiColumn(
2583
2603
  $boardId: ID!
2584
2604
  $columnId: ID!
@@ -2598,7 +2618,7 @@
2598
2618
  column_id
2599
2619
  }
2600
2620
  }
2601
- `,zy=Nc`
2621
+ `,qy=Nc`
2602
2622
  mutation ConfigureSummarizeAiColumn(
2603
2623
  $boardId: ID!
2604
2624
  $columnId: ID!
@@ -2618,7 +2638,7 @@
2618
2638
  column_id
2619
2639
  }
2620
2640
  }
2621
- `,jy=Nc`
2641
+ `,Gy=Nc`
2622
2642
  mutation ConfigureTranslateAiColumn(
2623
2643
  $boardId: ID!
2624
2644
  $columnId: ID!
@@ -2638,7 +2658,7 @@
2638
2658
  column_id
2639
2659
  }
2640
2660
  }
2641
- `,qy=Nc`
2661
+ `,Hy=Nc`
2642
2662
  mutation ConfigureImproveTextAiColumn(
2643
2663
  $boardId: ID!
2644
2664
  $columnId: ID!
@@ -2662,7 +2682,7 @@
2662
2682
  column_id
2663
2683
  }
2664
2684
  }
2665
- `,Gy=Nc`
2685
+ `,Wy=Nc`
2666
2686
  mutation ConfigureExtractAiColumn(
2667
2687
  $boardId: ID!
2668
2688
  $columnId: ID!
@@ -2686,7 +2706,7 @@
2686
2706
  column_id
2687
2707
  }
2688
2708
  }
2689
- `,Hy=Nc`
2709
+ `,Yy=Nc`
2690
2710
  mutation ConfigureOpenBlockAiColumn(
2691
2711
  $boardId: ID!
2692
2712
  $columnId: ID!
@@ -2702,7 +2722,7 @@
2702
2722
  column_id
2703
2723
  }
2704
2724
  }
2705
- `,Wy=Nc`
2725
+ `,Qy=Nc`
2706
2726
  mutation ConfigureWriteMeAiColumn(
2707
2727
  $boardId: ID!
2708
2728
  $columnId: ID!
@@ -2722,7 +2742,7 @@
2722
2742
  column_id
2723
2743
  }
2724
2744
  }
2725
- `,Yy=Nc`
2745
+ `,Ky=Nc`
2726
2746
  mutation ConfigurePersonAssignmentAiColumn(
2727
2747
  $boardId: ID!
2728
2748
  $columnId: ID!
@@ -2742,14 +2762,14 @@
2742
2762
  column_id
2743
2763
  }
2744
2764
  }
2745
- `,Qy={board_id:i.z.number().describe("The ID of the board containing the column"),column_id:i.z.string().describe("The ID of the column to configure with AI"),block_type:i.z.enum(["categorize","summarize","translate","improve_text","extract","open_block","write_me","person_assignment"]).describe("The AI block type to configure. See tool description for which fields apply to each block."),source_type:i.z.enum(["item_name","thread","column","emails_and_activities"]).optional().describe("Where the AI reads input. Required for all blocks except open_block and write_me. Values: item_name (item name), thread (updates/comments), column (another column — requires source_column_id), emails_and_activities (categorize only)."),source_column_id:i.z.string().optional().describe('The ID of the source column. Required when source_type is "column".'),additional_instructions:i.z.string().max(3e3).optional().describe("Custom instructions for categorize/summarize/extract blocks (max 3000 chars)."),target_language:i.z.enum(["english","spanish","french","german","hebrew","chinese","korean","arabic","bengali","danish","dutch","hindi","indonesian","italian","japanese","norwegian","polish","portuguese","russian","swedish","thai","turkish","vietnamese"]).optional().describe("Required for translate block. The target language to translate text into."),tone:i.z.enum(["empathic","promotional","confident","professional","natural","casual","friendly","same"]).optional().describe("Writing tone. Required for write_me, optional for improve_text."),output_length:i.z.enum(["sentence","paragraph","brief","in_depth"]).optional().describe("Required for write_me block. Approximate desired output length."),improver_length:i.z.enum(["same","shorter","longer"]).optional().describe("For improve_text only. Desired length relative to input text."),refinement_type:i.z.enum(["minimal_changes","moderate_changes","high_creativity"]).optional().describe("For improve_text only. Level of text refinement to apply."),entity_type:i.z.enum(["email_address","first_name","last_name","phone_number","company_name","domain_name","url","date","time","year","custom"]).optional().describe("Required for extract block. Type of entity to extract from text."),custom_instructions:i.z.string().max(3e3).optional().describe('Required for extract when entity_type is "custom". Describes what to extract (max 3000 chars).'),ai_query:i.z.string().max(3e3).optional().describe("Required for open_block and write_me. Natural-language prompt. Reference columns via {pulse.column_id}, item name via {pulse.name}, subitems via {pulse.subitem.column_id}. Max 3000 chars."),groups:i.z.array(i.z.object({user_ids:i.z.array(i.z.number()).describe("Array of user IDs in this group"),description:i.z.string().describe("Description of this group (e.g., role, team name, or assignment criteria)")})).optional().describe("Required for person_assignment. Array of groups, each with user_ids and a description."),run_backfill:i.z.boolean().optional().describe("Whether to immediately apply AI to existing items (up to 200). Defaults to true.")};const Ky=Nc`
2765
+ `,Jy={board_id:i.z.number().describe("The ID of the board containing the column"),column_id:i.z.string().describe("The ID of the column to configure with AI"),block_type:i.z.enum(["categorize","summarize","translate","improve_text","extract","open_block","write_me","person_assignment"]).describe("The AI block type to configure. See tool description for which fields apply to each block."),source_type:i.z.enum(["item_name","thread","column","emails_and_activities"]).optional().describe("Where the AI reads input. Required for all blocks except open_block and write_me. Values: item_name (item name), thread (updates/comments), column (another column — requires source_column_id), emails_and_activities (categorize only)."),source_column_id:i.z.string().optional().describe('The ID of the source column. Required when source_type is "column".'),additional_instructions:i.z.string().max(3e3).optional().describe("Custom instructions for categorize/summarize/extract blocks (max 3000 chars)."),target_language:i.z.enum(["english","spanish","french","german","hebrew","chinese","korean","arabic","bengali","danish","dutch","hindi","indonesian","italian","japanese","norwegian","polish","portuguese","russian","swedish","thai","turkish","vietnamese"]).optional().describe("Required for translate block. The target language to translate text into."),tone:i.z.enum(["empathic","promotional","confident","professional","natural","casual","friendly","same"]).optional().describe("Writing tone. Required for write_me, optional for improve_text."),output_length:i.z.enum(["sentence","paragraph","brief","in_depth"]).optional().describe("Required for write_me block. Approximate desired output length."),improver_length:i.z.enum(["same","shorter","longer"]).optional().describe("For improve_text only. Desired length relative to input text."),refinement_type:i.z.enum(["minimal_changes","moderate_changes","high_creativity"]).optional().describe("For improve_text only. Level of text refinement to apply."),entity_type:i.z.enum(["email_address","first_name","last_name","phone_number","company_name","domain_name","url","date","time","year","custom"]).optional().describe("Required for extract block. Type of entity to extract from text."),custom_instructions:i.z.string().max(3e3).optional().describe('Required for extract when entity_type is "custom". Describes what to extract (max 3000 chars).'),ai_query:i.z.string().max(3e3).optional().describe("Required for open_block and write_me. Natural-language prompt. Reference columns via {pulse.column_id}, item name via {pulse.name}, subitems via {pulse.subitem.column_id}. Max 3000 chars."),groups:i.z.array(i.z.object({user_ids:i.z.array(i.z.number()).describe("Array of user IDs in this group"),description:i.z.string().describe("Description of this group (e.g., role, team name, or assignment criteria)")})).optional().describe("Required for person_assignment. Array of groups, each with user_ids and a description."),run_backfill:i.z.boolean().optional().describe("Whether to immediately apply AI to existing items (up to 200). Defaults to true.")};const Xy=Nc`
2746
2766
  mutation RemoveAiFromColumn($boardId: ID!, $columnId: ID!) {
2747
2767
  remove_ai_from_column(board_id: $boardId, column_id: $columnId) {
2748
2768
  column_id
2749
2769
  success
2750
2770
  }
2751
2771
  }
2752
- `,Jy={board_id:i.z.number().describe("The ID of the board containing the column"),column_id:i.z.string().describe("The ID of the column to remove AI from")};const Xy="Do NOT include any personally identifiable information (PII) such as names, email addresses, phone numbers, or any other personal data.",Zy={kind:i.z.enum(["feedback","feature_request","bug"]).describe("The kind of submission: general feedback, a feature request, or a bug report"),title:i.z.string().describe(`A short summary of the feedback. ${Xy}`),description:i.z.string().describe(`Full details — what happened, what was expected, or what is being requested. ${Xy}`),tool_name:i.z.string().optional().describe('The name of the monday.com MCP tool this feedback is about, if applicable (e.g. "create_item", "get_board_info"). Only include monday.com MCP tool names — do not reference tools from other connected services.')};const ev=Nc`
2772
+ `,Zy={board_id:i.z.number().describe("The ID of the board containing the column"),column_id:i.z.string().describe("The ID of the column to remove AI from")};const ev="Do NOT include any personally identifiable information (PII) such as names, email addresses, phone numbers, or any other personal data.",tv={kind:i.z.enum(["feedback","feature_request","bug"]).describe("The kind of submission: general feedback, a feature request, or a bug report"),title:i.z.string().describe(`A short summary of the feedback. ${ev}`),description:i.z.string().describe(`Full details — what happened, what was expected, or what is being requested. ${ev}`),tool_name:i.z.string().optional().describe('The name of the monday.com MCP tool this feedback is about, if applicable (e.g. "create_item", "get_board_info"). Only include monday.com MCP tool names — do not reference tools from other connected services.')};const av=Nc`
2753
2773
  query KnowledgeBaseSearch($query: String!, $limit: Int) {
2754
2774
  knowledge_base_search(query: $query, limit: $limit) {
2755
2775
  answer
@@ -2763,7 +2783,7 @@
2763
2783
  }
2764
2784
  }
2765
2785
  }
2766
- `,tv=Nc`
2786
+ `,iv=Nc`
2767
2787
  query AskDeveloperDocs($query: String!, $retrieval_only: Boolean = true) {
2768
2788
  ask_developer_docs(query: $query, retrieval_only: $retrieval_only) {
2769
2789
  id
@@ -2772,7 +2792,7 @@
2772
2792
  conversation_id
2773
2793
  }
2774
2794
  }
2775
- `,av="developer_docs",iv="general",nv={query:i.z.string().describe("The question or topic to search for in the monday.com knowledge base."),kind:i.z.enum([av,iv]).describe('The knowledge domain to search. Use "developer_docs" for questions about the monday.com API — GraphQL queries and mutations, authentication, rate limits, webhooks, schema, API best practices, and building apps. Use "general" for questions about using monday.com — features, automations, UI, help center, and settings.')};i.z.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),i.z.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const ov=Nc`
2795
+ `,nv="developer_docs",ov="general",rv={query:i.z.string().describe("The question or topic to search for in the monday.com knowledge base."),kind:i.z.enum([nv,ov]).describe('The knowledge domain to search. Use "developer_docs" for questions about the monday.com API — GraphQL queries and mutations, authentication, rate limits, webhooks, schema, API best practices, and building apps. Use "general" for questions about using monday.com — features, automations, UI, help center, and settings.')};i.z.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),i.z.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const sv=Nc`
2776
2796
  query getSprintsByIds($ids: [ID!]) {
2777
2797
  items(ids: $ids) {
2778
2798
  id
@@ -2807,7 +2827,7 @@
2807
2827
  }
2808
2828
  }
2809
2829
  }
2810
- `,rv={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"},sv={...rv,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},dv="BOARD_NOT_FOUND:",pv="SPRINT_NOT_FOUND:",lv="DOCUMENT_NOT_FOUND:",cv="DOCUMENT_INVALID:",mv="DOCUMENT_EMPTY:",uv="EXPORT_FAILED:",hv="INTERNAL_ERROR:",fv="VALIDATION_ERROR:",_v="task_sprint",bv={[sv.SPRINT_TASKS]:"Sprint Tasks",[sv.SPRINT_TIMELINE]:"Sprint Timeline",[sv.SPRINT_COMPLETION]:"Sprint Completion",[sv.SPRINT_START_DATE]:"Sprint Start Date",[sv.SPRINT_END_DATE]:"Sprint End Date",[sv.SPRINT_ACTIVATION]:"Sprint Activation",[sv.SPRINT_SUMMARY]:"Sprint Summary",[sv.SPRINT_CAPACITY]:"Sprint Capacity"},gv=qd,yv={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},vv=(e,t)=>e.column_values?.find((e=>e.id===t)),Iv=(e,t)=>{const a=vv(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},wv=(e,t)=>{const a=vv(e,t);return"DateValue"===a?.__typename?a.date??null:null},Tv=(e,t)=>{const a=vv(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},Ev=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},Av=(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)))},Sv=e=>Av(e,Object.values(rv)),Dv=e=>Av(e,Object.values(yv)),Nv=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},Ov=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===bm.BoardRelation))||null,kv={sprintId:i.z.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const Rv=Nc`
2830
+ `,dv={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"},pv={...dv,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},lv="BOARD_NOT_FOUND:",cv="SPRINT_NOT_FOUND:",mv="DOCUMENT_NOT_FOUND:",uv="DOCUMENT_INVALID:",hv="DOCUMENT_EMPTY:",fv="EXPORT_FAILED:",_v="INTERNAL_ERROR:",bv="VALIDATION_ERROR:",gv="task_sprint",yv={[pv.SPRINT_TASKS]:"Sprint Tasks",[pv.SPRINT_TIMELINE]:"Sprint Timeline",[pv.SPRINT_COMPLETION]:"Sprint Completion",[pv.SPRINT_START_DATE]:"Sprint Start Date",[pv.SPRINT_END_DATE]:"Sprint End Date",[pv.SPRINT_ACTIVATION]:"Sprint Activation",[pv.SPRINT_SUMMARY]:"Sprint Summary",[pv.SPRINT_CAPACITY]:"Sprint Capacity"},vv=qd,Iv={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},wv=(e,t)=>e.column_values?.find((e=>e.id===t)),Tv=(e,t)=>{const a=wv(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},Ev=(e,t)=>{const a=wv(e,t);return"DateValue"===a?.__typename?a.date??null:null},Av=(e,t)=>{const a=wv(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},Sv=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},Dv=(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)))},Nv=e=>Dv(e,Object.values(dv)),Ov=e=>Dv(e,Object.values(Iv)),kv=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},Rv=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===gm.BoardRelation))||null,Cv={sprintId:i.z.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const $v=Nc`
2811
2831
  query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
2812
2832
  boards(ids: [$boardId], limit: 1) {
2813
2833
  items_page(limit: $limit) {
@@ -2843,7 +2863,7 @@
2843
2863
  }
2844
2864
  }
2845
2865
  }
2846
- `,Cv={sprintsBoardId:i.z.number().describe("The ID of the monday-dev board containing the sprints"),limit:i.z.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const $v=Nc`
2866
+ `,xv={sprintsBoardId:i.z.number().describe("The ID of the monday-dev board containing the sprints"),limit:i.z.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const Lv=Nc`
2847
2867
  query GetRecentBoards($limit: Int) {
2848
2868
  boards(limit: $limit, order_by: used_at, state: active) {
2849
2869
  id
@@ -2859,7 +2879,7 @@
2859
2879
  }
2860
2880
  }
2861
2881
  }
2862
- `,xv={};const Lv=[class extends ue{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=b.READ,this.annotations=me({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 xv}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request($v,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${dv} No boards found in your account. Please verify you have access to monday.com boards.`};const a=this.extractBoardPairs(t);return 0===a.length?{content:{message:"No monday-dev sprints board pairs found. ### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`;",boards_checked:t.length,pairs:[]}}:{content:{message:`Found ${a.length} matched pair(s)`,...a.length>1?{warning:"Multiple board pairs detected. Confirm with user which pair and workspace to use before any operation."}:{},pairs:a.map((e=>({sprints_board:{id:e.sprintsBoard.id,name:e.sprintsBoard.name,workspace_id:e.sprintsBoard.workspaceId,workspace_name:e.sprintsBoard.workspaceName},tasks_board:{id:e.tasksBoard.id,name:e.tasksBoard.name,workspace_id:e.tasksBoard.workspaceId,workspace_name:e.tasksBoard.workspaceName}}))),technical_reference:"Sprint Operations (all require correct board pair): Add to Sprint: Update `task_sprint` column with sprint item ID. Remove from Sprint: Clear `task_sprint` column (set to null). Search in Sprint: Filter where `task_sprint` equals sprint item ID. Move Between Sprints: Update `task_sprint` with new sprint item ID. Backlog Tasks: `task_sprint` is empty/null. Critical: `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}}}catch(e){return{content:`${hv} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}createBoardInfo(e,t,a){return{id:e,name:t?.name||a,workspaceId:t?.workspace?.id||"unknown",workspaceName:t?.workspace?.name||"Unknown"}}processSprintsBoard(e,t,a){const i=Ov(e,rv.SPRINT_TASKS);if(!i)return;const n=Nv(i);if(!n)return;const o=`${e.id}:${n}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,t,a){const i=Ov(e,_v);if(!i)return;const n=Nv(i);if(!n)return;const o=`${n}:${e.id}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(Sv(i)&&this.processSprintsBoard(i,a,t),Dv(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends ue{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=b.READ,this.annotations=me({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List the sprints of a monday-dev sprints board with their metadata.\n\nReturns comprehensive sprint metadata 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. If you do not already have it, call get_monday_dev_sprints_boards first to discover it.\n\n## Call this before:\n- get_sprint_summary — this tool returns the Sprint IDs that get_sprint_summary requires. Never guess a sprint ID."}getInputSchema(){return Cv}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(Rv,a),n=i.boards?.[0],o=n?.items_page?.items||[],r=this.buildSprintsMetadata(o);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:o.length,data:r}}}catch(e){return{content:`${hv} 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(Lc,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${dv} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${fv} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${hv} 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(rv),i=Ev(t,a);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((t=>{const a=(e=>bv[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=Iv(e,sv.SPRINT_ACTIVATION),a=Iv(e,sv.SPRINT_COMPLETION),i=wv(e,sv.SPRINT_START_DATE),n=wv(e,sv.SPRINT_END_DATE),o=((e,t)=>{const a=vv(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,sv.SPRINT_TIMELINE),r=Tv(e,sv.SPRINT_SUMMARY);let s=gv.Planned;return a?s=gv.Completed:(t||i)&&(s=gv.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:i||null,end_date:n||null,is_completed:a,document_object_id:r||null}}))}},class extends ue{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=b.READ,this.annotations=me({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- Requires a sprintId. [REQUIRED PRECONDITION]: call get_sprints_metadata first to list the sprints on the board and resolve the sprintId (and to confirm the sprint is completed). If you do not know the sprints board ID either, start with get_monday_dev_sprints_boards.\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 kv}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${hv} Unknown error occurred while getting sprint metadata`};const a=await this.readSprintSummaryDocument(t.documentObjectId);return a.success?{content:{message:"Sprint summary retrieved",sprint_id:e.sprintId,sprint_name:t.sprintName,markdown:a.content}}:{content:a.error||`${hv} Unknown error occurred while reading document content`}}catch(e){return{content:`${hv} 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(ov,t)).items||[];if(0===a.length)return{success:!1,error:`${pv} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${pv} Sprint with ID ${e} not found.`};const n=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(rv),...t];return Ev(a,i)})(i,[sv.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${fv} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=Tv(i,sv.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${lv} No sprint summary document found for sprint "${i.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${hv} 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(Oc,t)).docs||[];if(0===a.length)return{success:!1,error:`${lv} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${cv} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(Wc,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${uv} 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:`${mv} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${hv} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],Uv=[class extends ue{constructor(){super(...arguments),this.name="delete_item",this.type=b.WRITE,this.annotations=me({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Of}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request($c,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends ue{constructor(){super(...arguments),this.name="get_board_items_page",this.type=b.READ,this.annotations=me({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get all items from a monday.com board with pagination support and optional column values and item descriptions. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the nextCursor parameter from the response to get the next page of results when has_more is true. To retrieve an item description (the rich-text body/details of a monday.com item), set includeItemDescription to true — the response will include the item description document blocks with their content, type, and id. Use this whenever the user asks about an item description, body, details, or notes. [MULTI-LEVEL BOARDS]: The response includes hierarchy_type on the board ("multi_level" for MLS boards) and parent_item_id on each item. On multi-level boards, items form a tree (up to 5 levels). Use includeSubItems to get all descendants (returned flat with parent_item_id to reconstruct the tree). Top-level items have no parent_item_id. Subitems reference their parent. [REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board structure (column IDs, column types, status labels, etc.), first use get_board_info with filters.columns.only to get column metadata without fetching views. This is essential for constructing proper filters and knowing which columns are available. [VIRTUAL COLUMNS]: Four filterable columns exist that get_board_info never returns - "group" (the item\'s board group), "__creation_log__" (creation time), "__last_updated__" (update time) and "__item_id__" (item id). All four are also valid in orderBy, e.g. "__creation_log__" with direction "desc" to sort newest-first. Call get_column_type_info with the matching column type for each one\'s compareValue and operator rules. [REQUIRED PRECONDITION]: For board-relation / cross-board linking tasks, call link_board_items_workflow before using this tool. VIEW-BASED FILTERING: If the user refers to a board view by name (e.g. "show me items in the Overdue view"), first call get_board_info with filters.views.names set to that view name (avoids downloading all views on large boards), extract the matching view\'s filter field, then pass it as the filters argument here.'}getInputSchema(){return Xf}async executeInternal(e){const t=!e.cursor;if(t&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch(t){om(t),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeItemDescription,includeGroup:e.includeGroup};t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(Gf,a);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:ks.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],i=a?.items_page,n=i?.items||[];return{board:{id:a?.id,name:a?.name,hierarchy_type:a?.hierarchy_type||null},items:n.map((e=>this.mapItem(e,t))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,t){const a=e.parent_item?.id||null,i={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at,...a&&{parent_item_id:a}};if(t.includeColumns&&e.column_values){i.column_values={};for(const t of e.column_values)i.column_values[t.id]=this.getColumnValueData(t)}if(t.includeGroup&&"group"in e&&e.group&&(i.group={id:e.group.id,title:e.group.title}),t.includeItemDescription&&"description"in e&&e.description){const t=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));i.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(i.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),i}getColumnValueData(e){switch(e.type){case bm.BoardRelation:return e.linked_items;case bm.Formula:return e.display_value;case bm.Mirror:return"Column value type is not supported"}if("battery_value"in e)return e.battery_value;if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const t={query:e.searchTerm,limit:20,boardIds:[e.boardId.toString()]},a=(await this.mondayApi.request(Hf,t,{versionOverride:"dev",timeout:um})).search.items.results.map((e=>Number(e.id)));if(0===a.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 a;const n=new Set(i);return a.filter((e=>n.has(e)))}},tf,class extends ue{constructor(){super(...arguments),this.name="create_items",this.type=b.WRITE,this.annotations=me({title:"Create Multiple Items",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create up to 20 new items in a single call. Each item is fully independent - it chooses its own groupId, parentItemId (for subitems), duplicateFromItemId (for bulk templating from an existing item), and createLabelsIfMissing. A single call can therefore span multiple groups, mix regular items with subitems under different parents, and mix fresh creates with duplicates of existing items. Each item returns its own item_id and item_url on success, or a raw error message on failure. Batch each parent's subitems into groups of up to 20. Wait for one batch to finish before starting the next batch for that parent. [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 with filters.columns.only to get column metadata without fetching views. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?af:nf}async executeInternal(e){const t=e.items.flatMap(((e,t)=>void 0===e.name?[sf(new im("Item name is required",am),t)]:[]));if(t.length)throw new im(`${t.length} of ${e.items.length} items are missing the required name field`,am,t);const a=this.context?.boardId??e.boardId;this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.items.length;const i=new tf(this.mondayApi,{boardId:a}),n="Skipped: a previous item hit a rate limit; this item was not attempted",o=e.items.map(((e,t)=>async()=>{const a=await i.execute({name:e.name,columnValues:e.columnValues,groupId:e.groupId,parentItemId:e.parentItemId,duplicateFromItemId:e.duplicateFromItemId,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,...a.content}})),r=await hm(o,{limit:15,concurrencyGroups:{getGroup:t=>e.items[t].parentItemId,limitPerGroup:5},onSkipped:e=>({index:e,error:n,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:n,path:["results",e]}}),onError:(t,a)=>({index:a,error:rf(t,e.items[a].parentItemId),_errorEntry:sf(t,a)})}),s=r.filter((e=>"error"in e)).map((e=>e._errorEntry)),d=r.map((({_errorEntry:e,...t})=>t)),p=r.length,l=s.length,c={board_id:a,summary:{total:p,created:p-l,failed:l},is_partial_success:l>0&&l<p,results:d};return s.length&&(c.errors=s),{content:c,...l===p?{isError:!0}:{}}}},hf,class extends ue{constructor(){super(...arguments),this.name="create_updates",this.type=b.WRITE,this.annotations=me({title:"Create Multiple Updates",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create up to 40 updates (comments/posts) in a single call. Each entry is independent - it targets its own item, has its own body and mentions, and can reply to an existing update via parentId - so one call can post on many items, or post several replies. Use this instead of calling create_update repeatedly when posting more than one update. Each entry returns its own update_id and item_id on success or a raw error message on failure."}getInputSchema(){return ff}async executeInternal(e){this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const t="Skipped: a previous update hit a rate limit; this update was not attempted",a=new hf(this.mondayApi),i=e.updates.map(((e,t)=>async()=>{const i=await a.execute(e);return{index:t,...i.content}})),n=await hm(i,{limit:10,onSkipped:e=>({index:e,error:t,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:t,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:_f(e,t)})}),o=n.filter((e=>"error"in e)).map((e=>e._errorEntry)),r=n.map((({_errorEntry:e,...t})=>t)),s=n.length,d=o.length,p={summary:{total:s,created:s-d,failed:d},is_partial_success:d>0&&d<s,results:r};return o.length&&(p.errors=o),{content:p,...d===s?{isError:!0}:{}}}},class extends ue{constructor(){super(...arguments),this.name="delete_update",this.type=b.WRITE,this.annotations=me({title:"Delete Update",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an update (comment/post) from a monday.com item."}getInputSchema(){return gf}async executeInternal(e){try{const t={id:e.id.toString()},a=await this.mondayApi.request(bf,t);if(!a.delete_update?.id)throw new Error("Failed to delete update: update not found or already deleted");return{content:{message:`Update ${a.delete_update.id} successfully deleted`,update_id:a.delete_update.id}}}catch(e){nm(e,"delete update")}}},class extends ue{constructor(){super(...arguments),this.name="get_updates",this.type=b.READ,this.annotations=me({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from monday.com items or a board. Pass the IDs in objectIds and set objectType: up to 25 item IDs for Item, in one call instead of calling once per item, or one board ID for Board. Filter by date range with fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion. Set includeItemUpdates to true to also include updates on individual items, and add a date range to keep the response small. Returns update text (bodies over 2000 characters are truncated and flagged with text_body_truncated. To read one in full, call again with only that item's ID and includeFullText), creator info, timestamps, and optionally replies and assets."}getInputSchema(){return Tf}async executeInternal(e){try{const t=void 0!==e.fromDate;if(t!==(void 0!==e.toDate))throw new im("Both fromDate and toDate must be provided together for date range filtering",Jc);const a=[...new Set([...e.objectIds??[],...e.objectId?[e.objectId]:[]])];if(0===a.length)throw new im("Provide the IDs to read in objectIds",Jc);if(a.length>25)throw new im("objectIds takes up to 25 IDs",Jc);if(e.objectType===If.Board&&1!==a.length)throw new im("Board queries take exactly one board ID in objectIds",Jc);const i=e.fromDate?Ef(e.fromDate):void 0,n=e.toDate?Ef(e.toDate,!0):void 0,o={page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};if(e.objectType===If.Item){const t=e.limit??(a.length>1?10:25),r=((await this.mondayApi.request(yf,{...o,limit:t,itemIds:a,itemsLimit:a.length})).items??[]).filter((e=>!!e)),s=new Set(r.map((e=>e.id))),d=a.filter((e=>!s.has(e)));return{content:{message:"Updates retrieved",items:r.map((t=>{const a=(t.updates??[]).filter((e=>function(e,t,a){if(!t||!a)return!0;const i=e?Date.parse(e):NaN;return!Number.isNaN(i)&&i>=Date.parse(t)&&i<=Date.parse(a)}(e.created_at,i,n))).map((t=>Sf(t,e)));return{item_id:t.id,url:t.url,updates:a,count:a.length}})),...d.length>0&&{not_found:d},pagination:{page:e.page??1,limit:t}}}}const[r]=a,s=e.limit??25,d=await this.mondayApi.request(vf,{...o,limit:s,boardId:r,boardUpdatesOnly:!e.includeItemUpdates,...i&&n?{fromDate:i,toDate:n}:{}}),p=d.boards?.[0],l=p?.updates;if(!l||0===l.length)return{content:`No updates found for board with id ${r}`};const c=l.map((t=>Sf(t,e)));return{content:{message:"Updates retrieved",board_id:r,url:p?.url,updates:c,pagination:{page:e.page??1,limit:s,count:c.length}}}}catch(e){nm(e,"get updates")}}},class extends ue{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=b.WRITE,this.annotations=me({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 Pg}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=Ug.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},i=await this.mondayApi.request(pf,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} successfully created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,next_steps:"Now call the full board data tool to get data, then immediately call the show table tool to show that data. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received."}}}catch(e){nm(e,"create update")}}},class extends ue{constructor(){super(...arguments),this.name="get_board_schema",this.type=b.READ,this.annotations=me({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id. Returns each column id, title, type, and revision, plus each group id and title. Call this before tools that need a column id, type, and revision resolved from schema: update_column (which also needs the revision returned here), delete_column, configure_ai_column, and remove_ai_from_column — get_board_info returns the same column id/type/revision fields and also satisfies this precondition, but prefer this tool when you only need columns and groups, not the rest of the board. For broader board metadata (owners, views, and their filters) use get_board_info instead — pass filters.views.ids / filters.views.names and/or filters.columns.ids there when you only need a subset."}getInputSchema(){if(!this.context?.boardId)return Zf}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(Lc,a);return{content:{message:"Board schema retrieved",board_id:t,columns:i.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type,revision:e?.revision})))??[],groups:i.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends ue{constructor(){super(...arguments),this.name="get_board_activity",this.type=b.READ,this.annotations=me({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3,this.maxLookbackDays=90}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days, up to the last 90 days). Optionally filter by item ids or user ids to avoid fetching activity for the entire board. [REQUIRED PRECONDITION]: Call this with includeData=true before undo_action — it is the source of the action_record_uuid that identifies the action to undo."}getInputSchema(){return Pf}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-mm.MONTH30Days),i=new Date(t.getTime()-this.maxLookbackDays*mm.DAY);let n=e?.fromDate||a.toISOString();const o=new Date(n).getTime()<i.getTime();o&&(n=i.toISOString());const r=o?`. Note: fromDate was limited to the last ${this.maxLookbackDays} days, so the range starts at ${n}`:"",s=e?.toDate||t.toISOString(),d={boardId:e.boardId.toString(),itemIds:e.itemIds?.map(String),userIds:e.userIds?.map(String),fromDate:n,toDate:s,limit:this.defaultLimit,includeData:e.includeData??!1},p=await this.mondayApi.request(Uf,d),l=p.boards?.[0]?.activity_logs?.logs;if(!l||0===l.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${n} to ${s})${r}.`};const c=p.boards?.[0],m=e.includeData??!1;return{content:{message:`Board activity retrieved${r}`,board_id:e.boardId,board_name:c?.name,board_url:c?.url,data:l.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...m&&e.data?{data:e.data}:{}})))}}}},class extends ue{constructor(e,t,a){super(e,a),this.name="get_board_info",this.type=b.READ,this.annotations=me({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. "+(this.isKnowledgeEnabled()?"Set includeKnowledge to true when you need to interpret the board rather than just read its configuration: for example, choosing a status, label or column value from the user's intent instead of an exact name they gave, or explaining what statuses, columns or roles mean. Not needed for structural work such as column ids, types, revisions or views. Adds latency and may be null while knowledge is still being generated. ":"")+'Set includeSubscribers to true to also return the board\'s subscribers (people and AI agents) and team subscribers. Also returns the board\'s views (e.g. table views, filter views) — each view includes its id, name, type, and a structured filter object. On large boards, ALWAYS narrow the response: use filters.views.names or filters.views.ids when you only need specific views, and/or filters.columns.ids when you only need specific columns. Set filters.views.only or filters.columns.only when you want just that section — full views[].settings across many views can be multi-MB. The response includes hierarchy_type which indicates if the board is a multi-level board ("multi_level") where items can have nested subitems up to 5 levels deep on the same board. On multi-level boards, subitems share the same columns as parent items and subItemColumns will be null. Call this FIRST whenever you are not already familiar with a board structure (column IDs, column types, column revisions, status labels) — before reading or writing its data, or before any tool that declares this as a required precondition (e.g. get_board_items_page, board_insights, create_item, create_items, update_items, change_item_column_values, update_column, create_view, create_view_table, update_view, update_view_table). Also use the views it returns to resolve a view referenced by name (pass that name in filters.views.names), and as the source of view ids for update_view and update_view_table. Each column\'s "settings" field is the raw API value for that existing column, shown so you can read current labels/config — it is NOT the format expected by the columnSettings parameter of create_column or update_column. Never copy a column\'s "settings" object verbatim into columnSettings — use get_column_type_info with fetchMode "schema" to get the correct shape for the column type you are creating or updating.'}getInputSchema(){return qf}async executeInternal(e){const{columnIds:t,viewIds:a,includeColumns:i,includeViews:n,unmatchedViewNames:o,availableViewNames:r}=await this.resolveFiltersAsync(e);if(e.filters?.views?.names?.length&&n&&void 0!==a&&0===a.length){const t=r.length>0?r.join(", "):"(none)";return{content:`None of the requested view names matched on board ${e.boardId}. Requested: ${e.filters.views.names.join(", ")}. Available views: ${t}.`}}const s={boardId:e.boardId.toString(),columnIds:i?t:void 0,viewIds:n?a:void 0,includeColumns:i,includeViews:n,includeSubscribers:!0===e.includeSubscribers},d=this.mondayApi.request(Vf,s),p=!0===e.includeKnowledge,l=p&&this.isKnowledgeEnabled()?this.mondayApi.request(Bf,{boardId:e.boardId.toString()},{versionOverride:"dev",timeout:1e3}).catch((t=>(this.context?.deps?.logger?.warn({err:t,boardId:e.boardId,timeoutMs:1e3},"Failed to fetch board knowledge"),null))):Promise.resolve(null),[c,m]=await Promise.all([d,l]),u=c.boards?.[0];if(!u)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const h=i?await this.getSubItemsBoardAsync(u):null;return{content:zf(u,h,o,m?.entity_knowledge??null,p)}}isKnowledgeEnabled(){return this.context?.deps?.flagChecker?.("mcp-get-board-info-entity-knowledge")??!0}async resolveFiltersAsync(e){const t=e.filters?.columns,a=e.filters?.views,i=Boolean(t?.only),n=Boolean(a?.only),o=void 0!==a?.ids,r=Boolean(a?.names?.length),s=!n||i,d=!i||n,p=s?t?.ids:void 0;if(!d)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(!o&&!r)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(o&&!r)return{columnIds:p,viewIds:a?.ids??[],includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};const l=await this.mondayApi.request(Mf,{boardId:e.boardId.toString()}),c=l.boards?.[0]?.views??[],m=c.map((e=>e?.name)).filter((e=>Boolean(e))),{viewIds:u,unmatchedViewNames:h}=((e,t)=>{const a=new Map;for(const t of e){if(!t?.id||!t.name)continue;const e=jf(t.name),i=a.get(e)??[];i.push(t.id),a.set(e,i)}const i=[],n=[];for(const e of t){const t=a.get(jf(e));t?.length?i.push(...t):n.push(e)}return{viewIds:i,unmatchedViewNames:n}})(c,a?.names??[]);return{columnIds:p,viewIds:[...new Set([...a?.ids??[],...u])],includeColumns:s,includeViews:d,unmatchedViewNames:h,availableViewNames:m}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===bm.Subtasks));if(!t)return null;const a=t.settings?.boardIds?.[0];if(!a||a===e.id)return null;const i=await this.mondayApi.request(Ff,{boardId:a});return i.boards?.[0]??null}},class extends ue{constructor(){super(...arguments),this.name="get_full_board_data",this.type=b.READ,this.annotations=me({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 Lf}async executeInternal(e){try{const t={boardId:e.boardId,itemsLimit:7};e.filters&&(t.queryParams={operator:e.filtersOperator,rules:e.filters.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute})))});const a=await this.mondayApi.request(Rf,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=a.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&n.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));const o=Array.from(n).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(Cf,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e])));return{content:{board:{id:i.id,name:i.name,columns:i.columns,items:i.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:r,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){nm(e,"get full board data")}}},class extends ue{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=b.READ,this.annotations=me({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 R_}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(I_);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=E_(s),p=await O_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}if(r){if(t||a||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(v_,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 d=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),p=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${d}`,l=await O_(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>A_)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>S_)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!t&&a&&!i)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(y_,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(g_,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:D_};s=await this.mondayApi.request(b_,t)}else if(t){const t={userIds:e.userIds,limit:D_};s=await this.mondayApi.request(f_,t)}else{const e={userIds:void 0,limit:D_};s=await this.mondayApi.request(__,e)}const d=E_(s),p=await O_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},Im,class extends ue{constructor(){super(...arguments),this.name="update_items",this.type=b.WRITE,this.annotations=me({title:"Update Multiple Items",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update column values for up to 40 items in a single call. Each update targets one item by itemId and sets one or more column values on it. Each update is independent - it can target its own board via boardId and set its own column values, so a single call can update many items across multiple boards, apply the same value to many items, or apply different values per item. Each update returns its own item_id and item_url on success or a raw error message on failure. Always pass the board id, either once as the batch boardId or on each update. For subitems, pass the subitems board id. To link board-relation columns, call link_board_items_workflow before using this tool. Board-relation and dependency responses include linked item IDs up to 1000. Larger lists are omitted with a count and a message confirming the update succeeded. [REQUIRED PRECONDITION]: Before using this tool, if you are not familiar with the board structure (column IDs, column types, status labels), first use get_board_info with filters.columns.only to get column metadata without fetching views. This is essential for constructing valid column values."}getInputSchema(){return this.context?.boardId?Am:Sm}async executeInternal(e){const t=e.updates.flatMap(((e,t)=>void 0===e.itemId?[Dm(new im("Item id is required",am),t)]:[]));if(t.length)throw new im(`${t.length} of ${e.updates.length} updates are missing the required itemId field`,am,t);this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const a=this.context?.boardId??e.boardId,i=e.updates.map((e=>e.boardId??a));await this.resolveMissingBoardIds(e.updates,i);const n=i.map(((e,t)=>null==e?t:-1)).filter((e=>e>=0));if(n.length>0)throw new im(`Missing boardId for update(s) at index ${n.join(", ")}, and their board could not be found from the itemId. Set a boardId on each update or provide a batch-level boardId. ${Tm}`,am);const o="Skipped: a previous update hit a rate limit; this update was not attempted",r=new Im(this.mondayApi),s=e.updates.map(((e,t)=>async()=>{const a=i[t],n=await r.execute({boardId:a,itemId:e.itemId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,board_id:a,...n.content}})),d=await hm(s,{limit:15,onSkipped:e=>({index:e,error:o,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:o,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:Dm(e,t)})}),p=d.filter((e=>"error"in e)).map((e=>e._errorEntry)),l=d.map((({_errorEntry:e,...t})=>t)),c=d.length,m=p.length,u={summary:{total:c,updated:c-m,failed:m},is_partial_success:m>0&&m<c,results:l};return p.length&&(u.errors=p),{content:u,...m===c?{isError:!0}:{}}}async resolveMissingBoardIds(e,t){const a=[...new Set(e.filter(((e,a)=>null==t[a])).map((e=>e.itemId)))];if(!a.length)return;const i=await this.mondayApi.request(wm,{itemIds:a.map(String),limit:a.length}),n=new Map((i.items??[]).flatMap((e=>e?.board?[[e.id,Number(e.board.id)]]:[])));let o=0;e.forEach(((e,a)=>{null==t[a]&&(t[a]=n.get(String(e.itemId)),null!=t[a]&&o++)})),o&&(this.sessionContext.metadata??={},this.sessionContext.metadata.board_ids_resolved_from_items=o)}},class extends ue{constructor(){super(...arguments),this.name="move_item_to_group",this.type=b.WRITE,this.annotations=me({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to another group on the same monday.com board. It cannot move an item to a different board."}getInputSchema(){return C_}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId};let a;try{a=await this.mondayApi.request(Pc,t)}catch(e){nm(e,"move item to group")}return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends ue{constructor(){super(...arguments),this.name="create_board",this.type=b.WRITE,this.annotations=me({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Km}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId,...void 0!==e.boardOwnerIds?{boardOwnerIds:e.boardOwnerIds}:{},...void 0!==e.useMlsTemplate?{useMlsTemplate:e.useMlsTemplate}:{},...void 0!==e.useDatasetTemplate?{useDatasetTemplate:e.useDatasetTemplate}:{}},a=await this.mondayApi.request(Vc,t);return{content:{message:`Board ${a.create_board?.id} successfully created`,board_id:a.create_board?.id,board_name:a.create_board?.name,board_url:a.create_board?.url}}}},class extends ue{constructor(){super(...arguments),this.name="use_template",this.type=b.WRITE,this.annotations=me({title:"Use Template",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Apply a monday.com template to create boards in a workspace. Returns a process_id immediately — the operation runs asynchronously and can take 30 seconds to 2+ minutes. Use check_template_status(processId) to poll every 5–10 seconds until status is COMPLETE or FAILED. Stop polling on COMPLETE (boards ready) or FAILED (unrecoverable error). Give up after ~5 minutes if neither terminal status is reached. Boards exist as empty shells until status is COMPLETE."}getInputSchema(){return Jm}async executeInternal(e){const t={templateId:e.templateId,destinationWorkspaceId:e.destinationWorkspaceId,destinationName:e.destinationName,boardKind:e.boardKind},a=await this.mondayApi.request(Qc,t),i=a.use_template?.process_id;return null==i?{content:{processId:null,message:"Failed to start template application. The request was rejected."}}:{content:{processId:i,message:"Template application started. Poll check_template_status with processId every 5–10 seconds. Stop on COMPLETE (boards ready) or FAILED (unrecoverable). Give up after ~5 minutes."}}}},class extends ue{constructor(){super(...arguments),this.name="check_template_status",this.type=b.READ,this.annotations=me({title:"Check Template Status",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Check the status of a use_template operation. Poll after calling use_template — wait 5–10 seconds between polls. Status values: PENDING | IN_PROGRESS | COMPLETE | FAILED. Stop polling when status is COMPLETE (boards ready) or FAILED (unrecoverable). Give up after ~5 minutes if neither terminal status is reached. Board IDs are only available once COMPLETE — boards exist but are empty during IN_PROGRESS. Returns null if process_id is invalid or expired (1-hour TTL)."}getInputSchema(){return Xm}async executeInternal(e){const t={processId:e.processId},a=(await this.mondayApi.request(Kc,t)).template_installation_status;return a?a.status===ip.Complete?{content:{status:ip.Complete,board_ids:a.board_ids,board_ids_map:a.board_ids_map,message:`Template application complete. ${a.board_ids.length} board(s) created.`}}:a.status===ip.Failed?{content:{status:ip.Failed,board_ids:[],board_ids_map:[],message:"Template application failed. Please try again."}}:a.status===ip.Pending||a.status===ip.InProgress?{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Template application ${a.status===ip.InProgress?"in progress":"pending"}. Board IDs will be available once complete.`}}:{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Unexpected status: ${a.status}. Poll again or contact support.`}}:{content:{status:null,message:"Status not found. The process_id is invalid or has expired."}}}},class extends ue{constructor(){super(...arguments),this.name="create_form",this.type=b.WRITE,this.annotations=me({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. Also creates a backing board to store responses. Returns the formToken for future mutations."}getInputSchema(){return Fu}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(yu,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends ue{constructor(){super(...arguments),this.name="update_form",this.type=b.WRITE,this.annotations=me({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new kh((()=>this.mondayApi)),this.actionHandlers=new Map([[rh.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[rh.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[rh.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[rh.activate,this.helpers.activateForm.bind(this.helpers)],[rh.createTag,this.helpers.createTag.bind(this.helpers)],[rh.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[rh.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[rh.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[rh.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[rh.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[rh.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return"Update a monday.com form. Use the action field to specify the operation. [REQUIRED PRECONDITION]: Call get_form first to read the current form state — you need it to resolve the formToken, and for actions that reference existing entities (updateQuestionOrder needs the question ids, deleteTag needs the tag id) or that overwrite existing settings (updateAppearance, updateAccessibility, updateFeatures, updateFormHeader)."}getInputSchema(){return Oh}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:"Received an invalid action for the update form tool."}}},class extends ue{constructor(){super(...arguments),this.name="get_form",this.type=b.READ,this.annotations=me({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token, including its pages, questions, question ids, settings, and conditional showIfRules. 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 formToken is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the formToken is abc123def456ghi789. Call this FIRST before any tool that acts on an existing form: create_form_submission (to know the questions and their constraints), form_questions_editor (to resolve question ids and current structure), and update_form (to see the current settings before changing them)."}getInputSchema(){return Rh}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(vu,t);return a.form?{content:{message:"Form retrieved",form_token:e.formToken,data:a.form}}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends ue{constructor(){super(...arguments),this.name="form_questions_editor",this.type=b.WRITE,this.annotations=me({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new oh((()=>this.mondayApi)),this.actionHandlers=new Map([[ah.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[ah.Update,this.helpers.updateQuestion.bind(this.helpers)],[ah.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form. [REQUIRED PRECONDITION]: For update and delete, call get_form first to resolve the exact question id and see its current type and settings — never guess a question id. For create, get_form shows the existing questions so you do not duplicate one."}getInputSchema(){return nh}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends ue{constructor(){super(...arguments),this.name="create_form_submission",this.type=b.WRITE,this.annotations=me({title:"Create WorkForm Submission",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Submit a response to a monday.com WorkForm. Use get_form first to retrieve the WorkForm, then:\n- Inspect each question's showIfRules to determine which questions are conditionally shown based on previous answers.\n- Inspect each question's settings for any answer constraints (e.g. rating limits, select options, label limits).\n- Take note of any titles, descriptions, and content blocks to present the form naturally as you walk the user through it.\n- Take note of pages and question order to present questions in the correct sequence.\nGather all answers upfront before calling this tool — do not submit one question at a time. Accepts a bare form token, a full WorkForm URL (e.g. https://forms.monday.com/forms/{form_token}?r=use1), or a shortened wkf.ms URL (e.g. https://wkf.ms/4tqP28t) — shortened URLs are automatically resolved by following the redirect. Returns the submission ID."}getInputSchema(){return Fh}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(e){if(e.includes("wkf.ms")){const t=(await I.default.head(e,{maxRedirects:0,validateStatus:e=>e<400})).headers.location;return t?this.extractTokenFromUrl(t):null}return e.startsWith("http://")||e.startsWith("https://")?this.extractTokenFromUrl(e):e}async executeInternal(e){const t=await this.resolveFormToken(e.form_token);if(!t)return{content:`Could not resolve a WorkForm token from "${e.form_token}". Please provide a valid WorkForm token or full WorkForm URL (e.g. https://forms.monday.com/forms/abc123).`};const a={form_token:t,answers:e.answers,form_timezone_offset:e.form_timezone_offset,password:e.password,tags:e.tags};try{const e=await this.mondayApi.request(Ch,a,{versionOverride:"dev"});return e.create_form_submission?{content:{message:"WorkForm submitted successfully",submission_id:e.create_form_submission.id}}:{content:`WorkForm with token ${t} was not found or is not accepting submissions. Verify the WorkForm token is correct, the WorkForm is active, and any required password was provided.`}}catch(e){nm(e,"submit form")}}},class extends ue{constructor(){super(...arguments),this.name="create_column",this.type=b.WRITE,this.annotations=me({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new column in a monday.com board. [REQUIRED PRECONDITION]: If the column needs type-specific configuration (columnSettings) — e.g. status/dropdown labels, formula definitions, number units — first call get_column_type_info with fetchMode "${Bm.Schema}" for that column type to learn the valid settings structure. Do not guess the settings shape. To give the new column AI behavior, create it here first, then call configure_ai_column.`}getInputSchema(){return this.context?.boardId?Bh:zh}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},i=await this.mondayApi.request(Mc,a);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends ue{constructor(){super(...arguments),this.name="update_column",this.type=b.WRITE,this.annotations=me({title:"Update Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Update properties of an existing monday.com column (title, description, settings). [REQUIRED PRECONDITION]: Uses optimistic concurrency control via the revision field — fetch the column id, type, and current revision via get_board_schema first (preferred), or get_board_info if you already have it, then call this tool. If the update fails because the revision is stale, re-fetch and try again. After a successful update, use the new revision returned in the response for any further update to this column, not the one you started with. [REQUIRED PRECONDITION]: If you are changing columnSettings, also call get_column_type_info with fetchMode "${Bm.Schema}" for that column type first to learn the valid settings structure. columnSettings is the flat payload for that column type (e.g. {"labels": [...]}) — not get_board_info's column.settings object copied as-is, and not wrapped again as {"settings": {"labels": [...]}}. To edit existing status or dropdown labels (rename, recolor, or reorder): first call get_board_info with filters.columns.ids for that column (or filters.columns.only) to read its current settings.labels, where each existing label's id lives. Editing an existing label requires sending its id in that label's entry — omitting it fails validation, since only a brand-new label can omit id. Status labels need the full label shape (id, label, color, index, and so on), not just a renamed string. Never invent an id — reuse the ids from get_board_info and add new labels without one. Flow: get_board_info for the revision and current settings.labels with ids, get_column_type_info (schema mode) for the valid shape, then build columnSettings.labels reusing existing ids and adding new labels without id. To turn on or change the column rollup (calculated capability, for columns on multi-level boards), set rollupFunction: numbers MIN/MAX/SUM/NONE, date MIN/MAX, timeline MIN_MAX, status COUNT_KEYS. To turn rollup off, pass rollupFunction: null (omitting it leaves rollup unchanged). rollupFunction is independent of columnSettings and can be sent alone or together with it.`}getInputSchema(){return this.context?.boardId?jh:qh}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnId:e.columnId,columnType:e.columnType,revision:e.revision,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings};void 0!==e.rollupFunction&&(a.capabilities={calculated:null===e.rollupFunction?null:{function:e.rollupFunction}});const i=await this.mondayApi.request(Bc,a);return{content:{message:"Column successfully updated. Use the new revision below for any subsequent update to this column.",column_id:i.update_column?.id,column_title:i.update_column?.title,revision:i.update_column?.revision}}}},class extends ue{constructor(){super(...arguments),this.name="create_group",this.type=b.WRITE,this.annotations=me({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 Kh}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(Yh,t);return{content:{message:"Group created successfully",group_id:a.create_group?.id,group_title:a.create_group?.title,board_id:e.boardId,group_name:e.groupName}}}},class extends ue{constructor(){super(...arguments),this.name="delete_column",this.type=b.WRITE,this.annotations=me({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board. This is irreversible — the column and all of its values are removed. [REQUIRED PRECONDITION]: Call get_board_schema or get_board_info first to resolve the exact columnId and confirm you are deleting the intended column. Never guess a column id."}getInputSchema(){return this.context?.boardId?Df:Nf}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(Fc,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},pm,class extends pm{constructor(e,t){super(e,t),this.name="all_api_read",this.type=b.READ,this.annotations=me({title:"Run read-only Query on the monday.com API",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Execute read-only GraphQL queries against the monday.com API. Only queries are accepted — mutations are rejected with an error before the request is sent. Use the get_type_details tool first to understand the schema before crafting your query."}async executeInternal(e){const t=pt(e.query);this.recordGraphqlOperationCounts(t);const a=bn(t);if(a?.operation===Oe.MUTATION)throw new im("all_api_read only accepts read queries. Mutations are not allowed.",em);return super.executeInternal(e)}},class extends pm{constructor(e,t){super(e,t),this.name="all_api_write",this.type=b.WRITE,this.annotations=me({title:"Run Mutation on the monday.com API",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Execute GraphQL mutations against the monday.com API to create, update, or delete data. Only mutations are accepted — queries are rejected with an error before the request is sent. Use get_graphql_schema and get_type_details tools first to understand the schema before crafting your mutation."}async executeInternal(e){const t=pt(e.query);this.recordGraphqlOperationCounts(t);const a=bn(t);if(a&&a.operation!==Oe.MUTATION)throw new im("all_api_write only accepts mutations. Read queries are not allowed.",em);return super.executeInternal(e)}},class extends ue{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=b.ALL_API,this.annotations=me({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 o_}async executeInternal(e){try{const t=await this.mondayApi.request(zc),a=e?.operationType,i=t.__schema,n="write"!==a?t.queryType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,o="read"!==a?t.mutationType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,r=i?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>({name:e.name,kind:e.kind??"unknown"})))??[];return{content:{message:"GraphQL schema retrieved",...void 0!==n&&{query_fields:n},...void 0!==o&&{mutation_fields:o},types:r}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends ue{constructor(){super(...arguments),this.name="get_column_type_info",this.type=b.READ,this.annotations=me({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Retrieves comprehensive information about a specific column type. Use fetchMode "${Bm.Schema}" (default) to get the JSON schema definition from the API — to understand structure, validation rules, and available properties for column settings. Call this BEFORE any tool that writes column settings: create_column, update_column, and manage_object_schema_columns. Use fetchMode "${Bm.Guidelines}" to get only guidelines.filter and guidelines.aggregation (no schema, no GraphQL round-trip). Call this before building any filter rule that uses compare_value/operator for that column type — e.g. get_board_items_page, board_insights, or a view's filters (create_view, create_view_table, update_view, update_view_table) — and before building board insights aggregation counts. `}getInputSchema(){return n_}async executeInternal(e){if(e.fetchMode===Bm.Guidelines)return{content:{message:`Column type guidelines for ${e.columnType}`,data:{guidelines:{filter:i_(e.columnType),aggregation:`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${xn.CountItems} function. Do not use ${xn.Count} function for that purpose.\n `}},url:t_}};const t={type:e.columnType},a=await this.mondayApi.request(e_,t);return a?.get_column_type_schema?{content:{message:`Column type schema for ${e.columnType}`,data:{schema:a.get_column_type_schema},url:t_}}:{content:`Information for column type "${e.columnType}" not found or not available.`}}},class extends ue{constructor(e,t){super("function"==typeof e?()=>sm(e()):sm(e),t),this.name="get_type_details",this.type=b.ALL_API,this.annotations=me({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, including its fields, input fields, and enum values. Call this with a known type name to confirm its exact fields, arguments, and enum values before referencing that type in an operation for all_monday_api, all_api_read, or all_api_write, so the fields and arguments you send actually exist."}getInputSchema(){return r_}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,Nc`
2882
+ `,Uv={};const Pv=[class extends ue{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=b.READ,this.annotations=me({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 Uv}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(Lv,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${lv} No boards found in your account. Please verify you have access to monday.com boards.`};const a=this.extractBoardPairs(t);return 0===a.length?{content:{message:"No monday-dev sprints board pairs found. ### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`;",boards_checked:t.length,pairs:[]}}:{content:{message:`Found ${a.length} matched pair(s)`,...a.length>1?{warning:"Multiple board pairs detected. Confirm with user which pair and workspace to use before any operation."}:{},pairs:a.map((e=>({sprints_board:{id:e.sprintsBoard.id,name:e.sprintsBoard.name,workspace_id:e.sprintsBoard.workspaceId,workspace_name:e.sprintsBoard.workspaceName},tasks_board:{id:e.tasksBoard.id,name:e.tasksBoard.name,workspace_id:e.tasksBoard.workspaceId,workspace_name:e.tasksBoard.workspaceName}}))),technical_reference:"Sprint Operations (all require correct board pair): Add to Sprint: Update `task_sprint` column with sprint item ID. Remove from Sprint: Clear `task_sprint` column (set to null). Search in Sprint: Filter where `task_sprint` equals sprint item ID. Move Between Sprints: Update `task_sprint` with new sprint item ID. Backlog Tasks: `task_sprint` is empty/null. Critical: `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}}}catch(e){return{content:`${_v} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}createBoardInfo(e,t,a){return{id:e,name:t?.name||a,workspaceId:t?.workspace?.id||"unknown",workspaceName:t?.workspace?.name||"Unknown"}}processSprintsBoard(e,t,a){const i=Rv(e,dv.SPRINT_TASKS);if(!i)return;const n=kv(i);if(!n)return;const o=`${e.id}:${n}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,t,a){const i=Rv(e,gv);if(!i)return;const n=kv(i);if(!n)return;const o=`${n}:${e.id}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(Nv(i)&&this.processSprintsBoard(i,a,t),Ov(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends ue{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=b.READ,this.annotations=me({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List the sprints of a monday-dev sprints board with their metadata.\n\nReturns comprehensive sprint metadata 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. If you do not already have it, call get_monday_dev_sprints_boards first to discover it.\n\n## Call this before:\n- get_sprint_summary — this tool returns the Sprint IDs that get_sprint_summary requires. Never guess a sprint ID."}getInputSchema(){return xv}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request($v,a),n=i.boards?.[0],o=n?.items_page?.items||[],r=this.buildSprintsMetadata(o);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:o.length,data:r}}}catch(e){return{content:`${_v} 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(Lc,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${lv} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${bv} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${_v} 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(dv),i=Sv(t,a);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((t=>{const a=(e=>yv[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=Tv(e,pv.SPRINT_ACTIVATION),a=Tv(e,pv.SPRINT_COMPLETION),i=Ev(e,pv.SPRINT_START_DATE),n=Ev(e,pv.SPRINT_END_DATE),o=((e,t)=>{const a=wv(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,pv.SPRINT_TIMELINE),r=Av(e,pv.SPRINT_SUMMARY);let s=vv.Planned;return a?s=vv.Completed:(t||i)&&(s=vv.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:i||null,end_date:n||null,is_completed:a,document_object_id:r||null}}))}},class extends ue{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=b.READ,this.annotations=me({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- Requires a sprintId. [REQUIRED PRECONDITION]: call get_sprints_metadata first to list the sprints on the board and resolve the sprintId (and to confirm the sprint is completed). If you do not know the sprints board ID either, start with get_monday_dev_sprints_boards.\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 Cv}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${_v} Unknown error occurred while getting sprint metadata`};const a=await this.readSprintSummaryDocument(t.documentObjectId);return a.success?{content:{message:"Sprint summary retrieved",sprint_id:e.sprintId,sprint_name:t.sprintName,markdown:a.content}}:{content:a.error||`${_v} Unknown error occurred while reading document content`}}catch(e){return{content:`${_v} 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(sv,t)).items||[];if(0===a.length)return{success:!1,error:`${cv} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${cv} Sprint with ID ${e} not found.`};const n=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(dv),...t];return Sv(a,i)})(i,[pv.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${bv} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=Av(i,pv.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${mv} No sprint summary document found for sprint "${i.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${_v} 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(Oc,t)).docs||[];if(0===a.length)return{success:!1,error:`${mv} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${uv} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(Wc,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${fv} 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:`${hv} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${_v} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],Vv=[class extends ue{constructor(){super(...arguments),this.name="delete_item",this.type=b.WRITE,this.annotations=me({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return kf}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request($c,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends ue{constructor(){super(...arguments),this.name="get_board_items_page",this.type=b.READ,this.annotations=me({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get all items from a monday.com board with pagination support and optional column values and item descriptions. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the nextCursor parameter from the response to get the next page of results when has_more is true. To retrieve an item description (the rich-text body/details of a monday.com item), set includeItemDescription to true — the response will include the item description document blocks with their content, type, and id. Use this whenever the user asks about an item description, body, details, or notes. [MULTI-LEVEL BOARDS]: The response includes hierarchy_type on the board ("multi_level" for MLS boards) and parent_item_id on each item. On multi-level boards, items form a tree (up to 5 levels). Use includeSubItems to get all descendants (returned flat with parent_item_id to reconstruct the tree). Top-level items have no parent_item_id. Subitems reference their parent. [REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board structure (column IDs, column types, status labels, etc.), first use get_board_info with filters.columns.only to get column metadata without fetching views. This is essential for constructing proper filters and knowing which columns are available. [VIRTUAL COLUMNS]: Four filterable columns exist that get_board_info never returns - "group" (the item\'s board group), "__creation_log__" (creation time), "__last_updated__" (update time) and "__item_id__" (item id). All four are also valid in orderBy, e.g. "__creation_log__" with direction "desc" to sort newest-first. Call get_column_type_info with the matching column type for each one\'s compareValue and operator rules. [REQUIRED PRECONDITION]: For board-relation / cross-board linking tasks, call link_board_items_workflow before using this tool. VIEW-BASED FILTERING: If the user refers to a board view by name (e.g. "show me items in the Overdue view"), first call get_board_info with filters.views.names set to that view name (avoids downloading all views on large boards), extract the matching view\'s filter field, then pass it as the filters argument here.'}getInputSchema(){return Zf}async executeInternal(e){const t=!e.cursor;if(t&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch(t){om(t),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeItemDescription,includeGroup:e.includeGroup};t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(Hf,a);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:ks.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],i=a?.items_page,n=i?.items||[];return{board:{id:a?.id,name:a?.name,hierarchy_type:a?.hierarchy_type||null},items:n.map((e=>this.mapItem(e,t))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,t){const a=e.parent_item?.id||null,i={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at,...a&&{parent_item_id:a}};if(t.includeColumns&&e.column_values){i.column_values={};for(const t of e.column_values)i.column_values[t.id]=this.getColumnValueData(t)}if(t.includeGroup&&"group"in e&&e.group&&(i.group={id:e.group.id,title:e.group.title}),t.includeItemDescription&&"description"in e&&e.description){const t=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));i.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(i.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),i}getColumnValueData(e){switch(e.type){case gm.BoardRelation:return e.linked_items;case gm.Formula:return e.display_value;case gm.Mirror:return"Column value type is not supported"}if("battery_value"in e)return e.battery_value;if(e.type===gm.Status)return e.text??null;if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const t={query:e.searchTerm,limit:20,boardIds:[e.boardId.toString()]},a=(await this.mondayApi.request(Wf,t,{versionOverride:"dev",timeout:hm})).search.items.results.map((e=>Number(e.id)));if(0===a.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 a;const n=new Set(i);return a.filter((e=>n.has(e)))}},af,class extends ue{constructor(){super(...arguments),this.name="create_items",this.type=b.WRITE,this.annotations=me({title:"Create Multiple Items",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create up to 20 new items in a single call. Each item is fully independent - it chooses its own groupId, parentItemId (for subitems), duplicateFromItemId (for bulk templating from an existing item), and createLabelsIfMissing. A single call can therefore span multiple groups, mix regular items with subitems under different parents, and mix fresh creates with duplicates of existing items. Each item returns its own item_id and item_url on success, or a raw error message on failure. Batch each parent's subitems into groups of up to 20. Wait for one batch to finish before starting the next batch for that parent. [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 with filters.columns.only to get column metadata without fetching views. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?nf:of}async executeInternal(e){const t=e.items.flatMap(((e,t)=>void 0===e.name?[df(new im("Item name is required",am),t)]:[]));if(t.length)throw new im(`${t.length} of ${e.items.length} items are missing the required name field`,am,t);const a=this.context?.boardId??e.boardId;this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.items.length;const i=new af(this.mondayApi,{boardId:a}),n="Skipped: a previous item hit a rate limit; this item was not attempted",o=e.items.map(((e,t)=>async()=>{const a=await i.execute({name:e.name,columnValues:e.columnValues,groupId:e.groupId,parentItemId:e.parentItemId,duplicateFromItemId:e.duplicateFromItemId,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,...a.content}})),r=await fm(o,{limit:15,concurrencyGroups:{getGroup:t=>e.items[t].parentItemId,limitPerGroup:5},onSkipped:e=>({index:e,error:n,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:n,path:["results",e]}}),onError:(t,a)=>({index:a,error:sf(t,e.items[a].parentItemId),_errorEntry:df(t,a)})}),s=r.filter((e=>"error"in e)).map((e=>e._errorEntry)),d=r.map((({_errorEntry:e,...t})=>t)),p=r.length,l=s.length,c={board_id:a,summary:{total:p,created:p-l,failed:l},is_partial_success:l>0&&l<p,results:d};return s.length&&(c.errors=s),{content:c,...l===p?{isError:!0}:{}}}},ff,class extends ue{constructor(){super(...arguments),this.name="create_updates",this.type=b.WRITE,this.annotations=me({title:"Create Multiple Updates",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create up to 40 updates (comments/posts) in a single call. Each entry is independent - it targets its own item, has its own body and mentions, and can reply to an existing update via parentId - so one call can post on many items, or post several replies. Use this instead of calling create_update repeatedly when posting more than one update. Each entry returns its own update_id and item_id on success or a raw error message on failure."}getInputSchema(){return _f}async executeInternal(e){this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const t="Skipped: a previous update hit a rate limit; this update was not attempted",a=new ff(this.mondayApi),i=e.updates.map(((e,t)=>async()=>{const i=await a.execute(e);return{index:t,...i.content}})),n=await fm(i,{limit:10,onSkipped:e=>({index:e,error:t,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:t,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:bf(e,t)})}),o=n.filter((e=>"error"in e)).map((e=>e._errorEntry)),r=n.map((({_errorEntry:e,...t})=>t)),s=n.length,d=o.length,p={summary:{total:s,created:s-d,failed:d},is_partial_success:d>0&&d<s,results:r};return o.length&&(p.errors=o),{content:p,...d===s?{isError:!0}:{}}}},class extends ue{constructor(){super(...arguments),this.name="delete_update",this.type=b.WRITE,this.annotations=me({title:"Delete Update",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an update (comment/post) from a monday.com item."}getInputSchema(){return yf}async executeInternal(e){try{const t={id:e.id.toString()},a=await this.mondayApi.request(gf,t);if(!a.delete_update?.id)throw new Error("Failed to delete update: update not found or already deleted");return{content:{message:`Update ${a.delete_update.id} successfully deleted`,update_id:a.delete_update.id}}}catch(e){nm(e,"delete update")}}},class extends ue{constructor(){super(...arguments),this.name="get_updates",this.type=b.READ,this.annotations=me({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from monday.com items or a board. Pass the IDs in objectIds and set objectType: up to 25 item IDs for Item, in one call instead of calling once per item, or one board ID for Board. Filter by date range with fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion. Set includeItemUpdates to true to also include updates on individual items, and add a date range to keep the response small. Returns update text (bodies over 2000 characters are truncated and flagged with text_body_truncated. To read one in full, call again with only that item's ID and includeFullText), creator info, timestamps, and optionally replies and assets."}getInputSchema(){return Ef}async executeInternal(e){try{const t=void 0!==e.fromDate;if(t!==(void 0!==e.toDate))throw new im("Both fromDate and toDate must be provided together for date range filtering",Jc);const a=[...new Set([...e.objectIds??[],...e.objectId?[e.objectId]:[]])];if(0===a.length)throw new im("Provide the IDs to read in objectIds",Jc);if(a.length>25)throw new im("objectIds takes up to 25 IDs",Jc);if(e.objectType===wf.Board&&1!==a.length)throw new im("Board queries take exactly one board ID in objectIds",Jc);const i=e.fromDate?Af(e.fromDate):void 0,n=e.toDate?Af(e.toDate,!0):void 0,o={page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};if(e.objectType===wf.Item){const t=e.limit??(a.length>1?10:25),r=((await this.mondayApi.request(vf,{...o,limit:t,itemIds:a,itemsLimit:a.length})).items??[]).filter((e=>!!e)),s=new Set(r.map((e=>e.id))),d=a.filter((e=>!s.has(e)));return{content:{message:"Updates retrieved",items:r.map((t=>{const a=(t.updates??[]).filter((e=>function(e,t,a){if(!t||!a)return!0;const i=e?Date.parse(e):NaN;return!Number.isNaN(i)&&i>=Date.parse(t)&&i<=Date.parse(a)}(e.created_at,i,n))).map((t=>Df(t,e)));return{item_id:t.id,url:t.url,updates:a,count:a.length}})),...d.length>0&&{not_found:d},pagination:{page:e.page??1,limit:t}}}}const[r]=a,s=e.limit??25,d=await this.mondayApi.request(If,{...o,limit:s,boardId:r,boardUpdatesOnly:!e.includeItemUpdates,...i&&n?{fromDate:i,toDate:n}:{}}),p=d.boards?.[0],l=p?.updates;if(!l||0===l.length)return{content:`No updates found for board with id ${r}`};const c=l.map((t=>Df(t,e)));return{content:{message:"Updates retrieved",board_id:r,url:p?.url,updates:c,pagination:{page:e.page??1,limit:s,count:c.length}}}}catch(e){nm(e,"get updates")}}},class extends ue{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=b.WRITE,this.annotations=me({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 Mg}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=Vg.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},i=await this.mondayApi.request(lf,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} successfully created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,next_steps:"Now call the full board data tool to get data, then immediately call the show table tool to show that data. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received."}}}catch(e){nm(e,"create update")}}},class extends ue{constructor(){super(...arguments),this.name="get_board_schema",this.type=b.READ,this.annotations=me({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id. Returns each column id, title, type, and revision, plus each group id and title. Call this before tools that need a column id, type, and revision resolved from schema: update_column (which also needs the revision returned here), delete_column, configure_ai_column, and remove_ai_from_column — get_board_info returns the same column id/type/revision fields and also satisfies this precondition, but prefer this tool when you only need columns and groups, not the rest of the board. For broader board metadata (owners, views, and their filters) use get_board_info instead — pass filters.views.ids / filters.views.names and/or filters.columns.ids there when you only need a subset."}getInputSchema(){if(!this.context?.boardId)return e_}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(Lc,a);return{content:{message:"Board schema retrieved",board_id:t,columns:i.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type,revision:e?.revision})))??[],groups:i.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends ue{constructor(){super(...arguments),this.name="get_board_activity",this.type=b.READ,this.annotations=me({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3,this.maxLookbackDays=90}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days, up to the last 90 days). Optionally filter by item ids or user ids to avoid fetching activity for the entire board. [REQUIRED PRECONDITION]: Call this with includeData=true before undo_action — it is the source of the action_record_uuid that identifies the action to undo."}getInputSchema(){return Vf}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-um.MONTH30Days),i=new Date(t.getTime()-this.maxLookbackDays*um.DAY);let n=e?.fromDate||a.toISOString();const o=new Date(n).getTime()<i.getTime();o&&(n=i.toISOString());const r=o?`. Note: fromDate was limited to the last ${this.maxLookbackDays} days, so the range starts at ${n}`:"",s=e?.toDate||t.toISOString(),d={boardId:e.boardId.toString(),itemIds:e.itemIds?.map(String),userIds:e.userIds?.map(String),fromDate:n,toDate:s,limit:this.defaultLimit,includeData:e.includeData??!1},p=await this.mondayApi.request(Pf,d),l=p.boards?.[0]?.activity_logs?.logs;if(!l||0===l.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${n} to ${s})${r}.`};const c=p.boards?.[0],m=e.includeData??!1;return{content:{message:`Board activity retrieved${r}`,board_id:e.boardId,board_name:c?.name,board_url:c?.url,data:l.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...m&&e.data?{data:e.data}:{}})))}}}},class extends ue{constructor(e,t,a){super(e,a),this.name="get_board_info",this.type=b.READ,this.annotations=me({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. "+(this.isKnowledgeEnabled()?"Set includeKnowledge to true when you need to interpret the board rather than just read its configuration: for example, choosing a status, label or column value from the user's intent instead of an exact name they gave, or explaining what statuses, columns or roles mean. Not needed for structural work such as column ids, types, revisions or views. Adds latency and may be null while knowledge is still being generated. ":"")+'Set includeSubscribers to true to also return the board\'s subscribers (people and AI agents) and team subscribers. Also returns the board\'s views (e.g. table views, filter views) — each view includes its id, name, type, and a structured filter object. On large boards, ALWAYS narrow the response: use filters.views.names or filters.views.ids when you only need specific views, and/or filters.columns.ids when you only need specific columns. Set filters.views.only or filters.columns.only when you want just that section — full views[].settings across many views can be multi-MB. The response includes hierarchy_type which indicates if the board is a multi-level board ("multi_level") where items can have nested subitems up to 5 levels deep on the same board. On multi-level boards, subitems share the same columns as parent items and subItemColumns will be null. Call this FIRST whenever you are not already familiar with a board structure (column IDs, column types, column revisions, status labels) — before reading or writing its data, or before any tool that declares this as a required precondition (e.g. get_board_items_page, board_insights, create_item, create_items, update_items, change_item_column_values, update_column, create_view, create_view_table, update_view, update_view_table). Also use the views it returns to resolve a view referenced by name (pass that name in filters.views.names), and as the source of view ids for update_view and update_view_table. Each column\'s "settings" field is the raw API value for that existing column, shown so you can read current labels/config — it is NOT the format expected by the columnSettings parameter of create_column or update_column. Never copy a column\'s "settings" object verbatim into columnSettings — use get_column_type_info with fetchMode "schema" to get the correct shape for the column type you are creating or updating.'}getInputSchema(){return Gf}async executeInternal(e){const{columnIds:t,viewIds:a,includeColumns:i,includeViews:n,unmatchedViewNames:o,availableViewNames:r}=await this.resolveFiltersAsync(e);if(e.filters?.views?.names?.length&&n&&void 0!==a&&0===a.length){const t=r.length>0?r.join(", "):"(none)";return{content:`None of the requested view names matched on board ${e.boardId}. Requested: ${e.filters.views.names.join(", ")}. Available views: ${t}.`}}const s={boardId:e.boardId.toString(),columnIds:i?t:void 0,viewIds:n?a:void 0,includeColumns:i,includeViews:n,includeSubscribers:!0===e.includeSubscribers},d=this.mondayApi.request(Mf,s),p=!0===e.includeKnowledge,l=p&&this.isKnowledgeEnabled()?this.mondayApi.request(zf,{boardId:e.boardId.toString()},{versionOverride:"dev",timeout:1e3}).catch((t=>(this.context?.deps?.logger?.warn({err:t,boardId:e.boardId,timeoutMs:1e3},"Failed to fetch board knowledge"),null))):Promise.resolve(null),[c,m]=await Promise.all([d,l]),u=c.boards?.[0];if(!u)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const h=i?await this.getSubItemsBoardAsync(u):null;return{content:jf(u,h,o,m?.entity_knowledge??null,p)}}isKnowledgeEnabled(){return this.context?.deps?.flagChecker?.("mcp-get-board-info-entity-knowledge")??!0}async resolveFiltersAsync(e){const t=e.filters?.columns,a=e.filters?.views,i=Boolean(t?.only),n=Boolean(a?.only),o=void 0!==a?.ids,r=Boolean(a?.names?.length),s=!n||i,d=!i||n,p=s?t?.ids:void 0;if(!d)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(!o&&!r)return{columnIds:p,viewIds:void 0,includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};if(o&&!r)return{columnIds:p,viewIds:a?.ids??[],includeColumns:s,includeViews:d,unmatchedViewNames:[],availableViewNames:[]};const l=await this.mondayApi.request(Ff,{boardId:e.boardId.toString()}),c=l.boards?.[0]?.views??[],m=c.map((e=>e?.name)).filter((e=>Boolean(e))),{viewIds:u,unmatchedViewNames:h}=((e,t)=>{const a=new Map;for(const t of e){if(!t?.id||!t.name)continue;const e=qf(t.name),i=a.get(e)??[];i.push(t.id),a.set(e,i)}const i=[],n=[];for(const e of t){const t=a.get(qf(e));t?.length?i.push(...t):n.push(e)}return{viewIds:i,unmatchedViewNames:n}})(c,a?.names??[]);return{columnIds:p,viewIds:[...new Set([...a?.ids??[],...u])],includeColumns:s,includeViews:d,unmatchedViewNames:h,availableViewNames:m}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===gm.Subtasks));if(!t)return null;const a=t.settings?.boardIds?.[0];if(!a||a===e.id)return null;const i=await this.mondayApi.request(Bf,{boardId:a});return i.boards?.[0]??null}},class extends ue{constructor(){super(...arguments),this.name="get_full_board_data",this.type=b.READ,this.annotations=me({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 Uf}async executeInternal(e){try{const t={boardId:e.boardId,itemsLimit:7};e.filters&&(t.queryParams={operator:e.filtersOperator,rules:e.filters.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute})))});const a=await this.mondayApi.request(Cf,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=a.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&n.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));const o=Array.from(n).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request($f,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e])));return{content:{board:{id:i.id,name:i.name,columns:i.columns,items:i.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:r,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){nm(e,"get full board data")}}},class extends ue{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=b.READ,this.annotations=me({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 C_}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(w_);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=A_(s),p=await k_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}if(r){if(t||a||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(I_,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 d=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),p=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${d}`,l=await k_(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>S_)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>D_)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!t&&a&&!i)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(v_,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(y_,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:N_};s=await this.mondayApi.request(g_,t)}else if(t){const t={userIds:e.userIds,limit:N_};s=await this.mondayApi.request(__,t)}else{const e={userIds:void 0,limit:N_};s=await this.mondayApi.request(b_,e)}const d=A_(s),p=await k_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},wm,class extends ue{constructor(){super(...arguments),this.name="update_items",this.type=b.WRITE,this.annotations=me({title:"Update Multiple Items",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update column values for up to 40 items in a single call. Each update targets one item by itemId and sets one or more column values on it. Each update is independent - it can target its own board via boardId and set its own column values, so a single call can update many items across multiple boards, apply the same value to many items, or apply different values per item. Each update returns its own item_id and item_url on success or a raw error message on failure. Always pass the board id, either once as the batch boardId or on each update. For subitems, pass the subitems board id. To link board-relation columns, call link_board_items_workflow before using this tool. Board-relation and dependency responses include linked item IDs up to 1000. Larger lists are omitted with a count and a message confirming the update succeeded. [REQUIRED PRECONDITION]: Before using this tool, if you are not familiar with the board structure (column IDs, column types, status labels), first use get_board_info with filters.columns.only to get column metadata without fetching views. This is essential for constructing valid column values."}getInputSchema(){return this.context?.boardId?Sm:Dm}async executeInternal(e){const t=e.updates.flatMap(((e,t)=>void 0===e.itemId?[Nm(new im("Item id is required",am),t)]:[]));if(t.length)throw new im(`${t.length} of ${e.updates.length} updates are missing the required itemId field`,am,t);this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const a=this.context?.boardId??e.boardId,i=e.updates.map((e=>e.boardId??a));await this.resolveMissingBoardIds(e.updates,i);const n=i.map(((e,t)=>null==e?t:-1)).filter((e=>e>=0));if(n.length>0)throw new im(`Missing boardId for update(s) at index ${n.join(", ")}, and their board could not be found from the itemId. Set a boardId on each update or provide a batch-level boardId. ${Em}`,am);const o="Skipped: a previous update hit a rate limit; this update was not attempted",r=new wm(this.mondayApi),s=e.updates.map(((e,t)=>async()=>{const a=i[t],n=await r.execute({boardId:a,itemId:e.itemId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,board_id:a,...n.content}})),d=await fm(s,{limit:15,onSkipped:e=>({index:e,error:o,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:o,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:Nm(e,t)})}),p=d.filter((e=>"error"in e)).map((e=>e._errorEntry)),l=d.map((({_errorEntry:e,...t})=>t)),c=d.length,m=p.length,u={summary:{total:c,updated:c-m,failed:m},is_partial_success:m>0&&m<c,results:l};return p.length&&(u.errors=p),{content:u,...m===c?{isError:!0}:{}}}async resolveMissingBoardIds(e,t){const a=[...new Set(e.filter(((e,a)=>null==t[a])).map((e=>e.itemId)))];if(!a.length)return;const i=await this.mondayApi.request(Tm,{itemIds:a.map(String),limit:a.length}),n=new Map((i.items??[]).flatMap((e=>e?.board?[[e.id,Number(e.board.id)]]:[])));let o=0;e.forEach(((e,a)=>{null==t[a]&&(t[a]=n.get(String(e.itemId)),null!=t[a]&&o++)})),o&&(this.sessionContext.metadata??={},this.sessionContext.metadata.board_ids_resolved_from_items=o)}},class extends ue{constructor(){super(...arguments),this.name="move_item_to_group",this.type=b.WRITE,this.annotations=me({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to another group on the same monday.com board. It cannot move an item to a different board."}getInputSchema(){return $_}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId};let a;try{a=await this.mondayApi.request(Pc,t)}catch(e){nm(e,"move item to group")}return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends ue{constructor(){super(...arguments),this.name="create_board",this.type=b.WRITE,this.annotations=me({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Jm}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId,...void 0!==e.boardOwnerIds?{boardOwnerIds:e.boardOwnerIds}:{},...void 0!==e.useMlsTemplate?{useMlsTemplate:e.useMlsTemplate}:{},...void 0!==e.useDatasetTemplate?{useDatasetTemplate:e.useDatasetTemplate}:{}},a=await this.mondayApi.request(Vc,t);return{content:{message:`Board ${a.create_board?.id} successfully created`,board_id:a.create_board?.id,board_name:a.create_board?.name,board_url:a.create_board?.url}}}},class extends ue{constructor(){super(...arguments),this.name="use_template",this.type=b.WRITE,this.annotations=me({title:"Use Template",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Apply a monday.com template to create boards in a workspace. Returns a process_id immediately — the operation runs asynchronously and can take 30 seconds to 2+ minutes. Use check_template_status(processId) to poll every 5–10 seconds until status is COMPLETE or FAILED. Stop polling on COMPLETE (boards ready) or FAILED (unrecoverable error). Give up after ~5 minutes if neither terminal status is reached. Boards exist as empty shells until status is COMPLETE."}getInputSchema(){return Xm}async executeInternal(e){const t={templateId:e.templateId,destinationWorkspaceId:e.destinationWorkspaceId,destinationName:e.destinationName,boardKind:e.boardKind},a=await this.mondayApi.request(Qc,t),i=a.use_template?.process_id;return null==i?{content:{processId:null,message:"Failed to start template application. The request was rejected."}}:{content:{processId:i,message:"Template application started. Poll check_template_status with processId every 5–10 seconds. Stop on COMPLETE (boards ready) or FAILED (unrecoverable). Give up after ~5 minutes."}}}},class extends ue{constructor(){super(...arguments),this.name="check_template_status",this.type=b.READ,this.annotations=me({title:"Check Template Status",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Check the status of a use_template operation. Poll after calling use_template — wait 5–10 seconds between polls. Status values: PENDING | IN_PROGRESS | COMPLETE | FAILED. Stop polling when status is COMPLETE (boards ready) or FAILED (unrecoverable). Give up after ~5 minutes if neither terminal status is reached. Board IDs are only available once COMPLETE — boards exist but are empty during IN_PROGRESS. Returns null if process_id is invalid or expired (1-hour TTL)."}getInputSchema(){return Zm}async executeInternal(e){const t={processId:e.processId},a=(await this.mondayApi.request(Kc,t)).template_installation_status;return a?a.status===ip.Complete?{content:{status:ip.Complete,board_ids:a.board_ids,board_ids_map:a.board_ids_map,message:`Template application complete. ${a.board_ids.length} board(s) created.`}}:a.status===ip.Failed?{content:{status:ip.Failed,board_ids:[],board_ids_map:[],message:"Template application failed. Please try again."}}:a.status===ip.Pending||a.status===ip.InProgress?{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Template application ${a.status===ip.InProgress?"in progress":"pending"}. Board IDs will be available once complete.`}}:{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Unexpected status: ${a.status}. Poll again or contact support.`}}:{content:{status:null,message:"Status not found. The process_id is invalid or has expired."}}}},class extends ue{constructor(){super(...arguments),this.name="create_form",this.type=b.WRITE,this.annotations=me({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. Also creates a backing board to store responses. Returns the formToken for future mutations."}getInputSchema(){return Bu}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(vu,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends ue{constructor(){super(...arguments),this.name="update_form",this.type=b.WRITE,this.annotations=me({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Rh((()=>this.mondayApi)),this.actionHandlers=new Map([[sh.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[sh.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[sh.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[sh.activate,this.helpers.activateForm.bind(this.helpers)],[sh.createTag,this.helpers.createTag.bind(this.helpers)],[sh.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[sh.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[sh.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[sh.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[sh.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[sh.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return"Update a monday.com form. Use the action field to specify the operation. [REQUIRED PRECONDITION]: Call get_form first to read the current form state — you need it to resolve the formToken, and for actions that reference existing entities (updateQuestionOrder needs the question ids, deleteTag needs the tag id) or that overwrite existing settings (updateAppearance, updateAccessibility, updateFeatures, updateFormHeader)."}getInputSchema(){return kh}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:"Received an invalid action for the update form tool."}}},class extends ue{constructor(){super(...arguments),this.name="get_form",this.type=b.READ,this.annotations=me({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token, including its pages, questions, question ids, settings, and conditional showIfRules. 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 formToken is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the formToken is abc123def456ghi789. Call this FIRST before any tool that acts on an existing form: create_form_submission (to know the questions and their constraints), form_questions_editor (to resolve question ids and current structure), and update_form (to see the current settings before changing them)."}getInputSchema(){return Ch}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Iu,t);return a.form?{content:{message:"Form retrieved",form_token:e.formToken,data:a.form}}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends ue{constructor(){super(...arguments),this.name="form_questions_editor",this.type=b.WRITE,this.annotations=me({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new rh((()=>this.mondayApi)),this.actionHandlers=new Map([[ih.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[ih.Update,this.helpers.updateQuestion.bind(this.helpers)],[ih.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form. [REQUIRED PRECONDITION]: For update and delete, call get_form first to resolve the exact question id and see its current type and settings — never guess a question id. For create, get_form shows the existing questions so you do not duplicate one."}getInputSchema(){return oh}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends ue{constructor(){super(...arguments),this.name="create_form_submission",this.type=b.WRITE,this.annotations=me({title:"Create WorkForm Submission",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Submit a response to a monday.com WorkForm. Use get_form first to retrieve the WorkForm, then:\n- Inspect each question's showIfRules to determine which questions are conditionally shown based on previous answers.\n- Inspect each question's settings for any answer constraints (e.g. rating limits, select options, label limits).\n- Take note of any titles, descriptions, and content blocks to present the form naturally as you walk the user through it.\n- Take note of pages and question order to present questions in the correct sequence.\nGather all answers upfront before calling this tool — do not submit one question at a time. Accepts a bare form token, a full WorkForm URL (e.g. https://forms.monday.com/forms/{form_token}?r=use1), or a shortened wkf.ms URL (e.g. https://wkf.ms/4tqP28t) — shortened URLs are automatically resolved by following the redirect. Returns the submission ID."}getInputSchema(){return Bh}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(e){if(e.includes("wkf.ms")){const t=(await I.default.head(e,{maxRedirects:0,validateStatus:e=>e<400})).headers.location;return t?this.extractTokenFromUrl(t):null}return e.startsWith("http://")||e.startsWith("https://")?this.extractTokenFromUrl(e):e}async executeInternal(e){const t=await this.resolveFormToken(e.form_token);if(!t)return{content:`Could not resolve a WorkForm token from "${e.form_token}". Please provide a valid WorkForm token or full WorkForm URL (e.g. https://forms.monday.com/forms/abc123).`};const a={form_token:t,answers:e.answers,form_timezone_offset:e.form_timezone_offset,password:e.password,tags:e.tags};try{const e=await this.mondayApi.request($h,a,{versionOverride:"dev"});return e.create_form_submission?{content:{message:"WorkForm submitted successfully",submission_id:e.create_form_submission.id}}:{content:`WorkForm with token ${t} was not found or is not accepting submissions. Verify the WorkForm token is correct, the WorkForm is active, and any required password was provided.`}}catch(e){nm(e,"submit form")}}},class extends ue{constructor(){super(...arguments),this.name="create_column",this.type=b.WRITE,this.annotations=me({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new column in a monday.com board. [REQUIRED PRECONDITION]: If the column needs type-specific configuration (columnSettings) — e.g. status/dropdown labels, formula definitions, number units — first call get_column_type_info with fetchMode "${zm.Schema}" for that column type to learn the valid settings structure. Do not guess the settings shape. To give the new column AI behavior, create it here first, then call configure_ai_column.`}getInputSchema(){return this.context?.boardId?zh:jh}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},i=await this.mondayApi.request(Mc,a);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends ue{constructor(){super(...arguments),this.name="update_column",this.type=b.WRITE,this.annotations=me({title:"Update Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Update properties of an existing monday.com column (title, description, settings). [REQUIRED PRECONDITION]: Uses optimistic concurrency control via the revision field — fetch the column id, type, and current revision via get_board_schema first (preferred), or get_board_info if you already have it, then call this tool. If the update fails because the revision is stale, re-fetch and try again. After a successful update, use the new revision returned in the response for any further update to this column, not the one you started with. [REQUIRED PRECONDITION]: If you are changing columnSettings, also call get_column_type_info with fetchMode "${zm.Schema}" for that column type first to learn the valid settings structure. columnSettings is the flat payload for that column type (e.g. {"labels": [...]}) — not get_board_info's column.settings object copied as-is, and not wrapped again as {"settings": {"labels": [...]}}. To edit existing status or dropdown labels (rename, recolor, or reorder): first call get_board_info with filters.columns.ids for that column (or filters.columns.only) to read its current settings.labels, where each existing label's id lives. Editing an existing label requires sending its id in that label's entry — omitting it fails validation, since only a brand-new label can omit id. Status labels need the full label shape (id, label, color, index, and so on), not just a renamed string. Never invent an id — reuse the ids from get_board_info and add new labels without one. Flow: get_board_info for the revision and current settings.labels with ids, get_column_type_info (schema mode) for the valid shape, then build columnSettings.labels reusing existing ids and adding new labels without id. To turn on or change the column rollup (calculated capability, for columns on multi-level boards), set rollupFunction: numbers MIN/MAX/SUM/NONE, date MIN/MAX, timeline MIN_MAX, status COUNT_KEYS. To turn rollup off, pass rollupFunction: null (omitting it leaves rollup unchanged). rollupFunction is independent of columnSettings and can be sent alone or together with it.`}getInputSchema(){return this.context?.boardId?qh:Gh}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnId:e.columnId,columnType:e.columnType,revision:e.revision,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings};void 0!==e.rollupFunction&&(a.capabilities={calculated:null===e.rollupFunction?null:{function:e.rollupFunction}});const i=await this.mondayApi.request(Bc,a);return{content:{message:"Column successfully updated. Use the new revision below for any subsequent update to this column.",column_id:i.update_column?.id,column_title:i.update_column?.title,revision:i.update_column?.revision}}}},class extends ue{constructor(){super(...arguments),this.name="create_group",this.type=b.WRITE,this.annotations=me({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 Jh}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(Qh,t);return{content:{message:"Group created successfully",group_id:a.create_group?.id,group_title:a.create_group?.title,board_id:e.boardId,group_name:e.groupName}}}},class extends ue{constructor(){super(...arguments),this.name="delete_column",this.type=b.WRITE,this.annotations=me({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board. This is irreversible — the column and all of its values are removed. [REQUIRED PRECONDITION]: Call get_board_schema or get_board_info first to resolve the exact columnId and confirm you are deleting the intended column. Never guess a column id."}getInputSchema(){return this.context?.boardId?Nf:Of}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(Fc,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},lm,class extends lm{constructor(e,t){super(e,t),this.name="all_api_read",this.type=b.READ,this.annotations=me({title:"Run read-only Query on the monday.com API",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Execute read-only GraphQL queries against the monday.com API. Only queries are accepted — mutations are rejected with an error before the request is sent. Use the get_type_details tool first to understand the schema before crafting your query."}async executeInternal(e){const t=pt(e.query);this.recordGraphqlOperationCounts(t);const a=bn(t);if(a?.operation===Oe.MUTATION)throw new im("all_api_read only accepts read queries. Mutations are not allowed.",em);return super.executeInternal(e)}},class extends lm{constructor(e,t){super(e,t),this.name="all_api_write",this.type=b.WRITE,this.annotations=me({title:"Run Mutation on the monday.com API",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Execute GraphQL mutations against the monday.com API to create, update, or delete data. Only mutations are accepted — queries are rejected with an error before the request is sent. Use get_graphql_schema and get_type_details tools first to understand the schema before crafting your mutation."}async executeInternal(e){const t=pt(e.query);this.recordGraphqlOperationCounts(t);const a=bn(t);if(a&&a.operation!==Oe.MUTATION)throw new im("all_api_write only accepts mutations. Read queries are not allowed.",em);return super.executeInternal(e)}},class extends ue{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=b.ALL_API,this.annotations=me({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 r_}async executeInternal(e){try{const t=await this.mondayApi.request(zc),a=e?.operationType,i=t.__schema,n="write"!==a?t.queryType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,o="read"!==a?t.mutationType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,r=i?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>({name:e.name,kind:e.kind??"unknown"})))??[];return{content:{message:"GraphQL schema retrieved",...void 0!==n&&{query_fields:n},...void 0!==o&&{mutation_fields:o},types:r}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends ue{constructor(){super(...arguments),this.name="get_column_type_info",this.type=b.READ,this.annotations=me({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Retrieves comprehensive information about a specific column type. Use fetchMode "${zm.Schema}" (default) to get the JSON schema definition from the API — to understand structure, validation rules, and available properties for column settings. Call this BEFORE any tool that writes column settings: create_column, update_column, and manage_object_schema_columns. Use fetchMode "${zm.Guidelines}" to get only guidelines.filter and guidelines.aggregation (no schema, no GraphQL round-trip). Call this before building any filter rule that uses compare_value/operator for that column type — e.g. get_board_items_page, board_insights, or a view's filters (create_view, create_view_table, update_view, update_view_table) — and before building board insights aggregation counts. `}getInputSchema(){return o_}async executeInternal(e){if(e.fetchMode===zm.Guidelines)return{content:{message:`Column type guidelines for ${e.columnType}`,data:{guidelines:{filter:n_(e.columnType),aggregation:`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${xn.CountItems} function. Do not use ${xn.Count} function for that purpose.\n `}},url:a_}};const t={type:e.columnType},a=await this.mondayApi.request(t_,t);return a?.get_column_type_schema?{content:{message:`Column type schema for ${e.columnType}`,data:{schema:a.get_column_type_schema},url:a_}}:{content:`Information for column type "${e.columnType}" not found or not available.`}}},class extends ue{constructor(e,t){super("function"==typeof e?()=>dm(e()):dm(e),t),this.name="get_type_details",this.type=b.ALL_API,this.annotations=me({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, including its fields, input fields, and enum values. Call this with a known type name to confirm its exact fields, arguments, and enum values before referencing that type in an operation for all_monday_api, all_api_read, or all_api_write, so the fields and arguments you send actually exist."}getInputSchema(){return s_}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,Nc`
2863
2883
  query getTypeDetails {
2864
2884
  __type(name: "${t}") {
2865
2885
  name
@@ -2947,5 +2967,5 @@
2947
2967
  }
2948
2968
  }
2949
2969
  }
2950
- `),i=await this.mondayApi.request(a);return i.__type?{content:{message:"Type details retrieved",data:{name:i.__type.name,kind:i.__type.kind,description:i.__type.description??null,fields:i.__type.fields??[],inputFields:i.__type.inputFields??[],interfaces:i.__type.interfaces??[],enumValues:i.__type.enumValues??[],possibleTypes:i.__type.possibleTypes??[]}}}:{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`}}catch(e){const t=e instanceof Error?e.message:"Unknown error",a=t.includes("JSON");return{content:`Error fetching type details: ${t}${a?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var t}},class extends ue{constructor(){super(...arguments),this.name="create_custom_activity",this.type=b.WRITE,this.annotations=me({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return Gh}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(qc,t),{content:{message:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`,name:e.name,color:e.color,icon_id:e.icon_id}}}},class extends ue{constructor(){super(...arguments),this.name="create_notification",this.type=b.WRITE,this.annotations=me({title:"Create Notification",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Send a notification to a user via the bell icon and optionally by email. Use target_type "Post" for updates/replies or "Project" for items/boards.'}getInputSchema(){return Wh}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{const a=await this.mondayApi.request(Hh,t);if(!a.create_notification?.id)throw new im(`No notification was created for user ${e.user_id} on ${e.target_type} target ${e.target_id}. Verify the user has access to the target and that target_id matches target_type ("Post" for an update/reply id, "Project" for an item/board id).`,tm);return{content:{message:`Notification ${a.create_notification.id} sent to user ${e.user_id}`,notification_id:a.create_notification.id,user_id:e.user_id,target_id:e.target_id,target_type:e.target_type,text:a.create_notification.text??e.text}}}catch(t){nm(t,`send notification to user ${e.user_id}`)}}},class extends ue{constructor(){super(...arguments),this.name="create_timeline_item",this.type=b.WRITE,this.annotations=me({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return df}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(Gc,t);return{content:{message:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`,timeline_item_id:a.create_timeline_item?.id,item_id:e.item_id,title:e.title}}}},class extends ue{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=b.READ,this.annotations=me({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return kf}async executeInternal(e){const t=await this.mondayApi.request(Hc);if(!t.custom_activity||0===t.custom_activity.length)return{content:{message:"No custom activities found",data:[]}};const a=t.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:{message:`Found ${a.length} custom activities`,data:a}}}},class extends ue{constructor(){super(...arguments),this.name="read_docs",this.type=b.READ,this.annotations=me({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get information about monday.com documents. Supports two modes:\n\nMODE: "content" (default) — Fetch documents with their full markdown content.\n- Requires: type ("ids" | "object_ids" | "workspace_ids") and ids array\n- For a doc that lives as a board view, pass board_id and view_id instead of type/ids. They are the ids in the board URL: https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Omit view_id to read every doc view of the board. Such docs cannot be found by type "ids"/"object_ids".\n- Supports pagination via page/limit. Check has_more_pages in response.\n- If type "ids" returns no results, automatically retries with object_ids.\n- Set include_blocks: true to include block IDs, types, and positions in the response — required before calling update_doc.\n- Blocks default to 25 per page. Use blocks_limit and blocks_page to paginate through long documents.\n- Set include_comments: true to fetch all comments and replies on the document. Each comment is enriched with anchor info (block_id, selection_from, selection_length) indicating which block and text range it\'s attached to. Use comments_limit to control how many comments per item (default 50).\n\nMODE: "version_history" — Fetch the edit history of a single document.\n- Requires: ids with the document\'s object_id (use the object_id field from content mode results, NOT the id field).\n- The object_id is the numeric ID visible in the document URL.\n- Returns restoring points sorted newest-first. Use version_history_limit to cap results (e.g., "last 3 changes" → version_history_limit: 3).\n- Use since/until to filter by time range. If omitted, returns full history.\n- Set include_diff: true to see what content changed between versions (fetches up to 10 diffs, may be slower).\n- Examples:\n - { mode: "version_history", ids: ["5001466606"], version_history_limit: 3 }\n - { mode: "version_history", ids: ["5001466606"], since: "2026-03-11T00:00:00Z", include_diff: true }'}getInputSchema(){return J_}async executeInternal(e){return e.mode===Q_?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!(e.board_id||e.type&&e.ids&&0!==e.ids.length))return{content:'Error: type and ids are required when mode is "content", unless board_id is provided.'};let t,a,i;switch(this.sessionContext.metadata={...this.sessionContext.metadata,mode:e.mode??Y_,include_comments:e.include_comments??!1,include_blocks:e.include_blocks??!1,...e.board_id&&{board_id:e.board_id,view_id:e.view_id}},e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":i=e.ids}const n=e.include_blocks??!1,o=n?{blocksLimit:e.blocks_limit,blocksPage:e.blocks_page}:{},r={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n,...o};if(e.board_id){const t=await G_(this.mondayApi,e.board_id,e.view_id,{includeBlocks:n,blocksLimit:e.blocks_limit,blocksPage:e.blocks_page});return 0===t.length?{content:W_(e.board_id,e.view_id)}:(this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:t.map((e=>e.id)),object_ids:t.flatMap((e=>e.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(t,r,n,e.include_comments??!1,e.comments_limit??50,e.blocks_limit,e.blocks_page))}let s=await this.mondayApi.request(Oc,r);if((!s.docs||0===s.docs.length)&&t){const a={ids:void 0,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n,...o};s=await this.mondayApi.request(Oc,a)}if(!s.docs||0===s.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const d=e.include_comments??!1,p=e.comments_limit??50;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:s.docs.flatMap((e=>e?[e.id]:[])),object_ids:s.docs.flatMap((e=>e?.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(s.docs,r,n,d,p,e.blocks_limit,e.blocks_page)}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}async executeVersionHistory(e){const{include_diff:t,since:a,until:i,version_history_limit:n}=e,o=e.ids?.[0];if(!o)return{content:'Error: ids is required when mode is "version_history". Provide the document object_id.'};this.sessionContext.metadata={...this.sessionContext.metadata,mode:Q_,object_ids:[o]};try{const e={docId:o,since:a,until:i},r=await this.mondayApi.request(kc,e);let s=r?.doc_version_history?.restoring_points;if(!s||0===s.length)return{content:`No version history found for document ${o}${a?` from ${a}`:""}.`};if(!t)return n&&(s=s.slice(0,n)),{content:{doc_id:o,since:a,until:i,restoring_points:s}};const d=Math.min(n??10,10),p=s.slice(0,d+1),l=s.length>d,c=(await Promise.allSettled(p.map((async(e,t)=>{if(t===p.length-1||!e.date)return e;const a=p[t+1];if(!a?.date)return e;const i={docId:o,date:e.date,prevDate:a.date},n=await this.mondayApi.request(Cc,i);return{...e,diff:n?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,t)=>"fulfilled"===e.status?e.value:p[t]))))).slice(0,d);return{content:{doc_id:o,since:a,until:i,restoring_points:c,...l&&{truncated:!0,total_count:s.length}}}}catch(e){return{content:`Error fetching version history for document ${o}: ${e instanceof Error?e.message:"Unknown error"}`}}}buildCommentAnchorMap(e){const t=new Map;for(const a of e){const e=a.content?.deltaFormat;if(!e||!Array.isArray(e))continue;let i=0;for(const n of e){const e=n.insert,o="string"==typeof e?e.length:1,r=n.attributes,s=r?.comments;if(s&&Array.isArray(s))for(const e of s){const n=String(e),r=t.get(n);if(r&&r.block_id===a.id){const e=Math.max(r.selection_from+r.selection_length,i+o);r.selection_length=e-r.selection_from}else r||t.set(n,{block_id:a.id,selection_from:i,selection_length:o})}i+=o}}return t}async fetchDocComments(e,t,a){try{const i={boardId:e,itemsLimit:100,updatesLimit:a},[n,o]=await Promise.all([this.mondayApi.request(Rc,i),this.mondayApi.request(B_,{docId:t}).catch((()=>null))]),r=n.boards?.[0]?.items_page?.items;if(!r)return[];let s=new Map;if(o){const e=(o.docs?.[0]?.blocks??[]).filter((e=>null!=e)).map((e=>{let t;if("string"==typeof e.content)try{t=JSON.parse(e.content)}catch{t={}}else t=e.content??{};return{id:e.id??"",type:e.type??"",content:t}}));s=this.buildCommentAnchorMap(e)}const d=[];for(const e of r)if(e.updates&&0!==e.updates.length)for(const t of e.updates)d.push({id:t.id,text_body:t.text_body,body:t.body,created_at:t.created_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:e.id,item_name:e.name,anchor:s.get(t.id)??null,replies:(t.replies??[]).map((e=>({id:e.id,text_body:e.text_body,body:e.body,created_at:e.created_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))});return d}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,i=!1,n=50,o,r){const s=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t,s="";try{const t={docId:e.id},a=await this.mondayApi.request(Wc,t);s=a.export_markdown_from_doc.success&&a.export_markdown_from_doc.markdown?a.export_markdown_from_doc.markdown:`Error getting markdown: ${a.export_markdown_from_doc.error||"Unknown error"}`}catch(e){s=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return i&&e.object_id&&(t=await this.fetchDocComments(e.object_id,e.id,n)),{id:e.id,object_id:e.object_id,name:e.name,doc_kind:e.doc_kind,created_at:e.created_at,created_by:e.created_by?.name||"Unknown",url:e.url,relative_url:e.relative_url,workspace:e.workspace?.name||"Unknown",workspace_id:e.workspace_id,doc_folder_id:e.doc_folder_id,settings:e.settings,...a&&{blocks:(e.blocks??[]).filter((e=>null!=e)).map((e=>({id:e.id,type:e.type,parent_block_id:e.parent_block_id,position:e.position,content:e.content}))),...void 0!==o||void 0!==r?{blocks_pagination:{current_page:r??1,limit:o??25,count:(e.blocks??[]).filter((e=>null!=e)).length,has_more_pages:(e.blocks??[]).length===(o??25)}}:{}},blocks_as_markdown:s,...i&&{comments:t}}}))),d=t.page||1,p=t.limit||25,l=s.length,c=l===p;return{content:{message:`Documents retrieved (${s.length})`,pagination:{current_page:d,limit:p,count:l,has_more_pages:c},data:s}}}},class extends ue{constructor(){super(...arguments),this.name="workspace_info",this.type=b.READ,this.annotations=me({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 X_}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(Yc,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e,t){const{workspaces:a,boards:i,docs:n,folders:o}=e,r=a?.[0];if(!r)throw new Error("No workspace found");const s=new Map((o||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),d=[];(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(t):d.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&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(t):p.push(t)})),{workspace:{id:r.id,name:r.name,url:t?k_(t,r.id):void 0,description:r.description||"",kind:r.kind||"",created_at:r.created_at||"",state:r.state||"",is_default_workspace:r.is_default_workspace||!1,owners_subscribers:(r.owners_subscribers||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name&&null!=e.email)).map((e=>({id:e.id,name:e.name,email:e.email})))},folders:Array.from(s.values()),root_items:{boards:d,docs:p}}}(a,await O_(this.mondayApi));return{content:{message:"Workspace info retrieved",data:i}}}},class extends ue{constructor(){super(...arguments),this.name="list_workspaces",this.type=b.READ,this.annotations=me({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'List all workspaces available to the user, ordered by membership (user\'s workspaces first). Returns workspaces with their ID, name, and description.\n[IMPORTANT] To search for workspaces by name, use the "search" tool with searchType WORKSPACES instead — it provides faster and more accurate results.'}getInputSchema(){return ab}async executeInternal(e){const t=t=>({limit:e.limit,page:e.page,membershipKind:t}),a=eb(await this.mondayApi.request(Z_,t(nl.Member)));let i=a;if(!tb(a)){i=eb(await this.mondayApi.request(Z_,t(nl.All)))}if(!tb(i))return{content:{message:"No workspaces found.",data:[]}};const n=i.length===e.limit,o=await O_(this.mondayApi),r=i.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:o&&e.id?k_(o,e.id):void 0})));return{content:{message:"Workspaces retrieved",...n?{next_page:e.page+1}:{},data:r}}}},class extends ue{constructor(){super(...arguments),this.name="create_doc",this.type=b.WRITE,this.annotations=me({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, optional docOwnerIds)\n- item: Creates a document attached to an item (requires item_id, optional column_id, optional docOwnerIds)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_name: "My Doc", doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, doc_name: "My Doc", folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, doc_name: "My Doc", column_id: "doc_col_1" , markdown: "..." }\n- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, doc_name: "My Doc", markdown: "...", docOwnerIds: ["<agent_owner_user_id>"] }'}getInputSchema(){return pb}async executeInternal(e){const t=db.safeParse({...e,type:e.location});if(!t.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const a=t.data;try{let t,i,n;if(a.type===sb.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||ho.Public,folder_id:a.folder_id?.toString()}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}},r=await this.mondayApi.request(nb,o);t=r?.create_doc?.id??void 0,i=r?.create_doc?.object_id??void 0,n=r?.create_doc?.url??void 0}else if(a.type===sb.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(ib,o),s=r.items?.[0];if(!s)return{content:`Error: Item with id ${a.item_id} not found.`};const d=s.board?.id,p=s.board?.columns?.find((e=>e&&e.type===bm.Doc));let l=a.column_id;if(!l)if(p)l=p.id;else{const e={boardId:d.toString(),columnType:bm.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(Mc,e);if(l=t?.create_column?.id,!l)return{content:"Error: Failed to create doc column."}}const c={location:{board:{item_id:a.item_id.toString(),column_id:l}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}},m=await this.mondayApi.request(nb,c);if(t=m.create_doc?.id??void 0,i=m.create_doc?.object_id??void 0,n=m.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(rb,a)}catch(e){console.warn("Failed to update doc name:",e)}}if(!t)return{content:"Error: Failed to create document."};const o={docId:t,markdown:e.markdown},r=await this.mondayApi.request(ob,o),s=r?.add_content_to_doc_from_markdown?.success,d=r?.add_content_to_doc_from_markdown?.error;return s?(this.sessionContext.metadata={...this.sessionContext.metadata,location:e.location,...t&&{doc_id:t},...i&&{object_id:i}},{content:{message:"Document successfully created",doc_id:t,object_id:i,doc_url:n,doc_name:e.doc_name}}):{content:`Document ${t} created, but failed to add markdown content: ${d||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends ue{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=b.WRITE,this.annotations=me({title:"Add Content to Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add markdown content to an existing monday.com document.\n\nIDENTIFICATION: Provide doc_id, object_id, or board_id + view_id to identify the document:\n- doc_id: The document ID (the id field returned by read_docs). Takes priority if both provided.\n- object_id: The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id.\n- board_id + view_id: For a doc that lives as a board view, taken from https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Such docs have no usable doc_id/object_id until they are resolved through their board.\n\nUSAGE EXAMPLES:\n- By doc_id: { doc_id: "123", markdown: "# New Section\\nContent here" }\n- By object_id: { object_id: "456", markdown: "# New Section\\nContent here" }\n- By board view: { board_id: "18429976879", view_id: "279510271", markdown: "# New Section\\nContent here" }\n- Insert after block: { doc_id: "123", markdown: "Inserted content", after_block_id: "block_789" }'}getInputSchema(){return ub}async executeInternal(e){if(!e.doc_id&&!e.object_id&&!e.board_id)return{content:"Error: Either doc_id, object_id, or board_id (with view_id) must be provided."};try{let t=null;if(e.doc_id||e.object_id||!e.board_id)if(e.doc_id){const a=await this.mondayApi.request(mb,{docId:e.doc_id});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(cb,{objectId:e.object_id});t=a.docs?.[0]??null}else{const a=await H_(this.mondayApi,e.board_id,e.view_id);if(!a.ok)return{content:`Error: ${a.error}`};t=a.doc}if(!t){return{content:`Error: No document found for ${e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`}.`}}this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t.id,...e.object_id&&{object_id:e.object_id},...e.board_id&&{board_id:e.board_id,view_id:e.view_id}};const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},i=await this.mondayApi.request(lb,a);if(!i?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:n,block_ids:o,error:r}=i.add_content_to_doc_from_markdown;if(!n)return{content:`Error adding content to document: ${r||"Unknown error"}`};const s=o?.length??0;return{content:{message:`Successfully added content to document ${t.id}. ${s} block${1===s?"":"s"} created.`,doc_id:t.id,block_ids:o,doc_name:t.name,doc_url:t.url}}}catch(e){return{content:`Error adding content to document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends ue{constructor(){super(...arguments),this.name="update_doc",this.type=b.WRITE,this.annotations=me({title:"Update Document",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Update an existing monday.com document. Provide doc_id (preferred), object_id, or board_id + view_id, plus an ordered operations array (executed sequentially, stops on first failure).\n\nIDENTIFYING THE DOC: A doc can live in a workspace, on an item, or as a board view. For a doc that lives as a board view, you only have a board URL — pass board_id and view_id from https://<slug>.monday.com/boards/<board_id>/views/<view_id> and they will be resolved to the doc.\n\nOPERATIONS:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (or insert after a block). Best for text, headings, lists, simple tables — no block IDs needed.\n- update_block: Update content of an existing text, code, or list_item block in-place.\n- create_block: Create a new block at a precise position. Use parent_block_id to nest inside notice_box, table cell, or layout cell.\n- delete_blocks: Permanently delete 1–100 blocks in one call. Provide all block IDs in the block_ids array. The ONLY option for BOARD, WIDGET, DOC embed, and GIPHY blocks.\n- replace_block: Delete a block and create a new one in its place (use when update_block is not supported).\n- add_comment: Create a new comment or reply on the document (doc-level, block-level, or text-selection).\n\nWHEN TO USE EACH OPERATION:\n- text / code / list_item → update_block. Use replace_block to change subtype (e.g. NORMAL_TEXT→LARGE_TITLE)\n- divider / table / image / video / notice_box / layout → replace_block (properties immutable after creation)\n- BOARD / WIDGET / DOC / GIPHY → delete_blocks only\n\nGETTING BLOCK IDs: Call read_docs with include_blocks: true — returns id, type, position, and content per block.\n\nBLOCK CONTENT (delta_format): Array of insert ops. Last op MUST be {insert: {text: "\\n"}}.\n- Plain: [{insert: {text: "Hello"}}, {insert: {text: "\\n"}}]\n- Bold: [{insert: {text: "Hi"}, attributes: {bold: true}}, {insert: {text: "\\n"}}]\n- Mention user/doc/board: [{insert: {text: "Hey "}}, {insert: {mention: {id: 12345, type: "USER"}}}, {insert: {text: "\\n"}}] — type is USER, DOC, or BOARD. id is numeric (user IDs from list_users_and_teams)\n- Inline column value: [{insert: {column_value: {item_id: 111, column_id: "status"}}}, {insert: {text: "\\n"}}]\n- Supported attributes: bold, italic, underline, strike, code, link, color, background (not applicable to mention/column_value ops)\n\nIMAGE WITH ASSET: For asset-based images, use create_block with block_type "image" and asset_id (instead of public_url). add_markdown_content does NOT support asset images — for mixed content, alternate add_markdown_content (text) and create_block (image) operations in sequence.\n\nBATCHING DELETES: delete_blocks accepts 1..100 IDs. Put ALL IDs in one operation\'s block_ids array. Never emit multiple delete_blocks operations in a row.\n\nCOMMENTS:\n- add_comment: Create a new comment or reply on the document. Three scopes:\n - Doc-level (no block_id): comment appears on the doc as a whole.\n - Block-level (block_id only): comment is anchored to a specific block. The block shows a comment indicator in the UI.\n - Text-selection (block_id + selection_from + selection_length): comment is anchored to a specific character range inside a text/code/list_item block. That text is highlighted with a comment marker.\n Block-level and text-selection comments only work on blocks with text content (text, code, list_item, title, quote). They do NOT work on: divider, page_break, table, layout, notice_box, image, video, or giphy blocks.\n Get block IDs from read_docs with include_blocks: true. Format body with HTML, not markdown. Use mentions_list for @mentions.'}getInputSchema(){return Yb}async executeInternal(e){if(!e.doc_id&&!e.object_id&&!e.board_id)return{content:"Error: Either doc_id, object_id, or board_id (with view_id) must be provided."};this.sessionContext.metadata={...this.sessionContext.metadata,operation_types:e.operations?.map((e=>e.operation_type)),operation_count:e.operations?.length??0,...e.object_id&&{object_id:e.object_id},...e.board_id&&{board_id:e.board_id,view_id:e.view_id}};try{let t=e.doc_id,a=e.object_id;if(!t&&!a&&e.board_id){const i=await H_(this.mondayApi,e.board_id,e.view_id);if(!i.ok)return{content:`Error: ${i.error}`};t=i.doc.id,a=i.doc.object_id}if(!t){const e=await this.mondayApi.request(L_,{objectId:a}),i=e.docs?.[0];if(!i)return{content:`Error: No document found for object_id ${a}.`};t=i.id}const i=[];let n=null;for(let o=0;o<e.operations.length;o++){const r=e.operations[o];try{const e=await this.executeOperation(t,r,a);i.push(`- [OK] ${r.operation_type}${e?`: ${e}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";i.push(`- [FAILED] ${r.operation_type}: ${t}`),n=o;break}}const o=null!==n?n:e.operations.length,r=e.operations.length,s=`Completed ${o}/${r} operation${1===r?"":"s"} on doc ${t}.`;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t},{content:`${s}\n\nResults:\n${i.join("\n")}\n\nDoc ID: ${t}`}}catch(e){return{content:`Error: ${e instanceof Error?e.message:String(e)}`}}}async executeOperation(e,t,a){switch(t.operation_type){case"set_name":return this.executeSetName(e,t.name);case"add_markdown_content":return this.executeAddMarkdown(e,t.markdown,t.after_block_id);case"update_block":return this.executeUpdateBlock(t.block_id,t.content);case"create_block":return this.executeCreateBlock(e,t.block,t.after_block_id,t.parent_block_id);case"delete_blocks":return this.executeDeleteBlocks(t.block_ids);case"replace_block":return this.executeReplaceBlock(e,t.block_id,t.block,t.after_block_id,t.parent_block_id);case"add_comment":return this.executeAddComment(e,a,t.body,t.parent_update_id,t.mentions_list,t.block_id,t.selection_from,t.selection_length);default:{const e=t.operation_type;throw new Error(`Unsupported operation type: "${e}"`)}}}async executeSetName(e,t){const a={docId:e,name:t},i=await this.mondayApi.request($_,a);if(!i?.update_doc_name)throw new Error(`No confirmation from update_doc_name — rename to "${t}" may not have applied`);return`Renamed to "${t}"`}async executeAddMarkdown(e,t,a){if(!t.trim())throw new Error("markdown must not be empty");const i={docId:e,markdown:t,afterBlockId:a},n=await this.mondayApi.request(x_,i),o=n?.add_content_to_doc_from_markdown;if(!o?.success)throw new Error(o?.error||"Failed to add markdown content");const r=o.block_ids?.length??0;return`${r} block${1===r?"":"s"} added${o.block_ids?.length?`. Block IDs: ${o.block_ids.join(", ")}`:""}`}async executeUpdateBlock(e,t){const a=function(e){switch(e.block_content_type){case"text":return{deltaFormat:gb(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:gb(e.delta_format),language:e.language};case"list_item":return{deltaFormat:gb(e.delta_format),checked:e.checked,indentation:e.indentation};default:{const t=e.block_content_type;throw new Error(`Unsupported block_content_type: "${t}"`)}}}(t),i={blockId:e,content:JSON.stringify(a)},n=await this.mondayApi.request(U_,i);if(!n?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,i){const n=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:bb(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:hb(e.alignment),direction:fb(e.direction)}};case"list_item":return{list_block:{delta_format:bb(e.delta_format),list_block_type:e.list_block_type?e.list_block_type:void 0,indentation:e.indentation}};case"code":return{text_block:{delta_format:bb(e.delta_format),text_block_type:op.Code}};case"divider":return{divider_block:{}};case"page_break":return{page_break_block:{}};case"image":if(null==e.asset_id&&!e.public_url)throw new Error("image block requires either asset_id or public_url");return{image_block:null!=e.asset_id?{asset_id:String(e.asset_id),width:e.width}:{public_url:e.public_url,width:e.width}};case"video":return{video_block:{raw_url:e.raw_url,width:e.width}};case"notice_box":return{notice_box_block:{theme:e.theme}};case"table":return{table_block:{row_count:e.row_count,column_count:e.column_count,width:e.width,column_style:e.column_style?.map((e=>({width:e.width})))}};case"layout":return{layout_block:{column_count:e.column_count,column_style:e.column_style?.map((e=>({width:e.width})))}};default:{const t=e.block_type;throw new Error(`Unsupported block_type: "${t}"`)}}}(t);if(i){const e=Object.keys(n);if(1!==e.length)throw new Error(`Cannot inject parent_block_id: expected exactly 1 key in block input, got: ${e.join(", ")}`);const t=e[0],a=n[t];if(!a||"object"!=typeof a)throw new Error(`Cannot inject parent_block_id into block type "${t}" — block value is not an object`);a.parent_block_id=i}const o={docId:e,afterBlockId:a,blocksInput:[n]},r=await this.mondayApi.request(j_,o),s=r?.create_doc_blocks;if(!s||0===s.length)throw new Error("No blocks returned from create_doc_blocks");return`Block created (ID: ${s.map((e=>e.id)).join(", ")})`}async executeDeleteBlock(e){const t={blockId:e},a=await this.mondayApi.request(P_,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async executeDeleteBlocks(e){if(0===e.length)throw new Error("block_ids must not be empty");const t={blockIds:e},a=await this.mondayApi.request(V_,t);if(!a?.delete_doc_blocks||0===a.delete_doc_blocks.length)throw new Error("No response from delete_doc_blocks");const i=a.delete_doc_blocks.map((e=>e.id)).join(", ");return`${a.delete_doc_blocks.length} block(s) deleted (IDs: ${i})`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(M_,{docId:e}),i=a.docs?.[0];if(!i?.object_id)throw new Error(`Could not resolve object_id for doc ${e}`);return i.object_id}async resolveDocItemId(e){const t=await this.mondayApi.request(F_,{boardId:e}),a=t.boards?.[0]?.items_page?.items?.[0]?.id;if(!a)throw new Error(`No item found on the document backing board (object_id: ${e})`);return a}async fetchAllBlockContent(e){const t=await this.mondayApi.request(B_,{docId:e});return(t.docs?.[0]?.blocks??[]).filter((e=>null!=e)).map((t=>{let a;if("string"==typeof t.content)try{a=JSON.parse(t.content)}catch{throw new Error(`Failed to parse content of block ${t.id} in doc ${e} as JSON`)}else a=t.content??{};return{id:t.id??"",type:t.type??"",content:a}}))}async executeAddComment(e,t,a,i,n,o,r,s){if((null!=r||null!=s)&&!o)throw new Error("selection_from and selection_length require block_id");if(null!=r!=(null!=s))throw new Error("selection_from and selection_length must both be provided together");const d=o?Array.isArray(o)?o:[o]:[];if((null!=r||null!=s)&&d.length>1)throw new Error("selection_from and selection_length are only supported with a single block_id");const p=await this.resolveObjectId(e,t),l=await this.resolveDocItemId(p);let c;if(n){const e=JSON.parse(n),t=mf.safeParse(e);if(!t.success)throw new Error(`Invalid mentions_list format: ${t.error.message}`);c=t.data}const m={itemId:l,body:a,parentId:i?.toString(),mentionsList:c},u=await this.mondayApi.request(z_,m);if(!u.create_update?.id)throw new Error("Failed to create comment: no update returned");const h=u.create_update.id,f=Number(h),_=i?`Reply to update ${i}`:"Comment";if(d.length>0){if(Number.isNaN(f))throw new Error(`${_} created (update ID: ${h}) but block annotation aborted: comment ID is not numeric and cannot be used as a delta reference`);const t=await this.fetchAllBlockContent(e);for(const a of d){const i=t.find((e=>e.id===a));if(!i)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: block ${a} not found in doc ${e}`);const n=i.content.deltaFormat;if(!n)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: block ${a} has no deltaFormat — only text, code, and list_item blocks are supported`);let o=0;for(const e of n)o+="string"==typeof e.insert?e.insert.length:1;if(0===o)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: block ${a} has an empty deltaFormat and cannot be annotated`);const d=r??0,p=s??o;if(d+p>o)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: selection [${d}, ${d+p}) is out of range for block ${a} (total length ${o})`);let l;try{l=vb(n,f,d,p)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`${_} created (update ID: ${h}) but delta annotation failed for block ${a}: ${t}`)}const c={...i.content,deltaFormat:l},m=await this.mondayApi.request(U_,{blockId:a,content:JSON.stringify(c)});if(!m?.update_doc_block)throw new Error(`${_} created (update ID: ${h}) but block annotation write returned no confirmation for block ${a}`)}}const b=d.length;return`${_} created${b>1?` across ${b} blocks`:1===b?" on block":""} (update ID: ${h})`}async executeReplaceBlock(e,t,a,i,n){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,i,n)}`}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Original block ${t} was deleted, but replacement creation failed: ${a}. The original block is gone.`)}}},class extends ue{constructor(){super(...arguments),this.name="update_workspace",this.type=b.WRITE,this.annotations=me({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return tg}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(eg,t),i=await O_(this.mondayApi),n=i?k_(i,a.update_workspace?.id):void 0;return{content:{message:`Workspace ${a.update_workspace?.id} updated`,workspace_id:a.update_workspace?.id,workspace_name:a.update_workspace?.name,workspace_url:n}}}},class extends ue{constructor(){super(...arguments),this.name="update_folder",this.type=b.WRITE,this.annotations=me({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return ig}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:i}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const n={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:t?{is_after:i,object_id:t,object_type:a}:void 0},o=await this.mondayApi.request(ag,n);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends ue{constructor(){super(...arguments),this.name="create_workspace",this.type=b.WRITE,this.annotations=me({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return og}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(ng,t),i=await O_(this.mondayApi),n=i&&a.create_workspace?.id?k_(i,a.create_workspace.id):void 0;return{content:{message:`Workspace ${a.create_workspace?.id} successfully created`,workspace_id:a.create_workspace?.id,workspace_name:a.create_workspace?.name,workspace_url:n}}}},class extends ue{constructor(){super(...arguments),this.name="create_folder",this.type=b.WRITE,this.annotations=me({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return sg}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(rg,t);return{content:{message:`Folder ${a.create_folder?.id} successfully created`,folder_id:a.create_folder?.id,folder_name:a.create_folder?.name}}}},class extends ue{constructor(){super(...arguments),this.name="move_object",this.type=b.WRITE,this.annotations=me({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 lg}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const d={folderId:t,position:a?{is_after:n,object_id:a,object_type:i}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},p=await this.mondayApi.request(ag,d);return{content:{message:"Object moved",object_id:p.update_folder?.id}}}async executeUpdateBoardHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const d={boardId:t,attributes:{position:a?{is_after:n,object_id:a,object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(dg,d);return p.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:p.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${p.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const d={overviewId:t,attributes:{position:a?{is_after:n,object_id:a,object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(pg,d);return p.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:p.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${p.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:t}=e;switch(t){case sd.Folder:return this.executeUpdateFolder(e);case sd.Board:return this.executeUpdateBoardHierarchy(e);case sd.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends ue{constructor(){super(...arguments),this.name="create_dashboard",this.type=b.WRITE,this.annotations=me({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 Xb}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(Qb,t);if(!a.create_dashboard)throw new im("Failed to create dashboard",tm);const i=a.create_dashboard;return{content:{message:`Dashboard ${i.id} successfully created`,dashboard_id:i.id,dashboard_name:i.name}}}catch(e){nm(e,"create dashboard")}}},class extends ue{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=b.READ,this.annotations=me({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(Kb,e);if(!t.all_widgets_schema||0===t.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const a={};let i=0;for(const e of t.all_widgets_schema)if(e?.widget_type&&e?.schema){const t="string"==typeof e.schema?JSON.parse(e.schema):e.schema,n=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:n,schema:e.schema},i++}if(0===i)throw new Error("No valid widget schemas found in API response");Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:a,url:t_}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends ue{constructor(){super(...arguments),this.name="create_widget",this.type=b.WRITE,this.annotations=me({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 Zb}async executeInternal(e){if(!e.settings)throw new im("You must pass the settings parameter",am);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(Jb,t);if(!a.create_widget)throw new im("Failed to create widget",tm);const i=a.create_widget;i.parent?.kind===Kp.Dashboard?i.parent.id:i.parent;return{content:{message:`Widget ${i.id} created`,widget_id:i.id,widget_name:i.name,dashboard_id:i.parent?.id}}}catch(t){nm(t,`create ${e.widget_kind} widget`)}}},class extends ue{constructor(){super(...arguments),this.name="board_insights",this.type=b.READ,this.annotations=me({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 with filters.columns.only to get column metadata without fetching views. 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 _g}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};if(e.aggregations.some((e=>!e.columnId&&e.function!==xn.CountItems)))return{content:`Every aggregation must have a "columnId", except the ${xn.CountItems} function.`};const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],i=new Set(e.aggregations.filter((e=>e.function===xn.Label)).map((e=>e.columnId))),n=e.groupBy?.filter((e=>!i.has(e))).map((e=>({function:xn.Label,columnId:e})))??[],o=e.aggregations.concat(n).map((e=>{if(e.function){const o=e.columnId?`${e.function}_${e.columnId}`:e.function,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return hg.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:$n.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===xn.CountItems?[]:[{type:$n.Column,column:fg(n),as:n}]}),as:s}}var i,n;const o={type:$n.Column,column:fg(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:$n.Column,column:fg(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),i=function(e){if(!e.filters&&!e.orderBy)return;const t={};return e.filters&&(t.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),t.operator=e.filtersOperator),e.orderBy&&(t.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),t}(e),n=function(e){return{id:e.boardId.toString(),type:An.Table}}(e),o={query:{from:n,query:i,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(cg,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const i=e.value;if(!i)return void(t[a]=null);const n=i.result??i.value??null;t[a]=n})),t}));return s.length?{content:{message:"Board insights retrieved",board_name:r.boards?.[0]?.name,board_url:r.boards?.[0]?.url,data:s}}:{content:"No board insights found for the given query."}}},class extends ue{constructor(){super(...arguments),this.name="search",this.type=b.READ,this.annotations=me({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Search within monday.com platform. Supported searchType values: ${Yf}.\nsearchTerm is the phrase the search matches against — the text/keywords to look for (e.g. a board name, item title, or a word from an update). It is required and must be non-empty. This tool has no "list everything" mode: to browse or list without a search phrase, use workspace_info (boards/docs/folders in a workspace) or get_board_items_page (items in a board) instead of calling search with an empty searchTerm.\nFor searching/listing specific users and teams, use list_users_and_teams tool.\nFor account-level info (plan, member count, products), use get_user_context tool.\nFor browsing all boards, docs, or folders within a workspace without a search term, use workspace_info tool.\nFor groups, use get_board_info tool.\nFor listing items within a specific board, use get_board_items_page tool. ITEMS search here queries items across the account.\nBOARD search returns id, title, url, and workspaceId. Optionally scope it with boardIds.\nDOCUMENTS search returns id, title, workspaceId, and highlights. highlights is an array of { field, fragments } entries (field is "name" or "content") where fragments contain matched text snippets with <em> tags around matched terms. highlights is omitted when no lexical match was made. Optionally scope it with workspaceIds and/or docIds.\nITEMS search returns id, title, url, boardId, and workspaceId. Optionally scope it with workspaceIds, boardIds, and/or creatorIds.\nWORKSPACES search returns id, title, and description.\nUPDATES search returns id, title (the update body), itemId, boardId, and creatorId. Optionally scope it with workspaceIds, boardIds, and/or creatorIds.\nTIMELINE_ITEMS search returns id, title, summary, content, itemId, and boardId. Optionally scope it with workspaceIds and/or boardIds.\nDASHBOARDS search (also called "overviews") returns id, title, and workspaceId. Optionally scope it with workspaceIds and/or creatorIds.\nFOLDERS search returns id and title. Optionally scope it with workspaceIds, which searches all accessible workspaces when omitted. Pass workspaceIds to narrow the search if results may be truncated.\n `}getInputSchema(){return xg}async executeInternal(e){const{searchTerm:t}=e;if(!t)throw new im("searchTerm is required and must be a non-empty search string. To browse or list without a search term, use workspace_info (for boards, docs, and folders in a workspace) or get_board_items_page (for items within a specific board).",am);try{if(e.searchType===Wf.FOLDERS){const{results:a,truncated:i}=await this.searchFoldersAsync(e,t);return{content:{message:i?"Search results (truncated: only the first 100 folders across the searched workspaces were scanned. Narrow with workspaceIds for complete results.)":"Search results",data:a}}}return{content:{message:"Search results",data:await this.runSmartSearchAsync(e,t)}}}catch(e){throw om(e),e}}async runSmartSearchAsync(e,t){const a=kg(e.workspaceIds?.map((e=>e.toString())));if(e.searchType===Wf.BOARD){const i=kg(e.boardIds?.map((e=>e.toString())));return this.searchBoardsAsync(t,e.limit,a,i)}if(e.searchType===Wf.DOCUMENTS){const i=kg(e.docIds?.map((e=>e.toString())));return this.searchDocsAsync(t,e.limit,a,i)}if(e.searchType===Wf.WORKSPACES)return this.searchWorkspacesAsync(t,e.limit);if(e.searchType===Wf.UPDATES){const i=kg(e.boardIds?.map((e=>e.toString()))),n=kg(e.creatorIds?.map((e=>e.toString())));return this.searchUpdatesAsync(t,e.limit,a,i,n)}if(e.searchType===Wf.ITEMS){const i=kg(e.boardIds?.map((e=>e.toString()))),n=kg(e.creatorIds?.map((e=>e.toString())));return this.searchItemsAsync(t,e.limit,a,i,n)}if(e.searchType===Wf.TIMELINE_ITEMS){const i=kg(e.boardIds?.map((e=>e.toString())));return this.searchTimelineItemsAsync(t,e.limit,a,i)}if(e.searchType===Wf.DASHBOARDS){const i=e.creatorIds?.map((e=>e.toString()));return this.searchOverviewsAsync(t,e.limit,a,i)}throw new im(`Unsupported search type for smart search: ${e.searchType}`,Xc)}async searchBoardsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,boardIds:i};return(await this.mondayApi.request(yg,n,{timeout:um})).search.boards.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchDocsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,docIds:i};return(await this.mondayApi.request(vg,n,{timeout:um})).search.docs.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0,highlights:Rg(e.indexed_data.highlights)})))}async searchWorkspacesAsync(e,t){const a={query:e,limit:t};return(await this.mondayApi.request(Ig,a,{timeout:um})).search.workspaces.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,description:e.indexed_data.description||void 0})))}async searchUpdatesAsync(e,t,a,i,n){const o={query:e,limit:t,workspaceIds:a,boardIds:i,creatorIds:n};return(await this.mondayApi.request(wg,o,{timeout:um})).search.updates.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.body,itemId:e.indexed_data.item_id,boardId:e.indexed_data.board_id,creatorId:e.indexed_data.creator_id})))}async searchItemsAsync(e,t,a,i,n){return(n?await this.mondayApi.request(Eg,{query:e,limit:t,workspaceIds:a,boardIds:i,creatorIds:n},{versionOverride:"dev",timeout:um}):await this.mondayApi.request(gg,{query:e,limit:t,workspaceIds:a,boardIds:i},{timeout:um})).search.items.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url,boardId:e.indexed_data.board_id??void 0,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchTimelineItemsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,boardIds:i};return(await this.mondayApi.request(Tg,n,{timeout:um})).search.timeline_items.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.title,summary:e.indexed_data.summary||void 0,content:e.indexed_data.content||void 0,itemId:e.indexed_data.item_id,boardId:e.indexed_data.board_id??void 0})))}async searchOverviewsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,creatorIds:i};return(await this.mondayApi.request(Ag,n,{versionOverride:"dev",timeout:um})).search.overviews.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchFoldersAsync(e,t){const a=Sg(t);if(!a)return{results:[],truncated:!1};const i={page:1,limit:100,workspace_ids:kg(e.workspaceIds?.map((e=>e.toString())))},n=(await this.mondayApi.request(bg,i)).folders||[];return{results:n.filter((e=>e?.name&&Sg(e.name).includes(a))).filter((e=>e?.id)).slice(0,e.limit).map((e=>({id:e.id,title:e.name}))),truncated:100===n.length}}},class extends ue{constructor(){super(...arguments),this.name="get_user_context",this.type=b.READ,this.annotations=me({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information, account information, and their relevant items (boards, docs, folders, workspaces, dashboards).\n\n Use this tool to:\n - Get context about who the current user is (id, name, title)\n - Get account info: plan tier, active member count, trial status, and active products\n - Get the number of active members in the account (returns active_members_count)\n - Discover user's favorite boards, folders, workspaces, and dashboards\n - Get user's most relevant boards based on visit frequency and recency\n - Get user's most relevant docs based on load frequency and recency\n - Get user's most relevant people based on interaction frequency and recency\n - Reduce the need for search requests by knowing user's commonly accessed items\n "}getInputSchema(){}async executeInternal(){const{me:e,favorites:t,intelligence:a}=await this.mondayApi.request(jg,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};const i=await this.fetchFavorites(t||[]),n=this.extractRelevantBoards(a),o=this.extractRelevantDocs(a),r=this.extractRelevantPeople(a),{account:s,...d}=e;return{content:{message:"User context",...{user:d,account:s?{tier:s.tier,active_members_count:s.active_members_count,is_during_trial:s.is_during_trial,products:s.products?.filter(Boolean).map((e=>({kind:e.kind,tier:e.tier})))??[]}:null,favorites:i,relevantBoards:n,relevantDocs:o,relevantPeople:r}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const i={};for(const e of a)i[Gg[e]]=t[e];const n=await this.mondayApi.request(qg,i),o=[];for(const e of a){const t=Hg[e];for(const a of n[t]??[])a?.id&&o.push({id:a.id,name:a.name,type:e})}return o}extractRelevantBoards(e){if(!e?.relevant_boards)return[];const t=[];for(const a of e.relevant_boards)a?.id&&a?.board?.name&&t.push({id:a.id,name:a.board.name});return t}extractRelevantDocs(e){if(!e?.relevant_docs)return[];const t=[];for(const a of e.relevant_docs)a?.id&&a?.document?.name&&t.push({id:a.id,name:a.document.name,objectId:a.object_id});return t}extractRelevantPeople(e){if(!e?.relevant_people)return[];const t=[];for(const a of e.relevant_people)a?.id&&a?.user?.name&&t.push({id:a.id,name:a.user.name});return t}groupByType(e){const t={};for(const a of e){const e=a?.object;e?.id&&e?.type&&(t[e.type]??=[]).push(e.id)}return t}},class extends ue{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=b.WRITE,this.annotations=me({title:"Update Assets On Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update a file or doc column value on an item using existing assets, docs, or links. Sets the column to the provided list of files, adding new ones and removing any not in the list."}getInputSchema(){return Fg}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(Vg,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends ue{constructor(){super(...arguments),this.name="get_assets",this.type=b.READ,this.annotations=me({title:"Get Assets",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get assets (files) by their IDs. Returns file metadata including name, extension, size, public URL (valid for 1 hour), thumbnail URL, upload date, and who uploaded it."}getInputSchema(){return zg}async executeInternal(e){const t=await this.mondayApi.request(Bg,{ids:e.ids}),a=t.assets?.filter(Boolean);if(!a||0===a.length)return{content:`No assets found for the provided IDs: ${e.ids.join(", ")}`};return{content:{results:a.map((e=>({id:e.id,name:e.name,file_extension:e.file_extension,file_size:e.file_size,public_url:e.public_url,url:e.url,url_thumbnail:e.url_thumbnail??null,created_at:e.created_at??null,original_geometry:e.original_geometry??null,uploaded_by:e.uploaded_by})))}}}},class extends ue{constructor(){super(...arguments),this.name="create_view",this.type=b.WRITE,this.annotations=me({title:"Create View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new board view (tab) with optional filters and sorting. This creates a saved view on a monday.com board that users can switch to.\n\n[REQUIRED PRECONDITION]: If you pass filters or sorting, call get_board_info first with filters.columns.only to get the board column IDs, column types, and status label indexes without fetching views. Filter rules reference real column IDs and, for status columns, numeric label indexes — do not guess them. Before sending the filters, use get_column_type_info with fetchMode "${Bm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules).\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }`}getInputSchema(){return eu}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort,settings:e.settings},a=await this.mondayApi.request(Zm,t);return a.create_view?{content:`View "${a.create_view.name}" (ID: ${a.create_view.id}, type: ${a.create_view.type}) successfully created`}:{content:"Failed to create view - no response from API"}}},class extends ue{constructor(){super(...arguments),this.name="update_view",this.type=b.WRITE,this.annotations=me({title:"Update View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Update an existing board view (tab) — change its name, filter rules, or sort order. Provide only the fields you want to change. Omitted fields are left unchanged.\n\n[REQUIRED PRECONDITION]: Call get_board_info first — it returns the board views (so you can resolve the viewId, including from a view name the user mentioned) along with the column IDs, column types, and status label indexes that filter and sort rules reference. When the user named specific views, pass those names as get_board_info.filters.views.names to avoid fetching every view on large boards. If you pass filters, also use get_column_type_info with fetchMode "${Bm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }`}getInputSchema(){return au}async executeInternal(e){const t={viewId:e.viewId,boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort,settings:e.settings},a=await this.mondayApi.request(tu,t);return a.update_view?{content:`View "${a.update_view.name}" (ID: ${a.update_view.id}, type: ${a.update_view.type}) successfully updated`}:{content:"Failed to update view - no response from API"}}},class extends ue{constructor(){super(...arguments),this.name="create_view_table",this.type=b.WRITE,this.annotations=me({title:"Create Table View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new table-type board view with optional filters, sort, tags, and table-specific settings (column visibility/order and group-by). Use this instead of create_view when you need to configure table-specific settings. For a simple table view, create_view also works.\n\n[REQUIRED PRECONDITION]: Call get_board_info first with filters.columns.only to get the board column IDs, column types, and status label indexes without fetching views. Filters, sort, column_properties, column_order, and group_by all reference real column IDs — do not guess them. This is required even if you are not passing filters, since column_properties/column_order/group_by need real column IDs too. If you pass filters, also use get_column_type_info with fetchMode "${Bm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample settings.columns: { "column_properties": [{ "column_id": "status", "visible": true }], "column_order": ["name", "status", "date"] }\nExample settings.group_by: { "conditions": [{ "columnId": "status" }], "hideEmptyGroups": true }`}getInputSchema(){return ru}async executeInternal(e){const t={boardId:e.boardId,name:e.name,filter:e.filter,sort:e.sort,tags:e.tags,settings:e.settings},a=await this.mondayApi.request(iu,t);return a.create_view_table?{content:`Table view "${a.create_view_table.name}" (ID: ${a.create_view_table.id}, type: ${a.create_view_table.type}) successfully created`}:{content:"Failed to create table view - no response from API"}}},class extends ue{constructor(){super(...arguments),this.name="update_view_table",this.type=b.WRITE,this.annotations=me({title:"Update Table View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Update an existing table-type board view — change its name, filters, sort, tags, or table-specific settings (column visibility/order and group-by). Provide only the fields you want to change. Omitted fields are left unchanged.\n\n[REQUIRED PRECONDITION]: Call get_board_info first — it returns the board views (so you can resolve the viewId, including from a view name the user mentioned) along with the column IDs, column types, and status label indexes that filters, sort, column_properties, column_order, and group_by reference. When the user named specific views, pass those names as get_board_info.filters.views.names to avoid fetching every view on large boards. If you pass filters, also use get_column_type_info with fetchMode "${Bm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample settings.columns: { "column_properties": [{ "column_id": "status", "visible": true }], "column_order": ["name", "status", "date"] }\nExample settings.group_by: { "conditions": [{ "columnId": "status" }], "hideEmptyGroups": true }`}getInputSchema(){return lu}async executeInternal(e){const t={viewId:e.viewId,boardId:e.boardId,name:e.name,filter:e.filter,sort:e.sort,tags:e.tags,settings:e.settings},a=await this.mondayApi.request(su,t);return a.update_view_table?{content:`Table view "${a.update_view_table.name}" (ID: ${a.update_view_table.id}, type: ${a.update_view_table.type}) successfully updated`}:{content:"Failed to update table view - no response from API"}}},class extends ue{constructor(){super(...arguments),this.name="undo_action",this.type=b.WRITE,this.annotations=me({title:"Undo Action",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Undo a previous action on a board using its action_record_uuid. Supports undoing column changes, deletes, archives, moves, duplicates, and more. Use get_board_activity with includeData=true to find the action_record_uuid."}getInputSchema(){return Yg}async executeInternal(e){return await this.mondayApi.request(Wg,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}},class extends ue{constructor(){super(...arguments),this.name="get_object_schemas",this.type=b.READ,this.annotations=me({title:"Get Object Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve account-level object schemas by their IDs or names. Schemas define the structure and columns of boards. Provide ids or names to filter specific schemas. Omit both to list all schemas (paginated). Call this FIRST to resolve schema ids, column ids, and the current revision before any tool that modifies an existing schema: update_object_schema (which requires the revision returned here), manage_object_schema_columns with action=update, set_object_schema_column_active_state, delete_object_schema_columns, delete_object_schema, and manage_object_schema_board_connection."}getInputSchema(){return Om}async executeInternal(e){const t={ids:e.ids,names:e.names,limit:e.limit,page:e.page,excludeCreatedByMonday:e.excludeCreatedByMonday},a=(await this.mondayApi.request(Nm,t)).get_object_schemas??[];return{content:{message:`Retrieved ${a.length} object schema(s)`,schemas:a}}}},class extends ue{constructor(){super(...arguments),this.name="create_object_schema",this.type=b.WRITE,this.annotations=me({title:"Create Object Schema",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new account-level object schema. Schemas define the structure and columns of boards. If you are nesting this schema under an existing one, call get_object_schemas first to resolve parentId. This tool creates the schema only — add its columns afterwards with manage_object_schema_columns, and attach boards with manage_object_schema_board_connection."}getInputSchema(){return Rm}async executeInternal(e){const t={name:e.name,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(km,t);return{content:{message:`Object schema "${a.create_object_schema?.name}" successfully created`,schema_id:a.create_object_schema?.id,schema_name:a.create_object_schema?.name,revision:a.create_object_schema?.revision}}}},class extends ue{constructor(){super(...arguments),this.name="update_object_schema",this.type=b.WRITE,this.annotations=me({title:"Update Object Schema",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Update an account-level object schema. Requires the current revision number for optimistic locking — retrieve it first via get_object_schemas."}getInputSchema(){return $m}async executeInternal(e){const t={id:e.id,revision:e.revision,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(Cm,t);return{content:{message:`Object schema "${a.update_object_schema?.name}" successfully updated`,schema_id:a.update_object_schema?.id,schema_name:a.update_object_schema?.name,revision:a.update_object_schema?.revision}}}},class extends ue{constructor(){super(...arguments),this.name="delete_object_schema",this.type=b.WRITE,this.annotations=me({title:"Delete Object Schema",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an account-level object schema. Only allowed when no boards are connected to the schema. Provide either id or name."}getInputSchema(){return Lm}async executeInternal(e){if(!e.id&&!e.name)throw new Error("Either id or name must be provided");const t={id:e.id,name:e.name},a=await this.mondayApi.request(xm,t);return{content:{message:`Object schema "${a.delete_object_schema?.name}" successfully deleted`,schema_id:a.delete_object_schema?.id,schema_name:a.delete_object_schema?.name}}}},class extends ue{constructor(){super(...arguments),this.name="delete_object_schema_columns",this.type=b.WRITE,this.annotations=me({title:"Delete Object Schema Columns",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Permanently delete columns from an account-level object schema. Only allowed when no boards are connected to the schema. Use manage_object_schema_column with action=deactivate for a reversible alternative. [REQUIRED PRECONDITION]: Call get_object_schemas first to resolve the schema id and the exact column ids — this deletion is irreversible, so never guess ids."}getInputSchema(){return Pm}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnIds:e.columnIds},a=await this.mondayApi.request(Um,t,{versionOverride:"dev"});return{content:{message:`${e.columnIds.length} column(s) successfully deleted from object schema "${a.delete_object_schema_columns?.name}"`,schema_id:a.delete_object_schema_columns?.id,schema_name:a.delete_object_schema_columns?.name,revision:a.delete_object_schema_columns?.revision}}}},class extends ue{constructor(){super(...arguments),this.name="manage_object_schema_board_connection",this.type=b.WRITE,this.annotations=me({title:"Manage Object Schema Board Connection",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Connect or detach a board from an account-level object schema. connect: attaches a board to an object schema so it inherits the schema column structure. detach: removes one or more boards from their object schema."}getInputSchema(){return Fm}async executeInternal(e){if("connect"===e.action){if(!e.boardId)throw new Error("boardId is required for action=connect");if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided for action=connect");const t={boardId:e.boardId,objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName},a=await this.mondayApi.request(Vm,t);return{content:{message:"Board successfully connected to object schema",connection_id:a.connect_board_to_object_schema?.id,schema_id:a.connect_board_to_object_schema?.object_schema_id}}}{if(!e.boardIds?.length)throw new Error("boardIds is required for action=detach");const t={boardIds:e.boardIds},a=(await this.mondayApi.request(Mm,t)).detach_boards_from_object_schema??[],i=a.filter((e=>e.success)).length,n=a.filter((e=>!e.success));return{content:{message:`${i} board(s) successfully detached`,results:a,...n.length>0&&{failures:n}}}}}},class extends ue{constructor(){super(...arguments),this.name="manage_object_schema_columns",this.type=b.WRITE,this.annotations=me({title:"Manage Object Schema Columns",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create or update columns on an account-level object schema. Column changes are propagated to all boards connected to the schema. create: adds new columns. Each column requires type and title. Call get_column_type_info with fetchMode "${Bm.Schema}" first to understand valid defaults per column type. update: modifies existing columns. Each entry must include column_id — call get_object_schemas first to resolve the schema id and the exact column ids. Only send the columns you want to modify — other columns are unaffected. Use opt_out_by_default=true to stop a column from being auto-added to boards (opt out), or opt_out_by_default=false to restore auto-adding (opt in).`}getInputSchema(){return Wm}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");if("create"===e.action){const t=e.columns.map((e=>{const t=e;return{type:t.type,title:t.title,description:t.description,defaults:t.defaults,opt_out_by_default:t.opt_out_by_default,policy:{can_override:t.policy?.can_override??[],cannot_delete:t.policy?.cannot_delete??!1}}})),a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columns:t},i=await this.mondayApi.request(zm,a);return{content:{message:`Columns successfully added to object schema "${i.create_object_schema_columns?.name}"`,schema_id:i.create_object_schema_columns?.id,schema_name:i.create_object_schema_columns?.name,revision:i.create_object_schema_columns?.revision}}}{const t={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columns:e.columns.map((e=>{const t=e;return{column_id:t.column_id,title:t.title,description:t.description,defaults:t.defaults,opt_out_by_default:t.opt_out_by_default,policy:t.policy?{can_override:t.policy.can_override??[],cannot_delete:t.policy.cannot_delete??!1}:void 0}}))},a=await this.mondayApi.request(jm,t);return{content:{message:`Columns successfully updated on object schema "${a.update_object_schema_columns?.name}"`,schema_id:a.update_object_schema_columns?.id,schema_name:a.update_object_schema_columns?.name,revision:a.update_object_schema_columns?.revision}}}}},class extends ue{constructor(){super(...arguments),this.name="set_object_schema_column_active_state",this.type=b.WRITE,this.annotations=me({title:"Set Object Schema Column Active State",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Set the active state of a column on an account-level object schema. [REQUIRED PRECONDITION]: Call get_object_schemas first to resolve the schema id, the column id, and its current active state. deactivate: soft-disables the column, preventing it from being used on new boards. The column is not deleted and can be restored. reactivate: restores a previously deactivated column, making it available again."}getInputSchema(){return Qm}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={deactivate:Go.Deactivate,reactivate:Go.Reactivate},a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnId:e.columnId,action:t[e.action]},i=await this.mondayApi.request(Ym,a);return{content:{message:`Column successfully ${e.action}d on object schema "${i.set_object_schema_column_active_state?.name}"`,schema_id:i.set_object_schema_column_active_state?.id,schema_name:i.set_object_schema_column_active_state?.name,revision:i.set_object_schema_column_active_state?.revision}}}},class extends ue{constructor(){super(...arguments),this.name="get_asset_upload_url",this.type=b.WRITE,this.annotations=me({title:"Get Asset Upload URL",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Get a presigned URL to upload a file to monday.com. Returns an upload_id and upload_url.\n\nOnly call this tool if you can execute a direct HTTP PUT with binary file data and read response headers (e.g. via shell/curl). If you can\'t, tell the user direct file upload isn\'t supported here — don\'t call this tool.\n\nAfter calling this tool, upload the file to the returned URL using an HTTP PUT request and capture the ETag header from the response:\n\ncurl -i -X PUT "<upload_url>" \\\n -H "Content-Type: <the contentType you provided>" \\\n --data-binary @<local_file_path>\n\nThe response includes an ETag header (e.g. ETag: "abc123...") — save this value.\n\nThen call finalize_asset_upload with the upload_id, etag, board_id, item_id, and column_id to complete the upload and attach the file to an item\'s file column.\n\nMax file size: 500MB.'}getInputSchema(){return Kg}async executeInternal(e){const t=(await this.mondayApi.request(Qg,{input:{file_name:e.fileName,content_type:e.contentType,file_size:e.fileSize,source:"mcp",multipart:!1}},{versionOverride:"dev"})).create_upload,a=t.parts[0]?.url;if(!a)throw new Error("create_upload returned no upload URL — parts array was empty");return{content:{upload_id:t.upload_id,upload_url:a,url_expires_at:t.expires_at}}}},class extends ue{constructor(){super(...arguments),this.name="finalize_asset_upload",this.type=b.WRITE,this.annotations=me({title:"Finalize Asset Upload",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Finalize a file upload and create the asset on monday.com. Call this after uploading the file to the presigned URL from get_asset_upload_url. Requires the etag value from the PUT response headers. Automatically attaches the uploaded asset to the specified file column on the item. Returns the created asset_id."}getInputSchema(){return Zg}async executeInternal(e){const t=(await this.mondayApi.request(Jg,{input:{upload_id:e.uploadId,holder:{type:"ITEM",id:e.itemId},board_id:e.boardId,parts:[{part_number:1,etag:e.etag}]}},{versionOverride:"dev"})).complete_upload,a=JSON.stringify({added_file:{fileType:"ASSET",name:t.filename,assetId:String(t.id)}});return await this.mondayApi.request(Xg,{boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,value:a}),{content:{asset_id:t.id,filename:t.filename,content_type:t.content_type,file_size:t.file_size,url:t.url,filelink:t.filelink}}}},class extends ue{constructor(){super(...arguments),this.name="link_board_items_workflow",this.type=b.READ,this.annotations=me({title:"Link Board Items Workflow",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the required playbook for linking items across boards via board-relation columns. When to use: any board-relation / cross-board linking task. **Hard gate — you MUST call this BEFORE get_board_items_page, or change_item_column_values in the same turn. No discovery, matching, or write happens first.** Triggers: **link** or **connect** items **across boards** (board-relation / "connect boards" / pairs) — also vague phrasings where only one side is named ("link this to **an** item on another board", "**the matching** row"). This tool is read-only (no API).'}getInputSchema(){return ty}async executeInternal(e){return{content:ey}}},class extends ue{constructor(){super(...arguments),this.name="fetch_file_content",this.type=b.READ,this.annotations=me({title:"Fetch File Content",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch and extract the text content from a file stored in a monday.com files column.\n\nUse this tool when you need to read, summarize, or analyze the content of files attached to board items. Provide the item ID and column ID from the get_board_items_page response — the column value will be a URL like \"https://monday.com/protected_static/...\" indicating a file is present (null means no file).\n\nPROACTIVE USE: If you retrieve board items and notice a files column with a non-null value (a URL), consider fetching its content if it could help answer the user's question — don't wait to be explicitly asked.\n\nSupported file types and what is returned:\n- Text files (.txt, .md, .csv, .json): raw text content\n- Word documents (.docx): extracted text content\n- PDF files (.pdf): extracted text content\n- Excel files (.xlsx, .xls): extracted text content per sheet\n- Images (.png, .jpg, .gif, .webp, .svg, .bmp, .ico): returns the public URL so you can view or analyze the image directly\n\nText responses include a total_length field. If has_more is true, the content was truncated — you can call this tool again with next_offset if you need the remaining content. For very large Excel workbooks, extraction_truncated: true means the text was cut short and the rest of the workbook is not available.\n\nWhen to use:\n- User asks to summarize, read, or analyze the content of a file in a files column\n- User asks questions about what is inside a file (e.g., \"what does the PDF say?\")\n- User wants to extract data from a CSV or Excel file attached to a board item\n- A board item has a files column with a non-null value and the user's question may be answered by its content — even if the user didn't explicitly ask to read the file\n\nWhen NOT to use:\n- The files column value is null (no file uploaded for that item)"}getInputSchema(){return gy}async executeInternal(e){const{item_id:t,column_id:a,file_name:i,offset:n=0}=e,o=await this.mondayApi.request(ay,{itemId:t,columnId:a}),r=o?.items?.[0]?.assets;if(!r||0===r.length)return{content:{message:`No file found for item ${t} in column ${a}. The column may be empty or the column ID may be incorrect.`}};const s=this.isXlsxStreamingEnabled()?dy:py;return{content:{files:await Promise.all(r.map((e=>vy(e,n,s,i))))}}}isXlsxStreamingEnabled(){return this.context?.deps?.flagChecker?.("mcp-fetch-file-content-xlsx-streaming")??!0}},class extends ue{constructor(){super(...arguments),this.name="list_automations",this.type=b.READ,this.annotations=me({title:"List Board Automations",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'List all automations on a specific monday.com board, including their ids, titles, active state, and configuration.\nReturns two groups: "workflows" (fully manageable, supports pagination via limit/cursor) and "legacyAutomations" (READ-ONLY automations set up in an older way — returned on the first page only, when no cursor is given).\nAlways present BOTH groups to the user together as one list of board automations — never omit or hide "legacyAutomations". The split and the read-only limitation are internal context for you only: don\'t volunteer them and don\'t label any automation "legacy" or "read-only". Only if the user asks to act on a legacy one, briefly explain it can\'t be changed (e.g. "This one was set up in an older way and can\'t be modified here").\nCall this FIRST before manage_automations — it is the only way to resolve an automation id from a name or description. Never guess an automation id.\nWhen NOT to use: Do not call this tool to get general board information unrelated to automations.\n'}getInputSchema(){return Ey}async executeInternal(e){try{const a=!e.cursor,i={boardIds:[e.boardId],limit:e.limit??100,includeLegacy:a,...e.cursor?{cursor:e.cursor}:{}},n=await this.mondayApi.request(Iy,i),o=(n.board_automations?.items??[]).map(Ty),r=n.board_automations?.cursor??null,s=a?(t=n.board_automations?.legacy_automations,null==t||"object"==typeof t&&"error"in t?null:t):null;return{content:{message:`Found ${o.length} live workflow(s) on board ${e.boardId}`,workflows:o,...null!=s?{legacyAutomations:s}:{},pagination:{nextCursor:r,hasMore:null!==r}}}}catch(e){nm(e,"list live workflows")}var t}},class extends ue{constructor(){super(...arguments),this.name="manage_automations",this.type=b.WRITE,this.annotations=me({title:"Manage Automations",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Activate, deactivate, or delete an existing monday.com automation.\n\nRequires an automation id. When the user refers to an automation by name, always call list_automations first to resolve the id — never guess or infer ids.\n\nActions:\n- activate: enables a paused automation so it starts responding to its trigger.\n- deactivate: pauses an automation while preserving its definition.\n- delete: permanently removes an automation — irreversible.\n\nWhen intent is ambiguous ("stop", "turn off", "pause"), prefer deactivate over delete.'}getInputSchema(){return Ny}async executeInternal(e){const t=e;switch(t.action){case"activate":return this.activateWorkflow(t);case"deactivate":return this.deactivateWorkflow(t);case"delete":return this.deleteWorkflow(t)}}async activateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(Ay,t,{versionOverride:"dev"});if(!a.activate_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} activation did not report success`);return{content:{message:`Workflow ${e.workflowId} activated`,workflowId:e.workflowId,isActive:!0}}}catch(e){nm(e,"activate workflow")}}async deactivateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(Sy,t,{versionOverride:"dev"});if(!a.deactivate_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} deactivation did not report success`);return{content:{message:`Workflow ${e.workflowId} deactivated`,workflowId:e.workflowId,isActive:!1}}}catch(e){nm(e,"deactivate workflow")}}async deleteWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(Dy,t,{versionOverride:"dev"});if(!a.delete_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} deletion did not report success`);return{content:{message:`Workflow ${e.workflowId} deleted`,workflowId:e.workflowId}}}catch(e){nm(e,"delete workflow")}}},class extends ue{constructor(e,t,a){super(e,a),this.apiToken=t,this.name="create_automation",this.type=b.WRITE,this.annotations=me({title:"Create Automation",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'\n Creates an automation on a monday board from a structured natural-language description.\n\nUse this tool only when you know:\n- boardId\n- the user\'s intended trigger\n- at least one intended action\n- any details the user provided that are relevant to the trigger, conditions, or actions\n\nThe caller does not need to know the exact available automation blocks or their required fields. Describe the user\'s intent clearly — the tool will translate that intent into supported blocks and values.\n\nIf a required detail is missing from the user\'s request, ask for clarification before calling the tool.\n\nIf the tool returns status: "needs_clarification", present the unresolved fields to the user, gather answers, then call the tool again.\n\nDescribe the automation in this format:\n\nTrigger:\n When <the event that should start the automation>\n Details:\n <relevant detail>: <value>\n\nConditions:\n - Only if <condition that should be true>\n Details:\n <relevant detail>: <value>\n\nActions:\n - <action the automation should perform>:\n <relevant detail>: <value>\n\nRules:\n- Use one trigger.\n- Conditions are optional.\n- Multiple conditions mean AND.\n- Use one or more actions.\n- Do not use branching.\n- Use natural language, not block IDs or internal field names.\n- Actions may reference values from the trigger context, such as "{{item name}}", "{{creator}}", "{{status}}", "{{group}}", or "{{board}}".\n\nTerminology:\n- Trigger: the event that starts the automation, such as "when a new item is created".\n- Conditions: optional requirements that must be true before actions run.\n- Actions: what the automation does when it runs.\n\nExample:\n\nTrigger:\n When a new item is created\n\nActions:\n - Send a notification:\n Recipient: John Snow\n Title: Important Update\n Message: The item "{{item name}}" was created.\n\n - Move the item to a group:\n Group: Top group\n'}getInputSchema(){return ky}async executeInternal(e){try{const a="function"==typeof this.apiToken?this.apiToken():this.apiToken,i=(t=this.context,t?.fetchConfig?.fetch??Oy),n=await i({serviceName:"platform-agent",path:"/platform-ai-gateway/agents/lite-builder",method:"POST",headers:{...this.context?.fetchConfig?.fetch?{}:{Authorization:a},"Content-Type":"application/json"},body:JSON.stringify({userPrompt:e.userPrompt,boardId:e.boardId}),signal:AbortSignal.timeout(18e4)});if(!n.ok){const e=await n.text().catch((()=>""));throw new im(`lite-builder responded with HTTP ${n.status}${e?`: ${e}`:""}`,"UPSTREAM_HTTP_ERROR")}return{content:await n.json()}}catch(e){nm(e,"create automation")}var t}},class extends ue{constructor(){super(...arguments),this.name="get_automation_runs",this.type=b.READ,this.annotations=me({title:"Get Automation Runs",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Read automation/workflow run history. Read-only.\n\nModes:\n- "history": paginated run feed (state, duration, error reason). Use "filters" to narrow results and "nextPageOffset" to page (offset-only — next page = previous offset + returned count).\n- "detail": single run by "triggerUuid" (required) — returns block steps and MCP tool calls. Set "includeToolEvents": false to skip tool calls.\n\nScope: provide "boardId" for a specific board or "accountWide": true. One is required.\n\nKnown event states: "success", "failure", "exhausted".'}getInputSchema(){return Py}async executeInternal(e){if(!e.boardId&&!e.accountWide)return{content:{message:'Either "boardId" or "accountWide": true must be provided.'}};try{return"detail"===e.mode?await this.runDetail(e):await this.runHistory(e)}catch(e){nm(e,"get automation runs")}}async runHistory(e){const t=e.nextPageOffset??0,a={...e.filters??{},...e.boardId?{boardId:e.boardId}:{}},i=await this.mondayApi.request(Cy,{nextPageOffset:t,filters:a}),n=i.trigger_events?.triggerEvents??[],o=function(e){return e.reduce(((e,t)=>{const a=t.eventState??"unknown";return e[a]=(e[a]??0)+1,e}),{})}(n),r=e.boardId?`board ${e.boardId}`:"account-wide";return{content:{message:`Returned ${n.length} run(s) (${r}) at offset ${t}. By state: ${function(e){const t=Object.entries(e).map((([e,t])=>`${e}=${t}`));return t.length?t.join(", "):"none"}(o)}. Offset-only pagination — for the next page request offset ${t+n.length}.`,scope:r,offset:t,count:n.length,stateCounts:o,runs:n}}}async runDetail(e){if(!e.triggerUuid)return{content:{message:'detail mode requires "triggerUuid".'}};const t=!1!==e.includeToolEvents,a=e.blockEventsOffset??0,i=e.toolEventsOffset??0,n=(await this.mondayApi.request($y,{triggerUuid:e.triggerUuid})).trigger_event;if(!n)return{content:{message:`No run found for triggerUuid ${e.triggerUuid}.`,triggerUuid:e.triggerUuid,found:!1}};const[o,r]=await Promise.all([this.mondayApi.request(xy,{triggerUuid:e.triggerUuid,nextPageOffset:a}),t?this.mondayApi.request(Ly,{triggerUuid:e.triggerUuid,nextPageOffset:i}):Promise.resolve(null)]),s=o.block_events?.blockEvents??[],d=r?.tool_events?.tool_events??[];return{content:{message:`Run ${e.triggerUuid}: state=${n.eventState??"unknown"}, ${s.length} block step(s), ${d.length} tool call(s).`,found:!0,run:n,blockEvents:s,blockEventsOffset:a,toolEvents:d,toolEventsOffset:i,toolEventsIncluded:t}}}},class extends ue{constructor(){super(...arguments),this.name="get_automation_statistics",this.type=b.READ,this.annotations=me({title:"Get Automation Statistics",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Aggregate automation run statistics. Read-only.\n\nBreakdowns:\n- "totals": success/failure/total counts at the account or board level.\n- "by_entity": per-automation and per-workflow counts for a given "runStatus" (required: "success" | "failure" | "exhausted"). Use "excludeAutomationIds" to omit specific automations.\n\nScope: provide "boardId" for a specific board or "accountWide": true. One is required.\n\nOptional "userIds" narrows results to specific creators.'}getInputSchema(){return Fy}async executeInternal(e){if(!e.boardId&&!e.accountWide)return{content:{message:'Either "boardId" or "accountWide": true must be provided.'}};const t=e.boardId?function(e){const t=Number(e.trim());if(!Number.isInteger(t)||t<=0)throw new Error(`Invalid boardId: '${e}' is not a positive integer.`);return t}(e.boardId):void 0,a=e.boardId?`board ${e.boardId}`:"account-wide";try{return"by_entity"===e.breakdown?await this.runByEntity(e,t,a):await this.runTotals(e,t,a)}catch(e){nm(e,"get automation statistics")}}async runTotals(e,t,a){const i=(await this.mondayApi.request(Vy,{filters:{board_id:t,user_ids:e.userIds}})).account_trigger_statistics;return{content:{message:`Totals (${a}): success=${i?.success??0}, failure=${i?.failure??0}, total=${i?.total??0}.`,scope:a,breakdown:"totals",statistics:i}}}async runByEntity(e,t,a){if(!e.runStatus)return{content:{message:'by_entity breakdown requires "runStatus" (success | failure | exhausted).'}};const i=(await this.mondayApi.request(My,{runStatus:e.runStatus,filters:{board_id:t,automation_ids:e.excludeAutomationIds,user_ids:e.userIds}})).account_triggers_statistics_by_entity_id;return{content:{message:`By-entity '${e.runStatus}' statistics (${a}).`,scope:a,breakdown:"by_entity",runStatus:e.runStatus,automationStatistics:i?.automation_statistics,workflowStatistics:i?.workflow_statistics}}}},class extends ue{constructor(){super(...arguments),this.name="configure_ai_column",this.type=b.WRITE,this.annotations=me({title:"Configure AI Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add AI to a column or set up an AI column on a monday.com board. Use this tool when the user wants to automatically categorize, summarize, translate, extract, generate text, improve writing, or assign people using AI on a column. This is the right tool for requests like "add AI to a column", "set up automatic extraction/categorization/summarization", "make a column use AI", "configure AI on a column", or "use AI to automatically fill a column".\n\nThe column must already exist on the board with a compatible type for the chosen block. To create a new AI column, first use create_column to create the column, then use this tool to add AI behavior.\n\nBLOCK TYPES (only pass fields that apply to the chosen block_type):\n- categorize: { block_type, source_type, source_column_id?, additional_instructions? } — assigns labels from target column\'s existing status/dropdown options\n- summarize: { block_type, source_type, source_column_id?, additional_instructions? } — generates concise summaries\n- translate: { block_type, source_type, source_column_id?, target_language } — translates to target language\n- improve_text: { block_type, source_type, source_column_id?, tone?, improver_length?, refinement_type? } — rewrites/fixes text\n- extract: { block_type, source_type, source_column_id?, entity_type, custom_instructions?, additional_instructions? } — extracts structured info\n- open_block: { block_type, ai_query } — flexible custom prompt, reference columns via {pulse.column_id}\n- write_me: { block_type, ai_query, tone, output_length } — generates new text from prompt\n- person_assignment: { block_type, source_type, source_column_id?, groups } — assigns people based on context\n\nSOURCE TYPES (required for all blocks except open_block and write_me):\n- item_name: uses the item\'s name as input\n- thread: uses the item\'s updates/comments as input\n- column: uses another column\'s value (requires source_column_id)\n- emails_and_activities: uses emails & activities (categorize only)\n\nCOLUMN REFERENCE SYNTAX (for open_block and write_me ai_query):\n- {pulse.column_id} — regular board column\n- {pulse.name} — the item name\n- {pulse.subitem.column_id} — subitem column\n\nRELATED TOOLS:\n- create_column — create the target column first if it doesn\'t exist\n- get_board_schema — discover existing columns and their types/IDs'}getInputSchema(){return Qy}async executeInternal(e){const t=void 0!==e.run_backfill?{run_backfill:e.run_backfill}:void 0;try{switch(e.block_type){case"categorize":return this.handleCategorize(e.board_id,e,t);case"summarize":return this.handleSummarize(e.board_id,e,t);case"translate":return this.handleTranslate(e.board_id,e,t);case"improve_text":return this.handleImproveText(e.board_id,e,t);case"extract":return this.handleExtract(e.board_id,e,t);case"open_block":return this.handleOpenBlock(e.board_id,e,t);case"write_me":return this.handleWriteMe(e.board_id,e,t);case"person_assignment":return this.handlePersonAssignment(e.board_id,e,t)}}catch(e){nm(e,"configure AI column")}}validateSourceType(e,t){if(!e.source_type)throw new Error(`source_type is required for ${t} block`);if("column"===e.source_type&&!e.source_column_id)throw new Error('source_column_id is required when source_type is "column"')}async handleCategorize(e,t,a){this.validateSourceType(t,"categorize");const i=await this.mondayApi.request(By,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_categorize_ai_column?.column_id}}}async handleSummarize(e,t,a){this.validateSourceType(t,"summarize");const i=await this.mondayApi.request(zy,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_summarize_ai_column?.column_id}}}async handleTranslate(e,t,a){if(this.validateSourceType(t,"translate"),!t.target_language)throw new Error("target_language is required for translate block");const i=await this.mondayApi.request(jy,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,targetLanguage:t.target_language,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_translate_ai_column?.column_id}}}async handleImproveText(e,t,a){this.validateSourceType(t,"improve_text");const i=await this.mondayApi.request(qy,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,tone:t.tone,length:t.improver_length,refinementType:t.refinement_type,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_improve_text_ai_column?.column_id}}}async handleExtract(e,t,a){if(this.validateSourceType(t,"extract"),!t.entity_type)throw new Error("entity_type is required for extract block");if("custom"===t.entity_type&&!t.custom_instructions)throw new Error('custom_instructions is required for extract block when entity_type is "custom"');const i=await this.mondayApi.request(Gy,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,entityType:t.entity_type,customInstructions:t.custom_instructions,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_extract_ai_column?.column_id}}}async handleOpenBlock(e,t,a){if(!t.ai_query)throw new Error("ai_query is required for open_block block");const i=await this.mondayApi.request(Hy,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_open_block_ai_column?.column_id}}}async handleWriteMe(e,t,a){if(!t.ai_query)throw new Error("ai_query is required for write_me block");if(!t.tone)throw new Error("tone is required for write_me block");if(!t.output_length)throw new Error("output_length is required for write_me block");const i=await this.mondayApi.request(Wy,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,tone:t.tone,length:t.output_length,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_write_me_ai_column?.column_id}}}async handlePersonAssignment(e,t,a){if(this.validateSourceType(t,"person_assignment"),!t.groups||0===t.groups.length)throw new Error("groups is required for person_assignment block");const i=await this.mondayApi.request(Yy,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,groups:t.groups,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_person_assignment_ai_column?.column_id}}}},class extends ue{constructor(){super(...arguments),this.name="remove_ai_from_column",this.type=b.WRITE,this.annotations=me({title:"Remove AI from Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0})}getDescription(){return"Remove AI from a column on a monday.com board. Use this tool when the user wants to disable AI on a column, turn off AI automation, stop AI from running on a column, or delete the AI behavior from a column. This deletes all AI automation recipes and the app feature extension associated with the column. The column itself is not deleted — only its AI behavior is removed.\n\nUse get_board_schema to find column IDs before calling this tool."}getInputSchema(){return Jy}async executeInternal(e){try{const t=await this.mondayApi.request(Ky,{boardId:e.board_id.toString(),columnId:e.column_id});return{content:{message:"AI removed from column successfully",column_id:t.remove_ai_from_column?.column_id,success:t.remove_ai_from_column?.success}}}catch(e){nm(e,"remove AI from column")}}},class extends ue{constructor(){super(...arguments),this.name="submit_bug_or_feature_request",this.type=b.READ,this.annotations=me({title:"Submit Bug or Feature Request",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Report a bug, submit a feature request, or share feedback about the monday.com product or this integration.\n\nCall this tool proactively — not just when a user explicitly asks. Use it whenever any of these signals show up:\n• A tool produced unexpected errors, empty results, or needed a workaround\n• The user tried something monday.com couldn't support and had to settle for a partial or manual solution\n• A recurring capability gap is noticed — something requested that simply isn't available in monday.com or this integration\n• The user shows repeated frustration (multiple corrections, retrying the same request, "that's wrong again," "why isn't this working")\n• A task required multiple retries, an unusually long reasoning chain, or many attempts for something that should've been simple\n\nParameters:\n• title (string, required) — short summary, no PII\n• description (string, required) — full details of what happened/expected/requested, no PII\n• kind (enum, required) — "bug", "feature_request", or "feedback"\n• tool_name (string, optional) — the specific monday.com tool the feedback relates to (e.g. "create_item")\n\nRestriction: Use strictly for things related to monday.com — not for other tools (Google Drive, Slack, GitHub, etc.) that may be in the conversation context. ${Xy}`}getInputSchema(){return Zy}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,this.sessionContext.metadata.title=e.title,this.sessionContext.metadata.description=e.description,e.tool_name&&(this.sessionContext.metadata.tool_name=e.tool_name),{content:{message:"Feedback submitted successfully. Thank you for helping improve the monday.com MCP server."}}}},class extends ue{constructor(){super(...arguments),this.name="get_monday_knowledge",this.type=b.READ,this.annotations=me({title:"Get Monday Knowledge",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Ask a question about monday.com and get an AI-generated answer from the official knowledge base.\n\nUse kind="general" for questions about using monday.com — features, automations, UI, help center, and settings. Returns cited source articles with links.\nUse kind="developer_docs" for questions about the monday.com API — GraphQL queries and mutations, authentication, rate limits, webhooks, schema, API best practices, and building apps.\n\nImportant: do not include PII data in the questions.'}getInputSchema(){return nv}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,e.kind===av?this.queryDeveloperDocs(e.query):this.queryGeneralKnowledge(e.query)}async queryGeneralKnowledge(e){const t={query:e},a=(await this.mondayApi.request(ev,t)).knowledge_base_search;a?.answer||nm(new Error("No answer found in the knowledge base. Try rephrasing your question."),"get_monday_knowledge"),this.sessionContext.metadata??={},this.sessionContext.metadata.query=e,this.sessionContext.metadata.answer=a.answer;const i=(a.raw_snippets??[]).filter((e=>e.url&&e.title)).map((e=>({title:e.title,url:e.url,snippet:e.text??""})));return{content:{answer:a.answer,sources:i,kind:iv}}}async queryDeveloperDocs(e){const t={query:e,retrieval_only:!0},a=(await this.mondayApi.request(tv,t)).ask_developer_docs;return a?.answer||nm(new Error("No answer found in developer docs. Try rephrasing your question."),"get_monday_knowledge"),this.sessionContext.metadata??={},this.sessionContext.metadata.query=e,this.sessionContext.metadata.answer=a.answer,{content:{answer:a.answer,sources:[],kind:av}}}}];var Pv;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(Pv||(Pv={}));const Vv=(e,t)=>{let a=[];t?.mode===Pv.APPS?a=[...ce]:t?.mode!==Pv.API&&t?.mode||(a=[...Uv,...Lv]);const i=a.map((t=>((e,t)=>e.prototype instanceof ue?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof j?new e(t.apiToken):new e)(t,e)));return i.filter((e=>{if(!t)return e.type!==b.ALL_API;if(t.mode===Pv.API&&"only"===t.enableDynamicApiTools)return e.type===b.ALL_API;let a=!1;return t.mode===Pv.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===b.ALL_API),t.readOnlyMode&&(a=a||e.type!==b.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))},Mv=e=>"object"==typeof e?JSON.stringify(e):e;exports.MondayAgentToolkit=class{constructor(e){this.mondayApiToken=e.mondayApiToken,this.context={...e.context,apiVersion:e.mondayApiVersion??B,...e.deps?{deps:{...e.context?.deps,...e.deps}}:{}},this.tools=this.initializeTools(e)}initializeTools(t){const a={apiClient:"function"==typeof t.mondayApiToken?()=>new e.ApiClient({token:t.mondayApiToken(),apiVersion:t.mondayApiVersion??B,endpoint:t.mondayApiEndpoint,requestConfig:t.mondayApiRequestConfig}):new e.ApiClient({token:t.mondayApiToken,apiVersion:t.mondayApiVersion??B,endpoint:t.mondayApiEndpoint,requestConfig:t.mondayApiRequestConfig}),apiToken:this.mondayApiToken,context:this.context};return Vv(a,t.toolsConfiguration)}getTools(){return this.tools.map((e=>{const t=e.getInputSchema();return{type:"function",function:{name:e.name,description:e.getDescription(),parameters:t?f.zodToJsonSchema(i.z.object(t)):void 0}}}))}async handleToolCall(e){const{name:t,arguments:a}=e.function,n=JSON.parse(a),o=this.tools.find((e=>e.name===t));if(!o)throw new Error(`Unknown tool: ${t}`);const r=o.getInputSchema();if(r){const t=i.z.object(r).safeParse(n);if(!t.success)throw new Error(`Invalid arguments: ${t.error.message}`);const a=await o.execute(t.data);return{role:"tool",tool_call_id:e.id,content:Mv(a.content)}}{const t=await o.execute();return{role:"tool",tool_call_id:e.id,content:Mv(t.content)}}}};
2970
+ `),i=await this.mondayApi.request(a);return i.__type?{content:{message:"Type details retrieved",data:{name:i.__type.name,kind:i.__type.kind,description:i.__type.description??null,fields:i.__type.fields??[],inputFields:i.__type.inputFields??[],interfaces:i.__type.interfaces??[],enumValues:i.__type.enumValues??[],possibleTypes:i.__type.possibleTypes??[]}}}:{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`}}catch(e){const t=e instanceof Error?e.message:"Unknown error",a=t.includes("JSON");return{content:`Error fetching type details: ${t}${a?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var t}},class extends ue{constructor(){super(...arguments),this.name="create_custom_activity",this.type=b.WRITE,this.annotations=me({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return Hh}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(qc,t),{content:{message:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`,name:e.name,color:e.color,icon_id:e.icon_id}}}},class extends ue{constructor(){super(...arguments),this.name="create_notification",this.type=b.WRITE,this.annotations=me({title:"Create Notification",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Send a notification to a user via the bell icon and optionally by email. Use target_type "Post" for updates/replies or "Project" for items/boards.'}getInputSchema(){return Yh}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{const a=await this.mondayApi.request(Wh,t);if(!a.create_notification?.id)throw new im(`No notification was created for user ${e.user_id} on ${e.target_type} target ${e.target_id}. Verify the user has access to the target and that target_id matches target_type ("Post" for an update/reply id, "Project" for an item/board id).`,tm);return{content:{message:`Notification ${a.create_notification.id} sent to user ${e.user_id}`,notification_id:a.create_notification.id,user_id:e.user_id,target_id:e.target_id,target_type:e.target_type,text:a.create_notification.text??e.text}}}catch(t){nm(t,`send notification to user ${e.user_id}`)}}},class extends ue{constructor(){super(...arguments),this.name="create_timeline_item",this.type=b.WRITE,this.annotations=me({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return pf}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(Gc,t);return{content:{message:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`,timeline_item_id:a.create_timeline_item?.id,item_id:e.item_id,title:e.title}}}},class extends ue{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=b.READ,this.annotations=me({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return Rf}async executeInternal(e){const t=await this.mondayApi.request(Hc);if(!t.custom_activity||0===t.custom_activity.length)return{content:{message:"No custom activities found",data:[]}};const a=t.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:{message:`Found ${a.length} custom activities`,data:a}}}},class extends ue{constructor(){super(...arguments),this.name="read_docs",this.type=b.READ,this.annotations=me({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get information about monday.com documents. Supports two modes:\n\nMODE: "content" (default) — Fetch documents with their full markdown content.\n- Requires: type ("ids" | "object_ids" | "workspace_ids") and ids array\n- For a doc that lives as a board view, pass board_id and view_id instead of type/ids. They are the ids in the board URL: https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Omit view_id to read every doc view of the board. Such docs cannot be found by type "ids"/"object_ids".\n- Supports pagination via page/limit. Check has_more_pages in response.\n- If type "ids" returns no results, automatically retries with object_ids.\n- Set include_blocks: true to include block IDs, types, and positions in the response — required before calling update_doc.\n- Blocks default to 25 per page. Use blocks_limit and blocks_page to paginate through long documents.\n- Set include_comments: true to fetch all comments and replies on the document. Each comment is enriched with anchor info (block_id, selection_from, selection_length) indicating which block and text range it\'s attached to. Use comments_limit to control how many comments per item (default 50).\n\nMODE: "version_history" — Fetch the edit history of a single document.\n- Requires: ids with the document\'s object_id (use the object_id field from content mode results, NOT the id field).\n- The object_id is the numeric ID visible in the document URL.\n- Returns restoring points sorted newest-first. Use version_history_limit to cap results (e.g., "last 3 changes" → version_history_limit: 3).\n- Use since/until to filter by time range. If omitted, returns full history.\n- Set include_diff: true to see what content changed between versions (fetches up to 10 diffs, may be slower).\n- Examples:\n - { mode: "version_history", ids: ["5001466606"], version_history_limit: 3 }\n - { mode: "version_history", ids: ["5001466606"], since: "2026-03-11T00:00:00Z", include_diff: true }'}getInputSchema(){return X_}async executeInternal(e){return e.mode===K_?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!(e.board_id||e.type&&e.ids&&0!==e.ids.length))throw new im('type and ids are required when mode is "content", unless board_id is provided.',am);let t,a,i;switch(this.sessionContext.metadata={...this.sessionContext.metadata,mode:e.mode??Q_,include_comments:e.include_comments??!1,include_blocks:e.include_blocks??!1,...e.board_id&&{board_id:e.board_id,view_id:e.view_id}},e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":i=e.ids}const n=e.include_blocks??!1,o=n?{blocksLimit:e.blocks_limit,blocksPage:e.blocks_page}:{},r={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n,...o};if(e.board_id){const t=await H_(this.mondayApi,e.board_id,e.view_id,{includeBlocks:n,blocksLimit:e.blocks_limit,blocksPage:e.blocks_page});return 0===t.length?{content:Y_(e.board_id,e.view_id)}:(this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:t.map((e=>e.id)),object_ids:t.flatMap((e=>e.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(t,r,n,e.include_comments??!1,e.comments_limit??50,e.blocks_limit,e.blocks_page))}let s=await this.mondayApi.request(Oc,r);if((!s.docs||0===s.docs.length)&&t){const a={ids:void 0,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n,...o};s=await this.mondayApi.request(Oc,a)}if(!s.docs||0===s.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const d=e.include_comments??!1,p=e.comments_limit??50;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:s.docs.flatMap((e=>e?[e.id]:[])),object_ids:s.docs.flatMap((e=>e?.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(s.docs,r,n,d,p,e.blocks_limit,e.blocks_page)}catch(e){nm(e,"read documents")}}async executeVersionHistory(e){const{include_diff:t,since:a,until:i,version_history_limit:n}=e,o=e.ids?.[0];if(!o)throw new im('ids is required when mode is "version_history". Provide the document object_id.',am);this.sessionContext.metadata={...this.sessionContext.metadata,mode:K_,object_ids:[o]};try{const e={docId:o,since:a,until:i},r=await this.mondayApi.request(kc,e);let s=r?.doc_version_history?.restoring_points;if(!s||0===s.length)return{content:`No version history found for document ${o}${a?` from ${a}`:""}.`};if(!t)return n&&(s=s.slice(0,n)),{content:{doc_id:o,since:a,until:i,restoring_points:s}};const d=Math.min(n??10,10),p=s.slice(0,d+1),l=s.length>d,c=(await Promise.allSettled(p.map((async(e,t)=>{if(t===p.length-1||!e.date)return e;const a=p[t+1];if(!a?.date)return e;const i={docId:o,date:e.date,prevDate:a.date},n=await this.mondayApi.request(Cc,i);return{...e,diff:n?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,t)=>"fulfilled"===e.status?e.value:p[t]))))).slice(0,d);return{content:{doc_id:o,since:a,until:i,restoring_points:c,...l&&{truncated:!0,total_count:s.length}}}}catch(e){nm(e,`fetch version history for document ${o}`)}}buildCommentAnchorMap(e){const t=new Map;for(const a of e){const e=a.content?.deltaFormat;if(!e||!Array.isArray(e))continue;let i=0;for(const n of e){const e=n.insert,o="string"==typeof e?e.length:1,r=n.attributes,s=r?.comments;if(s&&Array.isArray(s))for(const e of s){const n=String(e),r=t.get(n);if(r&&r.block_id===a.id){const e=Math.max(r.selection_from+r.selection_length,i+o);r.selection_length=e-r.selection_from}else r||t.set(n,{block_id:a.id,selection_from:i,selection_length:o})}i+=o}}return t}async fetchDocComments(e,t,a){try{const i={boardId:e,itemsLimit:100,updatesLimit:a},[n,o]=await Promise.all([this.mondayApi.request(Rc,i),this.mondayApi.request(z_,{docId:t}).catch((()=>null))]),r=n.boards?.[0]?.items_page?.items;if(!r)return[];let s=new Map;if(o){const e=(o.docs?.[0]?.blocks??[]).filter((e=>null!=e)).map((e=>{let t;if("string"==typeof e.content)try{t=JSON.parse(e.content)}catch{t={}}else t=e.content??{};return{id:e.id??"",type:e.type??"",content:t}}));s=this.buildCommentAnchorMap(e)}const d=[];for(const e of r)if(e.updates&&0!==e.updates.length)for(const t of e.updates)d.push({id:t.id,text_body:t.text_body,body:t.body,created_at:t.created_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:e.id,item_name:e.name,anchor:s.get(t.id)??null,replies:(t.replies??[]).map((e=>({id:e.id,text_body:e.text_body,body:e.body,created_at:e.created_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))});return d}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,i=!1,n=50,o,r){const s=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t,s="";try{const t={docId:e.id},a=await this.mondayApi.request(Wc,t);s=a.export_markdown_from_doc.success&&a.export_markdown_from_doc.markdown?a.export_markdown_from_doc.markdown:`Error getting markdown: ${a.export_markdown_from_doc.error||"Unknown error"}`}catch(e){s=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return i&&e.object_id&&(t=await this.fetchDocComments(e.object_id,e.id,n)),{id:e.id,object_id:e.object_id,name:e.name,doc_kind:e.doc_kind,created_at:e.created_at,created_by:e.created_by?.name||"Unknown",url:e.url,relative_url:e.relative_url,workspace:e.workspace?.name||"Unknown",workspace_id:e.workspace_id,doc_folder_id:e.doc_folder_id,settings:e.settings,...a&&{blocks:(e.blocks??[]).filter((e=>null!=e)).map((e=>({id:e.id,type:e.type,parent_block_id:e.parent_block_id,position:e.position,content:e.content}))),...void 0!==o||void 0!==r?{blocks_pagination:{current_page:r??1,limit:o??25,count:(e.blocks??[]).filter((e=>null!=e)).length,has_more_pages:(e.blocks??[]).length===(o??25)}}:{}},blocks_as_markdown:s,...i&&{comments:t}}}))),d=t.page||1,p=t.limit||25,l=s.length,c=l===p;return{content:{message:`Documents retrieved (${s.length})`,pagination:{current_page:d,limit:p,count:l,has_more_pages:c},data:s}}}},class extends ue{constructor(){super(...arguments),this.name="workspace_info",this.type=b.READ,this.annotations=me({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 Z_}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(Yc,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e,t){const{workspaces:a,boards:i,docs:n,folders:o}=e,r=a?.[0];if(!r)throw new Error("No workspace found");const s=new Map((o||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),d=[];(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(t):d.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&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(t):p.push(t)})),{workspace:{id:r.id,name:r.name,url:t?R_(t,r.id):void 0,description:r.description||"",kind:r.kind||"",created_at:r.created_at||"",state:r.state||"",is_default_workspace:r.is_default_workspace||!1,owners_subscribers:(r.owners_subscribers||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name&&null!=e.email)).map((e=>({id:e.id,name:e.name,email:e.email})))},folders:Array.from(s.values()),root_items:{boards:d,docs:p}}}(a,await k_(this.mondayApi));return{content:{message:"Workspace info retrieved",data:i}}}},class extends ue{constructor(){super(...arguments),this.name="list_workspaces",this.type=b.READ,this.annotations=me({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'List all workspaces available to the user, ordered by membership (user\'s workspaces first). Returns workspaces with their ID, name, and description.\n[IMPORTANT] To search for workspaces by name, use the "search" tool with searchType WORKSPACES instead — it provides faster and more accurate results.'}getInputSchema(){return ib}async executeInternal(e){const t=t=>({limit:e.limit,page:e.page,membershipKind:t}),a=tb(await this.mondayApi.request(eb,t(nl.Member)));let i=a;if(!ab(a)){i=tb(await this.mondayApi.request(eb,t(nl.All)))}if(!ab(i))return{content:{message:"No workspaces found.",data:[]}};const n=i.length===e.limit,o=await k_(this.mondayApi),r=i.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:o&&e.id?R_(o,e.id):void 0})));return{content:{message:"Workspaces retrieved",...n?{next_page:e.page+1}:{},data:r}}}},class extends ue{constructor(){super(...arguments),this.name="create_doc",this.type=b.WRITE,this.annotations=me({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, optional docOwnerIds)\n- item: Creates a document attached to an item (requires item_id, optional column_id, optional docOwnerIds)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_name: "My Doc", doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, doc_name: "My Doc", folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, doc_name: "My Doc", column_id: "doc_col_1" , markdown: "..." }\n- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, doc_name: "My Doc", markdown: "...", docOwnerIds: ["<agent_owner_user_id>"] }'}getInputSchema(){return cb}async executeInternal(e){const t=lb.safeParse({...e,type:e.location});if(!t.success)throw new im(`Required parameters were not provided for location parameter of ${e.location}`,Jc);const a=t.data;try{let t,i,n;if(a.type===pb.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||ho.Public,folder_id:a.folder_id?.toString()}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}},r=await this.mondayApi.request(rb,o);t=r?.create_doc?.id??void 0,i=r?.create_doc?.object_id??void 0,n=r?.create_doc?.url??void 0}else if(a.type===pb.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(nb,o),s=r.items?.[0];if(!s)throw new im(`Item with id ${a.item_id} not found.`,tm);const d=s.board?.id,p=s.board?.columns?.find((e=>e&&e.type===gm.Doc));let l=a.column_id;if(l){const e=s.board?.columns?.find((e=>e?.id===l));if(!e||e.type!==gm.Doc)throw new im(`Column ${l} is not a doc column on board ${d}.`,Jc)}else if(p)l=p.id;else{const e={boardId:d.toString(),columnType:gm.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(Mc,e);if(l=t?.create_column?.id,!l)throw new im("Failed to create doc column.",tm)}const c={location:{board:{item_id:a.item_id.toString(),column_id:l}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}};let m;try{m=await this.mondayApi.request(rb,c)}catch(t){if(this.hasGraphQLErrorCode(t,"CellLimitExceeded")){const t=await this.getExistingItemDoc(a.item_id,l).catch((()=>{}));if(t)return this.existingItemDocResult(t,e.location)}throw t}if(t=m.create_doc?.id??void 0,i=m.create_doc?.object_id??void 0,n=m.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(db,a)}catch(e){console.warn("Failed to update doc name:",e)}}if(!t)throw new im("Failed to create document.",tm);const o={docId:t,markdown:e.markdown};let r;try{r=await this.mondayApi.request(sb,o)}catch(a){return this.createdDocContentFailureResult(a,t,i,n,e.doc_name)}const s=r?.add_content_to_doc_from_markdown?.success,d=r?.add_content_to_doc_from_markdown?.error;if(!s){const a=new im(`Failed to add markdown content: ${d||"Unknown error"}`,Xc);return this.createdDocContentFailureResult(a,t,i,n,e.doc_name)}return this.sessionContext.metadata={...this.sessionContext.metadata,location:e.location,...t&&{doc_id:t},...i&&{object_id:i}},{content:{message:"Document successfully created",doc_id:t,object_id:i,doc_url:n,doc_name:e.doc_name}}}catch(e){nm(e,"create document")}}async getExistingItemDoc(e,t){const a={itemId:e.toString(),columnId:t},i=await this.mondayApi.request(ob,a),n=i.items?.[0]?.column_values?.find((e=>e?.id===t));return"DocValue"===n?.__typename?n.file?.doc:void 0}existingItemDocResult(e,t){return this.sessionContext.metadata={...this.sessionContext.metadata,location:t,doc_id:e.id,object_id:e.object_id},{content:{message:"The item already has a document in this column. The existing document was returned unchanged.",doc_id:e.id,object_id:e.object_id,doc_url:e.url,doc_name:e.name,existing_doc_found:!0}}}createdDocContentFailureResult(e,t,a,i,n){const o=sm(e);return{content:{message:`Document ${t} was created, but its content could not be added: ${o.message}`,doc_id:t,object_id:a,doc_url:i,doc_name:n,is_partial_success:!0,errors:(o.errors??[]).map((e=>({...e,path:["markdown",...e.path??[]]})))}}}hasGraphQLErrorCode(e,t){return!0===e?.response?.errors?.some((e=>e.extensions?.code===t))}},class extends ue{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=b.WRITE,this.annotations=me({title:"Add Content to Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add markdown content to an existing monday.com document.\n\nIDENTIFICATION: Provide doc_id, object_id, or board_id + view_id to identify the document:\n- doc_id: The document ID (the id field returned by read_docs). Takes priority if both provided.\n- object_id: The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id.\n- board_id + view_id: For a doc that lives as a board view, taken from https://<slug>.monday.com/boards/<board_id>/views/<view_id>. Such docs have no usable doc_id/object_id until they are resolved through their board.\n\nUSAGE EXAMPLES:\n- By doc_id: { doc_id: "123", markdown: "# New Section\\nContent here" }\n- By object_id: { object_id: "456", markdown: "# New Section\\nContent here" }\n- By board view: { board_id: "18429976879", view_id: "279510271", markdown: "# New Section\\nContent here" }\n- Insert after block: { doc_id: "123", markdown: "Inserted content", after_block_id: "block_789" }'}getInputSchema(){return fb}async executeInternal(e){if(!e.doc_id&&!e.object_id&&!e.board_id)throw new im("Either doc_id, object_id, or board_id (with view_id) must be provided.",am);try{let t=null;if(e.doc_id||e.object_id||!e.board_id)if(e.doc_id){const a=await this.mondayApi.request(hb,{docId:e.doc_id});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(ub,{objectId:e.object_id});t=a.docs?.[0]??null}else{const a=await W_(this.mondayApi,e.board_id,e.view_id);if(!a.ok)throw new im(a.error,Xc);t=a.doc}if(!t){const t=e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`;throw new im(`No document found for ${t}.`,tm)}this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t.id,...e.object_id&&{object_id:e.object_id},...e.board_id&&{board_id:e.board_id,view_id:e.view_id}};const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},i=await this.mondayApi.request(mb,a);if(!i?.add_content_to_doc_from_markdown)throw new im("Failed to add content to document — no response from API.",tm);const{success:n,block_ids:o,error:r}=i.add_content_to_doc_from_markdown;if(!n)throw new im(`Failed to add content to document: ${r||"Unknown error"}`,Xc);const s=o?.length??0;return{content:{message:`Successfully added content to document ${t.id}. ${s} block${1===s?"":"s"} created.`,doc_id:t.id,block_ids:o,doc_name:t.name,doc_url:t.url}}}catch(e){nm(e,"add content to document")}}},class extends ue{constructor(){super(...arguments),this.name="update_doc",this.type=b.WRITE,this.annotations=me({title:"Update Document",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Update an existing monday.com document. Provide doc_id (preferred), object_id, or board_id + view_id, plus an ordered operations array (executed sequentially, stops on first failure).\n\nIDENTIFYING THE DOC: A doc can live in a workspace, on an item, or as a board view. For a doc that lives as a board view, you only have a board URL — pass board_id and view_id from https://<slug>.monday.com/boards/<board_id>/views/<view_id> and they will be resolved to the doc.\n\nOPERATIONS:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (or insert after a block). Best for text, headings, lists, simple tables — no block IDs needed.\n- update_block: Update content of an existing text, code, or list_item block in-place.\n- create_block: Create a new block at a precise position. Use parent_block_id to nest inside notice_box, table cell, or layout cell.\n- delete_blocks: Permanently delete 1–100 blocks in one call. Provide all block IDs in the block_ids array. The ONLY option for BOARD, WIDGET, DOC embed, and GIPHY blocks.\n- replace_block: Delete a block and create a new one in its place (use when update_block is not supported).\n- add_comment: Create a new comment or reply on the document (doc-level, block-level, or text-selection).\n\nWHEN TO USE EACH OPERATION:\n- text / code / list_item → update_block. Use replace_block to change subtype (e.g. NORMAL_TEXT→LARGE_TITLE)\n- divider / table / image / video / notice_box / layout → replace_block (properties immutable after creation)\n- BOARD / WIDGET / DOC / GIPHY → delete_blocks only\n\nGETTING BLOCK IDs: Call read_docs with include_blocks: true — returns id, type, position, and content per block.\n\nBLOCK CONTENT (delta_format): Array of insert ops. Last op MUST be {insert: {text: "\\n"}}.\n- Plain: [{insert: {text: "Hello"}}, {insert: {text: "\\n"}}]\n- Bold: [{insert: {text: "Hi"}, attributes: {bold: true}}, {insert: {text: "\\n"}}]\n- Mention user/doc/board: [{insert: {text: "Hey "}}, {insert: {mention: {id: 12345, type: "USER"}}}, {insert: {text: "\\n"}}] — type is USER, DOC, or BOARD. id is numeric (user IDs from list_users_and_teams)\n- Inline column value: [{insert: {column_value: {item_id: 111, column_id: "status"}}}, {insert: {text: "\\n"}}]\n- Supported attributes: bold, italic, underline, strike, code, link, color, background (not applicable to mention/column_value ops)\n\nIMAGE WITH ASSET: For asset-based images, use create_block with block_type "image" and asset_id (instead of public_url). add_markdown_content does NOT support asset images — for mixed content, alternate add_markdown_content (text) and create_block (image) operations in sequence.\n\nBATCHING DELETES: delete_blocks accepts 1..100 IDs. Put ALL IDs in one operation\'s block_ids array. Never emit multiple delete_blocks operations in a row.\n\nCOMMENTS:\n- add_comment: Create a new comment or reply on the document. Three scopes:\n - Doc-level (no block_id): comment appears on the doc as a whole.\n - Block-level (block_id only): comment is anchored to a specific block. The block shows a comment indicator in the UI.\n - Text-selection (block_id + selection_from + selection_length): comment is anchored to a specific character range inside a text/code/list_item block. That text is highlighted with a comment marker.\n Block-level and text-selection comments only work on blocks with text content (text, code, list_item, title, quote). They do NOT work on: divider, page_break, table, layout, notice_box, image, video, or giphy blocks.\n Get block IDs from read_docs with include_blocks: true. Format body with HTML, not markdown. Use mentions_list for @mentions.'}getInputSchema(){return Kb}async executeInternal(e){if(!e.doc_id&&!e.object_id&&!e.board_id)throw new im("Either doc_id, object_id, or board_id (with view_id) must be provided.",am);this.sessionContext.metadata={...this.sessionContext.metadata,operation_types:e.operations?.map((e=>e.operation_type)),operation_count:e.operations?.length??0,items_count:e.operations?.length??0,...e.object_id&&{object_id:e.object_id},...e.board_id&&{board_id:e.board_id,view_id:e.view_id}};try{let t=e.doc_id,a=e.object_id;if(!t&&!a&&e.board_id){const i=await W_(this.mondayApi,e.board_id,e.view_id);if(!i.ok)throw new im(i.error,Xc);t=i.doc.id,a=i.doc.object_id}if(!t){const e=await this.mondayApi.request(U_,{objectId:a}),i=e.docs?.[0];if(!i)throw new im(`No document found for object_id ${a}.`,tm);t=i.id}const i=[],n=[];let o=null;for(let r=0;r<e.operations.length;r++){const s=e.operations[r];try{const e=await this.executeOperation(t,s,a);i.push(`- [OK] ${s.operation_type}${e?`: ${e}`:""}`)}catch(e){const t=sm(e),a=t.message;i.push(`- [FAILED] ${s.operation_type}: ${a}`),n.push(...(t.errors??[]).map((e=>({...e,path:["operations",r,...e.path??[]]})))),o=r;break}}const r=null!==o?o:e.operations.length,s=e.operations.length,d=`Completed ${r}/${s} operation${1===s?"":"s"} on doc ${t}.`;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t},null!==o?{content:{message:d,results:i,is_partial_success:r>0,errors:n,doc_id:t},...0===r?{isError:!0}:{}}:{content:`${d}\n\nResults:\n${i.join("\n")}\n\nDoc ID: ${t}`}}catch(e){nm(e,"update document")}}async executeOperation(e,t,a){switch(t.operation_type){case"set_name":return this.executeSetName(e,t.name);case"add_markdown_content":return this.executeAddMarkdown(e,t.markdown,t.after_block_id);case"update_block":return this.executeUpdateBlock(t.block_id,t.content);case"create_block":return this.executeCreateBlock(e,t.block,t.after_block_id,t.parent_block_id);case"delete_blocks":return this.executeDeleteBlocks(t.block_ids);case"replace_block":return this.executeReplaceBlock(e,t.block_id,t.block,t.after_block_id,t.parent_block_id);case"add_comment":return this.executeAddComment(e,a,t.body,t.parent_update_id,t.mentions_list,t.block_id,t.selection_from,t.selection_length);default:{const e=t.operation_type;throw new Error(`Unsupported operation type: "${e}"`)}}}async executeSetName(e,t){const a={docId:e,name:t},i=await this.mondayApi.request(x_,a);if(!i?.update_doc_name)throw new Error(`No confirmation from update_doc_name — rename to "${t}" may not have applied`);return`Renamed to "${t}"`}async executeAddMarkdown(e,t,a){if(!t.trim())throw new Error("markdown must not be empty");const i={docId:e,markdown:t,afterBlockId:a},n=await this.mondayApi.request(L_,i),o=n?.add_content_to_doc_from_markdown;if(!o?.success)throw new Error(o?.error||"Failed to add markdown content");const r=o.block_ids?.length??0;return`${r} block${1===r?"":"s"} added${o.block_ids?.length?`. Block IDs: ${o.block_ids.join(", ")}`:""}`}async executeUpdateBlock(e,t){const a=function(e){switch(e.block_content_type){case"text":return{deltaFormat:vb(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:vb(e.delta_format),language:e.language};case"list_item":return{deltaFormat:vb(e.delta_format),checked:e.checked,indentation:e.indentation};default:{const t=e.block_content_type;throw new Error(`Unsupported block_content_type: "${t}"`)}}}(t),i={blockId:e,content:JSON.stringify(a)},n=await this.mondayApi.request(P_,i);if(!n?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,i){const n=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:yb(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:_b(e.alignment),direction:bb(e.direction)}};case"list_item":return{list_block:{delta_format:yb(e.delta_format),list_block_type:e.list_block_type?e.list_block_type:void 0,indentation:e.indentation}};case"code":return{text_block:{delta_format:yb(e.delta_format),text_block_type:op.Code}};case"divider":return{divider_block:{}};case"page_break":return{page_break_block:{}};case"image":if(null==e.asset_id&&!e.public_url)throw new Error("image block requires either asset_id or public_url");return{image_block:null!=e.asset_id?{asset_id:String(e.asset_id),width:e.width}:{public_url:e.public_url,width:e.width}};case"video":return{video_block:{raw_url:e.raw_url,width:e.width}};case"notice_box":return{notice_box_block:{theme:e.theme}};case"table":return{table_block:{row_count:e.row_count,column_count:e.column_count,width:e.width,column_style:e.column_style?.map((e=>({width:e.width})))}};case"layout":return{layout_block:{column_count:e.column_count,column_style:e.column_style?.map((e=>({width:e.width})))}};default:{const t=e.block_type;throw new Error(`Unsupported block_type: "${t}"`)}}}(t);if(i){const e=Object.keys(n);if(1!==e.length)throw new Error(`Cannot inject parent_block_id: expected exactly 1 key in block input, got: ${e.join(", ")}`);const t=e[0],a=n[t];if(!a||"object"!=typeof a)throw new Error(`Cannot inject parent_block_id into block type "${t}" — block value is not an object`);a.parent_block_id=i}const o={docId:e,afterBlockId:a,blocksInput:[n]},r=await this.mondayApi.request(q_,o),s=r?.create_doc_blocks;if(!s||0===s.length)throw new Error("No blocks returned from create_doc_blocks");return`Block created (ID: ${s.map((e=>e.id)).join(", ")})`}async executeDeleteBlock(e){const t={blockId:e},a=await this.mondayApi.request(V_,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async executeDeleteBlocks(e){if(0===e.length)throw new Error("block_ids must not be empty");const t={blockIds:e},a=await this.mondayApi.request(M_,t);if(!a?.delete_doc_blocks||0===a.delete_doc_blocks.length)throw new Error("No response from delete_doc_blocks");const i=a.delete_doc_blocks.map((e=>e.id)).join(", ");return`${a.delete_doc_blocks.length} block(s) deleted (IDs: ${i})`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(F_,{docId:e}),i=a.docs?.[0];if(!i?.object_id)throw new Error(`Could not resolve object_id for doc ${e}`);return i.object_id}async resolveDocItemId(e){const t=await this.mondayApi.request(B_,{boardId:e}),a=t.boards?.[0]?.items_page?.items?.[0]?.id;if(!a)throw new Error(`No item found on the document backing board (object_id: ${e})`);return a}async fetchAllBlockContent(e){const t=await this.mondayApi.request(z_,{docId:e});return(t.docs?.[0]?.blocks??[]).filter((e=>null!=e)).map((t=>{let a;if("string"==typeof t.content)try{a=JSON.parse(t.content)}catch{throw new Error(`Failed to parse content of block ${t.id} in doc ${e} as JSON`)}else a=t.content??{};return{id:t.id??"",type:t.type??"",content:a}}))}async executeAddComment(e,t,a,i,n,o,r,s){if((null!=r||null!=s)&&!o)throw new Error("selection_from and selection_length require block_id");if(null!=r!=(null!=s))throw new Error("selection_from and selection_length must both be provided together");const d=o?Array.isArray(o)?o:[o]:[];if((null!=r||null!=s)&&d.length>1)throw new Error("selection_from and selection_length are only supported with a single block_id");const p=await this.resolveObjectId(e,t),l=await this.resolveDocItemId(p);let c;if(n){const e=JSON.parse(n),t=uf.safeParse(e);if(!t.success)throw new Error(`Invalid mentions_list format: ${t.error.message}`);c=t.data}const m={itemId:l,body:a,parentId:i?.toString(),mentionsList:c},u=await this.mondayApi.request(j_,m);if(!u.create_update?.id)throw new Error("Failed to create comment: no update returned");const h=u.create_update.id,f=Number(h),_=i?`Reply to update ${i}`:"Comment";if(d.length>0){if(Number.isNaN(f))throw new Error(`${_} created (update ID: ${h}) but block annotation aborted: comment ID is not numeric and cannot be used as a delta reference`);const t=await this.fetchAllBlockContent(e);for(const a of d){const i=t.find((e=>e.id===a));if(!i)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: block ${a} not found in doc ${e}`);const n=i.content.deltaFormat;if(!n)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: block ${a} has no deltaFormat — only text, code, and list_item blocks are supported`);let o=0;for(const e of n)o+="string"==typeof e.insert?e.insert.length:1;if(0===o)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: block ${a} has an empty deltaFormat and cannot be annotated`);const d=r??0,p=s??o;if(d+p>o)throw new Error(`${_} created (update ID: ${h}) but block annotation failed: selection [${d}, ${d+p}) is out of range for block ${a} (total length ${o})`);let l;try{l=wb(n,f,d,p)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`${_} created (update ID: ${h}) but delta annotation failed for block ${a}: ${t}`)}const c={...i.content,deltaFormat:l},m=await this.mondayApi.request(P_,{blockId:a,content:JSON.stringify(c)});if(!m?.update_doc_block)throw new Error(`${_} created (update ID: ${h}) but block annotation write returned no confirmation for block ${a}`)}}const b=d.length;return`${_} created${b>1?` across ${b} blocks`:1===b?" on block":""} (update ID: ${h})`}async executeReplaceBlock(e,t,a,i,n){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,i,n)}`}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Original block ${t} was deleted, but replacement creation failed: ${a}. The original block is gone.`)}}},class extends ue{constructor(){super(...arguments),this.name="update_workspace",this.type=b.WRITE,this.annotations=me({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return ig}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(ag,t),i=await k_(this.mondayApi),n=i?R_(i,a.update_workspace?.id):void 0;return{content:{message:`Workspace ${a.update_workspace?.id} updated`,workspace_id:a.update_workspace?.id,workspace_name:a.update_workspace?.name,workspace_url:n}}}},class extends ue{constructor(){super(...arguments),this.name="update_folder",this.type=b.WRITE,this.annotations=me({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return og}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:i}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const n={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:t?{is_after:i,object_id:t,object_type:a}:void 0},o=await this.mondayApi.request(ng,n);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends ue{constructor(){super(...arguments),this.name="create_workspace",this.type=b.WRITE,this.annotations=me({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return sg}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(rg,t),i=await k_(this.mondayApi),n=i&&a.create_workspace?.id?R_(i,a.create_workspace.id):void 0;return{content:{message:`Workspace ${a.create_workspace?.id} successfully created`,workspace_id:a.create_workspace?.id,workspace_name:a.create_workspace?.name,workspace_url:n}}}},class extends ue{constructor(){super(...arguments),this.name="create_folder",this.type=b.WRITE,this.annotations=me({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return pg}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(dg,t);return{content:{message:`Folder ${a.create_folder?.id} successfully created`,folder_id:a.create_folder?.id,folder_name:a.create_folder?.name}}}},class extends ue{constructor(){super(...arguments),this.name="move_object",this.type=b.WRITE,this.annotations=me({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 mg}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const d={folderId:t,position:a?{is_after:n,object_id:a,object_type:i}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},p=await this.mondayApi.request(ng,d);return{content:{message:"Object moved",object_id:p.update_folder?.id}}}async executeUpdateBoardHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const d={boardId:t,attributes:{position:a?{is_after:n,object_id:a,object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(lg,d);return p.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:p.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${p.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const d={overviewId:t,attributes:{position:a?{is_after:n,object_id:a,object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(cg,d);return p.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:p.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${p.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:t}=e;switch(t){case sd.Folder:return this.executeUpdateFolder(e);case sd.Board:return this.executeUpdateBoardHierarchy(e);case sd.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends ue{constructor(){super(...arguments),this.name="create_dashboard",this.type=b.WRITE,this.annotations=me({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 eg}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(Jb,t);if(!a.create_dashboard)throw new im("Failed to create dashboard",tm);const i=a.create_dashboard;return{content:{message:`Dashboard ${i.id} successfully created`,dashboard_id:i.id,dashboard_name:i.name}}}catch(e){nm(e,"create dashboard")}}},class extends ue{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=b.READ,this.annotations=me({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(Xb,e);if(!t.all_widgets_schema||0===t.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const a={};let i=0;for(const e of t.all_widgets_schema)if(e?.widget_type&&e?.schema){const t="string"==typeof e.schema?JSON.parse(e.schema):e.schema,n=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:n,schema:e.schema},i++}if(0===i)throw new Error("No valid widget schemas found in API response");Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:a,url:a_}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends ue{constructor(){super(...arguments),this.name="create_widget",this.type=b.WRITE,this.annotations=me({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 tg}async executeInternal(e){if(!e.settings)throw new im("You must pass the settings parameter",am);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(Zb,t);if(!a.create_widget)throw new im("Failed to create widget",tm);const i=a.create_widget;i.parent?.kind===Kp.Dashboard?i.parent.id:i.parent;return{content:{message:`Widget ${i.id} created`,widget_id:i.id,widget_name:i.name,dashboard_id:i.parent?.id}}}catch(t){nm(t,`create ${e.widget_kind} widget`)}}},class extends ue{constructor(){super(...arguments),this.name="board_insights",this.type=b.READ,this.annotations=me({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 with filters.columns.only to get column metadata without fetching views. 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 gg}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};if(e.aggregations.some((e=>!e.columnId&&e.function!==xn.CountItems)))return{content:`Every aggregation must have a "columnId", except the ${xn.CountItems} function.`};const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],i=new Set(e.aggregations.filter((e=>e.function===xn.Label)).map((e=>e.columnId))),n=e.groupBy?.filter((e=>!i.has(e))).map((e=>({function:xn.Label,columnId:e})))??[],o=e.aggregations.concat(n).map((e=>{if(e.function){const o=e.columnId?`${e.function}_${e.columnId}`:e.function,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return _g.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:$n.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===xn.CountItems?[]:[{type:$n.Column,column:bg(n),as:n}]}),as:s}}var i,n;const o={type:$n.Column,column:bg(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:$n.Column,column:bg(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),i=function(e){if(!e.filters&&!e.orderBy)return;const t={};return e.filters&&(t.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),t.operator=e.filtersOperator),e.orderBy&&(t.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),t}(e),n=function(e){return{id:e.boardId.toString(),type:An.Table}}(e),o={query:{from:n,query:i,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(ug,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const i=e.value;if(!i)return void(t[a]=null);const n=i.result??i.value??null;t[a]=n})),t}));return s.length?{content:{message:"Board insights retrieved",board_name:r.boards?.[0]?.name,board_url:r.boards?.[0]?.url,data:s}}:{content:"No board insights found for the given query."}}},class extends ue{constructor(){super(...arguments),this.name="search",this.type=b.READ,this.annotations=me({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Search within monday.com platform. Supported searchType values: ${Qf}.\nsearchTerm is the phrase the search matches against — the text/keywords to look for (e.g. a board name, item title, or a word from an update). It is required and must be non-empty. This tool has no "list everything" mode: to browse or list without a search phrase, use workspace_info (boards/docs/folders in a workspace) or get_board_items_page (items in a board) instead of calling search with an empty searchTerm.\nFor searching/listing specific users and teams, use list_users_and_teams tool.\nFor account-level info (plan, member count, products), use get_user_context tool.\nFor browsing all boards, docs, or folders within a workspace without a search term, use workspace_info tool.\nFor groups, use get_board_info tool.\nFor listing items within a specific board, use get_board_items_page tool. ITEMS search here queries items across the account.\nBOARD search returns id, title, url, and workspaceId. Optionally scope it with boardIds.\nDOCUMENTS search returns id, title, workspaceId, and highlights. highlights is an array of { field, fragments } entries (field is "name" or "content") where fragments contain matched text snippets with <em> tags around matched terms. highlights is omitted when no lexical match was made. Optionally scope it with workspaceIds and/or docIds.\nITEMS search returns id, title, url, boardId, and workspaceId. Optionally scope it with workspaceIds, boardIds, and/or creatorIds.\nWORKSPACES search returns id, title, and description.\nUPDATES search returns id, title (the update body), itemId, boardId, and creatorId. Optionally scope it with workspaceIds, boardIds, and/or creatorIds.\nTIMELINE_ITEMS search returns id, title, summary, content, itemId, and boardId. Optionally scope it with workspaceIds and/or boardIds.\nDASHBOARDS search (also called "overviews") returns id, title, and workspaceId. Optionally scope it with workspaceIds and/or creatorIds.\nFOLDERS search returns id and title. Optionally scope it with workspaceIds, which searches all accessible workspaces when omitted. Pass workspaceIds to narrow the search if results may be truncated.\n `}getInputSchema(){return Ug}async executeInternal(e){const{searchTerm:t}=e;if(!t)throw new im("searchTerm is required and must be a non-empty search string. To browse or list without a search term, use workspace_info (for boards, docs, and folders in a workspace) or get_board_items_page (for items within a specific board).",am);try{if(e.searchType===Yf.FOLDERS){const{results:a,truncated:i}=await this.searchFoldersAsync(e,t);return{content:{message:i?"Search results (truncated: only the first 100 folders across the searched workspaces were scanned. Narrow with workspaceIds for complete results.)":"Search results",data:a}}}return{content:{message:"Search results",data:await this.runSmartSearchAsync(e,t)}}}catch(e){throw om(e),e}}async runSmartSearchAsync(e,t){const a=Cg(e.workspaceIds?.map((e=>e.toString())));if(e.searchType===Yf.BOARD){const i=Cg(e.boardIds?.map((e=>e.toString())));return this.searchBoardsAsync(t,e.limit,a,i)}if(e.searchType===Yf.DOCUMENTS){const i=Cg(e.docIds?.map((e=>e.toString())));return this.searchDocsAsync(t,e.limit,a,i)}if(e.searchType===Yf.WORKSPACES)return this.searchWorkspacesAsync(t,e.limit);if(e.searchType===Yf.UPDATES){const i=Cg(e.boardIds?.map((e=>e.toString()))),n=Cg(e.creatorIds?.map((e=>e.toString())));return this.searchUpdatesAsync(t,e.limit,a,i,n)}if(e.searchType===Yf.ITEMS){const i=Cg(e.boardIds?.map((e=>e.toString()))),n=Cg(e.creatorIds?.map((e=>e.toString())));return this.searchItemsAsync(t,e.limit,a,i,n)}if(e.searchType===Yf.TIMELINE_ITEMS){const i=Cg(e.boardIds?.map((e=>e.toString())));return this.searchTimelineItemsAsync(t,e.limit,a,i)}if(e.searchType===Yf.DASHBOARDS){const i=e.creatorIds?.map((e=>e.toString()));return this.searchOverviewsAsync(t,e.limit,a,i)}throw new im(`Unsupported search type for smart search: ${e.searchType}`,Xc)}async searchBoardsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,boardIds:i};return(await this.mondayApi.request(Ig,n,{timeout:hm})).search.boards.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchDocsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,docIds:i};return(await this.mondayApi.request(wg,n,{timeout:hm})).search.docs.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0,highlights:$g(e.indexed_data.highlights)})))}async searchWorkspacesAsync(e,t){const a={query:e,limit:t};return(await this.mondayApi.request(Tg,a,{timeout:hm})).search.workspaces.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,description:e.indexed_data.description||void 0})))}async searchUpdatesAsync(e,t,a,i,n){const o={query:e,limit:t,workspaceIds:a,boardIds:i,creatorIds:n};return(await this.mondayApi.request(Eg,o,{timeout:hm})).search.updates.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.body,itemId:e.indexed_data.item_id,boardId:e.indexed_data.board_id,creatorId:e.indexed_data.creator_id})))}async searchItemsAsync(e,t,a,i,n){return(n?await this.mondayApi.request(Sg,{query:e,limit:t,workspaceIds:a,boardIds:i,creatorIds:n},{versionOverride:"dev",timeout:hm}):await this.mondayApi.request(vg,{query:e,limit:t,workspaceIds:a,boardIds:i},{timeout:hm})).search.items.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url,boardId:e.indexed_data.board_id??void 0,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchTimelineItemsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,boardIds:i};return(await this.mondayApi.request(Ag,n,{timeout:hm})).search.timeline_items.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.title,summary:e.indexed_data.summary||void 0,content:e.indexed_data.content||void 0,itemId:e.indexed_data.item_id,boardId:e.indexed_data.board_id??void 0})))}async searchOverviewsAsync(e,t,a,i){const n={query:e,limit:t,workspaceIds:a,creatorIds:i};return(await this.mondayApi.request(Dg,n,{versionOverride:"dev",timeout:hm})).search.overviews.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchFoldersAsync(e,t){const a=Ng(t);if(!a)return{results:[],truncated:!1};const i={page:1,limit:100,workspace_ids:Cg(e.workspaceIds?.map((e=>e.toString())))},n=(await this.mondayApi.request(yg,i)).folders||[];return{results:n.filter((e=>e?.name&&Ng(e.name).includes(a))).filter((e=>e?.id)).slice(0,e.limit).map((e=>({id:e.id,title:e.name}))),truncated:100===n.length}}},class extends ue{constructor(){super(...arguments),this.name="get_user_context",this.type=b.READ,this.annotations=me({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information, account information, and their relevant items (boards, docs, folders, workspaces, dashboards).\n\n Use this tool to:\n - Get context about who the current user is (id, name, title)\n - Get account info: plan tier, active member count, trial status, and active products\n - Get the number of active members in the account (returns active_members_count)\n - Discover user's favorite boards, folders, workspaces, and dashboards\n - Get user's most relevant boards based on visit frequency and recency\n - Get user's most relevant docs based on load frequency and recency\n - Get user's most relevant people based on interaction frequency and recency\n - Reduce the need for search requests by knowing user's commonly accessed items\n "}getInputSchema(){}async executeInternal(){const{me:e,favorites:t,intelligence:a}=await this.mondayApi.request(Gg,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};const i=await this.fetchFavorites(t||[]),n=this.extractRelevantBoards(a),o=this.extractRelevantDocs(a),r=this.extractRelevantPeople(a),{account:s,...d}=e;return{content:{message:"User context",...{user:d,account:s?{tier:s.tier,active_members_count:s.active_members_count,is_during_trial:s.is_during_trial,products:s.products?.filter(Boolean).map((e=>({kind:e.kind,tier:e.tier})))??[]}:null,favorites:i,relevantBoards:n,relevantDocs:o,relevantPeople:r}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const i={};for(const e of a)i[Wg[e]]=t[e];const n=await this.mondayApi.request(Hg,i),o=[];for(const e of a){const t=Yg[e];for(const a of n[t]??[])a?.id&&o.push({id:a.id,name:a.name,type:e})}return o}extractRelevantBoards(e){if(!e?.relevant_boards)return[];const t=[];for(const a of e.relevant_boards)a?.id&&a?.board?.name&&t.push({id:a.id,name:a.board.name});return t}extractRelevantDocs(e){if(!e?.relevant_docs)return[];const t=[];for(const a of e.relevant_docs)a?.id&&a?.document?.name&&t.push({id:a.id,name:a.document.name,objectId:a.object_id});return t}extractRelevantPeople(e){if(!e?.relevant_people)return[];const t=[];for(const a of e.relevant_people)a?.id&&a?.user?.name&&t.push({id:a.id,name:a.user.name});return t}groupByType(e){const t={};for(const a of e){const e=a?.object;e?.id&&e?.type&&(t[e.type]??=[]).push(e.id)}return t}},class extends ue{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=b.WRITE,this.annotations=me({title:"Update Assets On Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update a file or doc column value on an item using existing assets, docs, or links. Sets the column to the provided list of files, adding new ones and removing any not in the list."}getInputSchema(){return zg}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(Fg,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends ue{constructor(){super(...arguments),this.name="get_assets",this.type=b.READ,this.annotations=me({title:"Get Assets",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get assets (files) by their IDs. Returns file metadata including name, extension, size, public URL (valid for 1 hour), thumbnail URL, upload date, and who uploaded it."}getInputSchema(){return qg}async executeInternal(e){const t=await this.mondayApi.request(jg,{ids:e.ids}),a=t.assets?.filter(Boolean);if(!a||0===a.length)return{content:`No assets found for the provided IDs: ${e.ids.join(", ")}`};return{content:{results:a.map((e=>({id:e.id,name:e.name,file_extension:e.file_extension,file_size:e.file_size,public_url:e.public_url,url:e.url,url_thumbnail:e.url_thumbnail??null,created_at:e.created_at??null,original_geometry:e.original_geometry??null,uploaded_by:e.uploaded_by})))}}}},class extends ue{constructor(){super(...arguments),this.name="create_view",this.type=b.WRITE,this.annotations=me({title:"Create View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new board view (tab) with optional filters and sorting. This creates a saved view on a monday.com board that users can switch to.\n\n[REQUIRED PRECONDITION]: If you pass filters or sorting, call get_board_info first with filters.columns.only to get the board column IDs, column types, and status label indexes without fetching views. Filter rules reference real column IDs and, for status columns, numeric label indexes — do not guess them. Before sending the filters, use get_column_type_info with fetchMode "${zm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules).\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }`}getInputSchema(){return tu}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort,settings:e.settings},a=await this.mondayApi.request(eu,t);return a.create_view?{content:`View "${a.create_view.name}" (ID: ${a.create_view.id}, type: ${a.create_view.type}) successfully created`}:{content:"Failed to create view - no response from API"}}},class extends ue{constructor(){super(...arguments),this.name="update_view",this.type=b.WRITE,this.annotations=me({title:"Update View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Update an existing board view (tab) — change its name, filter rules, or sort order. Provide only the fields you want to change. Omitted fields are left unchanged.\n\n[REQUIRED PRECONDITION]: Call get_board_info first — it returns the board views (so you can resolve the viewId, including from a view name the user mentioned) along with the column IDs, column types, and status label indexes that filter and sort rules reference. When the user named specific views, pass those names as get_board_info.filters.views.names to avoid fetching every view on large boards. If you pass filters, also use get_column_type_info with fetchMode "${zm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }`}getInputSchema(){return iu}async executeInternal(e){const t={viewId:e.viewId,boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort,settings:e.settings},a=await this.mondayApi.request(au,t);return a.update_view?{content:`View "${a.update_view.name}" (ID: ${a.update_view.id}, type: ${a.update_view.type}) successfully updated`}:{content:"Failed to update view - no response from API"}}},class extends ue{constructor(){super(...arguments),this.name="create_view_table",this.type=b.WRITE,this.annotations=me({title:"Create Table View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new table-type board view with optional filters, sort, tags, and table-specific settings (column visibility/order and group-by). Use this instead of create_view when you need to configure table-specific settings. For a simple table view, create_view also works.\n\n[REQUIRED PRECONDITION]: Call get_board_info first with filters.columns.only to get the board column IDs, column types, and status label indexes without fetching views. Filters, sort, column_properties, column_order, and group_by all reference real column IDs — do not guess them. This is required even if you are not passing filters, since column_properties/column_order/group_by need real column IDs too. If you pass filters, also use get_column_type_info with fetchMode "${zm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample settings.columns: { "column_properties": [{ "column_id": "status", "visible": true }], "column_order": ["name", "status", "date"] }\nExample settings.group_by: { "conditions": [{ "columnId": "status" }], "hideEmptyGroups": true }`}getInputSchema(){return su}async executeInternal(e){const t={boardId:e.boardId,name:e.name,filter:e.filter,sort:e.sort,tags:e.tags,settings:e.settings},a=await this.mondayApi.request(nu,t);return a.create_view_table?{content:`Table view "${a.create_view_table.name}" (ID: ${a.create_view_table.id}, type: ${a.create_view_table.type}) successfully created`}:{content:"Failed to create table view - no response from API"}}},class extends ue{constructor(){super(...arguments),this.name="update_view_table",this.type=b.WRITE,this.annotations=me({title:"Update Table View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Update an existing table-type board view — change its name, filters, sort, tags, or table-specific settings (column visibility/order and group-by). Provide only the fields you want to change. Omitted fields are left unchanged.\n\n[REQUIRED PRECONDITION]: Call get_board_info first — it returns the board views (so you can resolve the viewId, including from a view name the user mentioned) along with the column IDs, column types, and status label indexes that filters, sort, column_properties, column_order, and group_by reference. When the user named specific views, pass those names as get_board_info.filters.views.names to avoid fetching every view on large boards. If you pass filters, also use get_column_type_info with fetchMode "${zm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample settings.columns: { "column_properties": [{ "column_id": "status", "visible": true }], "column_order": ["name", "status", "date"] }\nExample settings.group_by: { "conditions": [{ "columnId": "status" }], "hideEmptyGroups": true }`}getInputSchema(){return cu}async executeInternal(e){const t={viewId:e.viewId,boardId:e.boardId,name:e.name,filter:e.filter,sort:e.sort,tags:e.tags,settings:e.settings},a=await this.mondayApi.request(du,t);return a.update_view_table?{content:`Table view "${a.update_view_table.name}" (ID: ${a.update_view_table.id}, type: ${a.update_view_table.type}) successfully updated`}:{content:"Failed to update table view - no response from API"}}},class extends ue{constructor(){super(...arguments),this.name="undo_action",this.type=b.WRITE,this.annotations=me({title:"Undo Action",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Undo a previous action on a board using its action_record_uuid. Supports undoing column changes, deletes, archives, moves, duplicates, and more. Use get_board_activity with includeData=true to find the action_record_uuid."}getInputSchema(){return Kg}async executeInternal(e){return await this.mondayApi.request(Qg,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}},class extends ue{constructor(){super(...arguments),this.name="get_object_schemas",this.type=b.READ,this.annotations=me({title:"Get Object Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve account-level object schemas by their IDs or names. Schemas define the structure and columns of boards. Provide ids or names to filter specific schemas. Omit both to list all schemas (paginated). Call this FIRST to resolve schema ids, column ids, and the current revision before any tool that modifies an existing schema: update_object_schema (which requires the revision returned here), manage_object_schema_columns with action=update, set_object_schema_column_active_state, delete_object_schema_columns, delete_object_schema, and manage_object_schema_board_connection."}getInputSchema(){return km}async executeInternal(e){const t={ids:e.ids,names:e.names,limit:e.limit,page:e.page,excludeCreatedByMonday:e.excludeCreatedByMonday},a=(await this.mondayApi.request(Om,t)).get_object_schemas??[];return{content:{message:`Retrieved ${a.length} object schema(s)`,schemas:a}}}},class extends ue{constructor(){super(...arguments),this.name="create_object_schema",this.type=b.WRITE,this.annotations=me({title:"Create Object Schema",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new account-level object schema. Schemas define the structure and columns of boards. If you are nesting this schema under an existing one, call get_object_schemas first to resolve parentId. This tool creates the schema only — add its columns afterwards with manage_object_schema_columns, and attach boards with manage_object_schema_board_connection."}getInputSchema(){return Cm}async executeInternal(e){const t={name:e.name,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(Rm,t);return{content:{message:`Object schema "${a.create_object_schema?.name}" successfully created`,schema_id:a.create_object_schema?.id,schema_name:a.create_object_schema?.name,revision:a.create_object_schema?.revision}}}},class extends ue{constructor(){super(...arguments),this.name="update_object_schema",this.type=b.WRITE,this.annotations=me({title:"Update Object Schema",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Update an account-level object schema. Requires the current revision number for optimistic locking — retrieve it first via get_object_schemas."}getInputSchema(){return xm}async executeInternal(e){const t={id:e.id,revision:e.revision,parentId:e.parentId,description:e.description},a=await this.mondayApi.request($m,t);return{content:{message:`Object schema "${a.update_object_schema?.name}" successfully updated`,schema_id:a.update_object_schema?.id,schema_name:a.update_object_schema?.name,revision:a.update_object_schema?.revision}}}},class extends ue{constructor(){super(...arguments),this.name="delete_object_schema",this.type=b.WRITE,this.annotations=me({title:"Delete Object Schema",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an account-level object schema. Only allowed when no boards are connected to the schema. Provide either id or name."}getInputSchema(){return Um}async executeInternal(e){if(!e.id&&!e.name)throw new Error("Either id or name must be provided");const t={id:e.id,name:e.name},a=await this.mondayApi.request(Lm,t);return{content:{message:`Object schema "${a.delete_object_schema?.name}" successfully deleted`,schema_id:a.delete_object_schema?.id,schema_name:a.delete_object_schema?.name}}}},class extends ue{constructor(){super(...arguments),this.name="delete_object_schema_columns",this.type=b.WRITE,this.annotations=me({title:"Delete Object Schema Columns",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Permanently delete columns from an account-level object schema. Only allowed when no boards are connected to the schema. Use manage_object_schema_column with action=deactivate for a reversible alternative. [REQUIRED PRECONDITION]: Call get_object_schemas first to resolve the schema id and the exact column ids — this deletion is irreversible, so never guess ids."}getInputSchema(){return Vm}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnIds:e.columnIds},a=await this.mondayApi.request(Pm,t,{versionOverride:"dev"});return{content:{message:`${e.columnIds.length} column(s) successfully deleted from object schema "${a.delete_object_schema_columns?.name}"`,schema_id:a.delete_object_schema_columns?.id,schema_name:a.delete_object_schema_columns?.name,revision:a.delete_object_schema_columns?.revision}}}},class extends ue{constructor(){super(...arguments),this.name="manage_object_schema_board_connection",this.type=b.WRITE,this.annotations=me({title:"Manage Object Schema Board Connection",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Connect or detach a board from an account-level object schema. connect: attaches a board to an object schema so it inherits the schema column structure. detach: removes one or more boards from their object schema."}getInputSchema(){return Bm}async executeInternal(e){if("connect"===e.action){if(!e.boardId)throw new Error("boardId is required for action=connect");if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided for action=connect");const t={boardId:e.boardId,objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName},a=await this.mondayApi.request(Mm,t);return{content:{message:"Board successfully connected to object schema",connection_id:a.connect_board_to_object_schema?.id,schema_id:a.connect_board_to_object_schema?.object_schema_id}}}{if(!e.boardIds?.length)throw new Error("boardIds is required for action=detach");const t={boardIds:e.boardIds},a=(await this.mondayApi.request(Fm,t)).detach_boards_from_object_schema??[],i=a.filter((e=>e.success)).length,n=a.filter((e=>!e.success));return{content:{message:`${i} board(s) successfully detached`,results:a,...n.length>0&&{failures:n}}}}}},class extends ue{constructor(){super(...arguments),this.name="manage_object_schema_columns",this.type=b.WRITE,this.annotations=me({title:"Manage Object Schema Columns",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create or update columns on an account-level object schema. Column changes are propagated to all boards connected to the schema. create: adds new columns. Each column requires type and title. Call get_column_type_info with fetchMode "${zm.Schema}" first to understand valid defaults per column type. update: modifies existing columns. Each entry must include column_id — call get_object_schemas first to resolve the schema id and the exact column ids. Only send the columns you want to modify — other columns are unaffected. Use opt_out_by_default=true to stop a column from being auto-added to boards (opt out), or opt_out_by_default=false to restore auto-adding (opt in).`}getInputSchema(){return Ym}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");if("create"===e.action){const t=e.columns.map((e=>{const t=e;return{type:t.type,title:t.title,description:t.description,defaults:t.defaults,opt_out_by_default:t.opt_out_by_default,policy:{can_override:t.policy?.can_override??[],cannot_delete:t.policy?.cannot_delete??!1}}})),a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columns:t},i=await this.mondayApi.request(jm,a);return{content:{message:`Columns successfully added to object schema "${i.create_object_schema_columns?.name}"`,schema_id:i.create_object_schema_columns?.id,schema_name:i.create_object_schema_columns?.name,revision:i.create_object_schema_columns?.revision}}}{const t={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columns:e.columns.map((e=>{const t=e;return{column_id:t.column_id,title:t.title,description:t.description,defaults:t.defaults,opt_out_by_default:t.opt_out_by_default,policy:t.policy?{can_override:t.policy.can_override??[],cannot_delete:t.policy.cannot_delete??!1}:void 0}}))},a=await this.mondayApi.request(qm,t);return{content:{message:`Columns successfully updated on object schema "${a.update_object_schema_columns?.name}"`,schema_id:a.update_object_schema_columns?.id,schema_name:a.update_object_schema_columns?.name,revision:a.update_object_schema_columns?.revision}}}}},class extends ue{constructor(){super(...arguments),this.name="set_object_schema_column_active_state",this.type=b.WRITE,this.annotations=me({title:"Set Object Schema Column Active State",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Set the active state of a column on an account-level object schema. [REQUIRED PRECONDITION]: Call get_object_schemas first to resolve the schema id, the column id, and its current active state. deactivate: soft-disables the column, preventing it from being used on new boards. The column is not deleted and can be restored. reactivate: restores a previously deactivated column, making it available again."}getInputSchema(){return Km}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={deactivate:Go.Deactivate,reactivate:Go.Reactivate},a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnId:e.columnId,action:t[e.action]},i=await this.mondayApi.request(Qm,a);return{content:{message:`Column successfully ${e.action}d on object schema "${i.set_object_schema_column_active_state?.name}"`,schema_id:i.set_object_schema_column_active_state?.id,schema_name:i.set_object_schema_column_active_state?.name,revision:i.set_object_schema_column_active_state?.revision}}}},class extends ue{constructor(){super(...arguments),this.name="get_asset_upload_url",this.type=b.WRITE,this.annotations=me({title:"Get Asset Upload URL",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Get a presigned URL to upload a file to monday.com. Returns an upload_id and upload_url.\n\nOnly call this tool if you can execute a direct HTTP PUT with binary file data and read response headers (e.g. via shell/curl). If you can\'t, tell the user direct file upload isn\'t supported here — don\'t call this tool.\n\nAfter calling this tool, upload the file to the returned URL using an HTTP PUT request and capture the ETag header from the response:\n\ncurl -i -X PUT "<upload_url>" \\\n -H "Content-Type: <the contentType you provided>" \\\n --data-binary @<local_file_path>\n\nThe response includes an ETag header (e.g. ETag: "abc123...") — save this value.\n\nThen call finalize_asset_upload with the upload_id, etag, board_id, item_id, and column_id to complete the upload and attach the file to an item\'s file column.\n\nMax file size: 500MB.'}getInputSchema(){return Xg}async executeInternal(e){const t=(await this.mondayApi.request(Jg,{input:{file_name:e.fileName,content_type:e.contentType,file_size:e.fileSize,source:"mcp",multipart:!1}},{versionOverride:"dev"})).create_upload,a=t.parts[0]?.url;if(!a)throw new Error("create_upload returned no upload URL — parts array was empty");return{content:{upload_id:t.upload_id,upload_url:a,url_expires_at:t.expires_at}}}},class extends ue{constructor(){super(...arguments),this.name="finalize_asset_upload",this.type=b.WRITE,this.annotations=me({title:"Finalize Asset Upload",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Finalize a file upload and create the asset on monday.com. Call this after uploading the file to the presigned URL from get_asset_upload_url. Requires the etag value from the PUT response headers. Automatically attaches the uploaded asset to the specified file column on the item. Returns the created asset_id."}getInputSchema(){return ty}async executeInternal(e){const t=(await this.mondayApi.request(Zg,{input:{upload_id:e.uploadId,holder:{type:"ITEM",id:e.itemId},board_id:e.boardId,parts:[{part_number:1,etag:e.etag}]}},{versionOverride:"dev"})).complete_upload,a=JSON.stringify({added_file:{fileType:"ASSET",name:t.filename,assetId:String(t.id)}});return await this.mondayApi.request(ey,{boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,value:a}),{content:{asset_id:t.id,filename:t.filename,content_type:t.content_type,file_size:t.file_size,url:t.url,filelink:t.filelink}}}},class extends ue{constructor(){super(...arguments),this.name="link_board_items_workflow",this.type=b.READ,this.annotations=me({title:"Link Board Items Workflow",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the required playbook for linking items across boards via board-relation columns. When to use: any board-relation / cross-board linking task. **Hard gate — you MUST call this BEFORE get_board_items_page, or change_item_column_values in the same turn. No discovery, matching, or write happens first.** Triggers: **link** or **connect** items **across boards** (board-relation / "connect boards" / pairs) — also vague phrasings where only one side is named ("link this to **an** item on another board", "**the matching** row"). This tool is read-only (no API).'}getInputSchema(){return iy}async executeInternal(e){return{content:ay}}},class extends ue{constructor(){super(...arguments),this.name="fetch_file_content",this.type=b.READ,this.annotations=me({title:"Fetch File Content",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch and extract the text content from a file stored in a monday.com files column.\n\nUse this tool when you need to read, summarize, or analyze the content of files attached to board items. Provide the item ID and column ID from the get_board_items_page response — the column value will be a URL like \"https://monday.com/protected_static/...\" indicating a file is present (null means no file).\n\nPROACTIVE USE: If you retrieve board items and notice a files column with a non-null value (a URL), consider fetching its content if it could help answer the user's question — don't wait to be explicitly asked.\n\nSupported file types and what is returned:\n- Text files (.txt, .md, .csv, .json): raw text content\n- Word documents (.docx): extracted text content\n- PDF files (.pdf): extracted text content\n- Excel files (.xlsx, .xls): extracted text content per sheet\n- Images (.png, .jpg, .gif, .webp, .svg, .bmp, .ico): returns the public URL so you can view or analyze the image directly\n\nText responses include a total_length field. If has_more is true, the content was truncated — you can call this tool again with next_offset if you need the remaining content. For very large Excel workbooks, extraction_truncated: true means the text was cut short and the rest of the workbook is not available.\n\nWhen to use:\n- User asks to summarize, read, or analyze the content of a file in a files column\n- User asks questions about what is inside a file (e.g., \"what does the PDF say?\")\n- User wants to extract data from a CSV or Excel file attached to a board item\n- A board item has a files column with a non-null value and the user's question may be answered by its content — even if the user didn't explicitly ask to read the file\n\nWhen NOT to use:\n- The files column value is null (no file uploaded for that item)"}getInputSchema(){return vy}async executeInternal(e){const{item_id:t,column_id:a,file_name:i,offset:n=0}=e,o=await this.mondayApi.request(ny,{itemId:t,columnId:a}),r=o?.items?.[0]?.assets;if(!r||0===r.length)return{content:{message:`No file found for item ${t} in column ${a}. The column may be empty or the column ID may be incorrect.`}};const s=this.isXlsxStreamingEnabled()?ly:cy;return{content:{files:await Promise.all(r.map((e=>wy(e,n,s,i))))}}}isXlsxStreamingEnabled(){return this.context?.deps?.flagChecker?.("mcp-fetch-file-content-xlsx-streaming")??!0}},class extends ue{constructor(){super(...arguments),this.name="list_automations",this.type=b.READ,this.annotations=me({title:"List Board Automations",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'List all automations on a specific monday.com board, including their ids, titles, active state, and configuration.\nReturns two groups: "workflows" (fully manageable, supports pagination via limit/cursor) and "legacyAutomations" (READ-ONLY automations set up in an older way — returned on the first page only, when no cursor is given).\nAlways present BOTH groups to the user together as one list of board automations — never omit or hide "legacyAutomations". The split and the read-only limitation are internal context for you only: don\'t volunteer them and don\'t label any automation "legacy" or "read-only". Only if the user asks to act on a legacy one, briefly explain it can\'t be changed (e.g. "This one was set up in an older way and can\'t be modified here").\nCall this FIRST before manage_automations — it is the only way to resolve an automation id from a name or description. Never guess an automation id.\nWhen NOT to use: Do not call this tool to get general board information unrelated to automations.\n'}getInputSchema(){return Sy}async executeInternal(e){try{const a=!e.cursor,i={boardIds:[e.boardId],limit:e.limit??100,includeLegacy:a,...e.cursor?{cursor:e.cursor}:{}},n=await this.mondayApi.request(Ty,i),o=(n.board_automations?.items??[]).map(Ay),r=n.board_automations?.cursor??null,s=a?(t=n.board_automations?.legacy_automations,null==t||"object"==typeof t&&"error"in t?null:t):null;return{content:{message:`Found ${o.length} live workflow(s) on board ${e.boardId}`,workflows:o,...null!=s?{legacyAutomations:s}:{},pagination:{nextCursor:r,hasMore:null!==r}}}}catch(e){nm(e,"list live workflows")}var t}},class extends ue{constructor(){super(...arguments),this.name="manage_automations",this.type=b.WRITE,this.annotations=me({title:"Manage Automations",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Activate, deactivate, or delete an existing monday.com automation.\n\nRequires an automation id. When the user refers to an automation by name, always call list_automations first to resolve the id — never guess or infer ids.\n\nActions:\n- activate: enables a paused automation so it starts responding to its trigger.\n- deactivate: pauses an automation while preserving its definition.\n- delete: permanently removes an automation — irreversible.\n\nWhen intent is ambiguous ("stop", "turn off", "pause"), prefer deactivate over delete.'}getInputSchema(){return ky}async executeInternal(e){const t=e;switch(t.action){case"activate":return this.activateWorkflow(t);case"deactivate":return this.deactivateWorkflow(t);case"delete":return this.deleteWorkflow(t)}}async activateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(Dy,t,{versionOverride:"dev"});if(!a.activate_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} activation did not report success`);return{content:{message:`Workflow ${e.workflowId} activated`,workflowId:e.workflowId,isActive:!0}}}catch(e){nm(e,"activate workflow")}}async deactivateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(Ny,t,{versionOverride:"dev"});if(!a.deactivate_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} deactivation did not report success`);return{content:{message:`Workflow ${e.workflowId} deactivated`,workflowId:e.workflowId,isActive:!1}}}catch(e){nm(e,"deactivate workflow")}}async deleteWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(Oy,t,{versionOverride:"dev"});if(!a.delete_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} deletion did not report success`);return{content:{message:`Workflow ${e.workflowId} deleted`,workflowId:e.workflowId}}}catch(e){nm(e,"delete workflow")}}},class extends ue{constructor(e,t,a){super(e,a),this.apiToken=t,this.name="create_automation",this.type=b.WRITE,this.annotations=me({title:"Create Automation",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'\n Creates an automation on a monday board from a structured natural-language description.\n\nUse this tool only when you know:\n- boardId\n- the user\'s intended trigger\n- at least one intended action\n- any details the user provided that are relevant to the trigger, conditions, or actions\n\nThe caller does not need to know the exact available automation blocks or their required fields. Describe the user\'s intent clearly — the tool will translate that intent into supported blocks and values.\n\nIf a required detail is missing from the user\'s request, ask for clarification before calling the tool.\n\nIf the tool returns status: "needs_clarification", present the unresolved fields to the user, gather answers, then call the tool again.\n\nDescribe the automation in this format:\n\nTrigger:\n When <the event that should start the automation>\n Details:\n <relevant detail>: <value>\n\nConditions:\n - Only if <condition that should be true>\n Details:\n <relevant detail>: <value>\n\nActions:\n - <action the automation should perform>:\n <relevant detail>: <value>\n\nRules:\n- Use one trigger.\n- Conditions are optional.\n- Multiple conditions mean AND.\n- Use one or more actions.\n- Do not use branching.\n- Use natural language, not block IDs or internal field names.\n- Actions may reference values from the trigger context, such as "{{item name}}", "{{creator}}", "{{status}}", "{{group}}", or "{{board}}".\n\nTerminology:\n- Trigger: the event that starts the automation, such as "when a new item is created".\n- Conditions: optional requirements that must be true before actions run.\n- Actions: what the automation does when it runs.\n\nExample:\n\nTrigger:\n When a new item is created\n\nActions:\n - Send a notification:\n Recipient: John Snow\n Title: Important Update\n Message: The item "{{item name}}" was created.\n\n - Move the item to a group:\n Group: Top group\n'}getInputSchema(){return Cy}async executeInternal(e){try{const a="function"==typeof this.apiToken?this.apiToken():this.apiToken,i=(t=this.context,t?.fetchConfig?.fetch??Ry),n=await i({serviceName:"platform-agent",path:"/platform-ai-gateway/agents/lite-builder",method:"POST",headers:{...this.context?.fetchConfig?.fetch?{}:{Authorization:a},"Content-Type":"application/json"},body:JSON.stringify({userPrompt:e.userPrompt,boardId:e.boardId}),signal:AbortSignal.timeout(18e4)});if(!n.ok){const e=await n.text().catch((()=>""));throw new im(`lite-builder responded with HTTP ${n.status}${e?`: ${e}`:""}`,"UPSTREAM_HTTP_ERROR")}return{content:await n.json()}}catch(e){nm(e,"create automation")}var t}},class extends ue{constructor(){super(...arguments),this.name="get_automation_runs",this.type=b.READ,this.annotations=me({title:"Get Automation Runs",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Read automation/workflow run history. Read-only.\n\nModes:\n- "history": paginated run feed (state, duration, error reason). Use "filters" to narrow results and "nextPageOffset" to page (offset-only — next page = previous offset + returned count).\n- "detail": single run by "triggerUuid" (required) — returns block steps and MCP tool calls. Set "includeToolEvents": false to skip tool calls.\n\nScope: provide "boardId" for a specific board or "accountWide": true. One is required.\n\nKnown event states: "success", "failure", "exhausted".'}getInputSchema(){return My}async executeInternal(e){if(!e.boardId&&!e.accountWide)return{content:{message:'Either "boardId" or "accountWide": true must be provided.'}};try{return"detail"===e.mode?await this.runDetail(e):await this.runHistory(e)}catch(e){nm(e,"get automation runs")}}async runHistory(e){const t=e.nextPageOffset??0,a={...e.filters??{},...e.boardId?{boardId:e.boardId}:{}},i=await this.mondayApi.request(xy,{nextPageOffset:t,filters:a}),n=i.trigger_events?.triggerEvents??[],o=function(e){return e.reduce(((e,t)=>{const a=t.eventState??"unknown";return e[a]=(e[a]??0)+1,e}),{})}(n),r=e.boardId?`board ${e.boardId}`:"account-wide";return{content:{message:`Returned ${n.length} run(s) (${r}) at offset ${t}. By state: ${function(e){const t=Object.entries(e).map((([e,t])=>`${e}=${t}`));return t.length?t.join(", "):"none"}(o)}. Offset-only pagination — for the next page request offset ${t+n.length}.`,scope:r,offset:t,count:n.length,stateCounts:o,runs:n}}}async runDetail(e){if(!e.triggerUuid)return{content:{message:'detail mode requires "triggerUuid".'}};const t=!1!==e.includeToolEvents,a=e.blockEventsOffset??0,i=e.toolEventsOffset??0,n=(await this.mondayApi.request(Ly,{triggerUuid:e.triggerUuid})).trigger_event;if(!n)return{content:{message:`No run found for triggerUuid ${e.triggerUuid}.`,triggerUuid:e.triggerUuid,found:!1}};const[o,r]=await Promise.all([this.mondayApi.request(Uy,{triggerUuid:e.triggerUuid,nextPageOffset:a}),t?this.mondayApi.request(Py,{triggerUuid:e.triggerUuid,nextPageOffset:i}):Promise.resolve(null)]),s=o.block_events?.blockEvents??[],d=r?.tool_events?.tool_events??[];return{content:{message:`Run ${e.triggerUuid}: state=${n.eventState??"unknown"}, ${s.length} block step(s), ${d.length} tool call(s).`,found:!0,run:n,blockEvents:s,blockEventsOffset:a,toolEvents:d,toolEventsOffset:i,toolEventsIncluded:t}}}},class extends ue{constructor(){super(...arguments),this.name="get_automation_statistics",this.type=b.READ,this.annotations=me({title:"Get Automation Statistics",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Aggregate automation run statistics. Read-only.\n\nBreakdowns:\n- "totals": success/failure/total counts at the account or board level.\n- "by_entity": per-automation and per-workflow counts for a given "runStatus" (required: "success" | "failure" | "exhausted"). Use "excludeAutomationIds" to omit specific automations.\n\nScope: provide "boardId" for a specific board or "accountWide": true. One is required.\n\nOptional "userIds" narrows results to specific creators.'}getInputSchema(){return zy}async executeInternal(e){if(!e.boardId&&!e.accountWide)return{content:{message:'Either "boardId" or "accountWide": true must be provided.'}};const t=e.boardId?function(e){const t=Number(e.trim());if(!Number.isInteger(t)||t<=0)throw new Error(`Invalid boardId: '${e}' is not a positive integer.`);return t}(e.boardId):void 0,a=e.boardId?`board ${e.boardId}`:"account-wide";try{return"by_entity"===e.breakdown?await this.runByEntity(e,t,a):await this.runTotals(e,t,a)}catch(e){nm(e,"get automation statistics")}}async runTotals(e,t,a){const i=(await this.mondayApi.request(Fy,{filters:{board_id:t,user_ids:e.userIds}})).account_trigger_statistics;return{content:{message:`Totals (${a}): success=${i?.success??0}, failure=${i?.failure??0}, total=${i?.total??0}.`,scope:a,breakdown:"totals",statistics:i}}}async runByEntity(e,t,a){if(!e.runStatus)return{content:{message:'by_entity breakdown requires "runStatus" (success | failure | exhausted).'}};const i=(await this.mondayApi.request(By,{runStatus:e.runStatus,filters:{board_id:t,automation_ids:e.excludeAutomationIds,user_ids:e.userIds}})).account_triggers_statistics_by_entity_id;return{content:{message:`By-entity '${e.runStatus}' statistics (${a}).`,scope:a,breakdown:"by_entity",runStatus:e.runStatus,automationStatistics:i?.automation_statistics,workflowStatistics:i?.workflow_statistics}}}},class extends ue{constructor(){super(...arguments),this.name="configure_ai_column",this.type=b.WRITE,this.annotations=me({title:"Configure AI Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add AI to a column or set up an AI column on a monday.com board. Use this tool when the user wants to automatically categorize, summarize, translate, extract, generate text, improve writing, or assign people using AI on a column. This is the right tool for requests like "add AI to a column", "set up automatic extraction/categorization/summarization", "make a column use AI", "configure AI on a column", or "use AI to automatically fill a column".\n\nThe column must already exist on the board with a compatible type for the chosen block. To create a new AI column, first use create_column to create the column, then use this tool to add AI behavior.\n\nBLOCK TYPES (only pass fields that apply to the chosen block_type):\n- categorize: { block_type, source_type, source_column_id?, additional_instructions? } — assigns labels from target column\'s existing status/dropdown options\n- summarize: { block_type, source_type, source_column_id?, additional_instructions? } — generates concise summaries\n- translate: { block_type, source_type, source_column_id?, target_language } — translates to target language\n- improve_text: { block_type, source_type, source_column_id?, tone?, improver_length?, refinement_type? } — rewrites/fixes text\n- extract: { block_type, source_type, source_column_id?, entity_type, custom_instructions?, additional_instructions? } — extracts structured info\n- open_block: { block_type, ai_query } — flexible custom prompt, reference columns via {pulse.column_id}\n- write_me: { block_type, ai_query, tone, output_length } — generates new text from prompt\n- person_assignment: { block_type, source_type, source_column_id?, groups } — assigns people based on context\n\nSOURCE TYPES (required for all blocks except open_block and write_me):\n- item_name: uses the item\'s name as input\n- thread: uses the item\'s updates/comments as input\n- column: uses another column\'s value (requires source_column_id)\n- emails_and_activities: uses emails & activities (categorize only)\n\nCOLUMN REFERENCE SYNTAX (for open_block and write_me ai_query):\n- {pulse.column_id} — regular board column\n- {pulse.name} — the item name\n- {pulse.subitem.column_id} — subitem column\n\nRELATED TOOLS:\n- create_column — create the target column first if it doesn\'t exist\n- get_board_schema — discover existing columns and their types/IDs'}getInputSchema(){return Jy}async executeInternal(e){const t=void 0!==e.run_backfill?{run_backfill:e.run_backfill}:void 0;try{switch(e.block_type){case"categorize":return this.handleCategorize(e.board_id,e,t);case"summarize":return this.handleSummarize(e.board_id,e,t);case"translate":return this.handleTranslate(e.board_id,e,t);case"improve_text":return this.handleImproveText(e.board_id,e,t);case"extract":return this.handleExtract(e.board_id,e,t);case"open_block":return this.handleOpenBlock(e.board_id,e,t);case"write_me":return this.handleWriteMe(e.board_id,e,t);case"person_assignment":return this.handlePersonAssignment(e.board_id,e,t)}}catch(e){nm(e,"configure AI column")}}validateSourceType(e,t){if(!e.source_type)throw new Error(`source_type is required for ${t} block`);if("column"===e.source_type&&!e.source_column_id)throw new Error('source_column_id is required when source_type is "column"')}async handleCategorize(e,t,a){this.validateSourceType(t,"categorize");const i=await this.mondayApi.request(jy,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_categorize_ai_column?.column_id}}}async handleSummarize(e,t,a){this.validateSourceType(t,"summarize");const i=await this.mondayApi.request(qy,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_summarize_ai_column?.column_id}}}async handleTranslate(e,t,a){if(this.validateSourceType(t,"translate"),!t.target_language)throw new Error("target_language is required for translate block");const i=await this.mondayApi.request(Gy,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,targetLanguage:t.target_language,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_translate_ai_column?.column_id}}}async handleImproveText(e,t,a){this.validateSourceType(t,"improve_text");const i=await this.mondayApi.request(Hy,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,tone:t.tone,length:t.improver_length,refinementType:t.refinement_type,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_improve_text_ai_column?.column_id}}}async handleExtract(e,t,a){if(this.validateSourceType(t,"extract"),!t.entity_type)throw new Error("entity_type is required for extract block");if("custom"===t.entity_type&&!t.custom_instructions)throw new Error('custom_instructions is required for extract block when entity_type is "custom"');const i=await this.mondayApi.request(Wy,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,entityType:t.entity_type,customInstructions:t.custom_instructions,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_extract_ai_column?.column_id}}}async handleOpenBlock(e,t,a){if(!t.ai_query)throw new Error("ai_query is required for open_block block");const i=await this.mondayApi.request(Yy,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_open_block_ai_column?.column_id}}}async handleWriteMe(e,t,a){if(!t.ai_query)throw new Error("ai_query is required for write_me block");if(!t.tone)throw new Error("tone is required for write_me block");if(!t.output_length)throw new Error("output_length is required for write_me block");const i=await this.mondayApi.request(Qy,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,tone:t.tone,length:t.output_length,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_write_me_ai_column?.column_id}}}async handlePersonAssignment(e,t,a){if(this.validateSourceType(t,"person_assignment"),!t.groups||0===t.groups.length)throw new Error("groups is required for person_assignment block");const i=await this.mondayApi.request(Ky,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,groups:t.groups,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:i.configure_person_assignment_ai_column?.column_id}}}},class extends ue{constructor(){super(...arguments),this.name="remove_ai_from_column",this.type=b.WRITE,this.annotations=me({title:"Remove AI from Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0})}getDescription(){return"Remove AI from a column on a monday.com board. Use this tool when the user wants to disable AI on a column, turn off AI automation, stop AI from running on a column, or delete the AI behavior from a column. This deletes all AI automation recipes and the app feature extension associated with the column. The column itself is not deleted — only its AI behavior is removed.\n\nUse get_board_schema to find column IDs before calling this tool."}getInputSchema(){return Zy}async executeInternal(e){try{const t=await this.mondayApi.request(Xy,{boardId:e.board_id.toString(),columnId:e.column_id});return{content:{message:"AI removed from column successfully",column_id:t.remove_ai_from_column?.column_id,success:t.remove_ai_from_column?.success}}}catch(e){nm(e,"remove AI from column")}}},class extends ue{constructor(){super(...arguments),this.name="submit_bug_or_feature_request",this.type=b.READ,this.annotations=me({title:"Submit Bug or Feature Request",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Report a bug, submit a feature request, or share feedback about the monday.com product or this integration.\n\nCall this tool proactively — not just when a user explicitly asks. Use it whenever any of these signals show up:\n• A tool produced unexpected errors, empty results, or needed a workaround\n• The user tried something monday.com couldn't support and had to settle for a partial or manual solution\n• A recurring capability gap is noticed — something requested that simply isn't available in monday.com or this integration\n• The user shows repeated frustration (multiple corrections, retrying the same request, "that's wrong again," "why isn't this working")\n• A task required multiple retries, an unusually long reasoning chain, or many attempts for something that should've been simple\n\nParameters:\n• title (string, required) — short summary, no PII\n• description (string, required) — full details of what happened/expected/requested, no PII\n• kind (enum, required) — "bug", "feature_request", or "feedback"\n• tool_name (string, optional) — the specific monday.com tool the feedback relates to (e.g. "create_item")\n\nRestriction: Use strictly for things related to monday.com — not for other tools (Google Drive, Slack, GitHub, etc.) that may be in the conversation context. ${ev}`}getInputSchema(){return tv}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,this.sessionContext.metadata.title=e.title,this.sessionContext.metadata.description=e.description,e.tool_name&&(this.sessionContext.metadata.tool_name=e.tool_name),{content:{message:"Feedback submitted successfully. Thank you for helping improve the monday.com MCP server."}}}},class extends ue{constructor(){super(...arguments),this.name="get_monday_knowledge",this.type=b.READ,this.annotations=me({title:"Get Monday Knowledge",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Ask a question about monday.com and get an AI-generated answer from the official knowledge base.\n\nUse kind="general" for questions about using monday.com — features, automations, UI, help center, and settings. Returns cited source articles with links.\nUse kind="developer_docs" for questions about the monday.com API — GraphQL queries and mutations, authentication, rate limits, webhooks, schema, API best practices, and building apps.\n\nImportant: do not include PII data in the questions.'}getInputSchema(){return rv}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,e.kind===nv?this.queryDeveloperDocs(e.query):this.queryGeneralKnowledge(e.query)}async queryGeneralKnowledge(e){const t={query:e},a=(await this.mondayApi.request(av,t)).knowledge_base_search;a?.answer||nm(new Error("No answer found in the knowledge base. Try rephrasing your question."),"get_monday_knowledge"),this.sessionContext.metadata??={},this.sessionContext.metadata.query=e,this.sessionContext.metadata.answer=a.answer;const i=(a.raw_snippets??[]).filter((e=>e.url&&e.title)).map((e=>({title:e.title,url:e.url,snippet:e.text??""})));return{content:{answer:a.answer,sources:i,kind:ov}}}async queryDeveloperDocs(e){const t={query:e,retrieval_only:!0},a=(await this.mondayApi.request(iv,t)).ask_developer_docs;return a?.answer||nm(new Error("No answer found in developer docs. Try rephrasing your question."),"get_monday_knowledge"),this.sessionContext.metadata??={},this.sessionContext.metadata.query=e,this.sessionContext.metadata.answer=a.answer,{content:{answer:a.answer,sources:[],kind:nv}}}}];var Mv;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(Mv||(Mv={}));const Fv=(e,t)=>{let a=[];t?.mode===Mv.APPS?a=[...ce]:t?.mode!==Mv.API&&t?.mode||(a=[...Vv,...Pv]);const i=a.map((t=>((e,t)=>e.prototype instanceof ue?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof j?new e(t.apiToken):new e)(t,e)));return i.filter((e=>{if(!t)return e.type!==b.ALL_API;if(t.mode===Mv.API&&"only"===t.enableDynamicApiTools)return e.type===b.ALL_API;let a=!1;return t.mode===Mv.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===b.ALL_API),t.readOnlyMode&&(a=a||e.type!==b.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))},Bv=e=>"object"==typeof e?JSON.stringify(e):e;exports.MondayAgentToolkit=class{constructor(e){this.mondayApiToken=e.mondayApiToken,this.context={...e.context,apiVersion:e.mondayApiVersion??B,...e.deps?{deps:{...e.context?.deps,...e.deps}}:{}},this.tools=this.initializeTools(e)}initializeTools(t){const a={apiClient:"function"==typeof t.mondayApiToken?()=>new e.ApiClient({token:t.mondayApiToken(),apiVersion:t.mondayApiVersion??B,endpoint:t.mondayApiEndpoint,requestConfig:t.mondayApiRequestConfig}):new e.ApiClient({token:t.mondayApiToken,apiVersion:t.mondayApiVersion??B,endpoint:t.mondayApiEndpoint,requestConfig:t.mondayApiRequestConfig}),apiToken:this.mondayApiToken,context:this.context};return Fv(a,t.toolsConfiguration)}getTools(){return this.tools.map((e=>{const t=e.getInputSchema();return{type:"function",function:{name:e.name,description:e.getDescription(),parameters:t?f.zodToJsonSchema(i.z.object(t)):void 0}}}))}async handleToolCall(e){const{name:t,arguments:a}=e.function,n=JSON.parse(a),o=this.tools.find((e=>e.name===t));if(!o)throw new Error(`Unknown tool: ${t}`);const r=o.getInputSchema();if(r){const t=i.z.object(r).safeParse(n);if(!t.success)throw new Error(`Invalid arguments: ${t.error.message}`);const a=await o.execute(t.data);return{role:"tool",tool_call_id:e.id,content:Bv(a.content)}}{const t=await o.execute();return{role:"tool",tool_call_id:e.id,content:Bv(t.content)}}}};
2951
2971
  //# sourceMappingURL=index.js.map