@mondaydotcomorg/agent-toolkit 5.22.1 → 5.23.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.
@@ -143,6 +143,7 @@ import e from"axios";import*as t from"crypto";import{randomUUID as a}from"crypto
143
143
  $itemId: ID!
144
144
  $columnValues: JSON!
145
145
  $createLabelsIfMissing: Boolean
146
+ $columnIds: [String!]
146
147
  ) {
147
148
  change_multiple_column_values(
148
149
  board_id: $boardId
@@ -153,6 +154,10 @@ import e from"axios";import*as t from"crypto";import{randomUUID as a}from"crypto
153
154
  id
154
155
  name
155
156
  url
157
+ column_values(ids: $columnIds) {
158
+ id
159
+ value
160
+ }
156
161
  }
157
162
  }
158
163
  `,us=ns`
@@ -476,7 +481,7 @@ import e from"axios";import*as t from"crypto";import{randomUUID as a}from"crypto
476
481
  name
477
482
  }
478
483
  }
479
- `,As={query:r.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:r.string().describe("JSON string containing the variables for the GraphQL operation")};class Ns extends te{constructor(e,t){super(e,t),this.name="all_monday_api",this.type=_.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 As}async loadSchema(e){if(Ns.schemaCache[e])return Ns.schemaCache[e];try{const t=await this.mondayApi.rawRequest(bs),{data:a}=t,i=nn(a);return Ns.schemaCache[e]=i,i}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}async validateOperation(e,t){var a;return an(await this.loadSchema(t),new Je(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 i=await this.validateOperation(t,this.context?.apiVersion??k);if(i.length>0)return{content:i.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}}}}Ns.schemaCache={};const Ss={itemId:r.number().describe("The ID of the item to be updated"),columnValues:r.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:r.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.")},Ds={boardId:r.number().describe("The ID of the board that contains the item to be updated"),...Ss};class ks extends te{constructor(){super(...arguments),this.name="change_item_column_values",this.type=_.WRITE,this.annotations=ee({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?Ss:Ds}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(ms,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 Os=ns`
484
+ `,As={query:r.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:r.string().describe("JSON string containing the variables for the GraphQL operation")};class Ns extends te{constructor(e,t){super(e,t),this.name="all_monday_api",this.type=_.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 As}async loadSchema(e){if(Ns.schemaCache[e])return Ns.schemaCache[e];try{const t=await this.mondayApi.rawRequest(bs),{data:a}=t,i=nn(a);return Ns.schemaCache[e]=i,i}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}async validateOperation(e,t){var a;return an(await this.loadSchema(t),new Je(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 i=await this.validateOperation(t,this.context?.apiVersion??k);if(i.length>0)return{content:i.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}}}}Ns.schemaCache={};const Ss={itemId:r.number().describe("The ID of the item to be updated"),columnValues:r.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:r.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.")},Ds={boardId:r.number().describe("The ID of the board that contains the item to be updated"),...Ss};class ks extends te{constructor(){super(...arguments),this.name="change_item_column_values",this.type=_.WRITE,this.annotations=ee({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?Ss:Ds}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}};let a;try{a=Object.keys(JSON.parse(e.columnValues))}catch(e){throw new Error(`Invalid columnValues JSON: ${e.message}`)}const i=await this.mondayApi.request(ms,{...t,columnIds:a}),n=i.change_multiple_column_values?.column_values?.reduce(((e,t)=>(e[t.id]=t.value??null,e)),{});return{content:{message:`Item ${i.change_multiple_column_values?.id} successfully updated`,item_id:i.change_multiple_column_values?.id,item_name:i.change_multiple_column_values?.name,item_url:i.change_multiple_column_values?.url,column_values:n}}}}const Os=ns`
480
485
  query GetObjectSchemas($ids: [ID!], $names: [String!], $limit: Int, $page: Int, $excludeCreatedByMonday: Boolean) {
481
486
  get_object_schemas(ids: $ids, names: $names, limit: $limit, page: $page, exclude_created_by_monday: $excludeCreatedByMonday) {
482
487
  id