@mondaydotcomorg/agent-toolkit 5.74.3 → 5.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -525,7 +525,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
525
525
  }
526
526
  }
527
527
  }
528
- `,bc="TOOL_EXECUTION_FAILED",yc="GRAPHQL_ERROR",vc="INVALID_OPERATION_TYPE",Ic="EMPTY_API_RESPONSE",Ec="MISSING_REQUIRED_PARAMETER";class Tc extends Error{constructor(e,t,a){super(e),this.name="ToolValidationError",this.code=t,this.errors=a}}function wc(e,t){if(e instanceof Tc)throw e;const a=e?.response?.errors?.map((e=>{const{code:t,error_data:a}=e.extensions??{},n=Object.fromEntries(Object.entries({code:t,error_data:a}).filter((([,e])=>void 0!==e)));return Object.keys(n).length>0?`${e.message} (details: ${JSON.stringify(n)})`:e.message}))?.join(", ");if(a){const n=new Error(`Failed to ${t}: ${a}`);throw n.response=e.response,n}const n=e instanceof Error?e.message:"Unknown error";throw new Tc(`Failed to ${t}: ${n}`,bc)}function Ac(e){if(e instanceof Error&&"AbortError"===e.name)throw new Tc("Search has timed out, try providing alternative search term","SEARCH_TIMEOUT")}function Sc(e){const t=e?.response;return 429===t?.status}function Nc(e){if(!(e instanceof p))return e;const{token:t,defaultApiVersion:a,defaultEndpoint:n,requestConfig:i}=e;return new p({token:t,apiVersion:a,endpoint:n,requestConfig:{...i,headers:{...i?.headers,"x-api-schema":"public"}}})}const Dc={query:a.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:a.string().default("{}").describe("JSON string containing the variables for the GraphQL operation")};class Oc extends ee{constructor(e,t){super("function"==typeof e?()=>Nc(e()):Nc(e),t),this.name="all_monday_api",this.type=_.ALL_API,this.annotations=Z({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 Dc}async loadSchema(e){if(Oc.schemaCache[e])return Oc.schemaCache[e];try{const t=await this.mondayApi.rawRequest(lc),{data:a}=t,n=oi(a);return Oc.schemaCache[e]=n,n}catch(e){throw new Tc(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`,"GRAPHQL_SCHEMA_LOAD_FAILED")}}countGraphqlOperations(e){const t={},a={};for(const n of e.definitions){if("OperationDefinition"!==n.kind)continue;const e=n.operation===fe.MUTATION?a:n.operation===fe.QUERY?t:null;if(e)for(const t of n.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 ni(await this.loadSchema(t),e).map((e=>e.message))}async executeInternal(e){const{query:t,variables:a}=e;let n={};try{n=JSON.parse(a)}catch(e){throw new Tc(`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`,"INVALID_VARIABLES_JSON")}const i=ze(t);this.recordGraphqlOperationCounts(i);const o=await this.validateOperation(i,this.context?.apiVersion??D);if(o.length>0)throw new Tc(o.join(", "),"GRAPHQL_VALIDATION_FAILED");try{return{content:await this.mondayApi.request(t,n)}}catch(e){wc(e,"execute GraphQL operation")}}}Oc.schemaCache={};var Rc;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(Rc||(Rc={}));const Cc=1e3;var kc,Lc;!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"}(kc||(kc={})),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=Cc]="SECOND"}(Lc||(Lc={}));const Uc=10*Lc.SECOND;async function Pc(e,t){const a={value:!1},n=t.isRateLimitError??Sc;return async function(e,t){const a=new Array(e.length);let n=0;const i=Math.min(t,e.length);return await Promise.allSettled(Array.from({length:i},(async()=>{for(;n<e.length;){const t=n++;a[t]=await e[t]()}}))),a}(e.map(((e,i)=>async()=>{if(a.value)return t.onSkipped(i);try{return await e()}catch(e){return n(e)&&(a.value=!0),t.onError(e,i)}})),t.limit)}const $c='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"}}',xc=e=>{try{const t=JSON.parse(e);return"string"==typeof t?t:e}catch{return e}},Mc={itemId:a.number().describe("The ID of the item to be updated"),columnValues:a.string().describe(`The new column values for the item. Multiple columns can be changed at once. ${$c}`),createLabelsIfMissing:a.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.")},Vc={boardId:a.number().describe("The ID of the board that contains the item to be updated"),...Mc};class Fc extends ee{constructor(){super(...arguments),this.name="change_item_column_values",this.type=_.WRITE,this.annotations=Z({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."}getInputSchema(){return this.context?.boardId?Mc:Vc}async executeInternal(e){const t=this.context?.boardId??e.boardId,a=xc(e.columnValues),n={boardId:t.toString(),itemId:e.itemId.toString(),columnValues:a,...void 0!==e.createLabelsIfMissing&&{createLabelsIfMissing:e.createLabelsIfMissing}};let i;try{i=JSON.parse(a)}catch(e){throw new Tc(`Invalid columnValues JSON: ${e.message}`,"INVALID_COLUMN_VALUES_JSON")}if(null===i||"object"!=typeof i||Array.isArray(i))throw new Tc("Invalid columnValues JSON: expected a JSON object keyed by column id","INVALID_COLUMN_VALUES_JSON");const o=Object.keys(i);let r;try{r=await this.mondayApi.request(nc,{...n,columnIds:o})}catch(e){wc(e,"change column values")}const s=r.change_multiple_column_values?.column_values?.reduce(((e,t)=>(e[t.id]=t.value??null,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 Bc=a.object({itemId:a.number().optional().describe("Required. The id of the item to update."),columnValues:a.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. ${$c}`),boardId:a.number().optional().describe("Optional. The id of the board that contains this item. Provide it when this update targets a board other than the batch default or the board in context. When omitted, the batch boardId or the board in context is used."),createLabelsIfMissing:a.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.")}),qc={updates:a.array(Bc).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.")},jc={boardId:a.number().optional().describe("Optional default board id used for any update that does not set its own boardId. Each update can override it with its own boardId, so a single call can span multiple boards."),...qc};function Gc(e,t){if(e instanceof Tc)return{code:e.code,message:e.message,path:["results",t]};const a=e?.response?.errors?.[0],n=e instanceof Error?e.message:String(e),i=a?.extensions??{};return{...i,code:i.code??yc,message:a?.message??n,path:["results",t]}}const Hc=Ql`
528
+ `,bc="INVALID_TOOL_ARGS",yc="TOOL_EXECUTION_FAILED",vc="GRAPHQL_ERROR",Ic="INVALID_OPERATION_TYPE",Ec="EMPTY_API_RESPONSE",Tc="MISSING_REQUIRED_PARAMETER";class wc extends Error{constructor(e,t,a){super(e),this.name="ToolValidationError",this.code=t,this.errors=a}}function Ac(e,t){if(e instanceof wc)throw e;const a=e?.response?.errors?.map((e=>{const{code:t,error_data:a}=e.extensions??{},n=Object.fromEntries(Object.entries({code:t,error_data:a}).filter((([,e])=>void 0!==e)));return Object.keys(n).length>0?`${e.message} (details: ${JSON.stringify(n)})`:e.message}))?.join(", ");if(a){const n=new Error(`Failed to ${t}: ${a}`);throw n.response=e.response,n}const n=e instanceof Error?e.message:"Unknown error";throw new wc(`Failed to ${t}: ${n}`,yc)}function Sc(e){if(e instanceof Error&&"AbortError"===e.name)throw new wc("Search has timed out, try providing alternative search term","SEARCH_TIMEOUT")}function Nc(e){const t=e?.response;return 429===t?.status}function Dc(e){if(!(e instanceof p))return e;const{token:t,defaultApiVersion:a,defaultEndpoint:n,requestConfig:i}=e;return new p({token:t,apiVersion:a,endpoint:n,requestConfig:{...i,headers:{...i?.headers,"x-api-schema":"public"}}})}const Oc={query:a.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:a.string().default("{}").describe("JSON string containing the variables for the GraphQL operation")};class Rc extends ee{constructor(e,t){super("function"==typeof e?()=>Dc(e()):Dc(e),t),this.name="all_monday_api",this.type=_.ALL_API,this.annotations=Z({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 Oc}async loadSchema(e){if(Rc.schemaCache[e])return Rc.schemaCache[e];try{const t=await this.mondayApi.rawRequest(lc),{data:a}=t,n=oi(a);return Rc.schemaCache[e]=n,n}catch(e){throw new wc(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`,"GRAPHQL_SCHEMA_LOAD_FAILED")}}countGraphqlOperations(e){const t={},a={};for(const n of e.definitions){if("OperationDefinition"!==n.kind)continue;const e=n.operation===fe.MUTATION?a:n.operation===fe.QUERY?t:null;if(e)for(const t of n.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 ni(await this.loadSchema(t),e).map((e=>e.message))}async executeInternal(e){const{query:t,variables:a}=e;let n={};try{n=JSON.parse(a)}catch(e){throw new wc(`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`,"INVALID_VARIABLES_JSON")}const i=ze(t);this.recordGraphqlOperationCounts(i);const o=await this.validateOperation(i,this.context?.apiVersion??D);if(o.length>0)throw new wc(o.join(", "),"GRAPHQL_VALIDATION_FAILED");try{return{content:await this.mondayApi.request(t,n)}}catch(e){Ac(e,"execute GraphQL operation")}}}Rc.schemaCache={};var Cc;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(Cc||(Cc={}));const kc=1e3;var Lc,Uc;!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"}(Lc||(Lc={})),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=kc]="SECOND"}(Uc||(Uc={}));const Pc=10*Uc.SECOND;async function $c(e,t){const a={value:!1},n=t.isRateLimitError??Nc;return async function(e,t){const a=new Array(e.length);let n=0;const i=Math.min(t,e.length);return await Promise.allSettled(Array.from({length:i},(async()=>{for(;n<e.length;){const t=n++;a[t]=await e[t]()}}))),a}(e.map(((e,i)=>async()=>{if(a.value)return t.onSkipped(i);try{return await e()}catch(e){return n(e)&&(a.value=!0),t.onError(e,i)}})),t.limit)}const xc='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"}}',Mc=e=>{try{const t=JSON.parse(e);return"string"==typeof t?t:e}catch{return e}},Vc={itemId:a.number().describe("The ID of the item to be updated"),columnValues:a.string().describe(`The new column values for the item. Multiple columns can be changed at once. ${xc}`),createLabelsIfMissing:a.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.")},Fc={boardId:a.number().describe("The ID of the board that contains the item to be updated"),...Vc};class Bc extends ee{constructor(){super(...arguments),this.name="change_item_column_values",this.type=_.WRITE,this.annotations=Z({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."}getInputSchema(){return this.context?.boardId?Vc:Fc}async executeInternal(e){const t=this.context?.boardId??e.boardId,a=Mc(e.columnValues),n={boardId:t.toString(),itemId:e.itemId.toString(),columnValues:a,...void 0!==e.createLabelsIfMissing&&{createLabelsIfMissing:e.createLabelsIfMissing}};let i;try{i=JSON.parse(a)}catch(e){throw new wc(`Invalid columnValues JSON: ${e.message}`,"INVALID_COLUMN_VALUES_JSON")}if(null===i||"object"!=typeof i||Array.isArray(i))throw new wc("Invalid columnValues JSON: expected a JSON object keyed by column id","INVALID_COLUMN_VALUES_JSON");const o=Object.keys(i);let r;try{r=await this.mondayApi.request(nc,{...n,columnIds:o})}catch(e){Ac(e,"change column values")}const s=r.change_multiple_column_values?.column_values?.reduce(((e,t)=>(e[t.id]=t.value??null,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 qc=a.object({itemId:a.number().optional().describe("Required. The id of the item to update."),columnValues:a.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. ${xc}`),boardId:a.number().optional().describe("Optional. The id of the board that contains this item. Provide it when this update targets a board other than the batch default or the board in context. When omitted, the batch boardId or the board in context is used."),createLabelsIfMissing:a.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.")}),jc={updates:a.array(qc).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.")},Gc={boardId:a.number().optional().describe("Optional default board id used for any update that does not set its own boardId. Each update can override it with its own boardId, so a single call can span multiple boards."),...jc};function Hc(e,t){if(e instanceof wc)return{code:e.code,message:e.message,path:["results",t]};const a=e?.response?.errors?.[0],n=e instanceof Error?e.message:String(e),i=a?.extensions??{};return{...i,code:i.code??vc,message:a?.message??n,path:["results",t]}}const Wc=Ql`
529
529
  query GetObjectSchemas($ids: [ID!], $names: [String!], $limit: Int, $page: Int, $excludeCreatedByMonday: Boolean) {
530
530
  get_object_schemas(ids: $ids, names: $names, limit: $limit, page: $page, exclude_created_by_monday: $excludeCreatedByMonday) {
531
531
  id
@@ -537,7 +537,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
537
537
  connected_boards_count
538
538
  }
539
539
  }
540
- `,Wc={ids:a.array(a.string()).optional().describe("List of object schema IDs to retrieve. Mutually exclusive with names."),names:a.array(a.string()).optional().describe("List of object schema names to retrieve. Mutually exclusive with ids."),limit:a.number().optional().describe("Number of results per page. Default 25, max 100."),page:a.number().optional().describe("1-indexed page number. Default 1."),excludeCreatedByMonday:a.boolean().optional().describe("If true, returns only user-created schemas and excludes default monday.com schemas.")};const Yc=Ql`
540
+ `,Yc={ids:a.array(a.string()).optional().describe("List of object schema IDs to retrieve. Mutually exclusive with names."),names:a.array(a.string()).optional().describe("List of object schema names to retrieve. Mutually exclusive with ids."),limit:a.number().optional().describe("Number of results per page. Default 25, max 100."),page:a.number().optional().describe("1-indexed page number. Default 1."),excludeCreatedByMonday:a.boolean().optional().describe("If true, returns only user-created schemas and excludes default monday.com schemas.")};const Kc=Ql`
541
541
  mutation CreateObjectSchema($name: String!, $parentId: ID, $description: String) {
542
542
  create_object_schema(name: $name, parent_id: $parentId, description: $description) {
543
543
  id
@@ -547,7 +547,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
547
547
  revision
548
548
  }
549
549
  }
550
- `,Kc={name:a.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:a.string().optional().describe("The ID of the parent object schema."),description:a.string().optional().describe("The description for this object schema.")};const Qc=Ql`
550
+ `,Qc={name:a.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:a.string().optional().describe("The ID of the parent object schema."),description:a.string().optional().describe("The description for this object schema.")};const zc=Ql`
551
551
  mutation UpdateObjectSchema($id: ID!, $revision: Int!, $parentId: ID, $description: String) {
552
552
  update_object_schema(id: $id, revision: $revision, parent_id: $parentId, description: $description) {
553
553
  id
@@ -557,14 +557,14 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
557
557
  revision
558
558
  }
559
559
  }
560
- `,zc={id:a.string().describe("The ID of the object schema to update."),revision:a.number().describe("The current revision number for optimistic locking. Retrieve it first via get_object_schemas."),parentId:a.string().optional().describe("The ID of the parent object schema."),description:a.string().optional().describe("The new description for this object schema.")};const Jc=Ql`
560
+ `,Jc={id:a.string().describe("The ID of the object schema to update."),revision:a.number().describe("The current revision number for optimistic locking. Retrieve it first via get_object_schemas."),parentId:a.string().optional().describe("The ID of the parent object schema."),description:a.string().optional().describe("The new description for this object schema.")};const Xc=Ql`
561
561
  mutation DeleteObjectSchema($id: ID, $name: String) {
562
562
  delete_object_schema(id: $id, name: $name) {
563
563
  id
564
564
  name
565
565
  }
566
566
  }
567
- `,Xc={id:a.string().optional().describe("The ID of the object schema to delete. Either id or name must be provided."),name:a.string().optional().describe("The name of the object schema to delete. Either id or name must be provided.")};const Zc=Ql`
567
+ `,Zc={id:a.string().optional().describe("The ID of the object schema to delete. Either id or name must be provided."),name:a.string().optional().describe("The name of the object schema to delete. Either id or name must be provided.")};const em=Ql`
568
568
  mutation DeleteObjectSchemaColumns($objectSchemaId: ID, $objectSchemaName: String, $columnIds: [ID!]!) {
569
569
  delete_object_schema_columns(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, column_ids: $columnIds) {
570
570
  id
@@ -574,14 +574,14 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
574
574
  revision
575
575
  }
576
576
  }
577
- `,em={objectSchemaId:a.string().optional().describe("The ID of the object schema to delete columns from. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:a.string().optional().describe("The name of the object schema to delete columns from. Either objectSchemaId or objectSchemaName must be provided."),columnIds:a.array(a.string()).describe("IDs of the columns to permanently delete. Only allowed when no boards are connected to the schema.")};const tm=Ql`
577
+ `,tm={objectSchemaId:a.string().optional().describe("The ID of the object schema to delete columns from. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:a.string().optional().describe("The name of the object schema to delete columns from. Either objectSchemaId or objectSchemaName must be provided."),columnIds:a.array(a.string()).describe("IDs of the columns to permanently delete. Only allowed when no boards are connected to the schema.")};const am=Ql`
578
578
  mutation ConnectBoardToObjectSchema($boardId: ID!, $objectSchemaId: ID, $objectSchemaName: String) {
579
579
  connect_board_to_object_schema(board_id: $boardId, object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName) {
580
580
  id
581
581
  object_schema_id
582
582
  }
583
583
  }
584
- `,am=Ql`
584
+ `,nm=Ql`
585
585
  mutation DetachBoardsFromObjectSchema($boardIds: [ID!]!) {
586
586
  detach_boards_from_object_schema(board_ids: $boardIds) {
587
587
  board_id
@@ -589,7 +589,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
589
589
  error
590
590
  }
591
591
  }
592
- `,nm={action:a.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:a.string().optional().describe("Required for action=connect. The ID of the board to connect."),boardIds:a.array(a.string()).optional().describe("Required for action=detach. The IDs of the boards to detach."),objectSchemaId:a.string().optional().describe("Required for action=connect. The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:a.string().optional().describe("Required for action=connect. The name of the object schema. Either objectSchemaId or objectSchemaName must be provided.")};var im;!function(e){e.Schema="schema",e.Guidelines="guidelines"}(im||(im={}));const om=Ql`
592
+ `,im={action:a.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:a.string().optional().describe("Required for action=connect. The ID of the board to connect."),boardIds:a.array(a.string()).optional().describe("Required for action=detach. The IDs of the boards to detach."),objectSchemaId:a.string().optional().describe("Required for action=connect. The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:a.string().optional().describe("Required for action=connect. The name of the object schema. Either objectSchemaId or objectSchemaName must be provided.")};var om;!function(e){e.Schema="schema",e.Guidelines="guidelines"}(om||(om={}));const rm=Ql`
593
593
  mutation CreateObjectSchemaColumns($objectSchemaId: ID, $objectSchemaName: String, $columns: [CreateObjectSchemaColumnInput!]!) {
594
594
  create_object_schema_columns(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, columns: $columns) {
595
595
  id
@@ -599,7 +599,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
599
599
  revision
600
600
  }
601
601
  }
602
- `,rm=Ql`
602
+ `,sm=Ql`
603
603
  mutation UpdateObjectSchemaColumns($objectSchemaId: ID, $objectSchemaName: String, $columns: [UpdateObjectSchemaColumnInput!]!) {
604
604
  update_object_schema_columns(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, columns: $columns) {
605
605
  id
@@ -609,7 +609,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
609
609
  revision
610
610
  }
611
611
  }
612
- `,sm=a.object({can_override:a.array(a.enum(["title","description","settings"])).optional().describe("Fields that boards can override. Allowed values: title, description, settings."),cannot_delete:a.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."),dm=a.object({type:a.string().describe(`Column type (e.g. text, status, numbers, date, dropdown, people). Call get_column_type_info with fetchMode "${im.Schema}" for a type's settings schema.`),title:a.string().describe("Column title."),description:a.string().optional().describe("Column description."),defaults:a.record(a.unknown()).optional().describe(`Type-specific column settings. Call get_column_type_info with fetchMode "${im.Schema}" before populating this field to understand the valid structure.`),policy:sm,opt_out_by_default:a.boolean().optional().describe("If true, the column will not be automatically added to boards connected to this schema.")}),pm=a.object({column_id:a.string().describe("The ID of the column to update."),title:a.string().optional().describe("New column title."),description:a.string().optional().describe("New column description."),defaults:a.record(a.unknown()).optional().describe(`Type-specific column settings. Call get_column_type_info with fetchMode "${im.Schema}" before populating this field.`),opt_out_by_default:a.boolean().optional().describe("If true, the column will not be automatically added to boards connected to this schema."),policy:sm}),lm={action:a.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 "${im.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:a.string().optional().describe("The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:a.string().optional().describe("The name of the object schema. Either objectSchemaId or objectSchemaName must be provided."),columns:a.array(a.union([dm,pm])).describe("Array of columns to create or update.")};const cm=Ql`
612
+ `,dm=a.object({can_override:a.array(a.enum(["title","description","settings"])).optional().describe("Fields that boards can override. Allowed values: title, description, settings."),cannot_delete:a.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."),pm=a.object({type:a.string().describe(`Column type (e.g. text, status, numbers, date, dropdown, people). Call get_column_type_info with fetchMode "${om.Schema}" for a type's settings schema.`),title:a.string().describe("Column title."),description:a.string().optional().describe("Column description."),defaults:a.record(a.unknown()).optional().describe(`Type-specific column settings. Call get_column_type_info with fetchMode "${om.Schema}" before populating this field to understand the valid structure.`),policy:dm,opt_out_by_default:a.boolean().optional().describe("If true, the column will not be automatically added to boards connected to this schema.")}),lm=a.object({column_id:a.string().describe("The ID of the column to update."),title:a.string().optional().describe("New column title."),description:a.string().optional().describe("New column description."),defaults:a.record(a.unknown()).optional().describe(`Type-specific column settings. Call get_column_type_info with fetchMode "${om.Schema}" before populating this field.`),opt_out_by_default:a.boolean().optional().describe("If true, the column will not be automatically added to boards connected to this schema."),policy:dm}),cm={action:a.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 "${om.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:a.string().optional().describe("The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:a.string().optional().describe("The name of the object schema. Either objectSchemaId or objectSchemaName must be provided."),columns:a.array(a.union([pm,lm])).describe("Array of columns to create or update.")};const mm=Ql`
613
613
  mutation SetObjectSchemaColumnActiveState($objectSchemaId: ID, $objectSchemaName: String, $columnId: ID!, $action: ColumnActiveStateAction!) {
614
614
  set_object_schema_column_active_state(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, column_id: $columnId, action: $action) {
615
615
  id
@@ -619,7 +619,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
619
619
  revision
620
620
  }
621
621
  }
622
- `,mm={action:a.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:a.string().optional().describe("The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:a.string().optional().describe("The name of the object schema. Either objectSchemaId or objectSchemaName must be provided."),columnId:a.string().describe("The ID of the column to deactivate or reactivate.")};const um={boardName:a.string().describe("The name of the board to create"),boardKind:a.nativeEnum(eo).default(eo.Public).describe("The kind of board to create"),boardDescription:a.string().optional().describe("The description of the board to create"),workspaceId:a.string().optional().describe("The ID of the workspace to create the board in"),boardOwnerIds:a.array(a.string()).optional().describe("Optional list of user IDs to set as board owners"),useMlsTemplate:a.boolean().optional().describe("Set to true to create a multi-level board using the MLS template"),useDatasetTemplate:a.boolean().optional().describe("Set to true to create a board from the dataset template")};const hm={templateId:a.coerce.number().int().positive().describe("The template ID to apply."),destinationWorkspaceId:a.coerce.number().int().positive().optional().describe("Target workspace ID."),destinationName:a.string().optional().describe("Name for the created instance or folder."),boardKind:a.nativeEnum(eo).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 _m={processId:a.string().describe("The process_id returned by use_template.")};const fm=Ql`
622
+ `,um={action:a.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:a.string().optional().describe("The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:a.string().optional().describe("The name of the object schema. Either objectSchemaId or objectSchemaName must be provided."),columnId:a.string().describe("The ID of the column to deactivate or reactivate.")};const hm={boardName:a.string().describe("The name of the board to create"),boardKind:a.nativeEnum(eo).default(eo.Public).describe("The kind of board to create"),boardDescription:a.string().optional().describe("The description of the board to create"),workspaceId:a.string().optional().describe("The ID of the workspace to create the board in"),boardOwnerIds:a.array(a.string()).optional().describe("Optional list of user IDs to set as board owners"),useMlsTemplate:a.boolean().optional().describe("Set to true to create a multi-level board using the MLS template"),useDatasetTemplate:a.boolean().optional().describe("Set to true to create a board from the dataset template")};const _m={templateId:a.coerce.number().int().positive().describe("The template ID to apply."),destinationWorkspaceId:a.coerce.number().int().positive().optional().describe("Target workspace ID."),destinationName:a.string().optional().describe("Name for the created instance or folder."),boardKind:a.nativeEnum(eo).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 fm={processId:a.string().describe("The process_id returned by use_template.")};const gm=Ql`
623
623
  mutation createView(
624
624
  $boardId: ID!
625
625
  $type: ViewKind!
@@ -641,7 +641,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
641
641
  type
642
642
  }
643
643
  }
644
- `,gm={boardId:a.string().describe("The board ID to create the view on"),type:a.nativeEnum(hp).default(hp.Table).describe("The type of board view to create. Use TABLE for standard board views."),name:a.string().optional().describe('The name of the view (e.g. "High Priority Items", "My Tasks")'),filter:a.object({rules:a.array(a.object({column_id:a.string().describe("The column ID to filter by"),compare_value:a.any().default([]).describe("The value(s) to compare against"),operator:a.nativeEnum(is).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:a.nativeEnum(ns).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration for the view"),sort:a.array(a.object({column_id:a.string().describe("The column ID to sort by"),direction:a.nativeEnum(as).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),settings:a.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 bm=Ql`
644
+ `,bm={boardId:a.string().describe("The board ID to create the view on"),type:a.nativeEnum(hp).default(hp.Table).describe("The type of board view to create. Use TABLE for standard board views."),name:a.string().optional().describe('The name of the view (e.g. "High Priority Items", "My Tasks")'),filter:a.object({rules:a.array(a.object({column_id:a.string().describe("The column ID to filter by"),compare_value:a.any().default([]).describe("The value(s) to compare against"),operator:a.nativeEnum(is).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:a.nativeEnum(ns).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration for the view"),sort:a.array(a.object({column_id:a.string().describe("The column ID to sort by"),direction:a.nativeEnum(as).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),settings:a.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 ym=Ql`
645
645
  mutation updateView(
646
646
  $viewId: ID!
647
647
  $boardId: ID!
@@ -665,7 +665,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
665
665
  type
666
666
  }
667
667
  }
668
- `,ym={viewId:a.string().describe("The ID of the view to update"),boardId:a.string().describe("The board ID the view belongs to"),type:a.nativeEnum(hp).default(hp.Table).describe("The type of the board view being updated. Use TABLE for standard board views."),name:a.string().optional().describe("New name for the view (omit to leave unchanged)"),filter:a.object({rules:a.array(a.object({column_id:a.string().describe("The column ID to filter by"),compare_value:a.any().default([]).describe("The value(s) to compare against"),operator:a.nativeEnum(is).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:a.nativeEnum(ns).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration to apply to the view"),sort:a.array(a.object({column_id:a.string().describe("The column ID to sort by"),direction:a.nativeEnum(as).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),settings:a.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 vm=Ql`
668
+ `,vm={viewId:a.string().describe("The ID of the view to update"),boardId:a.string().describe("The board ID the view belongs to"),type:a.nativeEnum(hp).default(hp.Table).describe("The type of the board view being updated. Use TABLE for standard board views."),name:a.string().optional().describe("New name for the view (omit to leave unchanged)"),filter:a.object({rules:a.array(a.object({column_id:a.string().describe("The column ID to filter by"),compare_value:a.any().default([]).describe("The value(s) to compare against"),operator:a.nativeEnum(is).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:a.nativeEnum(ns).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration to apply to the view"),sort:a.array(a.object({column_id:a.string().describe("The column ID to sort by"),direction:a.nativeEnum(as).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),settings:a.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 Im=Ql`
669
669
  mutation createViewTable(
670
670
  $boardId: ID!
671
671
  $name: String
@@ -687,7 +687,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
687
687
  type
688
688
  }
689
689
  }
