@mondaydotcomorg/agent-toolkit 5.72.0 → 5.72.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core/index.js +4 -4
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/mcp/index.js +4 -4
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.js +4 -4
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/core/index.js +4 -4
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/mcp/index.js +4 -4
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.js +4 -4
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/openai/index.js
CHANGED
|
@@ -525,7 +525,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"axios";import a f
|
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
`,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(t){if(!(t instanceof e))return t;const{token:a,defaultApiVersion:n,defaultEndpoint:i,requestConfig:o}=t;return new e({token:a,apiVersion:n,endpoint:i,requestConfig:{...o,headers:{...o?.headers,"x-api-schema":"public"}}})}const Oc={query:n.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:n.string().default("{}").describe("JSON string containing the variables for the GraphQL operation")};class Rc extends te{constructor(e,t){super("function"==typeof e?()=>Dc(e()):Dc(e),t),this.name="all_monday_api",this.type=f.ALL_API,this.annotations=ee({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(cc),{data:a}=t,n=ri(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===ge.MUTATION?a:n.operation===ge.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 ii(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=Je(t);this.recordGraphqlOperationCounts(i);const o=await this.validateOperation(i,this.context?.apiVersion??O);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={};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??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 $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" or "team". 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:n.number().describe("The ID of the item to be updated"),columnValues:n.string().describe(`The new column values for the item. Multiple columns can be changed at once. ${$c}`),createLabelsIfMissing:n.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:n.number().describe("The ID of the board that contains the item to be updated"),...Mc};class Fc extends te{constructor(){super(...arguments),this.name="change_item_column_values",this.type=f.WRITE,this.annotations=ee({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 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(ic,{...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 Bc=n.object({itemId:n.number().describe("The id of the item to update."),columnValues:n.string().describe(`The new column values for this item, keyed by column id. To change the item name include a "name" key. ${$c}`),boardId:n.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:n.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:n.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:n.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 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 Hc=zl`
|
|
528
|
+
`,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(t){if(!(t instanceof e))return t;const{token:a,defaultApiVersion:n,defaultEndpoint:i,requestConfig:o}=t;return new e({token:a,apiVersion:n,endpoint:i,requestConfig:{...o,headers:{...o?.headers,"x-api-schema":"public"}}})}const Oc={query:n.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:n.string().default("{}").describe("JSON string containing the variables for the GraphQL operation")};class Rc extends te{constructor(e,t){super("function"==typeof e?()=>Dc(e()):Dc(e),t),this.name="all_monday_api",this.type=f.ALL_API,this.annotations=ee({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(cc),{data:a}=t,n=ri(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===ge.MUTATION?a:n.operation===ge.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 ii(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=Je(t);this.recordGraphqlOperationCounts(i);const o=await this.validateOperation(i,this.context?.apiVersion??O);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={};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??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 $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:n.number().describe("The ID of the item to be updated"),columnValues:n.string().describe(`The new column values for the item. Multiple columns can be changed at once. ${$c}`),createLabelsIfMissing:n.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:n.number().describe("The ID of the board that contains the item to be updated"),...Mc};class Fc extends te{constructor(){super(...arguments),this.name="change_item_column_values",this.type=f.WRITE,this.annotations=ee({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 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(ic,{...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 Bc=n.object({itemId:n.number().describe("The id of the item to update."),columnValues:n.string().describe(`The new column values for this item, keyed by column id. To change the item name include a "name" key. ${$c}`),boardId:n.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:n.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:n.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:n.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 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 Hc=zl`
|
|
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
|
|
@@ -1145,7 +1145,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"axios";import a f
|
|
|
1145
1145
|
}
|
|
1146
1146
|
}
|
|
1147
1147
|
}
|
|
1148
|
-
`,Sh=n.object({id:n.string().describe("The ID of the entity to mention"),type:n.nativeEnum(bs).describe("The type of mention: User, Team, Board, or Project")}),Nh=n.array(Sh),Dh={itemId:n.number().describe("The id of the item to which the update will be added"),body:n.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:n.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'),parentId:n.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 te{constructor(){super(...arguments),this.name="create_update",this.type=f.WRITE,this.annotations=ee({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){Ac(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:n.array(n.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 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 kh=zl`
|
|
1148
|
+
`,Sh=n.object({id:n.string().describe("The ID of the entity to mention"),type:n.nativeEnum(bs).describe("The type of mention: User, Team, Board, or Project. Mention an AI agent as User, not Agent")}),Nh=n.array(Sh),Dh={itemId:n.number().describe("The id of the item to which the update will be added"),body:n.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:n.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:n.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 te{constructor(){super(...arguments),this.name="create_update",this.type=f.WRITE,this.annotations=ee({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){Ac(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:n.array(n.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 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 kh=zl`
|
|
1149
1149
|
mutation DeleteUpdate($id: ID!) {
|
|
1150
1150
|
delete_update(id: $id) {
|
|
1151
1151
|
id
|
|
@@ -1941,7 +1941,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"axios";import a f
|
|
|
1941
1941
|
url
|
|
1942
1942
|
}
|
|
1943
1943
|
}
|
|
1944
|
-
`,Ef={doc_id:n.string().min(1).optional().describe("The document ID (the id field returned by read_docs). Provide this OR object_id. Takes priority if both are provided."),object_id:n.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id. Provide this OR doc_id."),markdown:n.string().describe("Markdown content to add to the document."),after_block_id:n.string().optional().describe("Block ID after which to insert the new content. If omitted, content is appended at the end. To insert at the beginning, pass the first block ID from read_docs. Block IDs can be obtained from read_docs or from a previous add_content_to_doc response.")};function Tf(e){if(e)return e}function wf(e){if(e)return e}function Af(e){if(e)return{bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,code:e.code,link:e.link,color:e.color,background:e.background}}function Sf(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{blot:{mention:{id:String(t),type:e.insert.mention.type}}}}}return"column_value"in e.insert?{insert:{blot:{column_value:{item_id:String(e.insert.column_value.item_id),column_id:e.insert.column_value.column_id}}}}:{insert:{text:e.insert.text},attributes:Af(e.attributes)}}))}function Nf(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{mention:{id:t,type:e.insert.mention.type}}}}return"column_value"in e.insert?{insert:{macro:{type:"COLUMN_VALUE",macroId:l(),macroData:{itemId:Number(e.insert.column_value.item_id),columnId:e.insert.column_value.column_id}}}}:{insert:e.insert.text,attributes:Af(e.attributes)}}))}function Df(e,t){const a=e.attributes||{},n=a.comments||[];return{...e,attributes:{...a,comments:[...n,t]}}}function Of(e,t,a,n){const i=a+n;let o=0;const r=[];for(const n of e){const e=n.insert;if(null==e)throw new Error(`Unexpected delta op at position ${o}: op has no 'insert' field. Block content may be from an unsupported block type.`);const s=o,d=s+("string"==typeof e?e.length:1),p=Math.max(s,a),l=Math.min(d,i);p>=l?r.push(n):"string"!=typeof e?r.push(Df(n,t)):(p>s&&r.push({...n,insert:e.slice(0,p-s)}),r.push(Df({...n,insert:e.slice(p-s,l-s)},t)),l<d&&r.push({...n,insert:e.slice(l-s)})),o=d}return r}const Rf=n.object({bold:n.boolean().optional(),italic:n.boolean().optional(),underline:n.boolean().optional(),strike:n.boolean().optional(),code:n.boolean().optional(),link:n.string().optional(),color:n.string().optional(),background:n.string().optional()}).optional(),Cf=n.object({mention:n.object({id:n.union([n.string(),n.number()]).describe("User, doc, or board ID. Get user IDs from list_users_and_teams."),type:n.enum(["USER","DOC","BOARD"]).default("USER").describe("Mention type. USER is most common.")}).describe("Mention blot — tags a user, doc, or board inline. Do not set attributes on mention ops.")}),kf=n.object({column_value:n.object({item_id:n.union([n.string(),n.number()]).describe("The board item ID."),column_id:n.string().describe('The column ID (e.g. "status", "date4"). Get column IDs from get_board_schema.')}).describe("Column value blot — embeds a live board column value inline in the doc.")}),Lf=n.object({insert:n.union([n.string().transform((e=>({text:e}))),n.object({text:n.string()}),Cf,kf]).describe('Content to insert. Use {text: "..."} for plain text, {mention: {id, type}} to tag a user/doc/board, or {column_value: {item_id, column_id}} to embed a live column value. The last operation in the array must be {text: "\\n"}.'),attributes:Rf.describe("Optional formatting: bold, italic, underline, strike, code, link, color, background. Not applicable to mention or column_value ops.")}),Uf=n.object({block_content_type:n.literal("text"),delta_format:n.array(Lf).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:n.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:n.enum(["LTR","RTL"]).optional()}),Pf=n.object({block_content_type:n.literal("code"),delta_format:n.array(Lf).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:n.string().optional().describe('Programming language (e.g. "javascript", "python").')}),$f=n.object({block_content_type:n.literal("list_item"),delta_format:n.array(Lf).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),checked:n.boolean().optional().describe("Check state for CHECK_LIST items."),indentation:n.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),xf=n.discriminatedUnion("block_content_type",[Uf,Pf,$f]),Mf=n.object({block_type:n.literal("text"),text_block_type:n.enum(["NORMAL_TEXT","LARGE_TITLE","MEDIUM_TITLE","SMALL_TITLE","QUOTE"]).optional().describe("Block subtype. LARGE_TITLE=H1, MEDIUM_TITLE=H2, SMALL_TITLE=H3."),delta_format:n.array(Lf).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:n.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:n.enum(["LTR","RTL"]).optional()}),Vf=n.object({block_type:n.literal("list_item"),list_block_type:n.enum(["BULLETED_LIST","NUMBERED_LIST","CHECK_LIST"]).optional().describe("List type. Defaults to BULLETED_LIST."),delta_format:n.array(Lf).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),indentation:n.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),Ff=n.object({block_type:n.literal("code"),delta_format:n.array(Lf).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:n.string().optional().describe('Programming language (e.g. "javascript", "python").')}),Bf=n.object({block_type:n.literal("divider")}),qf=n.object({block_type:n.literal("page_break")}),jf=n.object({block_type:n.literal("image"),public_url:n.string().url().optional().describe("Publicly accessible image URL. Provide either public_url or asset_id."),asset_id:n.union([n.number().int(),n.string().regex(/^\d+$/).transform(Number)]).optional().describe("monday.com asset ID for the image. The image block will reference the asset directly. Provide either public_url or asset_id."),width:n.number().int().min(1).optional().describe("Width in pixels.")}),Gf=n.object({block_type:n.literal("video"),raw_url:n.string().url().describe("Video URL (YouTube, Vimeo, or direct video URL)."),width:n.number().int().min(1).optional().describe("Width in pixels.")}),Hf=n.object({block_type:n.literal("notice_box"),theme:n.enum(["INFO","TIPS","WARNING","GENERAL"]).describe("Visual style of the notice box.")}),Wf=n.object({block_type:n.literal("table"),row_count:n.number().int().min(1).max(25).describe("Number of rows (1–25)."),column_count:n.number().int().min(1).max(10).describe("Number of columns (1–10)."),width:n.number().int().optional().describe("Table width in pixels."),column_style:n.array(n.object({width:n.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),Yf=n.object({block_type:n.literal("layout"),column_count:n.number().int().min(2).max(6).describe("Number of columns (2–6)."),column_style:n.array(n.object({width:n.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),Kf=n.discriminatedUnion("block_type",[Mf,Vf,Ff,Bf,qf,jf,Gf,Hf,Wf,Yf]),Qf=n.object({operation_type:n.literal("set_name"),name:n.string().min(1).describe("New document name.")}),zf=n.object({operation_type:n.literal("add_markdown_content"),markdown:n.string().describe("Markdown content to convert and append (or insert) as blocks."),after_block_id:n.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs.")}),Jf=n.object({operation_type:n.literal("update_block"),block_id:n.string().describe("ID of the block to update. Get block IDs from read_docs."),content:xf.describe("New content for the block. Use block_content_type to select: text (updates text/heading/quote content), code (updates code content), list_item (updates bullets/numbered/todo content). Cannot change block subtype — use replace_block for that.")}),Xf=n.object({operation_type:n.literal("create_block"),after_block_id:n.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs."),parent_block_id:n.string().optional().describe("Parent block ID for nested blocks. Only works for notice_box containers — use the notice_box block ID directly. Table/layout cell nesting is NOT supported by the API. IMPORTANT: A notice_box created in the same call cannot be referenced — use a separate call first to create it, then a second call to nest content inside it."),block:Kf.describe("The block to create. Use block_type to select the block type.")}),Zf=n.object({operation_type:n.literal("delete_blocks"),block_ids:n.array(n.string()).min(1).max(100).describe("Block IDs to permanently delete (1–100 per call). Put ALL IDs for the delete into this single array — do NOT emit multiple delete_blocks operations back-to-back. Works for all block types including BOARD, WIDGET, DOC embed, GIPHY.")}),eg=n.object({operation_type:n.literal("replace_block"),block_id:n.string().describe("ID of the block to delete."),after_block_id:n.string().optional().describe("Insert replacement after this block ID. Provide the ID of the block that precedes the deleted block."),parent_block_id:n.string().optional().describe("Parent block ID for the replacement block."),block:Kf.describe("The new block to create in place of the deleted one.")}),tg=n.object({operation_type:n.literal("add_comment"),body:n.string().min(1).describe("The comment text. Use HTML tags for formatting (not markdown). Do not use @ to mention users — use mentions_list instead."),parent_update_id:n.number().optional().describe("The ID of an existing comment (update) to reply to. Omit to create a new top-level comment. Get comment IDs from read_docs with include_comments: true."),mentions_list:n.string().optional().describe('Optional JSON array of mentions: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types: User, Team, Board, Project.'),block_id:n.union([n.string(),n.array(n.string()).min(1)]).optional().describe("Block ID (string) or array of block IDs to anchor the comment to. When an array is provided, the same comment highlights all specified blocks. Only works on text-content blocks (text, code, list_item, title, quote) — not on divider, table, layout, notice_box, image, video, or giphy. Get block IDs from read_docs with include_blocks: true. Omit to create a general doc-level comment. Pair with selection_from + selection_length (single block_id only) to comment on a specific text range."),selection_from:n.number().int().min(0).optional().describe("Start character offset (0-indexed) of the selected text within the block. Requires block_id. Omit to comment on the entire block."),selection_length:n.number().int().min(1).optional().describe("Number of characters in the text selection. Requires block_id and selection_from. Only works for text, code, and list_item blocks that have a delta format.")}),ag=n.discriminatedUnion("operation_type",[Qf,zf,Jf,Xf,Zf,eg,tg]),ng={doc_id:n.string().min(1).optional().describe("The document ID (the id field from read_docs). Takes priority over object_id if both are provided."),object_id:n.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, visible in the document URL). Resolved to doc_id."),operations:n.array(ag).min(1).max(25).describe('Ordered list of operations to perform. Executed sequentially. Stops at first failure.\n\nOperation types:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (simplest for text/lists/tables).\n- update_block: Change content of an existing text/code/list/divider block.\n- create_block: Create a new block at a specific position (supports text, list_item, code, divider, page_break, image, video, notice_box, table, layout).\n- delete_blocks: Permanently delete 1–100 blocks in one call. Provide all block IDs in the block_ids array. Works for all block types including BOARD, WIDGET, DOC embed, and GIPHY.\n- replace_block: Delete a block and create a new one in its place. Use for: changing image/video source, table restructure, notice_box theme change.\n- add_comment: Create a new comment or reply on the document. Use parent_update_id to reply to an existing comment. Format text with HTML. Uses the doc\'s backing board item.\n\nWHEN TO USE WHICH:\n- Adding new text sections → add_markdown_content\n- Adding asset-based images → create_block with block_type "image" and asset_id (add_markdown_content does NOT support asset images)\n- Mixed content with asset images → alternate add_markdown_content (for text) and create_block (for each image) in sequence\n- Editing existing text block → update_block\n- Changing an image URL → replace_block (image URL is immutable after creation)\n- Changing video URL → replace_block\n- Restructuring a table → replace_block\n- BOARD/WIDGET/DOC/GIPHY blocks → delete_blocks only (no public API to create these)\n\nNESTING CONTENT IN CONTAINERS:\n- notice_box: Fully supported. Create the notice_box first, then in a separate call create child blocks with parent_block_id set to the notice_box ID. You cannot reference a block ID created in the same call.\n- table: Cell-level API nesting is NOT supported. To create a table with content, use add_markdown_content with a markdown table (e.g. "| H1 | H2 |\\n| --- | --- |\\n| A | B |"). This creates a pre-populated table in one shot. Empty tables created via create_block cannot have their cells populated through the API.\n- layout: Cell-level API nesting is NOT supported and there is no markdown equivalent. Layouts can only be created empty via create_block. No workaround exists to populate layout columns through the API.\nDeleting a container does NOT delete its children — delete children first for clean removal.\n\nBATCHING: delete_blocks accepts 1..100 IDs. Put ALL IDs in one operation\'s block_ids array. Never emit multiple delete_blocks operations in a row.\n\nBlock IDs are available in the blocks array returned by read_docs.')};const ig=zl`
|
|
1944
|
+
`,Ef={doc_id:n.string().min(1).optional().describe("The document ID (the id field returned by read_docs). Provide this OR object_id. Takes priority if both are provided."),object_id:n.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id. Provide this OR doc_id."),markdown:n.string().describe("Markdown content to add to the document."),after_block_id:n.string().optional().describe("Block ID after which to insert the new content. If omitted, content is appended at the end. To insert at the beginning, pass the first block ID from read_docs. Block IDs can be obtained from read_docs or from a previous add_content_to_doc response.")};function Tf(e){if(e)return e}function wf(e){if(e)return e}function Af(e){if(e)return{bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,code:e.code,link:e.link,color:e.color,background:e.background}}function Sf(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{blot:{mention:{id:String(t),type:e.insert.mention.type}}}}}return"column_value"in e.insert?{insert:{blot:{column_value:{item_id:String(e.insert.column_value.item_id),column_id:e.insert.column_value.column_id}}}}:{insert:{text:e.insert.text},attributes:Af(e.attributes)}}))}function Nf(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{mention:{id:t,type:e.insert.mention.type}}}}return"column_value"in e.insert?{insert:{macro:{type:"COLUMN_VALUE",macroId:l(),macroData:{itemId:Number(e.insert.column_value.item_id),columnId:e.insert.column_value.column_id}}}}:{insert:e.insert.text,attributes:Af(e.attributes)}}))}function Df(e,t){const a=e.attributes||{},n=a.comments||[];return{...e,attributes:{...a,comments:[...n,t]}}}function Of(e,t,a,n){const i=a+n;let o=0;const r=[];for(const n of e){const e=n.insert;if(null==e)throw new Error(`Unexpected delta op at position ${o}: op has no 'insert' field. Block content may be from an unsupported block type.`);const s=o,d=s+("string"==typeof e?e.length:1),p=Math.max(s,a),l=Math.min(d,i);p>=l?r.push(n):"string"!=typeof e?r.push(Df(n,t)):(p>s&&r.push({...n,insert:e.slice(0,p-s)}),r.push(Df({...n,insert:e.slice(p-s,l-s)},t)),l<d&&r.push({...n,insert:e.slice(l-s)})),o=d}return r}const Rf=n.object({bold:n.boolean().optional(),italic:n.boolean().optional(),underline:n.boolean().optional(),strike:n.boolean().optional(),code:n.boolean().optional(),link:n.string().optional(),color:n.string().optional(),background:n.string().optional()}).optional(),Cf=n.object({mention:n.object({id:n.union([n.string(),n.number()]).describe("User, doc, or board ID. Get user IDs from list_users_and_teams."),type:n.enum(["USER","DOC","BOARD"]).default("USER").describe("Mention type. USER is most common.")}).describe("Mention blot — tags a user, doc, or board inline. Do not set attributes on mention ops.")}),kf=n.object({column_value:n.object({item_id:n.union([n.string(),n.number()]).describe("The board item ID."),column_id:n.string().describe('The column ID (e.g. "status", "date4"). Get column IDs from get_board_schema.')}).describe("Column value blot — embeds a live board column value inline in the doc.")}),Lf=n.object({insert:n.union([n.string().transform((e=>({text:e}))),n.object({text:n.string()}),Cf,kf]).describe('Content to insert. Use {text: "..."} for plain text, {mention: {id, type}} to tag a user/doc/board, or {column_value: {item_id, column_id}} to embed a live column value. The last operation in the array must be {text: "\\n"}.'),attributes:Rf.describe("Optional formatting: bold, italic, underline, strike, code, link, color, background. Not applicable to mention or column_value ops.")}),Uf=n.object({block_content_type:n.literal("text"),delta_format:n.array(Lf).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:n.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:n.enum(["LTR","RTL"]).optional()}),Pf=n.object({block_content_type:n.literal("code"),delta_format:n.array(Lf).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:n.string().optional().describe('Programming language (e.g. "javascript", "python").')}),$f=n.object({block_content_type:n.literal("list_item"),delta_format:n.array(Lf).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),checked:n.boolean().optional().describe("Check state for CHECK_LIST items."),indentation:n.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),xf=n.discriminatedUnion("block_content_type",[Uf,Pf,$f]),Mf=n.object({block_type:n.literal("text"),text_block_type:n.enum(["NORMAL_TEXT","LARGE_TITLE","MEDIUM_TITLE","SMALL_TITLE","QUOTE"]).optional().describe("Block subtype. LARGE_TITLE=H1, MEDIUM_TITLE=H2, SMALL_TITLE=H3."),delta_format:n.array(Lf).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:n.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:n.enum(["LTR","RTL"]).optional()}),Vf=n.object({block_type:n.literal("list_item"),list_block_type:n.enum(["BULLETED_LIST","NUMBERED_LIST","CHECK_LIST"]).optional().describe("List type. Defaults to BULLETED_LIST."),delta_format:n.array(Lf).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),indentation:n.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),Ff=n.object({block_type:n.literal("code"),delta_format:n.array(Lf).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:n.string().optional().describe('Programming language (e.g. "javascript", "python").')}),Bf=n.object({block_type:n.literal("divider")}),qf=n.object({block_type:n.literal("page_break")}),jf=n.object({block_type:n.literal("image"),public_url:n.string().url().optional().describe("Publicly accessible image URL. Provide either public_url or asset_id."),asset_id:n.union([n.number().int(),n.string().regex(/^\d+$/).transform(Number)]).optional().describe("monday.com asset ID for the image. The image block will reference the asset directly. Provide either public_url or asset_id."),width:n.number().int().min(1).optional().describe("Width in pixels.")}),Gf=n.object({block_type:n.literal("video"),raw_url:n.string().url().describe("Video URL (YouTube, Vimeo, or direct video URL)."),width:n.number().int().min(1).optional().describe("Width in pixels.")}),Hf=n.object({block_type:n.literal("notice_box"),theme:n.enum(["INFO","TIPS","WARNING","GENERAL"]).describe("Visual style of the notice box.")}),Wf=n.object({block_type:n.literal("table"),row_count:n.number().int().min(1).max(25).describe("Number of rows (1–25)."),column_count:n.number().int().min(1).max(10).describe("Number of columns (1–10)."),width:n.number().int().optional().describe("Table width in pixels."),column_style:n.array(n.object({width:n.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),Yf=n.object({block_type:n.literal("layout"),column_count:n.number().int().min(2).max(6).describe("Number of columns (2–6)."),column_style:n.array(n.object({width:n.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),Kf=n.discriminatedUnion("block_type",[Mf,Vf,Ff,Bf,qf,jf,Gf,Hf,Wf,Yf]),Qf=n.object({operation_type:n.literal("set_name"),name:n.string().min(1).describe("New document name.")}),zf=n.object({operation_type:n.literal("add_markdown_content"),markdown:n.string().describe("Markdown content to convert and append (or insert) as blocks."),after_block_id:n.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs.")}),Jf=n.object({operation_type:n.literal("update_block"),block_id:n.string().describe("ID of the block to update. Get block IDs from read_docs."),content:xf.describe("New content for the block. Use block_content_type to select: text (updates text/heading/quote content), code (updates code content), list_item (updates bullets/numbered/todo content). Cannot change block subtype — use replace_block for that.")}),Xf=n.object({operation_type:n.literal("create_block"),after_block_id:n.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs."),parent_block_id:n.string().optional().describe("Parent block ID for nested blocks. Only works for notice_box containers — use the notice_box block ID directly. Table/layout cell nesting is NOT supported by the API. IMPORTANT: A notice_box created in the same call cannot be referenced — use a separate call first to create it, then a second call to nest content inside it."),block:Kf.describe("The block to create. Use block_type to select the block type.")}),Zf=n.object({operation_type:n.literal("delete_blocks"),block_ids:n.array(n.string()).min(1).max(100).describe("Block IDs to permanently delete (1–100 per call). Put ALL IDs for the delete into this single array — do NOT emit multiple delete_blocks operations back-to-back. Works for all block types including BOARD, WIDGET, DOC embed, GIPHY.")}),eg=n.object({operation_type:n.literal("replace_block"),block_id:n.string().describe("ID of the block to delete."),after_block_id:n.string().optional().describe("Insert replacement after this block ID. Provide the ID of the block that precedes the deleted block."),parent_block_id:n.string().optional().describe("Parent block ID for the replacement block."),block:Kf.describe("The new block to create in place of the deleted one.")}),tg=n.object({operation_type:n.literal("add_comment"),body:n.string().min(1).describe("The comment text. Use HTML tags for formatting (not markdown). Do not use @ to mention users — use mentions_list instead."),parent_update_id:n.number().optional().describe("The ID of an existing comment (update) to reply to. Omit to create a new top-level comment. Get comment IDs from read_docs with include_comments: true."),mentions_list:n.string().optional().describe('Optional JSON array of mentions: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types: User, Team, Board, Project. To mention an AI agent, use type User with the agent\'s user id from list_users_and_teams. Type Agent adds no mention.'),block_id:n.union([n.string(),n.array(n.string()).min(1)]).optional().describe("Block ID (string) or array of block IDs to anchor the comment to. When an array is provided, the same comment highlights all specified blocks. Only works on text-content blocks (text, code, list_item, title, quote) — not on divider, table, layout, notice_box, image, video, or giphy. Get block IDs from read_docs with include_blocks: true. Omit to create a general doc-level comment. Pair with selection_from + selection_length (single block_id only) to comment on a specific text range."),selection_from:n.number().int().min(0).optional().describe("Start character offset (0-indexed) of the selected text within the block. Requires block_id. Omit to comment on the entire block."),selection_length:n.number().int().min(1).optional().describe("Number of characters in the text selection. Requires block_id and selection_from. Only works for text, code, and list_item blocks that have a delta format.")}),ag=n.discriminatedUnion("operation_type",[Qf,zf,Jf,Xf,Zf,eg,tg]),ng={doc_id:n.string().min(1).optional().describe("The document ID (the id field from read_docs). Takes priority over object_id if both are provided."),object_id:n.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, visible in the document URL). Resolved to doc_id."),operations:n.array(ag).min(1).max(25).describe('Ordered list of operations to perform. Executed sequentially. Stops at first failure.\n\nOperation types:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (simplest for text/lists/tables).\n- update_block: Change content of an existing text/code/list/divider block.\n- create_block: Create a new block at a specific position (supports text, list_item, code, divider, page_break, image, video, notice_box, table, layout).\n- delete_blocks: Permanently delete 1–100 blocks in one call. Provide all block IDs in the block_ids array. Works for all block types including BOARD, WIDGET, DOC embed, and GIPHY.\n- replace_block: Delete a block and create a new one in its place. Use for: changing image/video source, table restructure, notice_box theme change.\n- add_comment: Create a new comment or reply on the document. Use parent_update_id to reply to an existing comment. Format text with HTML. Uses the doc\'s backing board item.\n\nWHEN TO USE WHICH:\n- Adding new text sections → add_markdown_content\n- Adding asset-based images → create_block with block_type "image" and asset_id (add_markdown_content does NOT support asset images)\n- Mixed content with asset images → alternate add_markdown_content (for text) and create_block (for each image) in sequence\n- Editing existing text block → update_block\n- Changing an image URL → replace_block (image URL is immutable after creation)\n- Changing video URL → replace_block\n- Restructuring a table → replace_block\n- BOARD/WIDGET/DOC/GIPHY blocks → delete_blocks only (no public API to create these)\n\nNESTING CONTENT IN CONTAINERS:\n- notice_box: Fully supported. Create the notice_box first, then in a separate call create child blocks with parent_block_id set to the notice_box ID. You cannot reference a block ID created in the same call.\n- table: Cell-level API nesting is NOT supported. To create a table with content, use add_markdown_content with a markdown table (e.g. "| H1 | H2 |\\n| --- | --- |\\n| A | B |"). This creates a pre-populated table in one shot. Empty tables created via create_block cannot have their cells populated through the API.\n- layout: Cell-level API nesting is NOT supported and there is no markdown equivalent. Layouts can only be created empty via create_block. No workaround exists to populate layout columns through the API.\nDeleting a container does NOT delete its children — delete children first for clean removal.\n\nBATCHING: delete_blocks accepts 1..100 IDs. Put ALL IDs in one operation\'s block_ids array. Never emit multiple delete_blocks operations in a row.\n\nBlock IDs are available in the blocks array returned by read_docs.')};const ig=zl`
|
|
1945
1945
|
mutation CreateDashboard(
|
|
1946
1946
|
$name: String!
|
|
1947
1947
|
$workspace_id: ID!
|
|
@@ -2261,7 +2261,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"axios";import a f
|
|
|
2261
2261
|
}
|
|
2262
2262
|
}
|
|
2263
2263
|
}
|
|
2264
|
-
`,Pg=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,""),$g=new Set(Object.values(o_));function xg(e){if(null!=e)return Array.isArray(e)?e:[e]}function Mg(e){return n.preprocess(xg,n.array(n.coerce.number().finite()).optional()).describe(e)}function Vg(e){return e&&e.length>0?e:void 0}function Fg(e){if(!e)return;const t=Object.entries(e).filter((([,e])=>e&&e.length>0)).map((([e,t])=>({field:e,fragments:[...t]})));return t.length>0?t:void 0}const Bg=n.preprocess((function(e){if("string"!=typeof e)return e;const t=s_(e),a=d_[t]??t;return $g.has(a)?a:e}),n.nativeEnum(o_,{errorMap:function(e,t){if(e.code===n.ZodIssueCode.invalid_type)return"undefined"===e.received||"null"===e.received?{message:`searchType is required. Valid values: ${r_}.`}:{message:`searchType must be a string. Valid values: ${r_}.`};if(e.code===n.ZodIssueCode.invalid_enum_value){const t=String(e.received),a=p_[s_(t)],n=`Invalid searchType "${t}". Valid values: ${r_}.`;return{message:a?`${n} ${a}`:n}}return{message:t.defaultError}}})).describe(`The type of search to perform. Valid values: ${r_}.`),qg=n.preprocess((function(e){return null==e?20:e}),n.coerce.number().finite().transform((e=>Math.min(Math.max(Math.trunc(e),1),20)))).optional().default(20).describe("The number of items to get. Maximum is 20."),jg={searchTerm:n.string().trim().min(1,{message:"searchTerm must be a non-empty search string."}).optional().describe("The search phrase — the text the search matches results against (e.g. a board name, item title, or keywords). Required and must be non-empty. This is NOT a filter or an id — pass the words to look for."),searchType:Bg,limit:qg,workspaceIds:Mg("Array of workspace IDs (numbers) to search in. Optional for FOLDERS search (searches all accessible workspaces when omitted). For ITEMS, BOARD, DOCUMENTS, DASHBOARDS, UPDATES, and TIMELINE_ITEMS search, only pass this if the user explicitly asked to search within specific workspaces. Example: [12345, 67890]."),boardIds:Mg("Array of board IDs (numbers) to scope the search to. Applies to BOARD, ITEMS, UPDATES, and TIMELINE_ITEMS search. Only pass it if the user explicitly asked to search within specific boards. Example: [12345, 67890]."),creatorIds:Mg("Array of user IDs (numbers) to filter by creator. Applies to ITEMS (filters by item creator), UPDATES (filters by update author), and DASHBOARDS (filters by dashboard creator). Only pass it if the user explicitly asked to filter by specific creators. Example: [12345, 67890]."),docIds:Mg("Array of document IDs (numbers), as they appear in document URLs, to scope the search to. Applies to DOCUMENTS search, with at most 512 ids. Use it to search within a known set of documents, for example to find which of them mention a term. Only pass it if the user explicitly asked to search within specific documents. Example: [12345, 67890].")};const Gg=n.object({id:n.string().describe("The ID of the entity to mention"),type:n.nativeEnum(bs).describe("The type of mention: User, Team, Board, or Project")}),Hg=n.array(Gg),Wg={itemId:n.number().describe("The id of the item to which the update will be added"),body:n.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:n.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project')};const Yg=zl`
|
|
2264
|
+
`,Pg=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,""),$g=new Set(Object.values(o_));function xg(e){if(null!=e)return Array.isArray(e)?e:[e]}function Mg(e){return n.preprocess(xg,n.array(n.coerce.number().finite()).optional()).describe(e)}function Vg(e){return e&&e.length>0?e:void 0}function Fg(e){if(!e)return;const t=Object.entries(e).filter((([,e])=>e&&e.length>0)).map((([e,t])=>({field:e,fragments:[...t]})));return t.length>0?t:void 0}const Bg=n.preprocess((function(e){if("string"!=typeof e)return e;const t=s_(e),a=d_[t]??t;return $g.has(a)?a:e}),n.nativeEnum(o_,{errorMap:function(e,t){if(e.code===n.ZodIssueCode.invalid_type)return"undefined"===e.received||"null"===e.received?{message:`searchType is required. Valid values: ${r_}.`}:{message:`searchType must be a string. Valid values: ${r_}.`};if(e.code===n.ZodIssueCode.invalid_enum_value){const t=String(e.received),a=p_[s_(t)],n=`Invalid searchType "${t}". Valid values: ${r_}.`;return{message:a?`${n} ${a}`:n}}return{message:t.defaultError}}})).describe(`The type of search to perform. Valid values: ${r_}.`),qg=n.preprocess((function(e){return null==e?20:e}),n.coerce.number().finite().transform((e=>Math.min(Math.max(Math.trunc(e),1),20)))).optional().default(20).describe("The number of items to get. Maximum is 20."),jg={searchTerm:n.string().trim().min(1,{message:"searchTerm must be a non-empty search string."}).optional().describe("The search phrase — the text the search matches results against (e.g. a board name, item title, or keywords). Required and must be non-empty. This is NOT a filter or an id — pass the words to look for."),searchType:Bg,limit:qg,workspaceIds:Mg("Array of workspace IDs (numbers) to search in. Optional for FOLDERS search (searches all accessible workspaces when omitted). For ITEMS, BOARD, DOCUMENTS, DASHBOARDS, UPDATES, and TIMELINE_ITEMS search, only pass this if the user explicitly asked to search within specific workspaces. Example: [12345, 67890]."),boardIds:Mg("Array of board IDs (numbers) to scope the search to. Applies to BOARD, ITEMS, UPDATES, and TIMELINE_ITEMS search. Only pass it if the user explicitly asked to search within specific boards. Example: [12345, 67890]."),creatorIds:Mg("Array of user IDs (numbers) to filter by creator. Applies to ITEMS (filters by item creator), UPDATES (filters by update author), and DASHBOARDS (filters by dashboard creator). Only pass it if the user explicitly asked to filter by specific creators. Example: [12345, 67890]."),docIds:Mg("Array of document IDs (numbers), as they appear in document URLs, to scope the search to. Applies to DOCUMENTS search, with at most 512 ids. Use it to search within a known set of documents, for example to find which of them mention a term. Only pass it if the user explicitly asked to search within specific documents. Example: [12345, 67890].")};const Gg=n.object({id:n.string().describe("The ID of the entity to mention"),type:n.nativeEnum(bs).describe("The type of mention: User, Team, Board, or Project. Mention an AI agent as User, not Agent")}),Hg=n.array(Gg),Wg={itemId:n.number().describe("The id of the item to which the update will be added"),body:n.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:n.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project. To mention an AI agent, use type User with the agent\'s user id from list_users_and_teams. Type Agent adds no mention')};const Yg=zl`
|
|
2265
2265
|
mutation updateAssetsOnItem($boardId: ID!, $itemId: ID!, $columnId: String!, $files: [FileInput!]!) {
|
|
2266
2266
|
update_assets_on_item(board_id: $boardId, item_id: $itemId, column_id: $columnId, files: $files) {
|
|
2267
2267
|
id
|