@mondaydotcomorg/agent-toolkit 5.7.1 → 5.8.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.
@@ -136,8 +136,18 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
136
136
  }
137
137
  }
138
138
  `,$c=Tc`
139
- mutation changeItemColumnValues($boardId: ID!, $itemId: ID!, $columnValues: JSON!) {
140
- change_multiple_column_values(board_id: $boardId, item_id: $itemId, column_values: $columnValues) {
139
+ mutation changeItemColumnValues(
140
+ $boardId: ID!
141
+ $itemId: ID!
142
+ $columnValues: JSON!
143
+ $createLabelsIfMissing: Boolean
144
+ ) {
145
+ change_multiple_column_values(
146
+ board_id: $boardId
147
+ item_id: $itemId
148
+ column_values: $columnValues
149
+ create_labels_if_missing: $createLabelsIfMissing
150
+ ) {
141
151
  id
142
152
  name
143
153
  url
@@ -433,7 +443,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
433
443
  name
434
444
  }
435
445
  }
436
- `,qc={query:e.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:e.string().describe("JSON string containing the variables for the GraphQL operation")};class Hc extends Ei{constructor(e,t){super(e,t),this.name="all_monday_api",this.type=jr.ALL_API,this.annotations=Ti({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 qc}async loadSchema(e){if(Hc.schemaCache[e])return Hc.schemaCache[e];try{const t=await this.mondayApi.rawRequest(Lc),{data:a}=t,r=Ad(a);return Hc.schemaCache[e]=r,r}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}async validateOperation(e,t){var a;return Nd(await this.loadSchema(t),new wo(e,a).parseDocument()).map((e=>e.message))}async executeInternal(e){const{query:t,variables:a}=e;try{let e={};try{e=JSON.parse(a)}catch(e){return{content:`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`}}const r=await this.validateOperation(t,this.context?.apiVersion??Xr);if(r.length>0)return{content:r.join(", ")};return{content:await this.mondayApi.request(t,e)}}catch(e){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)return{content:t.response.errors.map((e=>e.message)).join(", ")}}return{content:t}}}}Hc.schemaCache={};const Gc={itemId:e.number().describe("The ID of the item to be updated"),columnValues:e.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"}, \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"')},Wc={boardId:e.number().describe("The ID of the board that contains the item to be updated"),...Gc};class Qc extends Ei{constructor(){super(...arguments),this.name="change_item_column_values",this.type=jr.WRITE,this.annotations=Ti({title:"Change Item Column Values",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Change the column values of an item in a monday.com board. [REQUIRED PRECONDITION]: For board-relation linking tasks, call link_board_items_workflow before using this tool."}getInputSchema(){return this.context?.boardId?Gc:Wc}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),itemId:e.itemId.toString(),columnValues:e.columnValues},a=await this.mondayApi.request($c,t);return{content:{message:`Item ${a.change_multiple_column_values?.id} successfully updated`,item_id:a.change_multiple_column_values?.id,item_name:a.change_multiple_column_values?.name,item_url:a.change_multiple_column_values?.url}}}}const zc=Tc`
446
+ `,qc={query:e.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:e.string().describe("JSON string containing the variables for the GraphQL operation")};class Hc extends Ei{constructor(e,t){super(e,t),this.name="all_monday_api",this.type=jr.ALL_API,this.annotations=Ti({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 qc}async loadSchema(e){if(Hc.schemaCache[e])return Hc.schemaCache[e];try{const t=await this.mondayApi.rawRequest(Lc),{data:a}=t,r=Ad(a);return Hc.schemaCache[e]=r,r}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}async validateOperation(e,t){var a;return Nd(await this.loadSchema(t),new wo(e,a).parseDocument()).map((e=>e.message))}async executeInternal(e){const{query:t,variables:a}=e;try{let e={};try{e=JSON.parse(a)}catch(e){return{content:`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`}}const r=await this.validateOperation(t,this.context?.apiVersion??Xr);if(r.length>0)return{content:r.join(", ")};return{content:await this.mondayApi.request(t,e)}}catch(e){const t=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const t=e;if(t.response?.errors)return{content:t.response.errors.map((e=>e.message)).join(", ")}}return{content:t}}}}Hc.schemaCache={};const Gc={itemId:e.number().describe("The ID of the item to be updated"),columnValues:e.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"}, \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"'),createLabelsIfMissing:e.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.")},Wc={boardId:e.number().describe("The ID of the board that contains the item to be updated"),...Gc};class Qc extends Ei{constructor(){super(...arguments),this.name="change_item_column_values",this.type=jr.WRITE,this.annotations=Ti({title:"Change Item Column Values",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Change the column values of an item in a monday.com board. [REQUIRED PRECONDITION]: For board-relation linking tasks, call link_board_items_workflow before using this tool."}getInputSchema(){return this.context?.boardId?Gc:Wc}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),itemId:e.itemId.toString(),columnValues:e.columnValues,...void 0!==e.createLabelsIfMissing&&{createLabelsIfMissing:e.createLabelsIfMissing}},a=await this.mondayApi.request($c,t);return{content:{message:`Item ${a.change_multiple_column_values?.id} successfully updated`,item_id:a.change_multiple_column_values?.id,item_name:a.change_multiple_column_values?.name,item_url:a.change_multiple_column_values?.url}}}}const zc=Tc`
437
447
  query GetObjectSchemas($ids: [ID!], $names: [String!], $limit: Int, $page: Int, $excludeCreatedByMonday: Boolean) {
438
448
  get_object_schemas(ids: $ids, names: $names, limit: $limit, page: $page, exclude_created_by_monday: $excludeCreatedByMonday) {
439
449
  id