690
- `,Im=a.object({column_id:a.string().describe("The ID of the column"),visible:a.boolean().describe("Whether the column is visible")}),Em=a.object({columns:a.object({column_properties:a.array(Im).optional().describe("Visibility configuration for main board columns"),subitems_column_properties:a.array(Im).optional().describe("Visibility configuration for subitem columns"),floating_columns_count:a.number().int().optional().describe("Number of floating columns to display"),column_order:a.array(a.string()).optional().describe("Ordered list of column IDs")}).optional().describe("Column visibility and order configuration"),group_by:a.object({conditions:a.array(a.object({columnId:a.string().describe("ID of the column to group by"),config:a.object({sortSettings:a.object({direction:a.nativeEnum(ld).describe("Sort direction (ASC or DESC)"),type:a.string().optional().describe("Type of sorting to apply")}).optional()}).optional()})).describe("Group-by conditions"),hideEmptyGroups:a.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)"),Tm={boardId:a.string().describe("The board ID to create the table view on"),name:a.string().optional().describe('The name of the view (e.g. "High Priority Items", "My Tasks")'),filter:a.object({rules:a.array(a.object({column_id:a.string().describe("The column ID to filter by"),compare_value:a.any().default([]).describe("The value(s) to compare against"),operator:a.nativeEnum(is).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:a.nativeEnum(ns).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration for the view"),sort:a.array(a.object({column_id:a.string().describe("The column ID to sort by"),direction:a.nativeEnum(as).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),tags:a.array(a.string()).optional().describe("Tags to apply to the view"),settings:Em};const wm=Ql`
690
+ `,Em=a.object({column_id:a.string().describe("The ID of the column"),visible:a.boolean().describe("Whether the column is visible")}),Tm=a.object({columns:a.object({column_properties:a.array(Em).optional().describe("Visibility configuration for main board columns"),subitems_column_properties:a.array(Em).optional().describe("Visibility configuration for subitem columns"),floating_columns_count:a.number().int().optional().describe("Number of floating columns to display"),column_order:a.array(a.string()).optional().describe("Ordered list of column IDs")}).optional().describe("Column visibility and order configuration"),group_by:a.object({conditions:a.array(a.object({columnId:a.string().describe("ID of the column to group by"),config:a.object({sortSettings:a.object({direction:a.nativeEnum(ld).describe("Sort direction (ASC or DESC)"),type:a.string().optional().describe("Type of sorting to apply")}).optional()}).optional()})).describe("Group-by conditions"),hideEmptyGroups:a.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)"),wm={boardId:a.string().describe("The board ID to create the table view on"),name:a.string().optional().describe('The name of the view (e.g. "High Priority Items", "My Tasks")'),filter:a.object({rules:a.array(a.object({column_id:a.string().describe("The column ID to filter by"),compare_value:a.any().default([]).describe("The value(s) to compare against"),operator:a.nativeEnum(is).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:a.nativeEnum(ns).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration for the view"),sort:a.array(a.object({column_id:a.string().describe("The column ID to sort by"),direction:a.nativeEnum(as).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),tags:a.array(a.string()).optional().describe("Tags to apply to the view"),settings:Tm};const Am=Ql`
691
691
  mutation updateViewTable(
692
692
  $viewId: ID!
693
693
  $boardId: ID!
@@ -711,7 +711,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
711
711
  type
712
712
  }
713
713
  }
714
- `,Am=a.object({column_id:a.string().describe("The ID of the column"),visible:a.boolean().describe("Whether the column is visible")}),Sm=a.object({columns:a.object({column_properties:a.array(Am).optional().describe("Visibility configuration for main board columns"),subitems_column_properties:a.array(Am).optional().describe("Visibility configuration for subitem columns"),floating_columns_count:a.number().int().optional().describe("Number of floating columns to display"),column_order:a.array(a.string()).optional().describe("Ordered list of column IDs")}).optional().describe("Column visibility and order configuration"),group_by:a.object({conditions:a.array(a.object({columnId:a.string().describe("ID of the column to group by"),config:a.object({sortSettings:a.object({direction:a.nativeEnum(ld).describe("Sort direction (ASC or DESC)"),type:a.string().optional().describe("Type of sorting to apply")}).optional()}).optional()})).describe("Group-by conditions"),hideEmptyGroups:a.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)"),Nm={viewId:a.string().describe("The ID of the table view to update"),boardId:a.string().describe("The board ID the view belongs to"),name:a.string().optional().describe("New name for the view (omit to leave unchanged)"),filter:a.object({rules:a.array(a.object({column_id:a.string().describe("The column ID to filter by"),compare_value:a.any().default([]).describe("The value(s) to compare against"),operator:a.nativeEnum(is).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:a.nativeEnum(ns).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration to apply to the view"),sort:a.array(a.object({column_id:a.string().describe("The column ID to sort by"),direction:a.nativeEnum(as).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),tags:a.array(a.string()).optional().describe("Tags to apply to the view"),settings:Sm};const Dm=Ql`
714
+ `,Sm=a.object({column_id:a.string().describe("The ID of the column"),visible:a.boolean().describe("Whether the column is visible")}),Nm=a.object({columns:a.object({column_properties:a.array(Sm).optional().describe("Visibility configuration for main board columns"),subitems_column_properties:a.array(Sm).optional().describe("Visibility configuration for subitem columns"),floating_columns_count:a.number().int().optional().describe("Number of floating columns to display"),column_order:a.array(a.string()).optional().describe("Ordered list of column IDs")}).optional().describe("Column visibility and order configuration"),group_by:a.object({conditions:a.array(a.object({columnId:a.string().describe("ID of the column to group by"),config:a.object({sortSettings:a.object({direction:a.nativeEnum(ld).describe("Sort direction (ASC or DESC)"),type:a.string().optional().describe("Type of sorting to apply")}).optional()}).optional()})).describe("Group-by conditions"),hideEmptyGroups:a.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)"),Dm={viewId:a.string().describe("The ID of the table view to update"),boardId:a.string().describe("The board ID the view belongs to"),name:a.string().optional().describe("New name for the view (omit to leave unchanged)"),filter:a.object({rules:a.array(a.object({column_id:a.string().describe("The column ID to filter by"),compare_value:a.any().default([]).describe("The value(s) to compare against"),operator:a.nativeEnum(is).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:a.nativeEnum(ns).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration to apply to the view"),sort:a.array(a.object({column_id:a.string().describe("The column ID to sort by"),direction:a.nativeEnum(as).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view"),tags:a.array(a.string()).optional().describe("Tags to apply to the view"),settings:Nm};const Om=Ql`
715
715
  fragment QuestionBasic on FormQuestion {
716
716
  id
717
717
  type
@@ -721,7 +721,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
721
721
  required
722
722
  page_block_id
723
723
  }
724
- `,Om=Ql`
724
+ `,Rm=Ql`
725
725
  fragment QuestionOptions on FormQuestion {
726
726
  options {
727
727
  label
@@ -730,7 +730,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
730
730
  active
731
731
  }
732
732
  }
733
- `,Rm=Ql`
733
+ `,Cm=Ql`
734
734
  fragment QuestionSettings on FormQuestion {
735
735
  settings {
736
736
  prefill {
@@ -756,17 +756,17 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
756
756
  default_answer
757
757
  }
758
758
  }
759
- `,Cm=Ql`
759
+ `,km=Ql`
760
760
  fragment QuestionComplete on FormQuestion {
761
761
  ...QuestionBasic
762
762
  ...QuestionOptions
763
763
  ...QuestionSettings
764
764
  show_if_rules
765
765
  }
766
- ${Dm}
767
766
  ${Om}
768
767
  ${Rm}
769
- `,km=Ql`
768
+ ${Cm}
769
+ `,Lm=Ql`
770
770
  fragment FormFeatures on FormFeatures {
771
771
  isInternal
772
772
  reCaptchaChallenge
@@ -822,7 +822,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
822
822
  enabled
823
823
  }
824
824
  }
825
- `,Lm=Ql`
825
+ `,Um=Ql`
826
826
  fragment FormAppearance on FormAppearance {
827
827
  hideBranding
828
828
  showProgressBar
@@ -850,18 +850,18 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
850
850
  text
851
851
  }
852
852
  }
853
- `,Um=Ql`
853
+ `,Pm=Ql`
854
854
  fragment FormAccessibility on FormAccessibility {
855
855
  language
856
856
  logoAltText
857
857
  }
858
- `,Pm=Ql`
858
+ `,$m=Ql`
859
859
  fragment FormTag on FormTag {
860
860
  id
861
861
  name
862
862
  columnId
863
863
  }
864
- `,$m=Ql`
864
+ `,xm=Ql`
865
865
  mutation createForm(
866
866
  $destination_workspace_id: ID!
867
867
  $destination_folder_id: ID
@@ -888,7 +888,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
888
888
  token
889
889
  }
890
890
  }
891
- `,xm=Ql`
891
+ `,Mm=Ql`
892
892
  query getForm($formToken: String!) {
893
893
  form(formToken: $formToken) {
894
894
  id
@@ -917,16 +917,16 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
917
917
  }
918
918
  }
919
919
  }
920
- ${Cm}
921
920
  ${km}
922
921
  ${Lm}
923
922
  ${Um}
924
923
  ${Pm}
925
- `,Mm=Ql`
924
+ ${$m}
925
+ `,Vm=Ql`
926
926
  mutation deleteFormQuestion($formToken: String!, $questionId: String!) {
927
927
  delete_question(formToken: $formToken, questionId: $questionId)
928
928
  }
929
- `,Vm=Ql`
929
+ `,Fm=Ql`
930
930
  mutation createFormQuestion($formToken: String!, $question: CreateQuestionInput!) {
931
931
  create_form_question(formToken: $formToken, question: $question) {
932
932
  ...QuestionBasic
@@ -934,10 +934,10 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
934
934
  ...QuestionSettings
935
935
  }
936
936
  }
937
- ${Dm}
938
937
  ${Om}
939
938
  ${Rm}
940
- `,Fm=Ql`
939
+ ${Cm}
940
+ `,Bm=Ql`
941
941
  mutation updateFormQuestion($formToken: String!, $questionId: String!, $question: UpdateQuestionInput!) {
942
942
  update_form_question(formToken: $formToken, questionId: $questionId, question: $question) {
943
943
  ...QuestionBasic
@@ -945,9 +945,9 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
945
945
  ...QuestionSettings
946
946
  }
947
947
  }
948
- ${Dm}
949
948
  ${Om}
950
949
  ${Rm}
950
+ ${Cm}
951
951
  `;Ql`
952
952
  mutation updateForm($formToken: String!, $input: UpdateFormInput!) {
953
953
  update_form(formToken: $formToken, input: $input) {
@@ -972,42 +972,42 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
972
972
  }
973
973
  }
974
974
  }
975
- ${km}
976
975
  ${Lm}
977
976
  ${Um}
978
- `;const Bm=Ql`
977
+ ${Pm}
978
+ `;const qm=Ql`
979
979
  mutation setFormPassword($formToken: String!, $input: SetFormPasswordInput!) {
980
980
  set_form_password(formToken: $formToken, input: $input) {
981
981
  id
982
982
  }
983
983
  }
984
- `,qm=Ql`
984
+ `,jm=Ql`
985
985
  mutation shortenFormUrl($formToken: String!) {
986
986
  shorten_form_url(formToken: $formToken) {
987
987
  enabled
988
988
  url
989
989
  }
990
990
  }
991
- `,jm=Ql`
991
+ `,Gm=Ql`
992
992
  mutation deactivateForm($formToken: String!) {
993
993
  deactivate_form(formToken: $formToken)
994
994
  }
995
- `,Gm=Ql`
995
+ `,Hm=Ql`
996
996
  mutation activateForm($formToken: String!) {
997
997
  activate_form(formToken: $formToken)
998
998
  }
999
- `,Hm=Ql`
999
+ `,Wm=Ql`
1000
1000
  mutation deleteFormTag($formToken: String!, $tagId: String!) {
1001
1001
  delete_form_tag(formToken: $formToken, tagId: $tagId)
1002
1002
  }
1003
- `,Wm=Ql`
1003
+ `,Ym=Ql`
1004
1004
  mutation createFormTag($formToken: String!, $tag: CreateFormTagInput!) {
1005
1005
  create_form_tag(formToken: $formToken, tag: $tag) {
1006
1006
  ...FormTag
1007
1007
  }
1008
1008
  }
1009
- ${Pm}
1010
- `,Ym=Ql`
1009
+ ${$m}
1010
+ `,Km=Ql`
1011
1011
  mutation updateFormAppearance($formToken: String!, $appearance: FormAppearanceInput!) {
1012
1012
  update_form_settings(formToken: $formToken, settings: { appearance: $appearance }) {
1013
1013
  appearance {
@@ -1015,8 +1015,8 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1015
1015
  }
1016
1016
  }
1017
1017
  }
1018
- ${Lm}
1019
- `,Km=Ql`
1018
+ ${Um}
1019
+ `,Qm=Ql`
1020
1020
  mutation updateFormAccessibility($formToken: String!, $accessibility: FormAccessibilityInput!) {
1021
1021
  update_form_settings(formToken: $formToken, settings: { accessibility: $accessibility }) {
1022
1022
  accessibility {
@@ -1024,8 +1024,8 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1024
1024
  }
1025
1025
  }
1026
1026
  }
1027
- ${Um}
1028
- `,Qm=Ql`
1027
+ ${Pm}
1028
+ `,zm=Ql`
1029
1029
  mutation updateFormFeatures($formToken: String!, $features: FormFeaturesInput!, $is_anonymous: Boolean) {
1030
1030
  update_form_settings(formToken: $formToken, settings: { features: $features, is_anonymous: $is_anonymous }) {
1031
1031
  features {
@@ -1033,8 +1033,8 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1033
1033
  }
1034
1034
  }
1035
1035
  }
1036
- ${km}
1037
- `,zm=Ql`
1036
+ ${Lm}
1037
+ `,Jm=Ql`
1038
1038
  mutation updateFormQuestionOrder($formToken: String!, $questions: [QuestionOrderInput!]!) {
1039
1039
  update_form(formToken: $formToken, input: { questions: $questions }) {
1040
1040
  questions {
@@ -1043,14 +1043,14 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1043
1043
  }
1044
1044
  }
1045
1045
  }
1046
- `,Jm=Ql`
1046
+ `,Xm=Ql`
1047
1047
  mutation updateFormHeader($formToken: String!, $title: String, $description: String) {
1048
1048
  update_form(formToken: $formToken, input: { title: $title, description: $description }) {
1049
1049
  title
1050
1050
  description
1051
1051
  }
1052
1052
  }
1053
- `,Xm={questionId:"Question ID. Required for update/delete."},Zm={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."}},eu={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."}},tu={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."}},au={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"}},nu={destination_workspace_id:a.string(),destination_folder_id:a.string().optional(),destination_folder_name:a.string().optional(),board_kind:a.nativeEnum(eo).optional(),destination_name:a.string().optional().describe(Zm.args.destinationName),board_owner_ids:a.array(a.string()).optional(),board_owner_team_ids:a.array(a.string()).optional(),board_subscriber_ids:a.array(a.string()).optional().describe(Zm.args.boardSubscriberIds),board_subscriber_teams_ids:a.array(a.string()).optional().describe(Zm.args.boardSubscriberTeamsIds)};var iu,ou,ru,su,du,pu,lu,cu,mu,uu,hu,_u,fu,gu,bu,yu;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(iu||(iu={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(ou||(ou={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(ru||(ru={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(su||(su={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(du||(du={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(pu||(pu={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(lu||(lu={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(cu||(cu={})),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"}(mu||(mu={})),function(e){e.Account="account",e.QueryParam="queryParam"}(uu||(uu={})),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"}(hu||(hu={})),(_u||(_u={})).Or="OR",function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(fu||(fu={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(gu||(gu={})),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"}(bu||(bu={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(yu||(yu={}));const vu=a.object({type:a.nativeEnum(xr).describe(tu.properties.type),title:a.string().describe(tu.properties.title).optional(),description:a.string().describe(tu.properties.description).optional(),visible:a.boolean().optional(),required:a.boolean().optional(),insert_after_question_id:a.string().nullish().describe(tu.properties.insertAfterQuestionId),page_block_id:a.string().nullish().describe(tu.properties.pageBlockId),show_if_rules:a.object({operator:a.nativeEnum($o),rules:a.array(a.object({operator:a.nativeEnum($o),conditions:a.array(a.object({building_block_id:a.string().describe(tu.showIfConditionBuildingBlockId),operator:a.nativeEnum($o),values:a.array(a.string()).describe(tu.showIfConditionValues)}))}))}).describe(tu.showIfRules).optional(),options:a.array(a.object({label:a.string(),value:a.string().optional().describe(tu.properties.selectOptionsValue),visible:a.boolean().optional()})).describe(tu.properties.selectOptions).optional(),settings:a.object({checkedByDefault:a.boolean().describe(au.properties.checkedByDefault).optional(),defaultCurrentDate:a.boolean().describe(au.properties.defaultCurrentDate).optional(),display:a.nativeEnum(Pr).describe(au.properties.display).optional(),includeTime:a.boolean().describe(au.properties.includeTime).optional(),locationAutofilled:a.boolean().describe(au.properties.locationAutofilled).optional(),optionsOrder:a.nativeEnum($r).describe(au.properties.optionsOrder).optional(),prefixAutofilled:a.boolean().describe(au.properties.prefixAutofilled).optional(),prefixPredefined:a.object({enabled:a.boolean(),prefix:a.string().describe(au.properties.prefixPredefinedPrefix).optional()}).describe(au.properties.prefixPredefined).optional(),skipValidation:a.boolean().describe(au.properties.skipValidation).optional(),labelLimitCount:a.number().int().describe(au.properties.labelLimitCount).optional(),label_limit_count_enabled:a.boolean().describe(au.properties.labelLimitCountEnabled).optional(),default_answer:a.string().describe(au.properties.defaultAnswer).optional(),prefill:a.object({enabled:a.boolean(),lookup:a.string().describe(au.properties.prefillLookup).optional(),source:a.nativeEnum(Ur).optional()}).describe(au.properties.prefill).optional()}).describe("Type-specific question settings. Check each field description to see which question type it applies to.").optional()}),Iu={action:a.nativeEnum(yu).describe(tu.actions.type),formToken:a.string(),questionId:a.string().describe(Xm.questionId).optional(),question:vu.describe(tu.actions.question).optional()};class Eu{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(Mm,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 n={formToken:e.formToken,questionId:t,question:a};return await this.getMondayApi().request(Fm,n),{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}},n=await this.getMondayApi().request(Vm,a);return{content:{message:"Question created",question_id:n.create_form_question?.id,action_name:"create"}}}}var Tu;!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"}(Tu||(Tu={}));const wu=a.object({id:a.string().describe(Zm.properties.tags.id).optional(),name:a.string().describe(Zm.properties.tags.name).optional(),columnId:a.string().describe(Zm.properties.tags.columnId).optional()}),Au=a.object({type:a.nativeEnum(su).optional(),value:a.string().describe(eu.properties.backgroundValue).optional()}),Su=a.object({format:a.nativeEnum(pu).optional(),alignment:a.nativeEnum(lu).optional(),direction:a.nativeEnum(du).optional()}),Nu=a.object({position:a.nativeEnum(ru).optional(),size:a.nativeEnum(ou).describe(eu.properties.logoSize).optional()}),Du=a.object({text:a.string().optional()}),Ou=a.object({font:a.string().optional(),color:a.string().optional(),size:a.nativeEnum(cu).optional()}),Ru=a.object({enabled:a.boolean().optional(),redirectUrl:a.string().optional()}),Cu=a.object({allowEditSubmission:a.boolean().optional(),allowResubmit:a.boolean().optional(),allowViewSubmission:a.boolean().optional(),description:a.string().optional(),redirectAfterSubmission:Ru.optional(),showSuccessImage:a.boolean().optional(),title:a.string().optional()}),ku=a.object({enabled:a.boolean().optional(),date:a.string().describe(eu.properties.closeDateValue).optional()}),Lu=a.object({enabled:a.boolean().optional()}),Uu=a.object({itemGroupId:a.string().optional(),includeNameQuestion:a.boolean().describe(eu.properties.includeNameQuestion).optional(),includeUpdateQuestion:a.boolean().describe(eu.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:a.boolean().describe(eu.properties.syncQuestionAndColumnsTitles).optional(),allow_create_item:a.boolean().describe(eu.properties.allowCreateItem).optional()}),Pu=a.object({enabled:a.boolean().describe(eu.properties.passwordEnabled).optional()}),$u=a.object({text:a.string().optional()}),xu=a.object({enabled:a.boolean().optional(),title:a.string().optional(),description:a.string().optional(),startButton:$u.optional()}),Mu=a.object({enabled:a.boolean().optional(),redirectToLogin:a.boolean().optional()}),Vu=a.object({enabled:a.boolean().optional(),limit:a.number().optional()}),Fu=a.object({background:Au.optional(),hideBranding:a.boolean().optional(),layout:Su.optional(),logo:Nu.optional(),primaryColor:a.string().optional(),showProgressBar:a.boolean().optional(),submitButton:Du.optional(),text:Ou.optional()}),Bu=a.object({language:a.string().describe(eu.properties.language).optional(),logoAltText:a.string().optional()}),qu=a.object({enabled:a.boolean().optional()}),ju=a.object({afterSubmissionView:Cu.optional(),ai_translate:qu.optional(),closeDate:ku.optional(),draftSubmission:Lu.optional(),monday:Uu.optional(),password:Pu.optional(),preSubmissionView:xu.optional(),reCaptchaChallenge:a.boolean().optional(),requireLogin:Mu.optional(),responseLimit:Vu.optional(),is_anonymous:a.boolean().describe(Zm.properties.isAnonymous).optional()}),Gu=a.object({id:a.string().describe(Zm.inputs.questionId),page_block_id:a.string().describe(tu.properties.pageBlockId).optional()}),Hu=a.object({appearance:Fu.describe(Zm.inputs.form.appearance).optional(),accessibility:Bu.describe(Zm.inputs.form.accessibility).optional(),features:ju.describe(Zm.inputs.form.features).optional(),title:a.string().describe(Zm.inputs.title).optional(),description:a.string().describe(Zm.inputs.description).optional(),questions:a.array(Gu).describe(Zm.inputs.questions).optional()}),Wu={formToken:a.string(),action:a.nativeEnum(Tu).describe(Zm.operations.updateForm.action),formPassword:a.string().describe(eu.operations.setFormPassword).optional(),tag:wu.describe(Zm.inputs.tag).optional(),form:Hu.describe(Zm.inputs.form.describe).optional()};class Yu{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(Bm,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(qm,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(jm,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(Gm,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(Wm,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(Hm,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(Ym,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(Km,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,n={formToken:e.formToken,features:a,is_anonymous:t},i=await this.getMondayApi().request(Qm,n);return{content:{message:"Features successfully updated",form_token:e.formToken,action_name:"updateFeatures",data:i.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(zm,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(Jm,t);return{content:{message:"Form header updated",form_token:e.formToken,action_name:"updateFormHeader",data:a.update_form}}}}const Ku={formToken:a.string()};const Qu=Ql`
1053
+ `,Zm={questionId:"Question ID. Required for update/delete."},eu={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."}},tu={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."}},au={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."}},nu={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"}},iu={destination_workspace_id:a.string(),destination_folder_id:a.string().optional(),destination_folder_name:a.string().optional(),board_kind:a.nativeEnum(eo).optional(),destination_name:a.string().optional().describe(eu.args.destinationName),board_owner_ids:a.array(a.string()).optional(),board_owner_team_ids:a.array(a.string()).optional(),board_subscriber_ids:a.array(a.string()).optional().describe(eu.args.boardSubscriberIds),board_subscriber_teams_ids:a.array(a.string()).optional().describe(eu.args.boardSubscriberTeamsIds)};var ou,ru,su,du,pu,lu,cu,mu,uu,hu,_u,fu,gu,bu,yu,vu;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(ou||(ou={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(ru||(ru={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(su||(su={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(du||(du={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(pu||(pu={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(lu||(lu={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(cu||(cu={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(mu||(mu={})),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"}(uu||(uu={})),function(e){e.Account="account",e.QueryParam="queryParam"}(hu||(hu={})),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"}(_u||(_u={})),(fu||(fu={})).Or="OR",function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(gu||(gu={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(bu||(bu={})),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"}(yu||(yu={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(vu||(vu={}));const Iu=a.object({type:a.nativeEnum(xr).describe(au.properties.type),title:a.string().describe(au.properties.title).optional(),description:a.string().describe(au.properties.description).optional(),visible:a.boolean().optional(),required:a.boolean().optional(),insert_after_question_id:a.string().nullish().describe(au.properties.insertAfterQuestionId),page_block_id:a.string().nullish().describe(au.properties.pageBlockId),show_if_rules:a.object({operator:a.nativeEnum($o),rules:a.array(a.object({operator:a.nativeEnum($o),conditions:a.array(a.object({building_block_id:a.string().describe(au.showIfConditionBuildingBlockId),operator:a.nativeEnum($o),values:a.array(a.string()).describe(au.showIfConditionValues)}))}))}).describe(au.showIfRules).optional(),options:a.array(a.object({label:a.string(),value:a.string().optional().describe(au.properties.selectOptionsValue),visible:a.boolean().optional()})).describe(au.properties.selectOptions).optional(),settings:a.object({checkedByDefault:a.boolean().describe(nu.properties.checkedByDefault).optional(),defaultCurrentDate:a.boolean().describe(nu.properties.defaultCurrentDate).optional(),display:a.nativeEnum(Pr).describe(nu.properties.display).optional(),includeTime:a.boolean().describe(nu.properties.includeTime).optional(),locationAutofilled:a.boolean().describe(nu.properties.locationAutofilled).optional(),optionsOrder:a.nativeEnum($r).describe(nu.properties.optionsOrder).optional(),prefixAutofilled:a.boolean().describe(nu.properties.prefixAutofilled).optional(),prefixPredefined:a.object({enabled:a.boolean(),prefix:a.string().describe(nu.properties.prefixPredefinedPrefix).optional()}).describe(nu.properties.prefixPredefined).optional(),skipValidation:a.boolean().describe(nu.properties.skipValidation).optional(),labelLimitCount:a.number().int().describe(nu.properties.labelLimitCount).optional(),label_limit_count_enabled:a.boolean().describe(nu.properties.labelLimitCountEnabled).optional(),default_answer:a.string().describe(nu.properties.defaultAnswer).optional(),prefill:a.object({enabled:a.boolean(),lookup:a.string().describe(nu.properties.prefillLookup).optional(),source:a.nativeEnum(Ur).optional()}).describe(nu.properties.prefill).optional()}).describe("Type-specific question settings. Check each field description to see which question type it applies to.").optional()}),Eu={action:a.nativeEnum(vu).describe(au.actions.type),formToken:a.string(),questionId:a.string().describe(Zm.questionId).optional(),question:Iu.describe(au.actions.question).optional()};class Tu{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(Vm,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 n={formToken:e.formToken,questionId:t,question:a};return await this.getMondayApi().request(Bm,n),{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}},n=await this.getMondayApi().request(Fm,a);return{content:{message:"Question created",question_id:n.create_form_question?.id,action_name:"create"}}}}var wu;!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"}(wu||(wu={}));const Au=a.object({id:a.string().describe(eu.properties.tags.id).optional(),name:a.string().describe(eu.properties.tags.name).optional(),columnId:a.string().describe(eu.properties.tags.columnId).optional()}),Su=a.object({type:a.nativeEnum(du).optional(),value:a.string().describe(tu.properties.backgroundValue).optional()}),Nu=a.object({format:a.nativeEnum(lu).optional(),alignment:a.nativeEnum(cu).optional(),direction:a.nativeEnum(pu).optional()}),Du=a.object({position:a.nativeEnum(su).optional(),size:a.nativeEnum(ru).describe(tu.properties.logoSize).optional()}),Ou=a.object({text:a.string().optional()}),Ru=a.object({font:a.string().optional(),color:a.string().optional(),size:a.nativeEnum(mu).optional()}),Cu=a.object({enabled:a.boolean().optional(),redirectUrl:a.string().optional()}),ku=a.object({allowEditSubmission:a.boolean().optional(),allowResubmit:a.boolean().optional(),allowViewSubmission:a.boolean().optional(),description:a.string().optional(),redirectAfterSubmission:Cu.optional(),showSuccessImage:a.boolean().optional(),title:a.string().optional()}),Lu=a.object({enabled:a.boolean().optional(),date:a.string().describe(tu.properties.closeDateValue).optional()}),Uu=a.object({enabled:a.boolean().optional()}),Pu=a.object({itemGroupId:a.string().optional(),includeNameQuestion:a.boolean().describe(tu.properties.includeNameQuestion).optional(),includeUpdateQuestion:a.boolean().describe(tu.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:a.boolean().describe(tu.properties.syncQuestionAndColumnsTitles).optional(),allow_create_item:a.boolean().describe(tu.properties.allowCreateItem).optional()}),$u=a.object({enabled:a.boolean().describe(tu.properties.passwordEnabled).optional()}),xu=a.object({text:a.string().optional()}),Mu=a.object({enabled:a.boolean().optional(),title:a.string().optional(),description:a.string().optional(),startButton:xu.optional()}),Vu=a.object({enabled:a.boolean().optional(),redirectToLogin:a.boolean().optional()}),Fu=a.object({enabled:a.boolean().optional(),limit:a.number().optional()}),Bu=a.object({background:Su.optional(),hideBranding:a.boolean().optional(),layout:Nu.optional(),logo:Du.optional(),primaryColor:a.string().optional(),showProgressBar:a.boolean().optional(),submitButton:Ou.optional(),text:Ru.optional()}),qu=a.object({language:a.string().describe(tu.properties.language).optional(),logoAltText:a.string().optional()}),ju=a.object({enabled:a.boolean().optional()}),Gu=a.object({afterSubmissionView:ku.optional(),ai_translate:ju.optional(),closeDate:Lu.optional(),draftSubmission:Uu.optional(),monday:Pu.optional(),password:$u.optional(),preSubmissionView:Mu.optional(),reCaptchaChallenge:a.boolean().optional(),requireLogin:Vu.optional(),responseLimit:Fu.optional(),is_anonymous:a.boolean().describe(eu.properties.isAnonymous).optional()}),Hu=a.object({id:a.string().describe(eu.inputs.questionId),page_block_id:a.string().describe(au.properties.pageBlockId).optional()}),Wu=a.object({appearance:Bu.describe(eu.inputs.form.appearance).optional(),accessibility:qu.describe(eu.inputs.form.accessibility).optional(),features:Gu.describe(eu.inputs.form.features).optional(),title:a.string().describe(eu.inputs.title).optional(),description:a.string().describe(eu.inputs.description).optional(),questions:a.array(Hu).describe(eu.inputs.questions).optional()}),Yu={formToken:a.string(),action:a.nativeEnum(wu).describe(eu.operations.updateForm.action),formPassword:a.string().describe(tu.operations.setFormPassword).optional(),tag:Au.describe(eu.inputs.tag).optional(),form:Wu.describe(eu.inputs.form.describe).optional()};class Ku{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(qm,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(jm,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(Gm,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(Hm,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(Ym,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(Wm,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(Km,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(Qm,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,n={formToken:e.formToken,features:a,is_anonymous:t},i=await this.getMondayApi().request(zm,n);return{content:{message:"Features successfully updated",form_token:e.formToken,action_name:"updateFeatures",data:i.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(Jm,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(Xm,t);return{content:{message:"Form header updated",form_token:e.formToken,action_name:"updateFormHeader",data:a.update_form}}}}const Qu={formToken:a.string()};const zu=Ql`
1054
1054
  mutation CreateFormSubmission(
1055
1055
  $form_token: String!
1056
1056
  $answers: [FormAnswerInput!]!
@@ -1068,14 +1068,14 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1068
1068
  id
1069
1069
  }
1070
1070
  }
1071
- `,zu=a.object({phone:a.string().describe("The phone number."),country_short_name:a.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Ju=a.object({country_name:a.string().describe('The full country name (e.g. "United States").'),country_code:a.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Xu=a.object({date:a.string().describe("The date in YYYY-MM-DD format."),zone_diff:a.number().int().optional().describe("UTC offset in minutes.")}),Zu=a.object({from:a.string().describe("Start date in YYYY-MM-DD format."),to:a.string().describe("End date in YYYY-MM-DD format.")}),eh=a.object({lat:a.number().describe("Latitude."),lng:a.number().describe("Longitude."),place_id:a.string().describe("Google Maps place ID."),address:a.string().describe("Full formatted address."),country:a.object({long_name:a.string().describe("Full country name."),short_name:a.string().describe("ISO 3166-1 alpha-2 country code.")}),city:a.object({long_name:a.string().describe("Full city name."),short_name:a.string().describe("Abbreviated city name.")}),street:a.object({long_name:a.string().describe("Full street name."),short_name:a.string().describe("Abbreviated street name.")}),street_number:a.object({long_name:a.string().describe("Full street number."),short_name:a.string().describe("Abbreviated street number.")})}),th=a.object({id:a.string().describe("The file ID returned by the workforms upload endpoint."),name:a.string().describe('Original file name (e.g. "image.png").'),extension:a.string().optional().describe('File extension (e.g. "pdf", "png").'),is_image:a.boolean().optional().describe("Whether the file is an image.")}),ah=a.object({question_id:a.string().describe("The ID of the question being answered."),name:a.string().optional().describe("Answer for name questions."),email:a.string().optional().describe("Answer for email questions."),short_text:a.string().optional().describe("Answer for short text questions."),long_text:a.string().optional().describe("Answer for long text questions."),link:a.string().optional().describe("Answer for link questions."),updates:a.string().optional().describe("Answer for updates questions."),boolean:a.boolean().optional().describe("Answer for boolean questions."),number:a.number().optional().describe("Answer for number questions."),rating:a.number().min(1).optional().describe("Answer for rating questions. Must be a positive number within the question's configured limit."),single_select:a.string().optional().describe("Answer for single-select questions — the selected option ID."),multi_select:a.array(a.number()).optional().describe("Answer for multi-select questions — list of selected option IDs."),people:a.array(a.string()).optional().describe("Answer for people questions — list of user IDs. Obtain user IDs via the list_users_and_teams tool."),connected_boards:a.array(a.string()).optional().describe("Answer for connected boards questions — list of connected item IDs."),phone:zu.optional().describe("Answer for phone questions."),country:Ju.optional().describe("Answer for country questions."),date:Xu.optional().describe("Answer for date questions."),date_range:Zu.optional().describe("Answer for date range questions."),location:eh.optional().describe("Answer for location questions. Requires a Google Maps place ID and structured address components."),file:a.array(th).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:th.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."),nh={form_token:a.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:a.array(ah).describe("Array of answers to submit. Each answer specifies a question_id and the value for that question type."),form_timezone_offset:a.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:a.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:a.array(a.object({column_id:a.string().describe("The column ID this tag maps to."),value:a.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 ih=Object.fromEntries(Object.entries(Po).filter((([e])=>"Person"!==e))),oh={columnType:a.nativeEnum(ih).describe("The type of the column to be created"),columnTitle:a.string().describe("The title of the column to be created"),columnDescription:a.string().optional().describe("The description of the column to be created"),columnSettings:a.string().optional().describe("Column-specific configuration settings as a JSON string. Shape depends on columnType — see tool description for how to obtain it.")},rh={boardId:a.number().describe("The id of the board to which the new column will be added"),...oh};const sh={columnId:a.string().describe("The id of the column to update"),columnType:a.nativeEnum(ih).describe("The type of the column being updated. Must match the existing column type."),revision:a.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:a.string().optional().describe("The new title of the column. If omitted, the title is unchanged."),columnDescription:a.string().optional().describe("The new description of the column. If omitted, the description is unchanged."),columnSettings:a.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.")},dh={boardId:a.number().describe("The id of the board containing the column"),...sh};const ph={color:a.nativeEnum(jo).describe("The color of the custom activity"),icon_id:a.nativeEnum(Go).describe("The icon ID of the custom activity"),name:a.string().describe("The name of the custom activity")};const lh=Ql`
1071
+ `,Ju=a.object({phone:a.string().describe("The phone number."),country_short_name:a.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Xu=a.object({country_name:a.string().describe('The full country name (e.g. "United States").'),country_code:a.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Zu=a.object({date:a.string().describe("The date in YYYY-MM-DD format."),zone_diff:a.number().int().optional().describe("UTC offset in minutes.")}),eh=a.object({from:a.string().describe("Start date in YYYY-MM-DD format."),to:a.string().describe("End date in YYYY-MM-DD format.")}),th=a.object({lat:a.number().describe("Latitude."),lng:a.number().describe("Longitude."),place_id:a.string().describe("Google Maps place ID."),address:a.string().describe("Full formatted address."),country:a.object({long_name:a.string().describe("Full country name."),short_name:a.string().describe("ISO 3166-1 alpha-2 country code.")}),city:a.object({long_name:a.string().describe("Full city name."),short_name:a.string().describe("Abbreviated city name.")}),street:a.object({long_name:a.string().describe("Full street name."),short_name:a.string().describe("Abbreviated street name.")}),street_number:a.object({long_name:a.string().describe("Full street number."),short_name:a.string().describe("Abbreviated street number.")})}),ah=a.object({id:a.string().describe("The file ID returned by the workforms upload endpoint."),name:a.string().describe('Original file name (e.g. "image.png").'),extension:a.string().optional().describe('File extension (e.g. "pdf", "png").'),is_image:a.boolean().optional().describe("Whether the file is an image.")}),nh=a.object({question_id:a.string().describe("The ID of the question being answered."),name:a.string().optional().describe("Answer for name questions."),email:a.string().optional().describe("Answer for email questions."),short_text:a.string().optional().describe("Answer for short text questions."),long_text:a.string().optional().describe("Answer for long text questions."),link:a.string().optional().describe("Answer for link questions."),updates:a.string().optional().describe("Answer for updates questions."),boolean:a.boolean().optional().describe("Answer for boolean questions."),number:a.number().optional().describe("Answer for number questions."),rating:a.number().min(1).optional().describe("Answer for rating questions. Must be a positive number within the question's configured limit."),single_select:a.string().optional().describe("Answer for single-select questions — the selected option ID."),multi_select:a.array(a.number()).optional().describe("Answer for multi-select questions — list of selected option IDs."),people:a.array(a.string()).optional().describe("Answer for people questions — list of user IDs. Obtain user IDs via the list_users_and_teams tool."),connected_boards:a.array(a.string()).optional().describe("Answer for connected boards questions — list of connected item IDs."),phone:Ju.optional().describe("Answer for phone questions."),country:Xu.optional().describe("Answer for country questions."),date:Zu.optional().describe("Answer for date questions."),date_range:eh.optional().describe("Answer for date range questions."),location:th.optional().describe("Answer for location questions. Requires a Google Maps place ID and structured address components."),file:a.array(ah).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:ah.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."),ih={form_token:a.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:a.array(nh).describe("Array of answers to submit. Each answer specifies a question_id and the value for that question type."),form_timezone_offset:a.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:a.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:a.array(a.object({column_id:a.string().describe("The column ID this tag maps to."),value:a.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 oh=Object.fromEntries(Object.entries(Po).filter((([e])=>"Person"!==e))),rh={columnType:a.nativeEnum(oh).describe("The type of the column to be created"),columnTitle:a.string().describe("The title of the column to be created"),columnDescription:a.string().optional().describe("The description of the column to be created"),columnSettings:a.string().optional().describe("Column-specific configuration settings as a JSON string. Shape depends on columnType — see tool description for how to obtain it.")},sh={boardId:a.number().describe("The id of the board to which the new column will be added"),...rh};const dh={columnId:a.string().describe("The id of the column to update"),columnType:a.nativeEnum(oh).describe("The type of the column being updated. Must match the existing column type."),revision:a.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:a.string().optional().describe("The new title of the column. If omitted, the title is unchanged."),columnDescription:a.string().optional().describe("The new description of the column. If omitted, the description is unchanged."),columnSettings:a.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.")},ph={boardId:a.number().describe("The id of the board containing the column"),...dh};const lh={color:a.nativeEnum(jo).describe("The color of the custom activity"),icon_id:a.nativeEnum(Go).describe("The icon ID of the custom activity"),name:a.string().describe("The name of the custom activity")};const ch=Ql`
1072
1072
  mutation createNotification($user_id: ID!, $target_id: ID!, $text: String!, $target_type: NotificationTargetType!) {
1073
1073
  create_notification(user_id: $user_id, target_id: $target_id, text: $text, target_type: $target_type) {
1074
1074
  id
1075
1075
  text
1076
1076
  }
1077
1077
  }
1078
- `,ch={user_id:a.string().describe("The user ID to send the notification to"),target_id:a.string().describe("The target ID (update/reply ID for Post type, item/board ID for Project type)"),text:a.string().describe("The notification text"),target_type:a.nativeEnum(Ns).describe("The target type (Post for update/reply, Project for item/board)")};const mh=Ql`
1078
+ `,mh={user_id:a.string().describe("The user ID to send the notification to"),target_id:a.string().describe("The target ID (update/reply ID for Post type, item/board ID for Project type)"),text:a.string().describe("The notification text"),target_type:a.nativeEnum(Ns).describe("The target type (Post for update/reply, Project for item/board)")};const uh=Ql`
1079
1079
  mutation createGroup(
1080
1080
  $boardId: ID!
1081
1081
  $groupName: String!
@@ -1094,7 +1094,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1094
1094
  title
1095
1095
  }
1096
1096
  }
1097
- `,uh=["#037f4c","#00c875","#9cd326","#cab641","#ffcb00","#784bd1","#9d50dd","#007eb5","#579bfc","#66ccff","#bb3354","#df2f4a","#ff007f","#ff5ac4","#ff642e","#fdab3d","#7f5347","#c4c4c4","#757575"],hh={boardId:a.string().describe("The ID of the board to create the group in"),groupName:a.string().max(255).describe("The name of the new group (maximum 255 characters)"),groupColor:a.enum(uh).optional().describe(`The color for the group. Must be one of the predefined Monday.com group colors: ${uh.join(", ")}`),relativeTo:a.string().optional().describe("The ID of the group to position this new group relative to"),positionRelativeMethod:a.nativeEnum(Ms).optional().describe("Whether to position the new group before or after the relativeTo group")};const _h=Ql`
1097
+ `,hh=["#037f4c","#00c875","#9cd326","#cab641","#ffcb00","#784bd1","#9d50dd","#007eb5","#579bfc","#66ccff","#bb3354","#df2f4a","#ff007f","#ff5ac4","#ff642e","#fdab3d","#7f5347","#c4c4c4","#757575"],_h={boardId:a.string().describe("The ID of the board to create the group in"),groupName:a.string().max(255).describe("The name of the new group (maximum 255 characters)"),groupColor:a.enum(hh).optional().describe(`The color for the group. Must be one of the predefined Monday.com group colors: ${hh.join(", ")}`),relativeTo:a.string().optional().describe("The ID of the group to position this new group relative to"),positionRelativeMethod:a.nativeEnum(Ms).optional().describe("Whether to position the new group before or after the relativeTo group")};const fh=Ql`
1098
1098
  mutation duplicateItem($boardId: ID!, $itemId: ID!, $withUpdates: Boolean) {
1099
1099
  duplicate_item(board_id: $boardId, item_id: $itemId, with_updates: $withUpdates) {
1100
1100
  id
@@ -1102,7 +1102,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1102
1102
  url
1103
1103
  }
1104
1104
  }
1105
- `,fh=Ql`
1105
+ `,gh=Ql`
1106
1106
  mutation createSubitem(
1107
1107
  $parentItemId: ID!
1108
1108
  $itemName: String!
@@ -1123,7 +1123,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1123
1123
  }
1124
1124
  }
1125
1125
  }
1126
- `,gh={name:a.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:a.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:a.string().describe($c),createLabelsIfMissing:a.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:a.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:a.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},bh={boardId:a.number().describe("The id of the board to which the new item will be added"),...gh};class yh extends ee{constructor(){super(...arguments),this.name="create_item",this.type=_.WRITE,this.annotations=Z({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?gh:bh}async executeInternal(e){const t={...e,columnValues:xc(e.columnValues)},a=this.context?.boardId??t.boardId;if(t.duplicateFromItemId&&t.parentItemId)throw new Tc("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()},n=await this.mondayApi.request(_h,a);if(!n.duplicate_item?.id)throw new Tc("Failed to duplicate item: no item duplicated","EMPTY_API_RESPONSE");let i;try{i=JSON.parse(e.columnValues)}catch(e){throw new Tc("Invalid columnValues JSON: expected a JSON object keyed by column id","INVALID_COLUMN_VALUES_JSON")}const o={...i,name:e.name},r=new Fc(this.mondayApi,{boardId:t});return await r.execute({itemId:parseInt(n.duplicate_item.id),columnValues:JSON.stringify(o),createLabelsIfMissing:e.createLabelsIfMissing}),{content:{message:`Item ${n.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:n.duplicate_item.id,item_name:n.duplicate_item.name,item_url:n.duplicate_item.url,board_id:t}}}catch(e){wc(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(fh,t);if(!a.create_subitem?.id)throw new Tc("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){wc(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},n=await this.mondayApi.request(tc,a);return{content:{message:`Item ${n.create_item?.id} successfully created`,item_id:n.create_item?.id,item_name:n.create_item?.name,item_url:n.create_item?.url,board_id:t}}}catch(e){wc(e,"create item")}}}const vh={items:a.array(a.object({name:a.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:a.string().default("{}").describe(`Column values for this item, keyed by column id. Defaults to "{}" (no column values). ${$c}`),groupId:a.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:a.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:a.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:a.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.")},Ih={boardId:a.number().describe("The id of the board to which the new items will be added"),...vh};function Eh(e,t){const a=e?.response?.errors?.[0],n=e instanceof Error?e.message:String(e);return{...e instanceof Tc?{code:e.code}:{},...a?.extensions??{},message:a?.message??n,path:["results",t]}}const Th={item_id:a.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:a.string().describe("The ID of the custom activity for the timeline item"),title:a.string().describe("The title of the new timeline item"),summary:a.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:a.string().optional().describe("The content of the new timeline item"),timestamp:a.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:a.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:a.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:a.string().optional().describe("The location to add to the new timeline item"),phone:a.string().optional().describe("The phone number to add to the new timeline item"),url:a.string().optional().describe("The URL to add to the new timeline item")};const wh=Ql`
1126
+ `,bh={name:a.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:a.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:a.string().describe(xc),createLabelsIfMissing:a.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:a.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:a.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},yh={boardId:a.number().describe("The id of the board to which the new item will be added"),...bh};class vh extends ee{constructor(){super(...arguments),this.name="create_item",this.type=_.WRITE,this.annotations=Z({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?bh:yh}async executeInternal(e){const t={...e,columnValues:Mc(e.columnValues)},a=this.context?.boardId??t.boardId;if(t.duplicateFromItemId&&t.parentItemId)throw new wc("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()},n=await this.mondayApi.request(fh,a);if(!n.duplicate_item?.id)throw new wc("Failed to duplicate item: no item duplicated","EMPTY_API_RESPONSE");let i;try{i=JSON.parse(e.columnValues)}catch(e){throw new wc("Invalid columnValues JSON: expected a JSON object keyed by column id","INVALID_COLUMN_VALUES_JSON")}const o={...i,name:e.name},r=new Bc(this.mondayApi,{boardId:t});return await r.execute({itemId:parseInt(n.duplicate_item.id),columnValues:JSON.stringify(o),createLabelsIfMissing:e.createLabelsIfMissing}),{content:{message:`Item ${n.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:n.duplicate_item.id,item_name:n.duplicate_item.name,item_url:n.duplicate_item.url,board_id:t}}}catch(e){Ac(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(gh,t);if(!a.create_subitem?.id)throw new wc("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){Ac(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},n=await this.mondayApi.request(tc,a);return{content:{message:`Item ${n.create_item?.id} successfully created`,item_id:n.create_item?.id,item_name:n.create_item?.name,item_url:n.create_item?.url,board_id:t}}}catch(e){Ac(e,"create item")}}}const Ih={items:a.array(a.object({name:a.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:a.string().default("{}").describe(`Column values for this item, keyed by column id. Defaults to "{}" (no column values). ${xc}`),groupId:a.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:a.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:a.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:a.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.")},Eh={boardId:a.number().describe("The id of the board to which the new items will be added"),...Ih};function Th(e,t){const a=e?.response?.errors?.[0],n=e instanceof Error?e.message:String(e);return{...e instanceof wc?{code:e.code}:{},...a?.extensions??{},message:a?.message??n,path:["results",t]}}const wh={item_id:a.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:a.string().describe("The ID of the custom activity for the timeline item"),title:a.string().describe("The title of the new timeline item"),summary:a.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:a.string().optional().describe("The content of the new timeline item"),timestamp:a.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:a.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:a.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:a.string().optional().describe("The location to add to the new timeline item"),phone:a.string().optional().describe("The phone number to add to the new timeline item"),url:a.string().optional().describe("The URL to add to the new timeline item")};const Ah=Ql`
1127
1127
  mutation createUpdate($itemId: ID!, $body: String!, $mentionsList: [UpdateMention], $parentId: ID) {
1128
1128
  create_update(body: $body, item_id: $itemId, mentions_list: $mentionsList, parent_id: $parentId) {
1129
1129
  id
@@ -1134,7 +1134,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1134
1134
  }
1135
1135
  }
1136
1136
  }
1137
- `,Ah=Ql`
1137
+ `,Sh=Ql`
1138
1138
  query getItemUpdateReplyIds($itemId: ID!) {
1139
1139
  items(ids: [$itemId], limit: 1) {
1140
1140
  updates(limit: 100) {
@@ -1145,49 +1145,13 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1145
1145
  }
1146
1146
  }
1147
1147
  }
1148
- `,Sh=a.object({id:a.string().describe("The ID of the entity to mention"),type:a.nativeEnum(gs).describe("The type of mention: User, Team, Board, or Project. Mention an AI agent as User, not Agent")}),Nh=a.array(Sh),Dh={itemId:a.number().describe("The id of the item to which the update will be added"),body:a.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:a.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:a.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 Oh extends ee{constructor(){super(...arguments),this.name="create_update",this.type=_.WRITE,this.annotations=Z({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 Dh}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),n=Nh.safeParse(a);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);t=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t,parentId:e.parentId?.toString()},n=await this.createUpdate(a);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${n.create_update.id} created on item ${e.itemId}`,update_id:n.create_update.id,item_id:e.itemId,item_name:n.create_update.item?.name,item_url:n.create_update.item?.url}}}catch(e){wc(e,"create update")}}async createUpdate(e){try{return await this.mondayApi.request(wh,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(wh,{...e,parentId:a})}}async findParentUpdateId(e,t){const a=await this.mondayApi.request(Ah,{itemId:e});return a.items?.[0]?.updates?.find((e=>e.replies?.some((e=>e.id===t))))?.id}}const Rh={updates:a.array(a.object(Dh)).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 Ch(e,t){if(e instanceof Tc)return{code:e.code,message:e.message,path:["results",t]};const a=e?.response?.errors?.[0],n=e instanceof Error?e.message:String(e),i=a?.extensions??{};return{...i,code:i.code??yc,message:a?.message??n,path:["results",t]}}const kh=Ql`
1148
+ `,Nh=a.object({id:a.string().describe("The ID of the entity to mention"),type:a.nativeEnum(gs).describe("The type of mention: User, Team, Board, or Project. Mention an AI agent as User, not Agent")}),Dh=a.array(Nh),Oh={itemId:a.number().describe("The id of the item to which the update will be added"),body:a.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:a.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:a.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 Rh extends ee{constructor(){super(...arguments),this.name="create_update",this.type=_.WRITE,this.annotations=Z({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 Oh}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),n=Dh.safeParse(a);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);t=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t,parentId:e.parentId?.toString()},n=await this.createUpdate(a);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${n.create_update.id} created on item ${e.itemId}`,update_id:n.create_update.id,item_id:e.itemId,item_name:n.create_update.item?.name,item_url:n.create_update.item?.url}}}catch(e){Ac(e,"create update")}}async createUpdate(e){try{return await this.mondayApi.request(Ah,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(Ah,{...e,parentId:a})}}async findParentUpdateId(e,t){const a=await this.mondayApi.request(Sh,{itemId:e});return a.items?.[0]?.updates?.find((e=>e.replies?.some((e=>e.id===t))))?.id}}const Ch={updates:a.array(a.object(Oh)).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 kh(e,t){if(e instanceof wc)return{code:e.code,message:e.message,path:["results",t]};const a=e?.response?.errors?.[0],n=e instanceof Error?e.message:String(e),i=a?.extensions??{};return{...i,code:i.code??vc,message:a?.message??n,path:["results",t]}}const Lh=Ql`
1149
1149
  mutation DeleteUpdate($id: ID!) {
1150
1150
  delete_update(id: $id) {
1151
1151
  id
1152
1152
  }
1153
1153
  }
1154
- `,Lh={id:a.number().describe("The unique identifier of the update to delete")};const Uh=Ql`
1155
- query GetItemUpdates($itemId: ID!, $limit: Int, $page: Int, $includeReplies: Boolean!, $includeAssets: Boolean!) {
1156
- items(ids: [$itemId], limit: 1) {
1157
- id
1158
- url
1159
- updates(limit: $limit, page: $page) {
1160
- id
1161
- text_body
1162
- created_at
1163
- updated_at
1164
- item_id
1165
- creator {
1166
- id
1167
- name
1168
- }
1169
- replies @include(if: $includeReplies) {
1170
- id
1171
- text_body
1172
- created_at
1173
- updated_at
1174
- creator {
1175
- id
1176
- name
1177
- }
1178
- }
1179
- assets @include(if: $includeAssets) {
1180
- id
1181
- name
1182
- url
1183
- file_extension
1184
- file_size
1185
- created_at
1186
- }
1187
- }
1188
- }
1189
- }
1190
- `,Ph=Ql`
1154
+ `,Uh={id:a.number().describe("The unique identifier of the update to delete")};const Ph=Ql`
1191
1155
  query GetItemsUpdates($itemIds: [ID!]!, $itemsLimit: Int, $limit: Int, $page: Int, $includeReplies: Boolean!, $includeAssets: Boolean!) {
1192
1156
  items(ids: $itemIds, limit: $itemsLimit) {
1193
1157
  id
@@ -1259,7 +1223,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1259
1223
  }
1260
1224
  }
1261
1225
  }
1262
- `;var xh;!function(e){e.Item="Item",e.Board="Board"}(xh||(xh={}));const Mh=2e3,Vh={objectId:a.string().optional().describe("The ID of the item or board to get updates from. Provide either objectId or objectIds."),objectIds:a.array(a.string()).min(1).max(25).optional().describe("Item IDs to get updates from in one request, up to 25, instead of objectId. Item objectType only. limit and page apply to each item."),objectType:a.enum([xh.Item,xh.Board]).describe("Type of object for which objectId was provided"),limit:a.number().min(1).max(100).optional().describe("Number of updates per page (default: 25, or 10 per item with objectIds, max: 100)"),page:a.number().min(1).optional().default(1).describe("Page number for pagination (default: 1)"),includeReplies:a.boolean().optional().default(!1).describe("Include update replies in the response"),includeAssets:a.boolean().optional().default(!1).describe("Include file attachments in the response"),includeFullText:a.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 do not combine it with objectIds."),fromDate:a.string().optional().describe('Start of date range filter (e.g. "2025-01-01" or "2025-01-01T00:00:00Z"). Must be used together with toDate. Only supported for Board objectType.'),toDate:a.string().optional().describe('End of date range filter (e.g. "2025-06-01" or "2025-06-01T23:59:59Z"). Must be used together with fromDate. Only supported for Board objectType.'),includeItemUpdates:a.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 Fh(e,t=!1){return/^\d{4}-\d{2}-\d{2}$/.test(e)?t?`${e}T23:59:59Z`:`${e}T00:00:00Z`:e}function Bh(e,t){return t||!e||e.length<=Mh?{text_body:e}:{text_body:e.slice(0,Mh),text_body_truncated:!0}}function qh(e,t){const a={id:e.id,...Bh(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,...Bh(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 jh={columnId:a.string().describe("The id of the column to be deleted")},Gh={boardId:a.number().describe("The id of the board to which the new column will be added"),...jh};const Hh={itemId:a.number()};const Wh={};const Yh=Ql`
1226
+ `;var xh;!function(e){e.Item="Item",e.Board="Board"}(xh||(xh={}));const Mh=2e3,Vh={objectIds:a.array(a.string()).min(1).max(25).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."),objectType:a.enum([xh.Item,xh.Board]).describe("Type of object the IDs in objectIds belong to"),limit:a.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:a.number().min(1).optional().default(1).describe("Page number for pagination (default: 1)"),includeReplies:a.boolean().optional().default(!1).describe("Include update replies in the response"),includeAssets:a.boolean().optional().default(!1).describe("Include file attachments in the response"),includeFullText:a.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:a.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:a.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:a.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 Fh(e,t=!1){return/^\d{4}-\d{2}-\d{2}$/.test(e)?t?`${e}T23:59:59Z`:`${e}T00:00:00Z`:e}function Bh(e,t){return t||!e||e.length<=Mh?{text_body:e}:{text_body:e.slice(0,Mh),text_body_truncated:!0}}function qh(e,t){const a={id:e.id,...Bh(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,...Bh(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 jh={columnId:a.string().describe("The id of the column to be deleted")},Gh={boardId:a.number().describe("The id of the board to which the new column will be added"),...jh};const Hh={itemId:a.number()};const Wh={};const Yh=Ql`
1263
1227
  query getBoardData($boardId: ID!, $itemsLimit: Int!, $queryParams: ItemsQuery) {
1264
1228
  boards(ids: [$boardId], limit: 1) {
1265
1229
  id
@@ -1312,7 +1276,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1312
1276
  }
1313
1277
  }
1314
1278
  }
1315
- `,Qh=a.array(a.object({columnId:a.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:a.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:a.union([a.string(),a.number(),a.boolean(),a.array(a.union([a.string(),a.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:a.nativeEnum(is).optional().default(is.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 "${im.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules).`),zh=a.nativeEnum(ns).optional().default(ns.And).describe("The operator to use for the filters"),Jh={boardId:a.string().describe("The ID of the board to fetch complete data for"),filters:Qh,filtersOperator:zh};const Xh=Ql`
1279
+ `,Qh=a.array(a.object({columnId:a.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:a.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:a.union([a.string(),a.number(),a.boolean(),a.array(a.union([a.string(),a.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:a.nativeEnum(is).optional().default(is.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 "${om.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules).`),zh=a.nativeEnum(ns).optional().default(ns.And).describe("The operator to use for the filters"),Jh={boardId:a.string().describe("The ID of the board to fetch complete data for"),filters:Qh,filtersOperator:zh};const Xh=Ql`
1316
1280
  query GetBoardActivity(
1317
1281
  $boardId: ID!
1318
1282
  $itemIds: [ID!]
@@ -1576,7 +1540,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
1576
1540
  query GetColumnTypeSchema($type: ColumnType!) {
1577
1541
  get_column_type_schema(type: $type)
1578
1542
  }
1579
- `,g_="https://developer.monday.com/api-reference",b_={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 y_(e){const t=b_[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 v_={columnType:a.nativeEnum(ih).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")'),fetchMode:a.nativeEnum(im).optional().default(im.Schema).describe(`fetchMode "${im.Schema}": JSON settings schema only (GraphQL). fetchMode "${im.Guidelines}": guidelines.filter and guidelines.aggregation only — no GraphQL round-trip.`)};const I_={random_string:a.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:a.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const E_={typeName:a.string().describe("The name of the GraphQL type to get details for")};const T_=Ql`
1543
+ `,g_="https://developer.monday.com/api-reference",b_={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 y_(e){const t=b_[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 v_={columnType:a.nativeEnum(oh).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")'),fetchMode:a.nativeEnum(om).optional().default(om.Schema).describe(`fetchMode "${om.Schema}": JSON settings schema only (GraphQL). fetchMode "${om.Guidelines}": guidelines.filter and guidelines.aggregation only — no GraphQL round-trip.`)};const I_={random_string:a.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:a.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const E_={typeName:a.string().describe("The name of the GraphQL type to get details for")};const T_=Ql`
1580
1544
  fragment UserDetails on User {
1581
1545
  # Basic User Information
1582
1546
  id
@@ -2145,7 +2109,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
2145
2109
  }
2146
2110
  }
2147
2111
  }
2148
- `,Ag=new Set([Ii.Case,Ii.Between,Ii.Left,Ii.Raw,Ii.None,Ii.CountKeys]),Sg=Object.values(Ii).filter((e=>!Ag.has(e))),Ng=new Set([Ii.Left,Ii.Trim,Ii.Upper,Ii.Lower,Ii.DateTruncDay,Ii.DateTruncWeek,Ii.DateTruncMonth,Ii.DateTruncQuarter,Ii.DateTruncYear,Ii.Color,Ii.Label,Ii.EndDate,Ii.StartDate,Ii.Hour,Ii.PhoneCountryShortName,Ii.Person,Ii.Upper,Ii.Lower,Ii.Order,Ii.Length,Ii.Flatten,Ii.IsDone]);function Dg(e){return{column_id:e}}new Set([Ii.Count,Ii.CountDistinct,Ii.CountSubitems,Ii.CountItems,Ii.First,Ii.Sum,Ii.Average,Ii.Median,Ii.Min,Ii.Max,Ii.MinMax]);const Og={boardId:a.number().describe("The id of the board to get insights for"),aggregations:a.array(a.object({function:a.enum(Sg).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:a.string().describe(`The id of the column to aggregate. Required for every function except ${Ii.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 "${im.Guidelines}" for a relevant column type on this board. Transformative functions and plain columns (no function) must be in group by.`).optional(),groupBy:a.array(a.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:a.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:Qh,filtersOperator:zh,orderBy:a.array(a.object({columnId:a.string().describe("The id of the column to order by"),direction:a.nativeEnum(as).optional().default(as.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 Rg=Ql`
2112
+ `,Ag=new Set([Ii.Case,Ii.Between,Ii.Left,Ii.Raw,Ii.None,Ii.CountKeys]),Sg=Object.values(Ii).filter((e=>!Ag.has(e))),Ng=new Set([Ii.Left,Ii.Trim,Ii.Upper,Ii.Lower,Ii.DateTruncDay,Ii.DateTruncWeek,Ii.DateTruncMonth,Ii.DateTruncQuarter,Ii.DateTruncYear,Ii.Color,Ii.Label,Ii.EndDate,Ii.StartDate,Ii.Hour,Ii.PhoneCountryShortName,Ii.Person,Ii.Upper,Ii.Lower,Ii.Order,Ii.Length,Ii.Flatten,Ii.IsDone]);function Dg(e){return{column_id:e}}new Set([Ii.Count,Ii.CountDistinct,Ii.CountSubitems,Ii.CountItems,Ii.First,Ii.Sum,Ii.Average,Ii.Median,Ii.Min,Ii.Max,Ii.MinMax]);const Og={boardId:a.number().describe("The id of the board to get insights for"),aggregations:a.array(a.object({function:a.enum(Sg).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:a.string().describe(`The id of the column to aggregate. Required for every function except ${Ii.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 "${om.Guidelines}" for a relevant column type on this board. Transformative functions and plain columns (no function) must be in group by.`).optional(),groupBy:a.array(a.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:a.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:Qh,filtersOperator:zh,orderBy:a.array(a.object({columnId:a.string().describe("The id of the column to order by"),direction:a.nativeEnum(as).optional().default(as.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 Rg=Ql`
2149
2113
  query GetFolders($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
2150
2114
  folders(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
2151
2115
  id
@@ -2964,7 +2928,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
2964
2928
  }
2965
2929
  }
2966
2930
  }
2967
- `,BA={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"},qA={...BA,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},jA="BOARD_NOT_FOUND:",GA="SPRINT_NOT_FOUND:",HA="DOCUMENT_NOT_FOUND:",WA="DOCUMENT_INVALID:",YA="DOCUMENT_EMPTY:",KA="EXPORT_FAILED:",QA="INTERNAL_ERROR:",zA="VALIDATION_ERROR:",JA="task_sprint",XA={[qA.SPRINT_TASKS]:"Sprint Tasks",[qA.SPRINT_TIMELINE]:"Sprint Timeline",[qA.SPRINT_COMPLETION]:"Sprint Completion",[qA.SPRINT_START_DATE]:"Sprint Start Date",[qA.SPRINT_END_DATE]:"Sprint End Date",[qA.SPRINT_ACTIVATION]:"Sprint Activation",[qA.SPRINT_SUMMARY]:"Sprint Summary",[qA.SPRINT_CAPACITY]:"Sprint Capacity"},ZA=ud,eS={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},tS=(e,t)=>e.column_values?.find((e=>e.id===t)),aS=(e,t)=>{const a=tS(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},nS=(e,t)=>{const a=tS(e,t);return"DateValue"===a?.__typename?a.date??null:null},iS=(e,t)=>{const a=tS(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},oS=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},rS=(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)))},sS=e=>rS(e,Object.values(BA)),dS=e=>rS(e,Object.values(eS)),pS=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},lS=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===ih.BoardRelation))||null,cS={sprintId:a.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const mS=Ql`
2931
+ `,BA={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"},qA={...BA,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},jA="BOARD_NOT_FOUND:",GA="SPRINT_NOT_FOUND:",HA="DOCUMENT_NOT_FOUND:",WA="DOCUMENT_INVALID:",YA="DOCUMENT_EMPTY:",KA="EXPORT_FAILED:",QA="INTERNAL_ERROR:",zA="VALIDATION_ERROR:",JA="task_sprint",XA={[qA.SPRINT_TASKS]:"Sprint Tasks",[qA.SPRINT_TIMELINE]:"Sprint Timeline",[qA.SPRINT_COMPLETION]:"Sprint Completion",[qA.SPRINT_START_DATE]:"Sprint Start Date",[qA.SPRINT_END_DATE]:"Sprint End Date",[qA.SPRINT_ACTIVATION]:"Sprint Activation",[qA.SPRINT_SUMMARY]:"Sprint Summary",[qA.SPRINT_CAPACITY]:"Sprint Capacity"},ZA=ud,eS={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},tS=(e,t)=>e.column_values?.find((e=>e.id===t)),aS=(e,t)=>{const a=tS(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},nS=(e,t)=>{const a=tS(e,t);return"DateValue"===a?.__typename?a.date??null:null},iS=(e,t)=>{const a=tS(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},oS=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},rS=(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)))},sS=e=>rS(e,Object.values(BA)),dS=e=>rS(e,Object.values(eS)),pS=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},lS=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===oh.BoardRelation))||null,cS={sprintId:a.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const mS=Ql`
2968
2932
  query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
2969
2933
  boards(ids: [$boardId], limit: 1) {
2970
2934
  items_page(limit: $limit) {
@@ -3016,7 +2980,7 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
3016
2980
  }
3017
2981
  }
3018
2982
  }
3019
- `,_S={};const fS=[class extends ee{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=_.READ,this.annotations=Z({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 _S}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(hS,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${jA} 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:`${QA} 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 n=lS(e,BA.SPRINT_TASKS);if(!n)return;const i=pS(n);if(!i)return;const o=`${e.id}:${i}`;if(a.has(o))return;const r=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(i,r,`Tasks Board ${i}`)})}processTasksBoard(e,t,a){const n=lS(e,JA);if(!n)return;const i=pS(n);if(!i)return;const o=`${i}:${e.id}`;if(a.has(o))return;const r=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(i,r,`Sprints Board ${i}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const n of e)n.columns&&(sS(n)&&this.processSprintsBoard(n,a,t),dS(n)&&this.processTasksBoard(n,a,t));return Array.from(t.values())}},class extends ee{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=_.READ,this.annotations=Z({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 uS}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},n=await this.mondayApi.request(mS,a),i=n.boards?.[0],o=i?.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:`${QA} 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(ac,t),n=a.boards?.[0];if(!n)return{success:!1,error:`${jA} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const i=n.columns||[],o=this.validateSprintsBoardSchemaFromColumns(i);return o.isValid?{success:!0}:{success:!1,error:`${zA} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${QA} 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(BA),n=oS(t,a);if(!n.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return n.missingColumns.forEach((t=>{const a=(e=>XA[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=aS(e,qA.SPRINT_ACTIVATION),a=aS(e,qA.SPRINT_COMPLETION),n=nS(e,qA.SPRINT_START_DATE),i=nS(e,qA.SPRINT_END_DATE),o=((e,t)=>{const a=tS(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,qA.SPRINT_TIMELINE),r=iS(e,qA.SPRINT_SUMMARY);let s=ZA.Planned;return a?s=ZA.Completed:(t||n)&&(s=ZA.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:n||null,end_date:i||null,is_completed:a,document_object_id:r||null}}))}},class extends ee{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=_.READ,this.annotations=Z({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 cS}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${QA} 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||`${QA} Unknown error occurred while reading document content`}}catch(e){return{content:`${QA} 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(FA,t)).items||[];if(0===a.length)return{success:!1,error:`${GA} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const n=a[0];if(!n)return{success:!1,error:`${GA} Sprint with ID ${e} not found.`};const i=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),n=[...Object.values(BA),...t];return oS(a,n)})(n,[qA.SPRINT_SUMMARY]);if(!i.isValid)return{success:!1,error:`${zA} Sprint item is missing required columns: ${i.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=iS(n,qA.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:n.name}:{success:!1,error:`${HA} No sprint summary document found for sprint "${n.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${QA} 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(zl,t)).docs||[];if(0===a.length)return{success:!1,error:`${HA} Document with object ID ${e} not found or not accessible.`};const n=a[0];if(!n||!n.id)return{success:!1,error:`${WA} Document data is invalid for object ID ${e}.`};const i={docId:n.id,blockIds:[]},o=await this.mondayApi.request(hc,i);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${KA} 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:`${YA} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${QA} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],gS=[class extends ee{constructor(){super(...arguments),this.name="delete_item",this.type=_.WRITE,this.annotations=Z({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Hh}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(ec,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends ee{constructor(){super(...arguments),this.name="get_board_items_page",this.type=_.READ,this.annotations=Z({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 h_}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){Ac(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 n=await this.mondayApi.request(s_,a);return{content:this.mapResult(n,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:is.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],n=a?.items_page,i=n?.items||[];return{board:{id:a?.id,name:a?.name,hierarchy_type:a?.hierarchy_type||null},items:i.map((e=>this.mapItem(e,t))),pagination:{has_more:!!n?.cursor,nextCursor:n?.cursor||null,count:i.length}}}mapItem(e,t){const a=e.parent_item?.id||null,n={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){n.column_values={};for(const t of e.column_values)n.column_values[t.id]=this.getColumnValueData(t)}if(t.includeGroup&&"group"in e&&e.group&&(n.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})));n.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(n.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),n}getColumnValueData(e){switch(e.type){case ih.BoardRelation:return e.linked_items;case ih.Formula:return e.display_value;case ih.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(d_,t,{versionOverride:"dev",timeout:Uc})).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 n=e.itemIds??[];if(0===n.length)return a;const i=new Set(n);return a.filter((e=>i.has(e)))}},yh,class extends ee{constructor(){super(...arguments),this.name="create_items",this.type=_.WRITE,this.annotations=Z({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. [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?vh:Ih}async executeInternal(e){const t=e.items.flatMap(((e,t)=>void 0===e.name?[Eh(new Tc("Item name is required",Ec),t)]:[]));if(t.length)throw new Tc(`${t.length} of ${e.items.length} items are missing the required name field`,Ec,t);const a=this.context?.boardId??e.boardId;this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.items.length;const n=new yh(this.mondayApi,{boardId:a}),i="Skipped: a previous item hit the minute rate limit; this item was not attempted",o=e.items.map(((e,t)=>async()=>{const a=await n.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 Pc(o,{limit:15,onSkipped:e=>({index:e,error:i,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:i,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:Eh(e,t)})}),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}}},Oh,class extends ee{constructor(){super(...arguments),this.name="create_updates",this.type=_.WRITE,this.annotations=Z({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 Rh}async executeInternal(e){this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const t="Skipped: a previous update hit the minute rate limit, this update was not attempted",a=new Oh(this.mondayApi),n=e.updates.map(((e,t)=>async()=>{const n=await a.execute(e);return{index:t,...n.content}})),i=await Pc(n,{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:Ch(e,t)})}),o=i.filter((e=>"error"in e)).map((e=>e._errorEntry)),r=i.map((({_errorEntry:e,...t})=>t)),s=i.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}}},class extends ee{constructor(){super(...arguments),this.name="delete_update",this.type=_.WRITE,this.annotations=Z({title:"Delete Update",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an update (comment/post) from a monday.com item."}getInputSchema(){return Lh}async executeInternal(e){try{const t={id:e.id.toString()},a=await this.mondayApi.request(kh,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){wc(e,"delete update")}}},class extends ee{constructor(){super(...arguments),this.name="get_updates",this.type=_.READ,this.annotations=Z({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. To read several items, pass up to 25 item IDs in objectIds in one call instead of calling once per item. For Board queries, you can filter by date range using fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion. Set includeItemUpdates to true to also include updates on individual items, 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 for that item only with includeFullText), creator info, timestamps, and optionally replies and assets."}getInputSchema(){return Vh}async executeInternal(e){try{const t=void 0!==e.fromDate,a=void 0!==e.toDate;if(t!==a)throw new Error("Both fromDate and toDate must be provided together for date range filtering");if((t||a)&&e.objectType===xh.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");if(void 0===e.objectId==(void 0===e.objectIds))throw new Error("Provide exactly one of objectId or objectIds");if(e.objectIds&&e.objectType!==xh.Item)throw new Error("objectIds is only supported for Item objectType");const n=e.limit??(e.objectIds?10:25),i={limit:n,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};if(e.objectIds){const t=((await this.mondayApi.request(Ph,{...i,itemIds:e.objectIds,itemsLimit:e.objectIds.length})).items??[]).filter((e=>!!e)),a=new Set(t.map((e=>e.id))),o=e.objectIds.filter((e=>!a.has(e)));return{content:{message:"Updates retrieved",items:t.map((t=>{const a=(t.updates??[]).map((t=>qh(t,e)));return{item_id:t.id,url:t.url,updates:a,count:a.length}})),...o.length>0&&{not_found:o},pagination:{page:e.page??1,limit:n}}}}let o;o=e.objectType===xh.Item?await this.mondayApi.request(Uh,{...i,itemId:e.objectId}):await this.mondayApi.request($h,{...i,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:Fh(e.fromDate),toDate:Fh(e.toDate,!0)}:{}});const r=e.objectType===xh.Item?o.items?.[0]?.updates:o.boards?.[0]?.updates;if(!r||0===r.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const s=r.map((t=>qh(t,e))),d=e.objectType===xh.Item?o.items?.[0]?.url:o.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:d,updates:s,pagination:{page:e.page??1,limit:n,count:s.length}}}}catch(e){wc(e,"get updates")}}},class extends ee{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=_.WRITE,this.annotations=Z({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 zg}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),n=Qg.safeParse(a);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);t=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},n=await this.mondayApi.request(wh,a);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${n.create_update.id} successfully created on item ${e.itemId}`,update_id:n.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){wc(e,"create update")}}},class extends ee{constructor(){super(...arguments),this.name="get_board_schema",this.type=_.READ,this.annotations=Z({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 __}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},n=await this.mondayApi.request(ac,a);return{content:{message:"Board schema retrieved",board_id:t,columns:n.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type,revision:e?.revision})))??[],groups:n.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends ee{constructor(){super(...arguments),this.name="get_board_activity",this.type=_.READ,this.annotations=Z({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days). 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 Zh}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-Lc.MONTH30Days),n=e?.fromDate||a.toISOString(),i=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),itemIds:e.itemIds?.map(String),userIds:e.userIds?.map(String),fromDate:n,toDate:i,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},r=await this.mondayApi.request(Xh,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${n} to ${i}).`};const d=r.boards?.[0],p=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:d?.name,board_url:d?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...p&&e.data?{data:e.data}:{}})))}}}},class extends ee{constructor(e,t,a){super(e,a),this.name="get_board_info",this.type=_.READ,this.annotations=Z({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 r_}async executeInternal(e){const{columnIds:t,viewIds:a,includeColumns:n,includeViews:i,unmatchedViewNames:o,availableViewNames:r}=await this.resolveFiltersAsync(e);if(e.filters?.views?.names?.length&&i&&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:n?t:void 0,viewIds:i?a:void 0,includeColumns:n,includeViews:i,includeSubscribers:!0===e.includeSubscribers},d=this.mondayApi.request(e_,s),p=!0===e.includeKnowledge,l=p&&this.isKnowledgeEnabled()?this.mondayApi.request(n_,{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=n?await this.getSubItemsBoardAsync(u):null;return{content:i_(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,n=Boolean(t?.only),i=Boolean(a?.only),o=void 0!==a?.ids,r=Boolean(a?.names?.length),s=!i||n,d=!n||i,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(t_,{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=o_(t.name),n=a.get(e)??[];n.push(t.id),a.set(e,n)}const n=[],i=[];for(const e of t){const t=a.get(o_(e));t?.length?n.push(...t):i.push(e)}return{viewIds:n,unmatchedViewNames:i}})(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===ih.Subtasks));if(!t)return null;const a=t.settings.boardIds[0];if(a===e.id)return null;const n=await this.mondayApi.request(a_,{boardId:a});return n.boards?.[0]??null}},class extends ee{constructor(){super(...arguments),this.name="get_full_board_data",this.type=_.READ,this.annotations=Z({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 Jh}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(Yh,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const n=a.boards[0],i=new Set;n.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&i.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&i.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&i.add(e.id)}))}}))}));const o=Array.from(i).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(Kh,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e])));return{content:{board:{id:n.id,name:n.name,columns:n.columns,items:n.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&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:n.items_page.items.length,total_updates:n.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){wc(e,"get full board data")}}},class extends ee{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=_.READ,this.annotations=Z({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 Y_}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,n=e.includeTeams||!1,i=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||n||i||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(x_);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=F_(s),p=await H_(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||n||i||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request($_,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 H_(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(i&&n)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>B_)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>q_)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(i||!t&&a&&!n)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(P_,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(U_,t)}else if(n){const t={userIds:e.userIds,teamIds:e.teamIds,limit:j_};s=await this.mondayApi.request(L_,t)}else if(t){const t={userIds:e.userIds,limit:j_};s=await this.mondayApi.request(C_,t)}else{const e={userIds:void 0,limit:j_};s=await this.mondayApi.request(k_,e)}const d=F_(s),p=await H_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},Fc,class extends ee{constructor(){super(...arguments),this.name="update_items",this.type=_.WRITE,this.annotations=Z({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. To link board-relation columns, call link_board_items_workflow before using this tool. [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?qc:jc}async executeInternal(e){const t=e.updates.flatMap(((e,t)=>void 0===e.itemId?[Gc(new Tc("Item id is required",Ec),t)]:[]));if(t.length)throw new Tc(`${t.length} of ${e.updates.length} updates are missing the required itemId field`,Ec,t);this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const a=this.context?.boardId??e.boardId,n=e.updates.map((e=>e.boardId??a)),i=n.map(((e,t)=>null==e?t:-1)).filter((e=>e>=0));if(i.length>0)throw new Tc(`Missing boardId for update(s) at index ${i.join(", ")}. Set a boardId on each update or provide a batch-level boardId.`,Ec);const o="Skipped: a previous update hit the minute rate limit, this update was not attempted",r=new Fc(this.mondayApi),s=e.updates.map(((e,t)=>async()=>{const a=n[t],i=await r.execute({boardId:a,itemId:e.itemId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,board_id:a,...i.content}})),d=await Pc(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:Gc(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}}},class extends ee{constructor(){super(...arguments),this.name="move_item_to_group",this.type=_.WRITE,this.annotations=Z({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 K_}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId};let a;try{a=await this.mondayApi.request(ic,t)}catch(e){wc(e,"move item to group")}return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends ee{constructor(){super(...arguments),this.name="create_board",this.type=_.WRITE,this.annotations=Z({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return um}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(oc,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 ee{constructor(){super(...arguments),this.name="use_template",this.type=_.WRITE,this.annotations=Z({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 hm}async executeInternal(e){const t={templateId:e.templateId,destinationWorkspaceId:e.destinationWorkspaceId,destinationName:e.destinationName,boardKind:e.boardKind},a=await this.mondayApi.request(fc,t),n=a.use_template?.process_id;return null==n?{content:{processId:null,message:"Failed to start template application. The request was rejected."}}:{content:{processId:n,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 ee{constructor(){super(...arguments),this.name="check_template_status",this.type=_.READ,this.annotations=Z({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 _m}async executeInternal(e){const t={processId:e.processId},a=(await this.mondayApi.request(gc,t)).template_installation_status;return a?a.status===Sd.Complete?{content:{status:Sd.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===Sd.Failed?{content:{status:Sd.Failed,board_ids:[],board_ids_map:[],message:"Template application failed. Please try again."}}:a.status===Sd.Pending||a.status===Sd.InProgress?{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Template application ${a.status===Sd.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 ee{constructor(){super(...arguments),this.name="create_form",this.type=_.WRITE,this.annotations=Z({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 nu}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($m,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends ee{constructor(){super(...arguments),this.name="update_form",this.type=_.WRITE,this.annotations=Z({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Yu((()=>this.mondayApi)),this.actionHandlers=new Map([[Tu.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Tu.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Tu.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Tu.activate,this.helpers.activateForm.bind(this.helpers)],[Tu.createTag,this.helpers.createTag.bind(this.helpers)],[Tu.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Tu.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Tu.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Tu.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Tu.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Tu.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 Wu}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 ee{constructor(){super(...arguments),this.name="get_form",this.type=_.READ,this.annotations=Z({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 Ku}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(xm,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 ee{constructor(){super(...arguments),this.name="form_questions_editor",this.type=_.WRITE,this.annotations=Z({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Eu((()=>this.mondayApi)),this.actionHandlers=new Map([[yu.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[yu.Update,this.helpers.updateQuestion.bind(this.helpers)],[yu.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 Iu}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends ee{constructor(){super(...arguments),this.name="create_form_submission",this.type=_.WRITE,this.annotations=Z({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 nh}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(t){if(t.includes("wkf.ms")){const a=(await e.head(t,{maxRedirects:0,validateStatus:e=>e<400})).headers.location;return a?this.extractTokenFromUrl(a):null}return t.startsWith("http://")||t.startsWith("https://")?this.extractTokenFromUrl(t):t}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(Qu,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){wc(e,"submit form")}}},class extends ee{constructor(){super(...arguments),this.name="create_column",this.type=_.WRITE,this.annotations=Z({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 "${im.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?oh:rh}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},n=await this.mondayApi.request(rc,a);return{content:{message:"Column successfully created",column_id:n.create_column?.id,column_title:n.create_column?.title}}}},class extends ee{constructor(){super(...arguments),this.name="update_column",this.type=_.WRITE,this.annotations=Z({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 "${im.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.`}getInputSchema(){return this.context?.boardId?sh:dh}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},n=await this.mondayApi.request(dc,a);return{content:{message:"Column successfully updated. Use the new revision below for any subsequent update to this column.",column_id:n.update_column?.id,column_title:n.update_column?.title,revision:n.update_column?.revision}}}},class extends ee{constructor(){super(...arguments),this.name="create_group",this.type=_.WRITE,this.annotations=Z({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 hh}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(mh,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 ee{constructor(){super(...arguments),this.name="delete_column",this.type=_.WRITE,this.annotations=Z({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?jh:Gh}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(sc,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Oc,class extends Oc{constructor(e,t){super(e,t),this.name="all_api_read",this.type=_.READ,this.annotations=Z({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=ze(e.query);this.recordGraphqlOperationCounts(t);const a=ii(t);if(a?.operation===fe.MUTATION)throw new Tc("all_api_read only accepts read queries. Mutations are not allowed.",vc);return super.executeInternal(e)}},class extends Oc{constructor(e,t){super(e,t),this.name="all_api_write",this.type=_.WRITE,this.annotations=Z({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=ze(e.query);this.recordGraphqlOperationCounts(t);const a=ii(t);if(a&&a.operation!==fe.MUTATION)throw new Tc("all_api_write only accepts mutations. Read queries are not allowed.",vc);return super.executeInternal(e)}},class extends ee{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=_.ALL_API,this.annotations=Z({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 I_}async executeInternal(e){try{const t=await this.mondayApi.request(pc),a=e?.operationType,n=t.__schema,i="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=n?.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!==i&&{query_fields:i},...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 ee{constructor(){super(...arguments),this.name="get_column_type_info",this.type=_.READ,this.annotations=Z({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Retrieves comprehensive information about a specific column type. Use fetchMode "${im.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 "${im.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 v_}async executeInternal(e){if(e.fetchMode===im.Guidelines)return{content:{message:`Column type guidelines for ${e.columnType}`,data:{guidelines:{filter:y_(e.columnType),aggregation:`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${Ii.CountItems} function. Do not use ${Ii.Count} function for that purpose.\n `}},url:g_}};const t={type:e.columnType},a=await this.mondayApi.request(f_,t);return a?.get_column_type_schema?{content:{message:`Column type schema for ${e.columnType}`,data:{schema:a.get_column_type_schema},url:g_}}:{content:`Information for column type "${e.columnType}" not found or not available.`}}},class extends ee{constructor(e,t){super("function"==typeof e?()=>Nc(e()):Nc(e),t),this.name="get_type_details",this.type=_.ALL_API,this.annotations=Z({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 E_}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,Ql`
2983
+ `,_S={};const fS=[class extends ee{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=_.READ,this.annotations=Z({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 _S}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(hS,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${jA} 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:`${QA} 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 n=lS(e,BA.SPRINT_TASKS);if(!n)return;const i=pS(n);if(!i)return;const o=`${e.id}:${i}`;if(a.has(o))return;const r=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(i,r,`Tasks Board ${i}`)})}processTasksBoard(e,t,a){const n=lS(e,JA);if(!n)return;const i=pS(n);if(!i)return;const o=`${i}:${e.id}`;if(a.has(o))return;const r=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(i,r,`Sprints Board ${i}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const n of e)n.columns&&(sS(n)&&this.processSprintsBoard(n,a,t),dS(n)&&this.processTasksBoard(n,a,t));return Array.from(t.values())}},class extends ee{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=_.READ,this.annotations=Z({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 uS}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},n=await this.mondayApi.request(mS,a),i=n.boards?.[0],o=i?.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:`${QA} 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(ac,t),n=a.boards?.[0];if(!n)return{success:!1,error:`${jA} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const i=n.columns||[],o=this.validateSprintsBoardSchemaFromColumns(i);return o.isValid?{success:!0}:{success:!1,error:`${zA} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${QA} 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(BA),n=oS(t,a);if(!n.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return n.missingColumns.forEach((t=>{const a=(e=>XA[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=aS(e,qA.SPRINT_ACTIVATION),a=aS(e,qA.SPRINT_COMPLETION),n=nS(e,qA.SPRINT_START_DATE),i=nS(e,qA.SPRINT_END_DATE),o=((e,t)=>{const a=tS(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,qA.SPRINT_TIMELINE),r=iS(e,qA.SPRINT_SUMMARY);let s=ZA.Planned;return a?s=ZA.Completed:(t||n)&&(s=ZA.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:n||null,end_date:i||null,is_completed:a,document_object_id:r||null}}))}},class extends ee{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=_.READ,this.annotations=Z({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 cS}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${QA} 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||`${QA} Unknown error occurred while reading document content`}}catch(e){return{content:`${QA} 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(FA,t)).items||[];if(0===a.length)return{success:!1,error:`${GA} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const n=a[0];if(!n)return{success:!1,error:`${GA} Sprint with ID ${e} not found.`};const i=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),n=[...Object.values(BA),...t];return oS(a,n)})(n,[qA.SPRINT_SUMMARY]);if(!i.isValid)return{success:!1,error:`${zA} Sprint item is missing required columns: ${i.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=iS(n,qA.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:n.name}:{success:!1,error:`${HA} No sprint summary document found for sprint "${n.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${QA} 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(zl,t)).docs||[];if(0===a.length)return{success:!1,error:`${HA} Document with object ID ${e} not found or not accessible.`};const n=a[0];if(!n||!n.id)return{success:!1,error:`${WA} Document data is invalid for object ID ${e}.`};const i={docId:n.id,blockIds:[]},o=await this.mondayApi.request(hc,i);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${KA} 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:`${YA} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${QA} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],gS=[class extends ee{constructor(){super(...arguments),this.name="delete_item",this.type=_.WRITE,this.annotations=Z({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Hh}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(ec,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends ee{constructor(){super(...arguments),this.name="get_board_items_page",this.type=_.READ,this.annotations=Z({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 h_}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){Sc(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 n=await this.mondayApi.request(s_,a);return{content:this.mapResult(n,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:is.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],n=a?.items_page,i=n?.items||[];return{board:{id:a?.id,name:a?.name,hierarchy_type:a?.hierarchy_type||null},items:i.map((e=>this.mapItem(e,t))),pagination:{has_more:!!n?.cursor,nextCursor:n?.cursor||null,count:i.length}}}mapItem(e,t){const a=e.parent_item?.id||null,n={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){n.column_values={};for(const t of e.column_values)n.column_values[t.id]=this.getColumnValueData(t)}if(t.includeGroup&&"group"in e&&e.group&&(n.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})));n.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(n.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),n}getColumnValueData(e){switch(e.type){case oh.BoardRelation:return e.linked_items;case oh.Formula:return e.display_value;case oh.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(d_,t,{versionOverride:"dev",timeout:Pc})).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 n=e.itemIds??[];if(0===n.length)return a;const i=new Set(n);return a.filter((e=>i.has(e)))}},vh,class extends ee{constructor(){super(...arguments),this.name="create_items",this.type=_.WRITE,this.annotations=Z({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. [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?Ih:Eh}async executeInternal(e){const t=e.items.flatMap(((e,t)=>void 0===e.name?[Th(new wc("Item name is required",Tc),t)]:[]));if(t.length)throw new wc(`${t.length} of ${e.items.length} items are missing the required name field`,Tc,t);const a=this.context?.boardId??e.boardId;this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.items.length;const n=new vh(this.mondayApi,{boardId:a}),i="Skipped: a previous item hit the minute rate limit; this item was not attempted",o=e.items.map(((e,t)=>async()=>{const a=await n.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 $c(o,{limit:15,onSkipped:e=>({index:e,error:i,_errorEntry:{code:"RATE_LIMIT_SKIPPED",message:i,path:["results",e]}}),onError:(e,t)=>({index:t,error:e instanceof Error?e.message:String(e),_errorEntry:Th(e,t)})}),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}}},Rh,class extends ee{constructor(){super(...arguments),this.name="create_updates",this.type=_.WRITE,this.annotations=Z({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 Ch}async executeInternal(e){this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const t="Skipped: a previous update hit the minute rate limit, this update was not attempted",a=new Rh(this.mondayApi),n=e.updates.map(((e,t)=>async()=>{const n=await a.execute(e);return{index:t,...n.content}})),i=await $c(n,{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:kh(e,t)})}),o=i.filter((e=>"error"in e)).map((e=>e._errorEntry)),r=i.map((({_errorEntry:e,...t})=>t)),s=i.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}}},class extends ee{constructor(){super(...arguments),this.name="delete_update",this.type=_.WRITE,this.annotations=Z({title:"Delete Update",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an update (comment/post) from a monday.com item."}getInputSchema(){return Uh}async executeInternal(e){try{const t={id:e.id.toString()},a=await this.mondayApi.request(Lh,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){Ac(e,"delete update")}}},class extends ee{constructor(){super(...arguments),this.name="get_updates",this.type=_.READ,this.annotations=Z({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 Vh}async executeInternal(e){try{const t=void 0!==e.fromDate;if(t!==(void 0!==e.toDate))throw new wc("Both fromDate and toDate must be provided together for date range filtering",bc);if(e.objectType===xh.Board&&1!==e.objectIds.length)throw new wc("Board queries take exactly one board ID in objectIds",bc);const a=e.fromDate?Fh(e.fromDate):void 0,n=e.toDate?Fh(e.toDate,!0):void 0,i={page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};if(e.objectType===xh.Item){const t=e.limit??(e.objectIds.length>1?10:25),o=((await this.mondayApi.request(Ph,{...i,limit:t,itemIds:e.objectIds,itemsLimit:e.objectIds.length})).items??[]).filter((e=>!!e)),r=new Set(o.map((e=>e.id))),s=e.objectIds.filter((e=>!r.has(e)));return{content:{message:"Updates retrieved",items:o.map((t=>{const i=(t.updates??[]).filter((e=>function(e,t,a){if(!t||!a)return!0;const n=e?Date.parse(e):NaN;return!Number.isNaN(n)&&n>=Date.parse(t)&&n<=Date.parse(a)}(e.created_at,a,n))).map((t=>qh(t,e)));return{item_id:t.id,url:t.url,updates:i,count:i.length}})),...s.length>0&&{not_found:s},pagination:{page:e.page??1,limit:t}}}}const[o]=e.objectIds,r=e.limit??25,s=await this.mondayApi.request($h,{...i,limit:r,boardId:o,boardUpdatesOnly:!e.includeItemUpdates,...a&&n?{fromDate:a,toDate:n}:{}}),d=s.boards?.[0],p=d?.updates;if(!p||0===p.length)return{content:`No updates found for board with id ${o}`};const l=p.map((t=>qh(t,e)));return{content:{message:"Updates retrieved",board_id:o,url:d?.url,updates:l,pagination:{page:e.page??1,limit:r,count:l.length}}}}catch(e){Ac(e,"get updates")}}},class extends ee{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=_.WRITE,this.annotations=Z({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 zg}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),n=Qg.safeParse(a);if(!n.success)throw new Error(`Invalid mentionsList format: ${n.error.message}`);t=n.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},n=await this.mondayApi.request(Ah,a);if(!n.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${n.create_update.id} successfully created on item ${e.itemId}`,update_id:n.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){Ac(e,"create update")}}},class extends ee{constructor(){super(...arguments),this.name="get_board_schema",this.type=_.READ,this.annotations=Z({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 __}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},n=await this.mondayApi.request(ac,a);return{content:{message:"Board schema retrieved",board_id:t,columns:n.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type,revision:e?.revision})))??[],groups:n.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends ee{constructor(){super(...arguments),this.name="get_board_activity",this.type=_.READ,this.annotations=Z({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days). 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 Zh}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-Uc.MONTH30Days),n=e?.fromDate||a.toISOString(),i=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),itemIds:e.itemIds?.map(String),userIds:e.userIds?.map(String),fromDate:n,toDate:i,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},r=await this.mondayApi.request(Xh,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${n} to ${i}).`};const d=r.boards?.[0],p=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:d?.name,board_url:d?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...p&&e.data?{data:e.data}:{}})))}}}},class extends ee{constructor(e,t,a){super(e,a),this.name="get_board_info",this.type=_.READ,this.annotations=Z({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 r_}async executeInternal(e){const{columnIds:t,viewIds:a,includeColumns:n,includeViews:i,unmatchedViewNames:o,availableViewNames:r}=await this.resolveFiltersAsync(e);if(e.filters?.views?.names?.length&&i&&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:n?t:void 0,viewIds:i?a:void 0,includeColumns:n,includeViews:i,includeSubscribers:!0===e.includeSubscribers},d=this.mondayApi.request(e_,s),p=!0===e.includeKnowledge,l=p&&this.isKnowledgeEnabled()?this.mondayApi.request(n_,{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=n?await this.getSubItemsBoardAsync(u):null;return{content:i_(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,n=Boolean(t?.only),i=Boolean(a?.only),o=void 0!==a?.ids,r=Boolean(a?.names?.length),s=!i||n,d=!n||i,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(t_,{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=o_(t.name),n=a.get(e)??[];n.push(t.id),a.set(e,n)}const n=[],i=[];for(const e of t){const t=a.get(o_(e));t?.length?n.push(...t):i.push(e)}return{viewIds:n,unmatchedViewNames:i}})(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===oh.Subtasks));if(!t)return null;const a=t.settings.boardIds[0];if(a===e.id)return null;const n=await this.mondayApi.request(a_,{boardId:a});return n.boards?.[0]??null}},class extends ee{constructor(){super(...arguments),this.name="get_full_board_data",this.type=_.READ,this.annotations=Z({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 Jh}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(Yh,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const n=a.boards[0],i=new Set;n.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&i.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&i.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&i.add(e.id)}))}}))}));const o=Array.from(i).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(Kh,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e])));return{content:{board:{id:n.id,name:n.name,columns:n.columns,items:n.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&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:n.items_page.items.length,total_updates:n.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){Ac(e,"get full board data")}}},class extends ee{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=_.READ,this.annotations=Z({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 Y_}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,n=e.includeTeams||!1,i=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||n||i||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(x_);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=F_(s),p=await H_(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||n||i||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request($_,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 H_(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(i&&n)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>B_)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>q_)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(i||!t&&a&&!n)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(P_,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(U_,t)}else if(n){const t={userIds:e.userIds,teamIds:e.teamIds,limit:j_};s=await this.mondayApi.request(L_,t)}else if(t){const t={userIds:e.userIds,limit:j_};s=await this.mondayApi.request(C_,t)}else{const e={userIds:void 0,limit:j_};s=await this.mondayApi.request(k_,e)}const d=F_(s),p=await H_(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},Bc,class extends ee{constructor(){super(...arguments),this.name="update_items",this.type=_.WRITE,this.annotations=Z({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. To link board-relation columns, call link_board_items_workflow before using this tool. [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?jc:Gc}async executeInternal(e){const t=e.updates.flatMap(((e,t)=>void 0===e.itemId?[Hc(new wc("Item id is required",Tc),t)]:[]));if(t.length)throw new wc(`${t.length} of ${e.updates.length} updates are missing the required itemId field`,Tc,t);this.sessionContext.metadata??={},this.sessionContext.metadata.items_count=e.updates.length;const a=this.context?.boardId??e.boardId,n=e.updates.map((e=>e.boardId??a)),i=n.map(((e,t)=>null==e?t:-1)).filter((e=>e>=0));if(i.length>0)throw new wc(`Missing boardId for update(s) at index ${i.join(", ")}. Set a boardId on each update or provide a batch-level boardId.`,Tc);const o="Skipped: a previous update hit the minute rate limit, this update was not attempted",r=new Bc(this.mondayApi),s=e.updates.map(((e,t)=>async()=>{const a=n[t],i=await r.execute({boardId:a,itemId:e.itemId,columnValues:e.columnValues,createLabelsIfMissing:e.createLabelsIfMissing});return{index:t,board_id:a,...i.content}})),d=await $c(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:Hc(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}}},class extends ee{constructor(){super(...arguments),this.name="move_item_to_group",this.type=_.WRITE,this.annotations=Z({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 K_}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId};let a;try{a=await this.mondayApi.request(ic,t)}catch(e){Ac(e,"move item to group")}return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends ee{constructor(){super(...arguments),this.name="create_board",this.type=_.WRITE,this.annotations=Z({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return hm}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(oc,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 ee{constructor(){super(...arguments),this.name="use_template",this.type=_.WRITE,this.annotations=Z({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 _m}async executeInternal(e){const t={templateId:e.templateId,destinationWorkspaceId:e.destinationWorkspaceId,destinationName:e.destinationName,boardKind:e.boardKind},a=await this.mondayApi.request(fc,t),n=a.use_template?.process_id;return null==n?{content:{processId:null,message:"Failed to start template application. The request was rejected."}}:{content:{processId:n,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 ee{constructor(){super(...arguments),this.name="check_template_status",this.type=_.READ,this.annotations=Z({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 fm}async executeInternal(e){const t={processId:e.processId},a=(await this.mondayApi.request(gc,t)).template_installation_status;return a?a.status===Sd.Complete?{content:{status:Sd.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===Sd.Failed?{content:{status:Sd.Failed,board_ids:[],board_ids_map:[],message:"Template application failed. Please try again."}}:a.status===Sd.Pending||a.status===Sd.InProgress?{content:{status:a.status,board_ids:[],board_ids_map:[],message:`Template application ${a.status===Sd.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 ee{constructor(){super(...arguments),this.name="create_form",this.type=_.WRITE,this.annotations=Z({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 iu}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(xm,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends ee{constructor(){super(...arguments),this.name="update_form",this.type=_.WRITE,this.annotations=Z({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Ku((()=>this.mondayApi)),this.actionHandlers=new Map([[wu.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[wu.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[wu.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[wu.activate,this.helpers.activateForm.bind(this.helpers)],[wu.createTag,this.helpers.createTag.bind(this.helpers)],[wu.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[wu.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[wu.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[wu.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[wu.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[wu.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 Yu}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 ee{constructor(){super(...arguments),this.name="get_form",this.type=_.READ,this.annotations=Z({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 Qu}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Mm,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 ee{constructor(){super(...arguments),this.name="form_questions_editor",this.type=_.WRITE,this.annotations=Z({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Tu((()=>this.mondayApi)),this.actionHandlers=new Map([[vu.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[vu.Update,this.helpers.updateQuestion.bind(this.helpers)],[vu.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 Eu}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends ee{constructor(){super(...arguments),this.name="create_form_submission",this.type=_.WRITE,this.annotations=Z({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 ih}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(t){if(t.includes("wkf.ms")){const a=(await e.head(t,{maxRedirects:0,validateStatus:e=>e<400})).headers.location;return a?this.extractTokenFromUrl(a):null}return t.startsWith("http://")||t.startsWith("https://")?this.extractTokenFromUrl(t):t}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(zu,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){Ac(e,"submit form")}}},class extends ee{constructor(){super(...arguments),this.name="create_column",this.type=_.WRITE,this.annotations=Z({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 "${om.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?rh:sh}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},n=await this.mondayApi.request(rc,a);return{content:{message:"Column successfully created",column_id:n.create_column?.id,column_title:n.create_column?.title}}}},class extends ee{constructor(){super(...arguments),this.name="update_column",this.type=_.WRITE,this.annotations=Z({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 "${om.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.`}getInputSchema(){return this.context?.boardId?dh:ph}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},n=await this.mondayApi.request(dc,a);return{content:{message:"Column successfully updated. Use the new revision below for any subsequent update to this column.",column_id:n.update_column?.id,column_title:n.update_column?.title,revision:n.update_column?.revision}}}},class extends ee{constructor(){super(...arguments),this.name="create_group",this.type=_.WRITE,this.annotations=Z({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 _h}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(uh,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 ee{constructor(){super(...arguments),this.name="delete_column",this.type=_.WRITE,this.annotations=Z({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?jh:Gh}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(sc,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Rc,class extends Rc{constructor(e,t){super(e,t),this.name="all_api_read",this.type=_.READ,this.annotations=Z({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=ze(e.query);this.recordGraphqlOperationCounts(t);const a=ii(t);if(a?.operation===fe.MUTATION)throw new wc("all_api_read only accepts read queries. Mutations are not allowed.",Ic);return super.executeInternal(e)}},class extends Rc{constructor(e,t){super(e,t),this.name="all_api_write",this.type=_.WRITE,this.annotations=Z({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=ze(e.query);this.recordGraphqlOperationCounts(t);const a=ii(t);if(a&&a.operation!==fe.MUTATION)throw new wc("all_api_write only accepts mutations. Read queries are not allowed.",Ic);return super.executeInternal(e)}},class extends ee{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=_.ALL_API,this.annotations=Z({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 I_}async executeInternal(e){try{const t=await this.mondayApi.request(pc),a=e?.operationType,n=t.__schema,i="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=n?.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!==i&&{query_fields:i},...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 ee{constructor(){super(...arguments),this.name="get_column_type_info",this.type=_.READ,this.annotations=Z({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Retrieves comprehensive information about a specific column type. Use fetchMode "${om.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 "${om.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 v_}async executeInternal(e){if(e.fetchMode===om.Guidelines)return{content:{message:`Column type guidelines for ${e.columnType}`,data:{guidelines:{filter:y_(e.columnType),aggregation:`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${Ii.CountItems} function. Do not use ${Ii.Count} function for that purpose.\n `}},url:g_}};const t={type:e.columnType},a=await this.mondayApi.request(f_,t);return a?.get_column_type_schema?{content:{message:`Column type schema for ${e.columnType}`,data:{schema:a.get_column_type_schema},url:g_}}:{content:`Information for column type "${e.columnType}" not found or not available.`}}},class extends ee{constructor(e,t){super("function"==typeof e?()=>Dc(e()):Dc(e),t),this.name="get_type_details",this.type=_.ALL_API,this.annotations=Z({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 E_}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,Ql`
3020
2984
  query getTypeDetails {
3021
2985
  __type(name: "${t}") {
3022
2986
  name
@@ -3104,5 +3068,5 @@ import e from"axios";import t from"jsonwebtoken";import{z as a}from"zod";import
3104
3068
  }
3105
3069
  }
3106
3070
  }
3107
- `),n=await this.mondayApi.request(a);return n.__type?{content:{message:"Type details retrieved",data:{name:n.__type.name,kind:n.__type.kind,description:n.__type.description??null,fields:n.__type.fields??[],inputFields:n.__type.inputFields??[],interfaces:n.__type.interfaces??[],enumValues:n.__type.enumValues??[],possibleTypes:n.__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 ee{constructor(){super(...arguments),this.name="create_custom_activity",this.type=_.WRITE,this.annotations=Z({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return ph}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(cc,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 ee{constructor(){super(...arguments),this.name="create_notification",this.type=_.WRITE,this.annotations=Z({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 ch}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(lh,t);if(!a.create_notification?.id)throw new Tc(`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).`,Ic);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){wc(t,`send notification to user ${e.user_id}`)}}},class extends ee{constructor(){super(...arguments),this.name="create_timeline_item",this.type=_.WRITE,this.annotations=Z({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return Th}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(mc,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 ee{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=_.READ,this.annotations=Z({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return Wh}async executeInternal(e){const t=await this.mondayApi.request(uc);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 ee{constructor(){super(...arguments),this.name="read_docs",this.type=_.READ,this.annotations=Z({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get information about monday.com documents. Supports two modes:\n\nMODE: "content" (default) — Fetch documents with their full markdown content.\n- Requires: type ("ids" | "object_ids" | "workspace_ids") and ids array\n- Supports pagination via page/limit. Check has_more_pages in response.\n- If type "ids" returns no results, automatically retries with object_ids.\n- Set include_blocks: true to include block IDs, types, and positions in the response — required before calling update_doc.\n- 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 lf}async executeInternal(e){return e.mode===df?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!e.type||!e.ids||0===e.ids.length)return{content:'Error: type and ids are required when mode is "content".'};let t,a,n;switch(this.sessionContext.metadata={...this.sessionContext.metadata,mode:e.mode??sf,include_comments:e.include_comments??!1,include_blocks:e.include_blocks??!1},e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":n=e.ids}const i=e.include_blocks??!1,o=i?{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:n,includeBlocks:i,...o};let s=await this.mondayApi.request(zl,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:n,includeBlocks:i,...o};s=await this.mondayApi.request(zl,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,i,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:n,version_history_limit:i}=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:df,object_ids:[o]};try{const e={docId:o,since:a,until:n},r=await this.mondayApi.request(Jl,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 i&&(s=s.slice(0,i)),{content:{doc_id:o,since:a,until:n,restoring_points:s}};const d=Math.min(i??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 n={docId:o,date:e.date,prevDate:a.date},i=await this.mondayApi.request(Zl,n);return{...e,diff:i?.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:n,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 n=0;for(const i of e){const e=i.insert,o="string"==typeof e?e.length:1,r=i.attributes,s=r?.comments;if(s&&Array.isArray(s))for(const e of s){const i=String(e),r=t.get(i);if(r&&r.block_id===a.id){const e=Math.max(r.selection_from+r.selection_length,n+o);r.selection_length=e-r.selection_from}else r||t.set(i,{block_id:a.id,selection_from:n,selection_length:o})}n+=o}}return t}async fetchDocComments(e,t,a){try{const n={boardId:e,itemsLimit:100,updatesLimit:a},[i,o]=await Promise.all([this.mondayApi.request(Xl,n),this.mondayApi.request(nf,{docId:t}).catch((()=>null))]),r=i.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,n=!1,i=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(hc,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 n&&e.object_id&&(t=await this.fetchDocComments(e.object_id,e.id,i)),{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,...n&&{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 ee{constructor(){super(...arguments),this.name="workspace_info",this.type=_.READ,this.annotations=Z({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 cf}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(_c,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const n=function(e,t){const{workspaces:a,boards:n,docs:i,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=[];(n||[]).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(i||[]).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?W_(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 H_(this.mondayApi));return{content:{message:"Workspace info retrieved",data:n}}}},class extends ee{constructor(){super(...arguments),this.name="list_workspaces",this.type=_.READ,this.annotations=Z({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 _f}async executeInternal(e){const t=t=>({limit:e.limit,page:e.page,membershipKind:t}),a=uf(await this.mondayApi.request(mf,t(Sp.Member)));let n=a;if(!hf(a)){n=uf(await this.mondayApi.request(mf,t(Sp.All)))}if(!hf(n))return{content:{message:"No workspaces found.",data:[]}};const i=n.length===e.limit,o=await H_(this.mondayApi),r=n.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:o&&e.id?W_(o,e.id):void 0})));return{content:{message:"Workspaces retrieved",...i?{next_page:e.page+1}:{},data:r}}}},class extends ee{constructor(){super(...arguments),this.name="create_doc",this.type=_.WRITE,this.annotations=Z({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 Ef}async executeInternal(e){const t=If.safeParse({...e,type:e.location});if(!t.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const a=t.data;try{let t,n,i;if(a.type===vf.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||eo.Public,folder_id:a.folder_id?.toString()}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}},r=await this.mondayApi.request(gf,o);t=r?.create_doc?.id??void 0,n=r?.create_doc?.object_id??void 0,i=r?.create_doc?.url??void 0}else if(a.type===vf.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(ff,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===ih.Doc));let l=a.column_id;if(!l)if(p)l=p.id;else{const e={boardId:d.toString(),columnType:ih.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(rc,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(gf,c);if(t=m.create_doc?.id??void 0,n=m.create_doc?.object_id??void 0,i=m.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(yf,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(bf,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},...n&&{object_id:n}},{content:{message:"Document successfully created",doc_id:t,object_id:n,doc_url:i,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 ee{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=_.WRITE,this.annotations=Z({title:"Add Content to Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add markdown content to an existing monday.com document.\n\nIDENTIFICATION: Provide either doc_id or object_id to identify the document:\n- doc_id: The document ID (the id field returned by read_docs). Takes priority if both provided.\n- object_id: The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id.\n\nUSAGE EXAMPLES:\n- By doc_id: { doc_id: "123", markdown: "# New Section\\nContent here" }\n- By object_id: { object_id: "456", markdown: "# New Section\\nContent here" }\n- Insert after block: { doc_id: "123", markdown: "Inserted content", after_block_id: "block_789" }'}getInputSchema(){return Sf}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};try{let t=null;if(e.doc_id){const a=await this.mondayApi.request(Af,{docId:e.doc_id});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(wf,{objectId:e.object_id});t=a.docs?.[0]??null}if(!t){return{content:`Error: No document found for ${e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`}.`}}this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t.id,...e.object_id&&{object_id:e.object_id}};const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},n=await this.mondayApi.request(Tf,a);if(!n?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:i,block_ids:o,error:r}=n.add_content_to_doc_from_markdown;if(!i)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 ee{constructor(){super(...arguments),this.name="update_doc",this.type=_.WRITE,this.annotations=Z({title:"Update Document",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Update an existing monday.com document. Provide doc_id (preferred) or object_id, plus an ordered operations array (executed sequentially, stops on first failure).\n\nOPERATIONS:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (or insert after a block). Best for text, headings, lists, simple tables — no block IDs needed.\n- update_block: Update content of an existing text, code, or list_item block in-place.\n- create_block: Create a new block at a precise position. Use parent_block_id to nest inside notice_box, table cell, or layout cell.\n- delete_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 sg}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};this.sessionContext.metadata={...this.sessionContext.metadata,operation_types:e.operations?.map((e=>e.operation_type)),operation_count:e.operations?.length??0,...e.object_id&&{object_id:e.object_id}};try{let t=e.doc_id;if(!t){const a=await this.mondayApi.request(J_,{objectId:e.object_id}),n=a.docs?.[0];if(!n)return{content:`Error: No document found for object_id ${e.object_id}.`};t=n.id}const a=[];let n=null;for(let i=0;i<e.operations.length;i++){const o=e.operations[i];try{const n=await this.executeOperation(t,o,e.object_id);a.push(`- [OK] ${o.operation_type}${n?`: ${n}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";a.push(`- [FAILED] ${o.operation_type}: ${t}`),n=i;break}}const i=null!==n?n:e.operations.length,o=e.operations.length,r=`Completed ${i}/${o} operation${1===o?"":"s"} on doc ${t}.`;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t},{content:`${r}\n\nResults:\n${a.join("\n")}\n\nDoc ID: ${t}`}}catch(e){return{content:`Error: ${e instanceof Error?e.message:String(e)}`}}}async executeOperation(e,t,a){switch(t.operation_type){case"set_name":return this.executeSetName(e,t.name);case"add_markdown_content":return this.executeAddMarkdown(e,t.markdown,t.after_block_id);case"update_block":return this.executeUpdateBlock(t.block_id,t.content);case"create_block":return this.executeCreateBlock(e,t.block,t.after_block_id,t.parent_block_id);case"delete_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},n=await this.mondayApi.request(Q_,a);if(!n?.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 n={docId:e,markdown:t,afterBlockId:a},i=await this.mondayApi.request(z_,n),o=i?.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:Cf(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:Cf(e.delta_format),language:e.language};case"list_item":return{deltaFormat:Cf(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),n={blockId:e,content:JSON.stringify(a)},i=await this.mondayApi.request(X_,n);if(!i?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,n){const i=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:Rf(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:Nf(e.alignment),direction:Df(e.direction)}};case"list_item":return{list_block:{delta_format:Rf(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:Rf(e.delta_format),text_block_type:Dd.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(n){const e=Object.keys(i);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=i[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=n}const o={docId:e,afterBlockId:a,blocksInput:[i]},r=await this.mondayApi.request(rf,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(Z_,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(ef,t);if(!a?.delete_doc_blocks||0===a.delete_doc_blocks.length)throw new Error("No response from delete_doc_blocks");const n=a.delete_doc_blocks.map((e=>e.id)).join(", ");return`${a.delete_doc_blocks.length} block(s) deleted (IDs: ${n})`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(tf,{docId:e}),n=a.docs?.[0];if(!n?.object_id)throw new Error(`Could not resolve object_id for doc ${e}`);return n.object_id}async resolveDocItemId(e){const t=await this.mondayApi.request(af,{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(nf,{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,n,i,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(i){const e=JSON.parse(i),t=Nh.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:n?.toString(),mentionsList:c},u=await this.mondayApi.request(of,m);if(!u.create_update?.id)throw new Error("Failed to create comment: no update returned");const h=u.create_update.id,_=Number(h),f=n?`Reply to update ${n}`:"Comment";if(d.length>0){if(Number.isNaN(_))throw new Error(`${f} 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 n=t.find((e=>e.id===a));if(!n)throw new Error(`${f} created (update ID: ${h}) but block annotation failed: block ${a} not found in doc ${e}`);const i=n.content.deltaFormat;if(!i)throw new Error(`${f} 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 i)o+="string"==typeof e.insert?e.insert.length:1;if(0===o)throw new Error(`${f} 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(`${f} 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=Lf(i,_,d,p)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`${f} created (update ID: ${h}) but delta annotation failed for block ${a}: ${t}`)}const c={...n.content,deltaFormat:l},m=await this.mondayApi.request(X_,{blockId:a,content:JSON.stringify(c)});if(!m?.update_doc_block)throw new Error(`${f} created (update ID: ${h}) but block annotation write returned no confirmation for block ${a}`)}}const g=d.length;return`${f} created${g>1?` across ${g} blocks`:1===g?" on block":""} (update ID: ${h})`}async executeReplaceBlock(e,t,a,n,i){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,n,i)}`}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 ee{constructor(){super(...arguments),this.name="update_workspace",this.type=_.WRITE,this.annotations=Z({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return hg}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(ug,t),n=await H_(this.mondayApi),i=n?W_(n,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:i}}}},class extends ee{constructor(){super(...arguments),this.name="update_folder",this.type=_.WRITE,this.annotations=Z({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return fg}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:n}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const i={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:t?{is_after:n,object_id:t,object_type:a}:void 0},o=await this.mondayApi.request(_g,i);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends ee{constructor(){super(...arguments),this.name="create_workspace",this.type=_.WRITE,this.annotations=Z({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return bg}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(gg,t),n=await H_(this.mondayApi),i=n&&a.create_workspace?.id?W_(n,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:i}}}},class extends ee{constructor(){super(...arguments),this.name="create_folder",this.type=_.WRITE,this.annotations=Z({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return vg}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(yg,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 ee{constructor(){super(...arguments),this.name="move_object",this.type=_.WRITE,this.annotations=Z({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 Tg}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const d={folderId:t,position:a?{is_after:i,object_id:a,object_type:n}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},p=await this.mondayApi.request(_g,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:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const d={boardId:t,attributes:{position:a?{is_after:i,object_id:a,object_type:n}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(Ig,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:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const d={overviewId:t,attributes:{position:a?{is_after:i,object_id:a,object_type:n}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(Eg,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 Cs.Folder:return this.executeUpdateFolder(e);case Cs.Board:return this.executeUpdateBoardHierarchy(e);case Cs.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends ee{constructor(){super(...arguments),this.name="create_dashboard",this.type=_.WRITE,this.annotations=Z({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 cg}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(dg,t);if(!a.create_dashboard)throw new Tc("Failed to create dashboard",Ic);const n=a.create_dashboard;return{content:{message:`Dashboard ${n.id} successfully created`,dashboard_id:n.id,dashboard_name:n.name}}}catch(e){wc(e,"create dashboard")}}},class extends ee{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=_.READ,this.annotations=Z({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(pg,e);if(!t.all_widgets_schema||0===t.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const a={};let n=0;for(const e of t.all_widgets_schema)if(e?.widget_type&&e?.schema){const t="string"==typeof e.schema?JSON.parse(e.schema):e.schema,i=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:i,schema:e.schema},n++}if(0===n)throw new Error("No valid widget schemas found in API response");Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:a,url:g_}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends ee{constructor(){super(...arguments),this.name="create_widget",this.type=_.WRITE,this.annotations=Z({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 mg}async executeInternal(e){if(!e.settings)throw new Tc("You must pass the settings parameter",Ec);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(lg,t);if(!a.create_widget)throw new Tc("Failed to create widget",Ic);const n=a.create_widget;n.parent?.kind===bp.Dashboard?n.parent.id:n.parent;return{content:{message:`Widget ${n.id} created`,widget_id:n.id,widget_name:n.name,dashboard_id:n.parent?.id}}}catch(t){wc(t,`create ${e.widget_kind} widget`)}}},class extends ee{constructor(){super(...arguments),this.name="board_insights",this.type=_.READ,this.annotations=Z({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 Og}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};if(e.aggregations.some((e=>!e.columnId&&e.function!==Ii.CountItems)))return{content:`Every aggregation must have a "columnId", except the ${Ii.CountItems} function.`};const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],n=new Set(e.aggregations.filter((e=>e.function===Ii.Label)).map((e=>e.columnId))),i=e.groupBy?.filter((e=>!n.has(e))).map((e=>({function:Ii.Label,columnId:e})))??[],o=e.aggregations.concat(i).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 Ng.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:vi.Function,function:(n=e.function,i=e.columnId,{function:n,params:n===Ii.CountItems?[]:[{type:vi.Column,column:Dg(i),as:i}]}),as:s}}var n,i;const o={type:vi.Column,column:Dg(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:vi.Column,column:Dg(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),n=function(e){if(!e.filters&&!e.orderBy)return;const t={};return e.filters&&(t.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),t.operator=e.filtersOperator),e.orderBy&&(t.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),t}(e),i=function(e){return{id:e.boardId.toString(),type:mi.Table}}(e),o={query:{from:i,query:n,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(wg,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const n=e.value;if(!n)return void(t[a]=null);const i=n.result??n.value??null;t[a]=i})),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 ee{constructor(){super(...arguments),this.name="search",this.type=_.READ,this.annotations=Z({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Search within monday.com platform. Supported searchType values: ${l_}.\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 Yg}async executeInternal(e){const{searchTerm:t}=e;if(!t)throw new Tc("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).",Ec);try{if(e.searchType===p_.FOLDERS){const{results:a,truncated:n}=await this.searchFoldersAsync(e,t);return{content:{message:n?"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 Ac(e),e}}async runSmartSearchAsync(e,t){const a=jg(e.workspaceIds?.map((e=>e.toString())));if(e.searchType===p_.BOARD){const n=jg(e.boardIds?.map((e=>e.toString())));return this.searchBoardsAsync(t,e.limit,a,n)}if(e.searchType===p_.DOCUMENTS){const n=jg(e.docIds?.map((e=>e.toString())));return this.searchDocsAsync(t,e.limit,a,n)}if(e.searchType===p_.WORKSPACES)return this.searchWorkspacesAsync(t,e.limit);if(e.searchType===p_.UPDATES){const n=jg(e.boardIds?.map((e=>e.toString()))),i=jg(e.creatorIds?.map((e=>e.toString())));return this.searchUpdatesAsync(t,e.limit,a,n,i)}if(e.searchType===p_.ITEMS){const n=jg(e.boardIds?.map((e=>e.toString()))),i=jg(e.creatorIds?.map((e=>e.toString())));return this.searchItemsAsync(t,e.limit,a,n,i)}if(e.searchType===p_.TIMELINE_ITEMS){const n=jg(e.boardIds?.map((e=>e.toString())));return this.searchTimelineItemsAsync(t,e.limit,a,n)}if(e.searchType===p_.DASHBOARDS){const n=e.creatorIds?.map((e=>e.toString()));return this.searchOverviewsAsync(t,e.limit,a,n)}throw new Tc(`Unsupported search type for smart search: ${e.searchType}`,bc)}async searchBoardsAsync(e,t,a,n){const i={query:e,limit:t,workspaceIds:a,boardIds:n};return(await this.mondayApi.request(kg,i,{timeout:Uc})).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,n){const i={query:e,limit:t,workspaceIds:a,docIds:n};return(await this.mondayApi.request(Lg,i,{timeout:Uc})).search.docs.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0,highlights:Gg(e.indexed_data.highlights)})))}async searchWorkspacesAsync(e,t){const a={query:e,limit:t};return(await this.mondayApi.request(Ug,a,{timeout:Uc})).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,n,i){const o={query:e,limit:t,workspaceIds:a,boardIds:n,creatorIds:i};return(await this.mondayApi.request(Pg,o,{timeout:Uc})).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,n,i){return(i?await this.mondayApi.request(xg,{query:e,limit:t,workspaceIds:a,boardIds:n,creatorIds:i},{versionOverride:"dev",timeout:Uc}):await this.mondayApi.request(Cg,{query:e,limit:t,workspaceIds:a,boardIds:n},{timeout:Uc})).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,n){const i={query:e,limit:t,workspaceIds:a,boardIds:n};return(await this.mondayApi.request($g,i,{timeout:Uc})).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,n){const i={query:e,limit:t,workspaceIds:a,creatorIds:n};return(await this.mondayApi.request(Mg,i,{versionOverride:"dev",timeout:Uc})).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=Vg(t);if(!a)return{results:[],truncated:!1};const n={page:1,limit:100,workspace_ids:jg(e.workspaceIds?.map((e=>e.toString())))},i=(await this.mondayApi.request(Rg,n)).folders||[];return{results:i.filter((e=>e?.name&&Vg(e.name).includes(a))).filter((e=>e?.id)).slice(0,e.limit).map((e=>({id:e.id,title:e.name}))),truncated:100===i.length}}},class extends ee{constructor(){super(...arguments),this.name="get_user_context",this.type=_.READ,this.annotations=Z({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(ab,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};const n=await this.fetchFavorites(t||[]),i=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:n,relevantBoards:i,relevantDocs:o,relevantPeople:r}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const n={};for(const e of a)n[ib[e]]=t[e];const i=await this.mondayApi.request(nb,n),o=[];for(const e of a){const t=ob[e];for(const a of i[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 ee{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=_.WRITE,this.annotations=Z({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(Jg,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends ee{constructor(){super(...arguments),this.name="get_assets",this.type=_.READ,this.annotations=Z({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 tb}async executeInternal(e){const t=await this.mondayApi.request(eb,{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 ee{constructor(){super(...arguments),this.name="create_view",this.type=_.WRITE,this.annotations=Z({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 "${im.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 gm}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(fm,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 ee{constructor(){super(...arguments),this.name="update_view",this.type=_.WRITE,this.annotations=Z({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 "${im.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 ym}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(bm,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 ee{constructor(){super(...arguments),this.name="create_view_table",this.type=_.WRITE,this.annotations=Z({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 "${im.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 Tm}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(vm,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 ee{constructor(){super(...arguments),this.name="update_view_table",this.type=_.WRITE,this.annotations=Z({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 "${im.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 Nm}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(wm,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 ee{constructor(){super(...arguments),this.name="undo_action",this.type=_.WRITE,this.annotations=Z({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 sb}async executeInternal(e){return await this.mondayApi.request(rb,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}},class extends ee{constructor(){super(...arguments),this.name="get_object_schemas",this.type=_.READ,this.annotations=Z({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 Wc}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(Hc,t)).get_object_schemas??[];return{content:{message:`Retrieved ${a.length} object schema(s)`,schemas:a}}}},class extends ee{constructor(){super(...arguments),this.name="create_object_schema",this.type=_.WRITE,this.annotations=Z({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 Kc}async executeInternal(e){const t={name:e.name,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(Yc,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 ee{constructor(){super(...arguments),this.name="update_object_schema",this.type=_.WRITE,this.annotations=Z({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 zc}async executeInternal(e){const t={id:e.id,revision:e.revision,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(Qc,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 ee{constructor(){super(...arguments),this.name="delete_object_schema",this.type=_.WRITE,this.annotations=Z({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 Xc}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(Jc,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 ee{constructor(){super(...arguments),this.name="delete_object_schema_columns",this.type=_.WRITE,this.annotations=Z({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 em}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(Zc,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 ee{constructor(){super(...arguments),this.name="manage_object_schema_board_connection",this.type=_.WRITE,this.annotations=Z({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 nm}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(tm,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(am,t)).detach_boards_from_object_schema??[],n=a.filter((e=>e.success)).length,i=a.filter((e=>!e.success));return{content:{message:`${n} board(s) successfully detached`,results:a,...i.length>0&&{failures:i}}}}}},class extends ee{constructor(){super(...arguments),this.name="manage_object_schema_columns",this.type=_.WRITE,this.annotations=Z({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 "${im.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 lm}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},n=await this.mondayApi.request(om,a);return{content:{message:`Columns successfully added to object schema "${n.create_object_schema_columns?.name}"`,schema_id:n.create_object_schema_columns?.id,schema_name:n.create_object_schema_columns?.name,revision:n.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(rm,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 ee{constructor(){super(...arguments),this.name="set_object_schema_column_active_state",this.type=_.WRITE,this.annotations=Z({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 mm}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={deactivate:ko.Deactivate,reactivate:ko.Reactivate},a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnId:e.columnId,action:t[e.action]},n=await this.mondayApi.request(cm,a);return{content:{message:`Column successfully ${e.action}d on object schema "${n.set_object_schema_column_active_state?.name}"`,schema_id:n.set_object_schema_column_active_state?.id,schema_name:n.set_object_schema_column_active_state?.name,revision:n.set_object_schema_column_active_state?.revision}}}},class extends ee{constructor(){super(...arguments),this.name="get_asset_upload_url",this.type=_.WRITE,this.annotations=Z({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 pb}async executeInternal(e){const t=(await this.mondayApi.request(db,{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 ee{constructor(){super(...arguments),this.name="finalize_asset_upload",this.type=_.WRITE,this.annotations=Z({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 mb}async executeInternal(e){const t=(await this.mondayApi.request(lb,{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(cb,{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 ee{constructor(){super(...arguments),this.name="link_board_items_workflow",this.type=_.READ,this.annotations=Z({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 hb}async executeInternal(e){return{content:ub}}},class extends ee{constructor(){super(...arguments),this.name="fetch_file_content",this.type=_.READ,this.annotations=Z({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.\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 wb}async executeInternal(e){const{item_id:t,column_id:a,file_name:n,offset:i=0}=e,o=await this.mondayApi.request(_b,{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.`}};return{content:{files:await Promise.all(r.map((e=>Nb(e,i,n))))}}}},class extends ee{constructor(){super(...arguments),this.name="manage_agent",this.type=_.WRITE,this.annotations=Z({title:"Manage monday Platform Agent",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Full lifecycle management for monday platform agents — create, read, update, delete, change state, and run.\n\nmonday platform agents are user-built work orchestrators on monday.com — each has a profile (name, role, avatar), a goal, and a markdown execution plan. Agents in state ACTIVE can be triggered automatically. They are NOT local LangChain or MCP agents.\n\nACTIONS (only pass fields that apply to the chosen action):\n- create: { action:"create", prompt, agent_model? } — AI-generated agent. Platform creates profile, goal, and plan from the prompt.\n- create_blank: { action:"create_blank", name?, role?, role_description?, avatar_url?, gender?, background_color?, user_prompt? } — manually defined agent.\n- get one: { action:"get", agent_id }\n- list owned: { action:"get" }\n- update: { action:"update", agent_id, name?, role?, role_description?, plan?, agent_model? }\n- delete: { action:"delete", agent_id }\n- activate: { action:"activate", agent_id }\n- deactivate: { action:"deactivate", agent_id }\n- run: { action:"run", agent_id }\n\nRULES:\n- "create_blank" with no fields creates a nameless blank agent — only do this intentionally.\n- "update" requires at least one of name/role/role_description/plan/agent_model.\n- "update", "delete", "activate", "deactivate", "run" all require "agent_id".\n- Created agents start INACTIVE. Follow with action:"activate" using the returned agent_id before they can be triggered.\n- ⚠️ DESTRUCTIVE — "delete" is permanent and irreversible. When the user refers to an agent by name, ALWAYS call action:"get" first to confirm the correct agent_id before deleting.\n- "run" is fire-and-forget. Returns trigger_uuid — no run-status query exists, treat successful enqueue as the only signal.\n- Agent state is one of ACTIVE, INACTIVE, ARCHIVED, or FAILED. DELETED only appears as the return value of action:"delete".\n\nUSAGE EXAMPLES:\n- AI create: { "action": "create", "prompt": "Run my daily standup every weekday at 9am." }\n- Manual create:{ "action": "create_blank", "name": "Standup Bot", "role": "Project Manager", "gender": "female" }\n- Fetch one: { "action": "get", "agent_id": "42" }\n- List mine: { "action": "get" }\n- Rename: { "action": "update", "agent_id": "7", "name": "New Name" }\n- Activate: { "action": "activate", "agent_id": "7" }\n- Deactivate: { "action": "deactivate", "agent_id": "7" }\n- Run: { "action": "run", "agent_id": "7" }\n- Delete: { "action": "delete", "agent_id": "7" }\n\nRELATED TOOLS:\n- agent_catalog — browse available trigger types and skills before wiring them to an agent\n- manage_agent_triggers — manage which triggers fire this agent automatically\n- manage_agent_skills — manage which skills this agent can perform\n- manage_agent_knowledge — manage which boards/docs this agent has access to'}getInputSchema(){return Yw}async executeInternal(e){switch(e.action){case"create":return this.handleCreate(e);case"create_blank":return this.handleCreateBlank(e);case"get":return this.handleGet(e);case"update":return this.handleUpdate(e);case"delete":return this.handleDelete(e);case"activate":return this.handleActivate(e);case"deactivate":return this.handleDeactivate(e);case"run":return this.handleRun(e)}}async handleCreate(e){if(!e.prompt)throw new Error('manage_agent action:"create" requires "prompt". For a manually configured agent, use action:"create_blank".');try{const t={input:{prompt:e.prompt,agent_model:e.agent_model}},a=await this.mondayApi.request(kw,t,{versionOverride:"dev"});if(!a.create_agent?.id)throw new Error("monday platform agent creation returned no id");return{content:{message:`monday platform agent ${a.create_agent.id} created in state INACTIVE — call manage_agent with action:"activate" and agent_id:"${a.create_agent.id}" to activate it`,agent:a.create_agent}}}catch(e){wc(e,"create monday platform agent")}}async handleCreateBlank(e){try{const t={};void 0!==e.name&&(t.name=e.name),void 0!==e.role&&(t.role=e.role),void 0!==e.role_description&&(t.role_description=e.role_description),void 0!==e.avatar_url&&(t.avatar_url=e.avatar_url),void 0!==e.gender&&(t.gender=e.gender),void 0!==e.background_color&&(t.background_color=e.background_color),void 0!==e.user_prompt&&(t.user_prompt=e.user_prompt);const a={input:t},n=await this.mondayApi.request(Lw,a,{versionOverride:"dev"});if(!n.create_blank_agent?.id)throw new Error("monday platform agent creation returned no id");return{content:{message:`monday platform agent ${n.create_blank_agent.id} created in state INACTIVE — call manage_agent with action:"activate" and agent_id:"${n.create_blank_agent.id}" to activate it`,agent:n.create_blank_agent}}}catch(e){wc(e,"create blank monday platform agent")}}async handleGet(e){if(void 0!==e.agent_id)try{const{custom_agents:t}=await this.mondayApi.request(Cw,{ids:[e.agent_id]},{versionOverride:"dev"}),a=t?.[0];return a?{content:{message:"monday platform agent",agent:a}}:{content:`monday platform agent ${e.agent_id} not found, or the authenticated user does not have access to it.`}}catch(e){wc(e,"get monday platform agent")}try{const{custom_agents:e}=await this.mondayApi.request(Cw,{limit:100},{versionOverride:"dev"}),t=e??[];return{content:{message:"monday platform agents owned by the authenticated user (limited to 100 — ask the user if they need more)",count:t.length,agents:t}}}catch(e){wc(e,"list monday platform agents")}}async handleUpdate(e){if(!e.agent_id)throw new Error('manage_agent action:"update" requires "agent_id".');try{const t={};if(void 0!==e.name&&(t.name=e.name),void 0!==e.role&&(t.role=e.role),void 0!==e.role_description&&(t.role_description=e.role_description),void 0!==e.plan&&(t.plan=e.plan),void 0!==e.agent_model&&(t.agent_model=e.agent_model),0===Object.keys(t).length)throw new Error('manage_agent action:"update" requires at least one of: name, role, role_description, plan, agent_model.');const a={id:e.agent_id,input:t},n=await this.mondayApi.request(Uw,a,{versionOverride:"dev"});if(!n.update_agent)throw new Error("update_agent returned no data — the agent may not exist");return{content:{message:"monday platform agent updated",agent:n.update_agent}}}catch(e){wc(e,"update monday platform agent")}}async handleDelete(e){if(!e.agent_id)throw new Error('manage_agent action:"delete" requires "agent_id".');try{const t={id:e.agent_id},a=await this.mondayApi.request(Pw,t,{versionOverride:"dev"});if(!a.delete_agent?.id)throw new Error("monday platform agent delete returned no id");return{content:{message:`monday platform agent ${a.delete_agent.id} deleted`,agent:a.delete_agent}}}catch(e){wc(e,"delete monday platform agent")}}async handleActivate(e){if(!e.agent_id)throw new Error('manage_agent action:"activate" requires "agent_id".');try{const t=await this.mondayApi.request($w,{id:e.agent_id},{versionOverride:"dev"});return{content:{message:"Agent activated.",success:t.activate_agent?.success??!1}}}catch(e){wc(e,"activate monday platform agent")}}async handleDeactivate(e){if(!e.agent_id)throw new Error('manage_agent action:"deactivate" requires "agent_id".');try{const t={id:e.agent_id,inactive_reason:CI.DeactivatedByUser},a=await this.mondayApi.request(xw,t,{versionOverride:"dev"});return{content:{message:"Agent deactivated.",success:a.deactivate_agent?.success??!1}}}catch(e){wc(e,"deactivate monday platform agent")}}async handleRun(e){if(!e.agent_id)throw new Error('manage_agent action:"run" requires "agent_id".');try{const t=await this.mondayApi.request(Mw,{id:e.agent_id},{versionOverride:"dev"});if(!t.run_agent)throw new Error("run_agent returned no data — the agent run may not have been enqueued");return{content:{message:"Agent run enqueued.",trigger_uuid:t.run_agent.trigger_uuid}}}catch(e){wc(e,"run monday platform agent")}}},class extends ee{constructor(){super(...arguments),this.name="manage_agent_triggers",this.type=_.WRITE,this.annotations=Z({title:"Manage monday Platform Agent Triggers",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Manage the triggers attached to a monday platform agent — triggers define WHEN the agent runs automatically.\n\nACTIONS:\n- list: { agent_id } — returns active triggers with node_id, block_reference_id, name, field_summary.\n- add: { agent_id, block_reference_id, field_values? } — attaches a trigger type to the agent.\n- remove: { agent_id, node_id } — detaches a trigger instance by node_id (NOT block_reference_id).\n\nWORKFLOW — add a trigger:\n1. Call agent_catalog action:"list_triggers" — note block_reference_id, field_schemas, and required_fields.\n2. Collect required field values from the user (e.g. board_id, column_id).\n3. Call this tool action:"add" with block_reference_id and field_values.\nNote: add returns only { success } — no node_id for the new instance. Call action:"list" afterward if you need the node_id.\n\nWORKFLOW — remove a trigger:\n1. Call action:"list" to see active triggers and note the node_id of the instance to remove.\n2. Call action:"remove" with that node_id.\n\nNOTE: Only triggers that can be added programmatically appear in the catalog. OAuth/3rd-party triggers (Slack, Gmail, Salesforce, etc.)\nrequire user setup in the monday.com UI — they will not appear in agent_catalog and cannot be managed here.\n\nUSAGE EXAMPLES:\n- List triggers: { "action": "list", "agent_id": "7" }\n- Add trigger: { "action": "add", "agent_id": "7", "block_reference_id": "status-change-ref", "field_values": { "board_id": "42" } }\n- Remove trigger: { "action": "remove", "agent_id": "7", "node_id": "node-abc" }\n\nRELATED TOOLS:\n- agent_catalog action:"list_triggers" — discover available trigger types and their required field_values before calling action:"add" here\n- manage_agent_skills — manage which skills this agent can perform\n- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)'}getInputSchema(){return Kw}async executeInternal(e){switch(e.action){case"list":return this.handleList(e);case"add":return this.handleAdd(e);case"remove":return this.handleRemove(e)}}async handleList(e){try{const t={agent_id:e.agent_id},a=(await this.mondayApi.request(Vw,t,{versionOverride:"dev"})).agent_active_triggers??[];return{content:{message:'Active triggers on this agent. Use node_id with action:"remove" to detach a trigger.',count:a.length,triggers:a}}}catch(e){wc(e,"list active triggers for monday platform agent")}}async handleAdd(e){if(!e.block_reference_id)throw new Error('block_reference_id is required for action:"add". Call agent_catalog action:"list_triggers" first to find the block_reference_id.');try{const t={agent_id:e.agent_id,block_reference_id:e.block_reference_id,field_values:e.field_values},a=await this.mondayApi.request(Fw,t,{versionOverride:"dev"});return{content:{message:'Trigger added to agent. Call action:"list" to verify and retrieve the node_id.',success:a.add_trigger_to_agent?.success??!1}}}catch(e){wc(e,"add trigger to monday platform agent")}}async handleRemove(e){if(!e.node_id)throw new Error('node_id is required for action:"remove". Call action:"list" first to get node_id values.');try{const t={agent_id:e.agent_id,node_id:e.node_id},a=await this.mondayApi.request(Bw,t,{versionOverride:"dev"});return{content:{message:"Trigger removed from agent.",success:a.remove_trigger_from_agent?.success??!1}}}catch(e){wc(e,"remove trigger from monday platform agent")}}},class extends ee{constructor(){super(...arguments),this.name="manage_agent_skills",this.type=_.WRITE,this.annotations=Z({title:"Manage monday Platform Agent Skills",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Manage the full skill lifecycle for monday platform agents — create new skills in the catalog, attach skills to an agent, or detach them.\n\nSkills extend what an agent can do (e.g. sending emails, querying databases, posting to Slack).\n\nACTIONS:\n- create: { name, content, description? } — creates a new custom skill in the account-wide catalog.\n The skill becomes available to all agents in the account.\n- add: { agent_id, skill_id } — attaches a skill to this agent.\n- remove: { agent_id, skill_id } — detaches a skill from this agent.\n\nWORKFLOW — attach an existing skill:\n1. Call agent_catalog action:"list_skills" — find the skill_id of the skill to attach.\n2. Call this tool action:"add" with agent_id and that skill_id.\n\nWORKFLOW — create a new skill and attach it:\n1. Call this tool action:"create" with name and content — note the returned id.\n2. Call this tool action:"add" with agent_id and that id directly (no catalog lookup needed).\n\nNOTE: There is no action to list which skills are currently attached to a specific agent — the platform does not yet expose that query.\nTo browse all skills available in the account catalog, use agent_catalog action:"list_skills".\n\nUSAGE EXAMPLES:\n- Create a skill: { "action": "create", "name": "Send Slack Message", "content": "## Instructions\\nPost a message to a Slack channel.", "description": "Sends a message to Slack" }\n- Add a skill: { "action": "add", "agent_id": "7", "skill_id": "skill-abc-123" }\n- Remove a skill: { "action": "remove", "agent_id": "7", "skill_id": "skill-abc-123" }\n\nRELATED TOOLS:\n- agent_catalog action:"list_skills" — browse existing skills to find a skill_id before calling action:"add"\n- manage_agent_triggers — manage which triggers fire this agent automatically\n- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)'}getInputSchema(){return Qw}async executeInternal(e){switch(e.action){case"create":return this.handleCreate(e);case"add":return this.handleAdd(e);case"remove":return this.handleRemove(e)}}async handleCreate(e){if(!e.name||!e.content)throw new Error('action:"create" requires both "name" and "content".');try{const t={name:e.name,content:e.content,description:e.description},a=await this.mondayApi.request(Ww,t,{versionOverride:"dev"});if(!a.create_agent_skill)throw new Error("create_agent_skill returned no data");return{content:{message:'Skill created and added to the account catalog. Use the returned id with action:"add" to attach it to an agent.',skill:a.create_agent_skill}}}catch(e){wc(e,"create monday platform agent skill")}}async handleAdd(e){if(!e.agent_id)throw new Error('agent_id is required for action:"add".');if(!e.skill_id)throw new Error('skill_id is required for action:"add". Get it from agent_catalog action:"list_skills" or from action:"create" in this tool.');try{const t={agent_id:e.agent_id,skill_id:e.skill_id},a=await this.mondayApi.request(qw,t,{versionOverride:"dev"});return{content:{message:"Skill added to agent.",success:a.add_skill_to_agent?.success??!1}}}catch(e){wc(e,"add skill to monday platform agent")}}async handleRemove(e){if(!e.agent_id)throw new Error('agent_id is required for action:"remove".');if(!e.skill_id)throw new Error('skill_id is required for action:"remove".');try{const t={agent_id:e.agent_id,skill_id:e.skill_id},a=await this.mondayApi.request(jw,t,{versionOverride:"dev"});return{content:{message:"Skill removed from agent.",success:a.remove_skill_from_agent?.success??!1}}}catch(e){wc(e,"remove skill from monday platform agent")}}},class extends ee{constructor(){super(...arguments),this.name="manage_agent_knowledge",this.type=_.WRITE,this.annotations=Z({title:"Manage monday Platform Agent Knowledge",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'List, grant, update, or revoke a monday platform agent\'s access to boards and docs.\n\nAn agent\'s "knowledge" is the set of monday.com boards and docs it can read from or write to during a run.\n\n- list: Returns all resources the agent currently has access to, including permission level and resource type.\n- add: Grants the agent access to a board or doc with the specified permission level.\n- update: Changes the permission level on a resource the agent already has access to. Call action:"list" first to confirm the resource_id exists.\n- remove: Revokes the agent\'s access to a board or doc entirely. Call action:"list" first to confirm the resource_id exists.\n\nPermission types:\n- READ: Agent can read data from the resource.\n- READ_WRITE: Agent can read and write data to the resource.\n\nUSAGE EXAMPLES:\n- List: { "action": "list", "agent_id": "7" }\n- Add board access: { "action": "add", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD", "permission_type": "READ" }\n- Update to read-write: { "action": "update", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD", "permission_type": "READ_WRITE" }\n- Remove access: { "action": "remove", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD" }\n\nRELATED TOOLS:\n- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)\n- manage_agent_triggers — manage which triggers fire this agent automatically\n- manage_agent_skills — manage which skills this agent can perform'}getInputSchema(){return eA}async executeInternal(e){switch(e.action){case"list":return this.handleList(e);case"add":return this.handleAdd(e);case"update":return this.handleUpdate(e);case"remove":return this.handleRemove(e)}}async handleList(e){try{const t=(await this.mondayApi.request(zw,{id:e.agent_id},{versionOverride:"dev"})).agent_knowledge??{resources:[],files:[]};return{content:{message:"Current agent resource access.",count:t.resources?.length??0,knowledge:t}}}catch(e){wc(e,"list agent knowledge for monday platform agent")}}async handleAdd(e){if(!e.resource_id||!e.scope_type||!e.permission_type)throw new Error("resource_id, scope_type, and permission_type are required for action:add");try{const t=await this.mondayApi.request(Jw,{id:e.agent_id,resource_id:e.resource_id,scope_type:e.scope_type,permission_type:e.permission_type},{versionOverride:"dev"});return{content:{message:"Resource access granted to agent.",success:t.add_agent_resource_access?.success??!1}}}catch(e){wc(e,"add agent resource access for monday platform agent")}}async handleUpdate(e){if(!e.resource_id||!e.scope_type||!e.permission_type)throw new Error("resource_id, scope_type, and permission_type are required for action:update");try{const t=await this.mondayApi.request(Zw,{id:e.agent_id,resource_id:e.resource_id,scope_type:e.scope_type,permission_type:e.permission_type},{versionOverride:"dev"});return{content:{message:"Resource access updated.",success:t.update_agent_resource_access?.success??!1}}}catch(e){wc(e,"update agent resource access for monday platform agent")}}async handleRemove(e){if(!e.resource_id||!e.scope_type)throw new Error("resource_id and scope_type are required for action:remove");try{const t=await this.mondayApi.request(Xw,{id:e.agent_id,resource_id:e.resource_id,scope_type:e.scope_type},{versionOverride:"dev"});return{content:{message:"Resource access removed from agent.",success:t.remove_agent_resource_access?.success??!1}}}catch(e){wc(e,"remove agent resource access for monday platform agent")}}},class extends ee{constructor(){super(...arguments),this.name="agent_catalog",this.type=_.READ,this.annotations=Z({title:"monday Platform Agent Catalog",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Browse the account-wide catalog of available trigger types and skills for monday platform agents. READ-ONLY — no agent_id required.\n\nUse this tool to discover what\'s available BEFORE wiring anything to a specific agent.\n\nACTIONS:\n- list_triggers: { block_reference_ids? } — returns available trigger types.\n Each entry has block_reference_id (required for manage_agent_triggers action:"add"), name, description,\n field_schemas (describes field_values shape), and required_fields (fields to collect from the user).\n Note: only triggers that can be added programmatically appear here. OAuth/3rd-party triggers (Slack, Gmail, Salesforce, etc.)\n require user setup in the monday.com UI and will not appear here.\n\n- list_skills: {} — returns available skills with id, name, description.\n Never guess or invent a skill id — always look it up here before calling manage_agent_skills action:"add".\n\nUSAGE EXAMPLES:\n- List all trigger types: { "action": "list_triggers" }\n- Fetch specific trigger: { "action": "list_triggers", "block_reference_ids": ["some-block-ref-id"] }\n- List all skills: { "action": "list_skills" }\n\nRELATED TOOLS:\n- manage_agent_triggers — use block_reference_id from list_triggers to attach a trigger to a specific agent\n- manage_agent_skills — use skill id from list_skills, or action:"create" to author a new skill, then attach to an agent\n- manage_agent — manage the agent entity itself (create, update, delete, activate, etc.)'}getInputSchema(){return tA}async executeInternal(e){switch(e.action){case"list_triggers":return this.handleListTriggers(e);case"list_skills":return this.handleListSkills()}}async handleListTriggers(e){try{const t={block_reference_ids:e.block_reference_ids},a=(await this.mondayApi.request(Gw,t,{versionOverride:"dev"})).agent_triggers_catalog??[];return{content:{message:'Available trigger types. Use block_reference_id and inspect field_schemas/required_fields before calling manage_agent_triggers action:"add".',count:a.length,triggers:a}}}catch(e){wc(e,"fetch monday platform agent triggers catalog")}}async handleListSkills(){try{const e=(await this.mondayApi.request(Hw,{},{versionOverride:"dev"})).agent_skills_catalog??[];return{content:{message:'Available skills. Use id when calling manage_agent_skills action:"add".',count:e.length,skills:e}}}catch(e){wc(e,"fetch monday platform agent skills catalog")}}},class extends ee{constructor(){super(...arguments),this.name="list_automations",this.type=_.READ,this.annotations=Z({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 oA}async executeInternal(e){try{const a=!e.cursor,n={boardIds:[e.boardId],limit:e.limit??100,includeLegacy:a,...e.cursor?{cursor:e.cursor}:{}},i=await this.mondayApi.request(aA,n),o=(i.board_automations?.items??[]).map(iA),r=i.board_automations?.cursor??null,s=a?(t=i.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){wc(e,"list live workflows")}var t}},class extends ee{constructor(){super(...arguments),this.name="manage_automations",this.type=_.WRITE,this.annotations=Z({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 pA}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(rA,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){wc(e,"activate workflow")}}async deactivateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(sA,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){wc(e,"deactivate workflow")}}async deleteWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(dA,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){wc(e,"delete workflow")}}},class extends ee{constructor(e,t,a){super(e,a),this.apiToken=t,this.name="create_automation",this.type=_.WRITE,this.annotations=Z({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 cA}async executeInternal(e){try{const a="function"==typeof this.apiToken?this.apiToken():this.apiToken,n=(t=this.context,t?.fetchConfig?.fetch??lA),i=await n({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(!i.ok){const e=await i.text().catch((()=>""));throw new Tc(`lite-builder responded with HTTP ${i.status}${e?`: ${e}`:""}`,"UPSTREAM_HTTP_ERROR")}return{content:await i.json()}}catch(e){wc(e,"create automation")}var t}},class extends ee{constructor(){super(...arguments),this.name="get_automation_runs",this.type=_.READ,this.annotations=Z({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 bA}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){wc(e,"get automation runs")}}async runHistory(e){const t=e.nextPageOffset??0,a={...e.filters??{},...e.boardId?{boardId:e.boardId}:{}},n=await this.mondayApi.request(uA,{nextPageOffset:t,filters:a}),i=n.trigger_events?.triggerEvents??[],o=function(e){return e.reduce(((e,t)=>{const a=t.eventState??"unknown";return e[a]=(e[a]??0)+1,e}),{})}(i),r=e.boardId?`board ${e.boardId}`:"account-wide";return{content:{message:`Returned ${i.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+i.length}.`,scope:r,offset:t,count:i.length,stateCounts:o,runs:i}}}async runDetail(e){if(!e.triggerUuid)return{content:{message:'detail mode requires "triggerUuid".'}};const t=!1!==e.includeToolEvents,a=e.blockEventsOffset??0,n=e.toolEventsOffset??0,i=(await this.mondayApi.request(hA,{triggerUuid:e.triggerUuid})).trigger_event;if(!i)return{content:{message:`No run found for triggerUuid ${e.triggerUuid}.`,triggerUuid:e.triggerUuid,found:!1}};const[o,r]=await Promise.all([this.mondayApi.request(_A,{triggerUuid:e.triggerUuid,nextPageOffset:a}),t?this.mondayApi.request(fA,{triggerUuid:e.triggerUuid,nextPageOffset:n}):Promise.resolve(null)]),s=o.block_events?.blockEvents??[],d=r?.tool_events?.tool_events??[];return{content:{message:`Run ${e.triggerUuid}: state=${i.eventState??"unknown"}, ${s.length} block step(s), ${d.length} tool call(s).`,found:!0,run:i,blockEvents:s,blockEventsOffset:a,toolEvents:d,toolEventsOffset:n,toolEventsIncluded:t}}}},class extends ee{constructor(){super(...arguments),this.name="get_automation_statistics",this.type=_.READ,this.annotations=Z({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 IA}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){wc(e,"get automation statistics")}}async runTotals(e,t,a){const n=(await this.mondayApi.request(yA,{filters:{board_id:t,user_ids:e.userIds}})).account_trigger_statistics;return{content:{message:`Totals (${a}): success=${n?.success??0}, failure=${n?.failure??0}, total=${n?.total??0}.`,scope:a,breakdown:"totals",statistics:n}}}async runByEntity(e,t,a){if(!e.runStatus)return{content:{message:'by_entity breakdown requires "runStatus" (success | failure | exhausted).'}};const n=(await this.mondayApi.request(vA,{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:n?.automation_statistics,workflowStatistics:n?.workflow_statistics}}}},class extends ee{constructor(){super(...arguments),this.name="configure_ai_column",this.type=_.WRITE,this.annotations=Z({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 RA}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){wc(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 n=await this.mondayApi.request(EA,{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:n.configure_categorize_ai_column?.column_id}}}async handleSummarize(e,t,a){this.validateSourceType(t,"summarize");const n=await this.mondayApi.request(TA,{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:n.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 n=await this.mondayApi.request(wA,{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:n.configure_translate_ai_column?.column_id}}}async handleImproveText(e,t,a){this.validateSourceType(t,"improve_text");const n=await this.mondayApi.request(AA,{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:n.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 n=await this.mondayApi.request(SA,{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:n.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 n=await this.mondayApi.request(NA,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.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 n=await this.mondayApi.request(DA,{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:n.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 n=await this.mondayApi.request(OA,{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:n.configure_person_assignment_ai_column?.column_id}}}},class extends ee{constructor(){super(...arguments),this.name="remove_ai_from_column",this.type=_.WRITE,this.annotations=Z({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 kA}async executeInternal(e){try{const t=await this.mondayApi.request(CA,{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){wc(e,"remove AI from column")}}},class extends ee{constructor(){super(...arguments),this.name="submit_bug_or_feature_request",this.type=_.READ,this.annotations=Z({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. ${LA}`}getInputSchema(){return UA}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 ee{constructor(){super(...arguments),this.name="get_monday_knowledge",this.type=_.READ,this.annotations=Z({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 VA}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,e.kind===xA?this.queryDeveloperDocs(e.query):this.queryGeneralKnowledge(e.query)}async queryGeneralKnowledge(e){const t={query:e},a=(await this.mondayApi.request(PA,t)).knowledge_base_search;a?.answer||wc(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 n=(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:n,kind:MA}}}async queryDeveloperDocs(e){const t={query:e,retrieval_only:!0},a=(await this.mondayApi.request($A,t)).ask_developer_docs;return a?.answer||wc(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:xA}}}}],bS=[...gS,...fS,...X];export{Rc as ToolMode,_ as ToolType,gS as allGraphqlApiTools,X as allMondayAppsTools,fS as allMondayDevTools,bS as allTools};
3071
+ `),n=await this.mondayApi.request(a);return n.__type?{content:{message:"Type details retrieved",data:{name:n.__type.name,kind:n.__type.kind,description:n.__type.description??null,fields:n.__type.fields??[],inputFields:n.__type.inputFields??[],interfaces:n.__type.interfaces??[],enumValues:n.__type.enumValues??[],possibleTypes:n.__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 ee{constructor(){super(...arguments),this.name="create_custom_activity",this.type=_.WRITE,this.annotations=Z({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return lh}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(cc,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 ee{constructor(){super(...arguments),this.name="create_notification",this.type=_.WRITE,this.annotations=Z({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 mh}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(ch,t);if(!a.create_notification?.id)throw new wc(`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).`,Ec);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){Ac(t,`send notification to user ${e.user_id}`)}}},class extends ee{constructor(){super(...arguments),this.name="create_timeline_item",this.type=_.WRITE,this.annotations=Z({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return wh}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(mc,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 ee{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=_.READ,this.annotations=Z({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return Wh}async executeInternal(e){const t=await this.mondayApi.request(uc);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 ee{constructor(){super(...arguments),this.name="read_docs",this.type=_.READ,this.annotations=Z({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get information about monday.com documents. Supports two modes:\n\nMODE: "content" (default) — Fetch documents with their full markdown content.\n- Requires: type ("ids" | "object_ids" | "workspace_ids") and ids array\n- Supports pagination via page/limit. Check has_more_pages in response.\n- If type "ids" returns no results, automatically retries with object_ids.\n- Set include_blocks: true to include block IDs, types, and positions in the response — required before calling update_doc.\n- 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 lf}async executeInternal(e){return e.mode===df?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!e.type||!e.ids||0===e.ids.length)return{content:'Error: type and ids are required when mode is "content".'};let t,a,n;switch(this.sessionContext.metadata={...this.sessionContext.metadata,mode:e.mode??sf,include_comments:e.include_comments??!1,include_blocks:e.include_blocks??!1},e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":n=e.ids}const i=e.include_blocks??!1,o=i?{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:n,includeBlocks:i,...o};let s=await this.mondayApi.request(zl,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:n,includeBlocks:i,...o};s=await this.mondayApi.request(zl,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,i,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:n,version_history_limit:i}=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:df,object_ids:[o]};try{const e={docId:o,since:a,until:n},r=await this.mondayApi.request(Jl,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 i&&(s=s.slice(0,i)),{content:{doc_id:o,since:a,until:n,restoring_points:s}};const d=Math.min(i??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 n={docId:o,date:e.date,prevDate:a.date},i=await this.mondayApi.request(Zl,n);return{...e,diff:i?.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:n,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 n=0;for(const i of e){const e=i.insert,o="string"==typeof e?e.length:1,r=i.attributes,s=r?.comments;if(s&&Array.isArray(s))for(const e of s){const i=String(e),r=t.get(i);if(r&&r.block_id===a.id){const e=Math.max(r.selection_from+r.selection_length,n+o);r.selection_length=e-r.selection_from}else r||t.set(i,{block_id:a.id,selection_from:n,selection_length:o})}n+=o}}return t}async fetchDocComments(e,t,a){try{const n={boardId:e,itemsLimit:100,updatesLimit:a},[i,o]=await Promise.all([this.mondayApi.request(Xl,n),this.mondayApi.request(nf,{docId:t}).catch((()=>null))]),r=i.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,n=!1,i=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(hc,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 n&&e.object_id&&(t=await this.fetchDocComments(e.object_id,e.id,i)),{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,...n&&{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 ee{constructor(){super(...arguments),this.name="workspace_info",this.type=_.READ,this.annotations=Z({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 cf}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(_c,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const n=function(e,t){const{workspaces:a,boards:n,docs:i,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=[];(n||[]).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(i||[]).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?W_(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 H_(this.mondayApi));return{content:{message:"Workspace info retrieved",data:n}}}},class extends ee{constructor(){super(...arguments),this.name="list_workspaces",this.type=_.READ,this.annotations=Z({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 _f}async executeInternal(e){const t=t=>({limit:e.limit,page:e.page,membershipKind:t}),a=uf(await this.mondayApi.request(mf,t(Sp.Member)));let n=a;if(!hf(a)){n=uf(await this.mondayApi.request(mf,t(Sp.All)))}if(!hf(n))return{content:{message:"No workspaces found.",data:[]}};const i=n.length===e.limit,o=await H_(this.mondayApi),r=n.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:o&&e.id?W_(o,e.id):void 0})));return{content:{message:"Workspaces retrieved",...i?{next_page:e.page+1}:{},data:r}}}},class extends ee{constructor(){super(...arguments),this.name="create_doc",this.type=_.WRITE,this.annotations=Z({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 Ef}async executeInternal(e){const t=If.safeParse({...e,type:e.location});if(!t.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const a=t.data;try{let t,n,i;if(a.type===vf.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||eo.Public,folder_id:a.folder_id?.toString()}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}},r=await this.mondayApi.request(gf,o);t=r?.create_doc?.id??void 0,n=r?.create_doc?.object_id??void 0,i=r?.create_doc?.url??void 0}else if(a.type===vf.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(ff,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===oh.Doc));let l=a.column_id;if(!l)if(p)l=p.id;else{const e={boardId:d.toString(),columnType:oh.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(rc,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(gf,c);if(t=m.create_doc?.id??void 0,n=m.create_doc?.object_id??void 0,i=m.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(yf,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(bf,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},...n&&{object_id:n}},{content:{message:"Document successfully created",doc_id:t,object_id:n,doc_url:i,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 ee{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=_.WRITE,this.annotations=Z({title:"Add Content to Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add markdown content to an existing monday.com document.\n\nIDENTIFICATION: Provide either doc_id or object_id to identify the document:\n- doc_id: The document ID (the id field returned by read_docs). Takes priority if both provided.\n- object_id: The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id.\n\nUSAGE EXAMPLES:\n- By doc_id: { doc_id: "123", markdown: "# New Section\\nContent here" }\n- By object_id: { object_id: "456", markdown: "# New Section\\nContent here" }\n- Insert after block: { doc_id: "123", markdown: "Inserted content", after_block_id: "block_789" }'}getInputSchema(){return Sf}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};try{let t=null;if(e.doc_id){const a=await this.mondayApi.request(Af,{docId:e.doc_id});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(wf,{objectId:e.object_id});t=a.docs?.[0]??null}if(!t){return{content:`Error: No document found for ${e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`}.`}}this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t.id,...e.object_id&&{object_id:e.object_id}};const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},n=await this.mondayApi.request(Tf,a);if(!n?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:i,block_ids:o,error:r}=n.add_content_to_doc_from_markdown;if(!i)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 ee{constructor(){super(...arguments),this.name="update_doc",this.type=_.WRITE,this.annotations=Z({title:"Update Document",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Update an existing monday.com document. Provide doc_id (preferred) or object_id, plus an ordered operations array (executed sequentially, stops on first failure).\n\nOPERATIONS:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (or insert after a block). Best for text, headings, lists, simple tables — no block IDs needed.\n- update_block: Update content of an existing text, code, or list_item block in-place.\n- create_block: Create a new block at a precise position. Use parent_block_id to nest inside notice_box, table cell, or layout cell.\n- delete_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 sg}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};this.sessionContext.metadata={...this.sessionContext.metadata,operation_types:e.operations?.map((e=>e.operation_type)),operation_count:e.operations?.length??0,...e.object_id&&{object_id:e.object_id}};try{let t=e.doc_id;if(!t){const a=await this.mondayApi.request(J_,{objectId:e.object_id}),n=a.docs?.[0];if(!n)return{content:`Error: No document found for object_id ${e.object_id}.`};t=n.id}const a=[];let n=null;for(let i=0;i<e.operations.length;i++){const o=e.operations[i];try{const n=await this.executeOperation(t,o,e.object_id);a.push(`- [OK] ${o.operation_type}${n?`: ${n}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";a.push(`- [FAILED] ${o.operation_type}: ${t}`),n=i;break}}const i=null!==n?n:e.operations.length,o=e.operations.length,r=`Completed ${i}/${o} operation${1===o?"":"s"} on doc ${t}.`;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t},{content:`${r}\n\nResults:\n${a.join("\n")}\n\nDoc ID: ${t}`}}catch(e){return{content:`Error: ${e instanceof Error?e.message:String(e)}`}}}async executeOperation(e,t,a){switch(t.operation_type){case"set_name":return this.executeSetName(e,t.name);case"add_markdown_content":return this.executeAddMarkdown(e,t.markdown,t.after_block_id);case"update_block":return this.executeUpdateBlock(t.block_id,t.content);case"create_block":return this.executeCreateBlock(e,t.block,t.after_block_id,t.parent_block_id);case"delete_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},n=await this.mondayApi.request(Q_,a);if(!n?.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 n={docId:e,markdown:t,afterBlockId:a},i=await this.mondayApi.request(z_,n),o=i?.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:Cf(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:Cf(e.delta_format),language:e.language};case"list_item":return{deltaFormat:Cf(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),n={blockId:e,content:JSON.stringify(a)},i=await this.mondayApi.request(X_,n);if(!i?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,n){const i=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:Rf(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:Nf(e.alignment),direction:Df(e.direction)}};case"list_item":return{list_block:{delta_format:Rf(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:Rf(e.delta_format),text_block_type:Dd.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(n){const e=Object.keys(i);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=i[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=n}const o={docId:e,afterBlockId:a,blocksInput:[i]},r=await this.mondayApi.request(rf,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(Z_,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(ef,t);if(!a?.delete_doc_blocks||0===a.delete_doc_blocks.length)throw new Error("No response from delete_doc_blocks");const n=a.delete_doc_blocks.map((e=>e.id)).join(", ");return`${a.delete_doc_blocks.length} block(s) deleted (IDs: ${n})`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(tf,{docId:e}),n=a.docs?.[0];if(!n?.object_id)throw new Error(`Could not resolve object_id for doc ${e}`);return n.object_id}async resolveDocItemId(e){const t=await this.mondayApi.request(af,{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(nf,{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,n,i,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(i){const e=JSON.parse(i),t=Dh.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:n?.toString(),mentionsList:c},u=await this.mondayApi.request(of,m);if(!u.create_update?.id)throw new Error("Failed to create comment: no update returned");const h=u.create_update.id,_=Number(h),f=n?`Reply to update ${n}`:"Comment";if(d.length>0){if(Number.isNaN(_))throw new Error(`${f} 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 n=t.find((e=>e.id===a));if(!n)throw new Error(`${f} created (update ID: ${h}) but block annotation failed: block ${a} not found in doc ${e}`);const i=n.content.deltaFormat;if(!i)throw new Error(`${f} 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 i)o+="string"==typeof e.insert?e.insert.length:1;if(0===o)throw new Error(`${f} 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(`${f} 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=Lf(i,_,d,p)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`${f} created (update ID: ${h}) but delta annotation failed for block ${a}: ${t}`)}const c={...n.content,deltaFormat:l},m=await this.mondayApi.request(X_,{blockId:a,content:JSON.stringify(c)});if(!m?.update_doc_block)throw new Error(`${f} created (update ID: ${h}) but block annotation write returned no confirmation for block ${a}`)}}const g=d.length;return`${f} created${g>1?` across ${g} blocks`:1===g?" on block":""} (update ID: ${h})`}async executeReplaceBlock(e,t,a,n,i){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,n,i)}`}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 ee{constructor(){super(...arguments),this.name="update_workspace",this.type=_.WRITE,this.annotations=Z({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return hg}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(ug,t),n=await H_(this.mondayApi),i=n?W_(n,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:i}}}},class extends ee{constructor(){super(...arguments),this.name="update_folder",this.type=_.WRITE,this.annotations=Z({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return fg}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:n}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const i={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:t?{is_after:n,object_id:t,object_type:a}:void 0},o=await this.mondayApi.request(_g,i);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends ee{constructor(){super(...arguments),this.name="create_workspace",this.type=_.WRITE,this.annotations=Z({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return bg}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(gg,t),n=await H_(this.mondayApi),i=n&&a.create_workspace?.id?W_(n,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:i}}}},class extends ee{constructor(){super(...arguments),this.name="create_folder",this.type=_.WRITE,this.annotations=Z({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return vg}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(yg,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 ee{constructor(){super(...arguments),this.name="move_object",this.type=_.WRITE,this.annotations=Z({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 Tg}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const d={folderId:t,position:a?{is_after:i,object_id:a,object_type:n}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},p=await this.mondayApi.request(_g,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:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const d={boardId:t,attributes:{position:a?{is_after:i,object_id:a,object_type:n}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(Ig,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:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const d={overviewId:t,attributes:{position:a?{is_after:i,object_id:a,object_type:n}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(Eg,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 Cs.Folder:return this.executeUpdateFolder(e);case Cs.Board:return this.executeUpdateBoardHierarchy(e);case Cs.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends ee{constructor(){super(...arguments),this.name="create_dashboard",this.type=_.WRITE,this.annotations=Z({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 cg}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(dg,t);if(!a.create_dashboard)throw new wc("Failed to create dashboard",Ec);const n=a.create_dashboard;return{content:{message:`Dashboard ${n.id} successfully created`,dashboard_id:n.id,dashboard_name:n.name}}}catch(e){Ac(e,"create dashboard")}}},class extends ee{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=_.READ,this.annotations=Z({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(pg,e);if(!t.all_widgets_schema||0===t.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const a={};let n=0;for(const e of t.all_widgets_schema)if(e?.widget_type&&e?.schema){const t="string"==typeof e.schema?JSON.parse(e.schema):e.schema,i=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:i,schema:e.schema},n++}if(0===n)throw new Error("No valid widget schemas found in API response");Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:a,url:g_}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends ee{constructor(){super(...arguments),this.name="create_widget",this.type=_.WRITE,this.annotations=Z({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 mg}async executeInternal(e){if(!e.settings)throw new wc("You must pass the settings parameter",Tc);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(lg,t);if(!a.create_widget)throw new wc("Failed to create widget",Ec);const n=a.create_widget;n.parent?.kind===bp.Dashboard?n.parent.id:n.parent;return{content:{message:`Widget ${n.id} created`,widget_id:n.id,widget_name:n.name,dashboard_id:n.parent?.id}}}catch(t){Ac(t,`create ${e.widget_kind} widget`)}}},class extends ee{constructor(){super(...arguments),this.name="board_insights",this.type=_.READ,this.annotations=Z({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 Og}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};if(e.aggregations.some((e=>!e.columnId&&e.function!==Ii.CountItems)))return{content:`Every aggregation must have a "columnId", except the ${Ii.CountItems} function.`};const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],n=new Set(e.aggregations.filter((e=>e.function===Ii.Label)).map((e=>e.columnId))),i=e.groupBy?.filter((e=>!n.has(e))).map((e=>({function:Ii.Label,columnId:e})))??[],o=e.aggregations.concat(i).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 Ng.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:vi.Function,function:(n=e.function,i=e.columnId,{function:n,params:n===Ii.CountItems?[]:[{type:vi.Column,column:Dg(i),as:i}]}),as:s}}var n,i;const o={type:vi.Column,column:Dg(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:vi.Column,column:Dg(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),n=function(e){if(!e.filters&&!e.orderBy)return;const t={};return e.filters&&(t.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),t.operator=e.filtersOperator),e.orderBy&&(t.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),t}(e),i=function(e){return{id:e.boardId.toString(),type:mi.Table}}(e),o={query:{from:i,query:n,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(wg,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const n=e.value;if(!n)return void(t[a]=null);const i=n.result??n.value??null;t[a]=i})),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 ee{constructor(){super(...arguments),this.name="search",this.type=_.READ,this.annotations=Z({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Search within monday.com platform. Supported searchType values: ${l_}.\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 Yg}async executeInternal(e){const{searchTerm:t}=e;if(!t)throw new wc("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).",Tc);try{if(e.searchType===p_.FOLDERS){const{results:a,truncated:n}=await this.searchFoldersAsync(e,t);return{content:{message:n?"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 Sc(e),e}}async runSmartSearchAsync(e,t){const a=jg(e.workspaceIds?.map((e=>e.toString())));if(e.searchType===p_.BOARD){const n=jg(e.boardIds?.map((e=>e.toString())));return this.searchBoardsAsync(t,e.limit,a,n)}if(e.searchType===p_.DOCUMENTS){const n=jg(e.docIds?.map((e=>e.toString())));return this.searchDocsAsync(t,e.limit,a,n)}if(e.searchType===p_.WORKSPACES)return this.searchWorkspacesAsync(t,e.limit);if(e.searchType===p_.UPDATES){const n=jg(e.boardIds?.map((e=>e.toString()))),i=jg(e.creatorIds?.map((e=>e.toString())));return this.searchUpdatesAsync(t,e.limit,a,n,i)}if(e.searchType===p_.ITEMS){const n=jg(e.boardIds?.map((e=>e.toString()))),i=jg(e.creatorIds?.map((e=>e.toString())));return this.searchItemsAsync(t,e.limit,a,n,i)}if(e.searchType===p_.TIMELINE_ITEMS){const n=jg(e.boardIds?.map((e=>e.toString())));return this.searchTimelineItemsAsync(t,e.limit,a,n)}if(e.searchType===p_.DASHBOARDS){const n=e.creatorIds?.map((e=>e.toString()));return this.searchOverviewsAsync(t,e.limit,a,n)}throw new wc(`Unsupported search type for smart search: ${e.searchType}`,yc)}async searchBoardsAsync(e,t,a,n){const i={query:e,limit:t,workspaceIds:a,boardIds:n};return(await this.mondayApi.request(kg,i,{timeout:Pc})).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,n){const i={query:e,limit:t,workspaceIds:a,docIds:n};return(await this.mondayApi.request(Lg,i,{timeout:Pc})).search.docs.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0,highlights:Gg(e.indexed_data.highlights)})))}async searchWorkspacesAsync(e,t){const a={query:e,limit:t};return(await this.mondayApi.request(Ug,a,{timeout:Pc})).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,n,i){const o={query:e,limit:t,workspaceIds:a,boardIds:n,creatorIds:i};return(await this.mondayApi.request(Pg,o,{timeout:Pc})).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,n,i){return(i?await this.mondayApi.request(xg,{query:e,limit:t,workspaceIds:a,boardIds:n,creatorIds:i},{versionOverride:"dev",timeout:Pc}):await this.mondayApi.request(Cg,{query:e,limit:t,workspaceIds:a,boardIds:n},{timeout:Pc})).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,n){const i={query:e,limit:t,workspaceIds:a,boardIds:n};return(await this.mondayApi.request($g,i,{timeout:Pc})).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,n){const i={query:e,limit:t,workspaceIds:a,creatorIds:n};return(await this.mondayApi.request(Mg,i,{versionOverride:"dev",timeout:Pc})).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=Vg(t);if(!a)return{results:[],truncated:!1};const n={page:1,limit:100,workspace_ids:jg(e.workspaceIds?.map((e=>e.toString())))},i=(await this.mondayApi.request(Rg,n)).folders||[];return{results:i.filter((e=>e?.name&&Vg(e.name).includes(a))).filter((e=>e?.id)).slice(0,e.limit).map((e=>({id:e.id,title:e.name}))),truncated:100===i.length}}},class extends ee{constructor(){super(...arguments),this.name="get_user_context",this.type=_.READ,this.annotations=Z({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(ab,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};const n=await this.fetchFavorites(t||[]),i=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:n,relevantBoards:i,relevantDocs:o,relevantPeople:r}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const n={};for(const e of a)n[ib[e]]=t[e];const i=await this.mondayApi.request(nb,n),o=[];for(const e of a){const t=ob[e];for(const a of i[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 ee{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=_.WRITE,this.annotations=Z({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(Jg,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends ee{constructor(){super(...arguments),this.name="get_assets",this.type=_.READ,this.annotations=Z({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 tb}async executeInternal(e){const t=await this.mondayApi.request(eb,{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 ee{constructor(){super(...arguments),this.name="create_view",this.type=_.WRITE,this.annotations=Z({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 "${om.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 bm}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(gm,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 ee{constructor(){super(...arguments),this.name="update_view",this.type=_.WRITE,this.annotations=Z({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 "${om.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 vm}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(ym,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 ee{constructor(){super(...arguments),this.name="create_view_table",this.type=_.WRITE,this.annotations=Z({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 "${om.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 wm}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(Im,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 ee{constructor(){super(...arguments),this.name="update_view_table",this.type=_.WRITE,this.annotations=Z({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 "${om.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 Dm}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(Am,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 ee{constructor(){super(...arguments),this.name="undo_action",this.type=_.WRITE,this.annotations=Z({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 sb}async executeInternal(e){return await this.mondayApi.request(rb,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}},class extends ee{constructor(){super(...arguments),this.name="get_object_schemas",this.type=_.READ,this.annotations=Z({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 Yc}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(Wc,t)).get_object_schemas??[];return{content:{message:`Retrieved ${a.length} object schema(s)`,schemas:a}}}},class extends ee{constructor(){super(...arguments),this.name="create_object_schema",this.type=_.WRITE,this.annotations=Z({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 Qc}async executeInternal(e){const t={name:e.name,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(Kc,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 ee{constructor(){super(...arguments),this.name="update_object_schema",this.type=_.WRITE,this.annotations=Z({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 Jc}async executeInternal(e){const t={id:e.id,revision:e.revision,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(zc,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 ee{constructor(){super(...arguments),this.name="delete_object_schema",this.type=_.WRITE,this.annotations=Z({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 Zc}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(Xc,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 ee{constructor(){super(...arguments),this.name="delete_object_schema_columns",this.type=_.WRITE,this.annotations=Z({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 tm}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(em,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 ee{constructor(){super(...arguments),this.name="manage_object_schema_board_connection",this.type=_.WRITE,this.annotations=Z({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 im}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(am,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(nm,t)).detach_boards_from_object_schema??[],n=a.filter((e=>e.success)).length,i=a.filter((e=>!e.success));return{content:{message:`${n} board(s) successfully detached`,results:a,...i.length>0&&{failures:i}}}}}},class extends ee{constructor(){super(...arguments),this.name="manage_object_schema_columns",this.type=_.WRITE,this.annotations=Z({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 "${om.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 cm}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},n=await this.mondayApi.request(rm,a);return{content:{message:`Columns successfully added to object schema "${n.create_object_schema_columns?.name}"`,schema_id:n.create_object_schema_columns?.id,schema_name:n.create_object_schema_columns?.name,revision:n.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(sm,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 ee{constructor(){super(...arguments),this.name="set_object_schema_column_active_state",this.type=_.WRITE,this.annotations=Z({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 um}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={deactivate:ko.Deactivate,reactivate:ko.Reactivate},a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnId:e.columnId,action:t[e.action]},n=await this.mondayApi.request(mm,a);return{content:{message:`Column successfully ${e.action}d on object schema "${n.set_object_schema_column_active_state?.name}"`,schema_id:n.set_object_schema_column_active_state?.id,schema_name:n.set_object_schema_column_active_state?.name,revision:n.set_object_schema_column_active_state?.revision}}}},class extends ee{constructor(){super(...arguments),this.name="get_asset_upload_url",this.type=_.WRITE,this.annotations=Z({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 pb}async executeInternal(e){const t=(await this.mondayApi.request(db,{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 ee{constructor(){super(...arguments),this.name="finalize_asset_upload",this.type=_.WRITE,this.annotations=Z({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 mb}async executeInternal(e){const t=(await this.mondayApi.request(lb,{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(cb,{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 ee{constructor(){super(...arguments),this.name="link_board_items_workflow",this.type=_.READ,this.annotations=Z({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 hb}async executeInternal(e){return{content:ub}}},class extends ee{constructor(){super(...arguments),this.name="fetch_file_content",this.type=_.READ,this.annotations=Z({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.\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 wb}async executeInternal(e){const{item_id:t,column_id:a,file_name:n,offset:i=0}=e,o=await this.mondayApi.request(_b,{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.`}};return{content:{files:await Promise.all(r.map((e=>Nb(e,i,n))))}}}},class extends ee{constructor(){super(...arguments),this.name="manage_agent",this.type=_.WRITE,this.annotations=Z({title:"Manage monday Platform Agent",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Full lifecycle management for monday platform agents — create, read, update, delete, change state, and run.\n\nmonday platform agents are user-built work orchestrators on monday.com — each has a profile (name, role, avatar), a goal, and a markdown execution plan. Agents in state ACTIVE can be triggered automatically. They are NOT local LangChain or MCP agents.\n\nACTIONS (only pass fields that apply to the chosen action):\n- create: { action:"create", prompt, agent_model? } — AI-generated agent. Platform creates profile, goal, and plan from the prompt.\n- create_blank: { action:"create_blank", name?, role?, role_description?, avatar_url?, gender?, background_color?, user_prompt? } — manually defined agent.\n- get one: { action:"get", agent_id }\n- list owned: { action:"get" }\n- update: { action:"update", agent_id, name?, role?, role_description?, plan?, agent_model? }\n- delete: { action:"delete", agent_id }\n- activate: { action:"activate", agent_id }\n- deactivate: { action:"deactivate", agent_id }\n- run: { action:"run", agent_id }\n\nRULES:\n- "create_blank" with no fields creates a nameless blank agent — only do this intentionally.\n- "update" requires at least one of name/role/role_description/plan/agent_model.\n- "update", "delete", "activate", "deactivate", "run" all require "agent_id".\n- Created agents start INACTIVE. Follow with action:"activate" using the returned agent_id before they can be triggered.\n- ⚠️ DESTRUCTIVE — "delete" is permanent and irreversible. When the user refers to an agent by name, ALWAYS call action:"get" first to confirm the correct agent_id before deleting.\n- "run" is fire-and-forget. Returns trigger_uuid — no run-status query exists, treat successful enqueue as the only signal.\n- Agent state is one of ACTIVE, INACTIVE, ARCHIVED, or FAILED. DELETED only appears as the return value of action:"delete".\n\nUSAGE EXAMPLES:\n- AI create: { "action": "create", "prompt": "Run my daily standup every weekday at 9am." }\n- Manual create:{ "action": "create_blank", "name": "Standup Bot", "role": "Project Manager", "gender": "female" }\n- Fetch one: { "action": "get", "agent_id": "42" }\n- List mine: { "action": "get" }\n- Rename: { "action": "update", "agent_id": "7", "name": "New Name" }\n- Activate: { "action": "activate", "agent_id": "7" }\n- Deactivate: { "action": "deactivate", "agent_id": "7" }\n- Run: { "action": "run", "agent_id": "7" }\n- Delete: { "action": "delete", "agent_id": "7" }\n\nRELATED TOOLS:\n- agent_catalog — browse available trigger types and skills before wiring them to an agent\n- manage_agent_triggers — manage which triggers fire this agent automatically\n- manage_agent_skills — manage which skills this agent can perform\n- manage_agent_knowledge — manage which boards/docs this agent has access to'}getInputSchema(){return Yw}async executeInternal(e){switch(e.action){case"create":return this.handleCreate(e);case"create_blank":return this.handleCreateBlank(e);case"get":return this.handleGet(e);case"update":return this.handleUpdate(e);case"delete":return this.handleDelete(e);case"activate":return this.handleActivate(e);case"deactivate":return this.handleDeactivate(e);case"run":return this.handleRun(e)}}async handleCreate(e){if(!e.prompt)throw new Error('manage_agent action:"create" requires "prompt". For a manually configured agent, use action:"create_blank".');try{const t={input:{prompt:e.prompt,agent_model:e.agent_model}},a=await this.mondayApi.request(kw,t,{versionOverride:"dev"});if(!a.create_agent?.id)throw new Error("monday platform agent creation returned no id");return{content:{message:`monday platform agent ${a.create_agent.id} created in state INACTIVE — call manage_agent with action:"activate" and agent_id:"${a.create_agent.id}" to activate it`,agent:a.create_agent}}}catch(e){Ac(e,"create monday platform agent")}}async handleCreateBlank(e){try{const t={};void 0!==e.name&&(t.name=e.name),void 0!==e.role&&(t.role=e.role),void 0!==e.role_description&&(t.role_description=e.role_description),void 0!==e.avatar_url&&(t.avatar_url=e.avatar_url),void 0!==e.gender&&(t.gender=e.gender),void 0!==e.background_color&&(t.background_color=e.background_color),void 0!==e.user_prompt&&(t.user_prompt=e.user_prompt);const a={input:t},n=await this.mondayApi.request(Lw,a,{versionOverride:"dev"});if(!n.create_blank_agent?.id)throw new Error("monday platform agent creation returned no id");return{content:{message:`monday platform agent ${n.create_blank_agent.id} created in state INACTIVE — call manage_agent with action:"activate" and agent_id:"${n.create_blank_agent.id}" to activate it`,agent:n.create_blank_agent}}}catch(e){Ac(e,"create blank monday platform agent")}}async handleGet(e){if(void 0!==e.agent_id)try{const{custom_agents:t}=await this.mondayApi.request(Cw,{ids:[e.agent_id]},{versionOverride:"dev"}),a=t?.[0];return a?{content:{message:"monday platform agent",agent:a}}:{content:`monday platform agent ${e.agent_id} not found, or the authenticated user does not have access to it.`}}catch(e){Ac(e,"get monday platform agent")}try{const{custom_agents:e}=await this.mondayApi.request(Cw,{limit:100},{versionOverride:"dev"}),t=e??[];return{content:{message:"monday platform agents owned by the authenticated user (limited to 100 — ask the user if they need more)",count:t.length,agents:t}}}catch(e){Ac(e,"list monday platform agents")}}async handleUpdate(e){if(!e.agent_id)throw new Error('manage_agent action:"update" requires "agent_id".');try{const t={};if(void 0!==e.name&&(t.name=e.name),void 0!==e.role&&(t.role=e.role),void 0!==e.role_description&&(t.role_description=e.role_description),void 0!==e.plan&&(t.plan=e.plan),void 0!==e.agent_model&&(t.agent_model=e.agent_model),0===Object.keys(t).length)throw new Error('manage_agent action:"update" requires at least one of: name, role, role_description, plan, agent_model.');const a={id:e.agent_id,input:t},n=await this.mondayApi.request(Uw,a,{versionOverride:"dev"});if(!n.update_agent)throw new Error("update_agent returned no data — the agent may not exist");return{content:{message:"monday platform agent updated",agent:n.update_agent}}}catch(e){Ac(e,"update monday platform agent")}}async handleDelete(e){if(!e.agent_id)throw new Error('manage_agent action:"delete" requires "agent_id".');try{const t={id:e.agent_id},a=await this.mondayApi.request(Pw,t,{versionOverride:"dev"});if(!a.delete_agent?.id)throw new Error("monday platform agent delete returned no id");return{content:{message:`monday platform agent ${a.delete_agent.id} deleted`,agent:a.delete_agent}}}catch(e){Ac(e,"delete monday platform agent")}}async handleActivate(e){if(!e.agent_id)throw new Error('manage_agent action:"activate" requires "agent_id".');try{const t=await this.mondayApi.request($w,{id:e.agent_id},{versionOverride:"dev"});return{content:{message:"Agent activated.",success:t.activate_agent?.success??!1}}}catch(e){Ac(e,"activate monday platform agent")}}async handleDeactivate(e){if(!e.agent_id)throw new Error('manage_agent action:"deactivate" requires "agent_id".');try{const t={id:e.agent_id,inactive_reason:CI.DeactivatedByUser},a=await this.mondayApi.request(xw,t,{versionOverride:"dev"});return{content:{message:"Agent deactivated.",success:a.deactivate_agent?.success??!1}}}catch(e){Ac(e,"deactivate monday platform agent")}}async handleRun(e){if(!e.agent_id)throw new Error('manage_agent action:"run" requires "agent_id".');try{const t=await this.mondayApi.request(Mw,{id:e.agent_id},{versionOverride:"dev"});if(!t.run_agent)throw new Error("run_agent returned no data — the agent run may not have been enqueued");return{content:{message:"Agent run enqueued.",trigger_uuid:t.run_agent.trigger_uuid}}}catch(e){Ac(e,"run monday platform agent")}}},class extends ee{constructor(){super(...arguments),this.name="manage_agent_triggers",this.type=_.WRITE,this.annotations=Z({title:"Manage monday Platform Agent Triggers",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Manage the triggers attached to a monday platform agent — triggers define WHEN the agent runs automatically.\n\nACTIONS:\n- list: { agent_id } — returns active triggers with node_id, block_reference_id, name, field_summary.\n- add: { agent_id, block_reference_id, field_values? } — attaches a trigger type to the agent.\n- remove: { agent_id, node_id } — detaches a trigger instance by node_id (NOT block_reference_id).\n\nWORKFLOW — add a trigger:\n1. Call agent_catalog action:"list_triggers" — note block_reference_id, field_schemas, and required_fields.\n2. Collect required field values from the user (e.g. board_id, column_id).\n3. Call this tool action:"add" with block_reference_id and field_values.\nNote: add returns only { success } — no node_id for the new instance. Call action:"list" afterward if you need the node_id.\n\nWORKFLOW — remove a trigger:\n1. Call action:"list" to see active triggers and note the node_id of the instance to remove.\n2. Call action:"remove" with that node_id.\n\nNOTE: Only triggers that can be added programmatically appear in the catalog. OAuth/3rd-party triggers (Slack, Gmail, Salesforce, etc.)\nrequire user setup in the monday.com UI — they will not appear in agent_catalog and cannot be managed here.\n\nUSAGE EXAMPLES:\n- List triggers: { "action": "list", "agent_id": "7" }\n- Add trigger: { "action": "add", "agent_id": "7", "block_reference_id": "status-change-ref", "field_values": { "board_id": "42" } }\n- Remove trigger: { "action": "remove", "agent_id": "7", "node_id": "node-abc" }\n\nRELATED TOOLS:\n- agent_catalog action:"list_triggers" — discover available trigger types and their required field_values before calling action:"add" here\n- manage_agent_skills — manage which skills this agent can perform\n- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)'}getInputSchema(){return Kw}async executeInternal(e){switch(e.action){case"list":return this.handleList(e);case"add":return this.handleAdd(e);case"remove":return this.handleRemove(e)}}async handleList(e){try{const t={agent_id:e.agent_id},a=(await this.mondayApi.request(Vw,t,{versionOverride:"dev"})).agent_active_triggers??[];return{content:{message:'Active triggers on this agent. Use node_id with action:"remove" to detach a trigger.',count:a.length,triggers:a}}}catch(e){Ac(e,"list active triggers for monday platform agent")}}async handleAdd(e){if(!e.block_reference_id)throw new Error('block_reference_id is required for action:"add". Call agent_catalog action:"list_triggers" first to find the block_reference_id.');try{const t={agent_id:e.agent_id,block_reference_id:e.block_reference_id,field_values:e.field_values},a=await this.mondayApi.request(Fw,t,{versionOverride:"dev"});return{content:{message:'Trigger added to agent. Call action:"list" to verify and retrieve the node_id.',success:a.add_trigger_to_agent?.success??!1}}}catch(e){Ac(e,"add trigger to monday platform agent")}}async handleRemove(e){if(!e.node_id)throw new Error('node_id is required for action:"remove". Call action:"list" first to get node_id values.');try{const t={agent_id:e.agent_id,node_id:e.node_id},a=await this.mondayApi.request(Bw,t,{versionOverride:"dev"});return{content:{message:"Trigger removed from agent.",success:a.remove_trigger_from_agent?.success??!1}}}catch(e){Ac(e,"remove trigger from monday platform agent")}}},class extends ee{constructor(){super(...arguments),this.name="manage_agent_skills",this.type=_.WRITE,this.annotations=Z({title:"Manage monday Platform Agent Skills",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Manage the full skill lifecycle for monday platform agents — create new skills in the catalog, attach skills to an agent, or detach them.\n\nSkills extend what an agent can do (e.g. sending emails, querying databases, posting to Slack).\n\nACTIONS:\n- create: { name, content, description? } — creates a new custom skill in the account-wide catalog.\n The skill becomes available to all agents in the account.\n- add: { agent_id, skill_id } — attaches a skill to this agent.\n- remove: { agent_id, skill_id } — detaches a skill from this agent.\n\nWORKFLOW — attach an existing skill:\n1. Call agent_catalog action:"list_skills" — find the skill_id of the skill to attach.\n2. Call this tool action:"add" with agent_id and that skill_id.\n\nWORKFLOW — create a new skill and attach it:\n1. Call this tool action:"create" with name and content — note the returned id.\n2. Call this tool action:"add" with agent_id and that id directly (no catalog lookup needed).\n\nNOTE: There is no action to list which skills are currently attached to a specific agent — the platform does not yet expose that query.\nTo browse all skills available in the account catalog, use agent_catalog action:"list_skills".\n\nUSAGE EXAMPLES:\n- Create a skill: { "action": "create", "name": "Send Slack Message", "content": "## Instructions\\nPost a message to a Slack channel.", "description": "Sends a message to Slack" }\n- Add a skill: { "action": "add", "agent_id": "7", "skill_id": "skill-abc-123" }\n- Remove a skill: { "action": "remove", "agent_id": "7", "skill_id": "skill-abc-123" }\n\nRELATED TOOLS:\n- agent_catalog action:"list_skills" — browse existing skills to find a skill_id before calling action:"add"\n- manage_agent_triggers — manage which triggers fire this agent automatically\n- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)'}getInputSchema(){return Qw}async executeInternal(e){switch(e.action){case"create":return this.handleCreate(e);case"add":return this.handleAdd(e);case"remove":return this.handleRemove(e)}}async handleCreate(e){if(!e.name||!e.content)throw new Error('action:"create" requires both "name" and "content".');try{const t={name:e.name,content:e.content,description:e.description},a=await this.mondayApi.request(Ww,t,{versionOverride:"dev"});if(!a.create_agent_skill)throw new Error("create_agent_skill returned no data");return{content:{message:'Skill created and added to the account catalog. Use the returned id with action:"add" to attach it to an agent.',skill:a.create_agent_skill}}}catch(e){Ac(e,"create monday platform agent skill")}}async handleAdd(e){if(!e.agent_id)throw new Error('agent_id is required for action:"add".');if(!e.skill_id)throw new Error('skill_id is required for action:"add". Get it from agent_catalog action:"list_skills" or from action:"create" in this tool.');try{const t={agent_id:e.agent_id,skill_id:e.skill_id},a=await this.mondayApi.request(qw,t,{versionOverride:"dev"});return{content:{message:"Skill added to agent.",success:a.add_skill_to_agent?.success??!1}}}catch(e){Ac(e,"add skill to monday platform agent")}}async handleRemove(e){if(!e.agent_id)throw new Error('agent_id is required for action:"remove".');if(!e.skill_id)throw new Error('skill_id is required for action:"remove".');try{const t={agent_id:e.agent_id,skill_id:e.skill_id},a=await this.mondayApi.request(jw,t,{versionOverride:"dev"});return{content:{message:"Skill removed from agent.",success:a.remove_skill_from_agent?.success??!1}}}catch(e){Ac(e,"remove skill from monday platform agent")}}},class extends ee{constructor(){super(...arguments),this.name="manage_agent_knowledge",this.type=_.WRITE,this.annotations=Z({title:"Manage monday Platform Agent Knowledge",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'List, grant, update, or revoke a monday platform agent\'s access to boards and docs.\n\nAn agent\'s "knowledge" is the set of monday.com boards and docs it can read from or write to during a run.\n\n- list: Returns all resources the agent currently has access to, including permission level and resource type.\n- add: Grants the agent access to a board or doc with the specified permission level.\n- update: Changes the permission level on a resource the agent already has access to. Call action:"list" first to confirm the resource_id exists.\n- remove: Revokes the agent\'s access to a board or doc entirely. Call action:"list" first to confirm the resource_id exists.\n\nPermission types:\n- READ: Agent can read data from the resource.\n- READ_WRITE: Agent can read and write data to the resource.\n\nUSAGE EXAMPLES:\n- List: { "action": "list", "agent_id": "7" }\n- Add board access: { "action": "add", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD", "permission_type": "READ" }\n- Update to read-write: { "action": "update", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD", "permission_type": "READ_WRITE" }\n- Remove access: { "action": "remove", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD" }\n\nRELATED TOOLS:\n- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)\n- manage_agent_triggers — manage which triggers fire this agent automatically\n- manage_agent_skills — manage which skills this agent can perform'}getInputSchema(){return eA}async executeInternal(e){switch(e.action){case"list":return this.handleList(e);case"add":return this.handleAdd(e);case"update":return this.handleUpdate(e);case"remove":return this.handleRemove(e)}}async handleList(e){try{const t=(await this.mondayApi.request(zw,{id:e.agent_id},{versionOverride:"dev"})).agent_knowledge??{resources:[],files:[]};return{content:{message:"Current agent resource access.",count:t.resources?.length??0,knowledge:t}}}catch(e){Ac(e,"list agent knowledge for monday platform agent")}}async handleAdd(e){if(!e.resource_id||!e.scope_type||!e.permission_type)throw new Error("resource_id, scope_type, and permission_type are required for action:add");try{const t=await this.mondayApi.request(Jw,{id:e.agent_id,resource_id:e.resource_id,scope_type:e.scope_type,permission_type:e.permission_type},{versionOverride:"dev"});return{content:{message:"Resource access granted to agent.",success:t.add_agent_resource_access?.success??!1}}}catch(e){Ac(e,"add agent resource access for monday platform agent")}}async handleUpdate(e){if(!e.resource_id||!e.scope_type||!e.permission_type)throw new Error("resource_id, scope_type, and permission_type are required for action:update");try{const t=await this.mondayApi.request(Zw,{id:e.agent_id,resource_id:e.resource_id,scope_type:e.scope_type,permission_type:e.permission_type},{versionOverride:"dev"});return{content:{message:"Resource access updated.",success:t.update_agent_resource_access?.success??!1}}}catch(e){Ac(e,"update agent resource access for monday platform agent")}}async handleRemove(e){if(!e.resource_id||!e.scope_type)throw new Error("resource_id and scope_type are required for action:remove");try{const t=await this.mondayApi.request(Xw,{id:e.agent_id,resource_id:e.resource_id,scope_type:e.scope_type},{versionOverride:"dev"});return{content:{message:"Resource access removed from agent.",success:t.remove_agent_resource_access?.success??!1}}}catch(e){Ac(e,"remove agent resource access for monday platform agent")}}},class extends ee{constructor(){super(...arguments),this.name="agent_catalog",this.type=_.READ,this.annotations=Z({title:"monday Platform Agent Catalog",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Browse the account-wide catalog of available trigger types and skills for monday platform agents. READ-ONLY — no agent_id required.\n\nUse this tool to discover what\'s available BEFORE wiring anything to a specific agent.\n\nACTIONS:\n- list_triggers: { block_reference_ids? } — returns available trigger types.\n Each entry has block_reference_id (required for manage_agent_triggers action:"add"), name, description,\n field_schemas (describes field_values shape), and required_fields (fields to collect from the user).\n Note: only triggers that can be added programmatically appear here. OAuth/3rd-party triggers (Slack, Gmail, Salesforce, etc.)\n require user setup in the monday.com UI and will not appear here.\n\n- list_skills: {} — returns available skills with id, name, description.\n Never guess or invent a skill id — always look it up here before calling manage_agent_skills action:"add".\n\nUSAGE EXAMPLES:\n- List all trigger types: { "action": "list_triggers" }\n- Fetch specific trigger: { "action": "list_triggers", "block_reference_ids": ["some-block-ref-id"] }\n- List all skills: { "action": "list_skills" }\n\nRELATED TOOLS:\n- manage_agent_triggers — use block_reference_id from list_triggers to attach a trigger to a specific agent\n- manage_agent_skills — use skill id from list_skills, or action:"create" to author a new skill, then attach to an agent\n- manage_agent — manage the agent entity itself (create, update, delete, activate, etc.)'}getInputSchema(){return tA}async executeInternal(e){switch(e.action){case"list_triggers":return this.handleListTriggers(e);case"list_skills":return this.handleListSkills()}}async handleListTriggers(e){try{const t={block_reference_ids:e.block_reference_ids},a=(await this.mondayApi.request(Gw,t,{versionOverride:"dev"})).agent_triggers_catalog??[];return{content:{message:'Available trigger types. Use block_reference_id and inspect field_schemas/required_fields before calling manage_agent_triggers action:"add".',count:a.length,triggers:a}}}catch(e){Ac(e,"fetch monday platform agent triggers catalog")}}async handleListSkills(){try{const e=(await this.mondayApi.request(Hw,{},{versionOverride:"dev"})).agent_skills_catalog??[];return{content:{message:'Available skills. Use id when calling manage_agent_skills action:"add".',count:e.length,skills:e}}}catch(e){Ac(e,"fetch monday platform agent skills catalog")}}},class extends ee{constructor(){super(...arguments),this.name="list_automations",this.type=_.READ,this.annotations=Z({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 oA}async executeInternal(e){try{const a=!e.cursor,n={boardIds:[e.boardId],limit:e.limit??100,includeLegacy:a,...e.cursor?{cursor:e.cursor}:{}},i=await this.mondayApi.request(aA,n),o=(i.board_automations?.items??[]).map(iA),r=i.board_automations?.cursor??null,s=a?(t=i.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){Ac(e,"list live workflows")}var t}},class extends ee{constructor(){super(...arguments),this.name="manage_automations",this.type=_.WRITE,this.annotations=Z({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 pA}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(rA,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){Ac(e,"activate workflow")}}async deactivateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(sA,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){Ac(e,"deactivate workflow")}}async deleteWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(dA,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){Ac(e,"delete workflow")}}},class extends ee{constructor(e,t,a){super(e,a),this.apiToken=t,this.name="create_automation",this.type=_.WRITE,this.annotations=Z({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 cA}async executeInternal(e){try{const a="function"==typeof this.apiToken?this.apiToken():this.apiToken,n=(t=this.context,t?.fetchConfig?.fetch??lA),i=await n({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(!i.ok){const e=await i.text().catch((()=>""));throw new wc(`lite-builder responded with HTTP ${i.status}${e?`: ${e}`:""}`,"UPSTREAM_HTTP_ERROR")}return{content:await i.json()}}catch(e){Ac(e,"create automation")}var t}},class extends ee{constructor(){super(...arguments),this.name="get_automation_runs",this.type=_.READ,this.annotations=Z({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 bA}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){Ac(e,"get automation runs")}}async runHistory(e){const t=e.nextPageOffset??0,a={...e.filters??{},...e.boardId?{boardId:e.boardId}:{}},n=await this.mondayApi.request(uA,{nextPageOffset:t,filters:a}),i=n.trigger_events?.triggerEvents??[],o=function(e){return e.reduce(((e,t)=>{const a=t.eventState??"unknown";return e[a]=(e[a]??0)+1,e}),{})}(i),r=e.boardId?`board ${e.boardId}`:"account-wide";return{content:{message:`Returned ${i.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+i.length}.`,scope:r,offset:t,count:i.length,stateCounts:o,runs:i}}}async runDetail(e){if(!e.triggerUuid)return{content:{message:'detail mode requires "triggerUuid".'}};const t=!1!==e.includeToolEvents,a=e.blockEventsOffset??0,n=e.toolEventsOffset??0,i=(await this.mondayApi.request(hA,{triggerUuid:e.triggerUuid})).trigger_event;if(!i)return{content:{message:`No run found for triggerUuid ${e.triggerUuid}.`,triggerUuid:e.triggerUuid,found:!1}};const[o,r]=await Promise.all([this.mondayApi.request(_A,{triggerUuid:e.triggerUuid,nextPageOffset:a}),t?this.mondayApi.request(fA,{triggerUuid:e.triggerUuid,nextPageOffset:n}):Promise.resolve(null)]),s=o.block_events?.blockEvents??[],d=r?.tool_events?.tool_events??[];return{content:{message:`Run ${e.triggerUuid}: state=${i.eventState??"unknown"}, ${s.length} block step(s), ${d.length} tool call(s).`,found:!0,run:i,blockEvents:s,blockEventsOffset:a,toolEvents:d,toolEventsOffset:n,toolEventsIncluded:t}}}},class extends ee{constructor(){super(...arguments),this.name="get_automation_statistics",this.type=_.READ,this.annotations=Z({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 IA}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){Ac(e,"get automation statistics")}}async runTotals(e,t,a){const n=(await this.mondayApi.request(yA,{filters:{board_id:t,user_ids:e.userIds}})).account_trigger_statistics;return{content:{message:`Totals (${a}): success=${n?.success??0}, failure=${n?.failure??0}, total=${n?.total??0}.`,scope:a,breakdown:"totals",statistics:n}}}async runByEntity(e,t,a){if(!e.runStatus)return{content:{message:'by_entity breakdown requires "runStatus" (success | failure | exhausted).'}};const n=(await this.mondayApi.request(vA,{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:n?.automation_statistics,workflowStatistics:n?.workflow_statistics}}}},class extends ee{constructor(){super(...arguments),this.name="configure_ai_column",this.type=_.WRITE,this.annotations=Z({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 RA}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){Ac(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 n=await this.mondayApi.request(EA,{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:n.configure_categorize_ai_column?.column_id}}}async handleSummarize(e,t,a){this.validateSourceType(t,"summarize");const n=await this.mondayApi.request(TA,{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:n.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 n=await this.mondayApi.request(wA,{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:n.configure_translate_ai_column?.column_id}}}async handleImproveText(e,t,a){this.validateSourceType(t,"improve_text");const n=await this.mondayApi.request(AA,{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:n.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 n=await this.mondayApi.request(SA,{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:n.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 n=await this.mondayApi.request(NA,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.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 n=await this.mondayApi.request(DA,{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:n.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 n=await this.mondayApi.request(OA,{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:n.configure_person_assignment_ai_column?.column_id}}}},class extends ee{constructor(){super(...arguments),this.name="remove_ai_from_column",this.type=_.WRITE,this.annotations=Z({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 kA}async executeInternal(e){try{const t=await this.mondayApi.request(CA,{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){Ac(e,"remove AI from column")}}},class extends ee{constructor(){super(...arguments),this.name="submit_bug_or_feature_request",this.type=_.READ,this.annotations=Z({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. ${LA}`}getInputSchema(){return UA}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 ee{constructor(){super(...arguments),this.name="get_monday_knowledge",this.type=_.READ,this.annotations=Z({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 VA}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,e.kind===xA?this.queryDeveloperDocs(e.query):this.queryGeneralKnowledge(e.query)}async queryGeneralKnowledge(e){const t={query:e},a=(await this.mondayApi.request(PA,t)).knowledge_base_search;a?.answer||Ac(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 n=(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:n,kind:MA}}}async queryDeveloperDocs(e){const t={query:e,retrieval_only:!0},a=(await this.mondayApi.request($A,t)).ask_developer_docs;return a?.answer||Ac(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:xA}}}}],bS=[...gS,...fS,...X];export{Cc as ToolMode,_ as ToolType,gS as allGraphqlApiTools,X as allMondayAppsTools,fS as allMondayDevTools,bS as allTools};
3108
3072
  //# sourceMappingURL=index.js.map