@mondaydotcomorg/agent-toolkit 5.8.0 → 5.9.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 +182 -153
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/mcp/index.js +185 -156
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.js +182 -153
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/core/index.js +182 -153
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/mcp/index.js +182 -153
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.js +182 -153
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/mcp/index.js
CHANGED
|
@@ -8,6 +8,8 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
8
8
|
$page: Int
|
|
9
9
|
$workspace_ids: [ID]
|
|
10
10
|
$includeBlocks: Boolean = false
|
|
11
|
+
$blocksLimit: Int
|
|
12
|
+
$blocksPage: Int
|
|
11
13
|
) {
|
|
12
14
|
docs(
|
|
13
15
|
ids: $ids
|
|
@@ -35,7 +37,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
35
37
|
}
|
|
36
38
|
workspace_id
|
|
37
39
|
doc_folder_id
|
|
38
|
-
blocks @include(if: $includeBlocks) {
|
|
40
|
+
blocks(limit: $blocksLimit, page: $blocksPage) @include(if: $includeBlocks) {
|
|
39
41
|
id
|
|
40
42
|
type
|
|
41
43
|
parent_block_id
|
|
@@ -132,6 +134,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
132
134
|
id
|
|
133
135
|
type
|
|
134
136
|
title
|
|
137
|
+
revision
|
|
135
138
|
}
|
|
136
139
|
}
|
|
137
140
|
}
|
|
@@ -199,6 +202,30 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
199
202
|
}
|
|
200
203
|
}
|
|
201
204
|
`,Fc=Tc`
|
|
205
|
+
mutation updateColumn(
|
|
206
|
+
$boardId: ID!
|
|
207
|
+
$columnId: String!
|
|
208
|
+
$columnType: ColumnType!
|
|
209
|
+
$revision: String!
|
|
210
|
+
$columnTitle: String
|
|
211
|
+
$columnDescription: String
|
|
212
|
+
$columnSettings: JSON
|
|
213
|
+
) {
|
|
214
|
+
update_column(
|
|
215
|
+
board_id: $boardId
|
|
216
|
+
id: $columnId
|
|
217
|
+
column_type: $columnType
|
|
218
|
+
revision: $revision
|
|
219
|
+
title: $columnTitle
|
|
220
|
+
description: $columnDescription
|
|
221
|
+
settings: $columnSettings
|
|
222
|
+
) {
|
|
223
|
+
id
|
|
224
|
+
title
|
|
225
|
+
revision
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
`,Lc=Tc`
|
|
202
229
|
query getGraphQLSchema {
|
|
203
230
|
__schema {
|
|
204
231
|
queryType {
|
|
@@ -251,7 +278,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
251
278
|
}
|
|
252
279
|
}
|
|
253
280
|
}
|
|
254
|
-
`,
|
|
281
|
+
`,Vc=Tc`
|
|
255
282
|
query IntrospectionQuery {
|
|
256
283
|
__schema {
|
|
257
284
|
queryType {
|
|
@@ -353,7 +380,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
353
380
|
}
|
|
354
381
|
}
|
|
355
382
|
}
|
|
356
|
-
`,
|
|
383
|
+
`,jc=Tc`
|
|
357
384
|
mutation createCustomActivity($color: CustomActivityColor!, $icon_id: CustomActivityIcon!, $name: String!) {
|
|
358
385
|
create_custom_activity(color: $color, icon_id: $icon_id, name: $name) {
|
|
359
386
|
color
|
|
@@ -361,7 +388,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
361
388
|
name
|
|
362
389
|
}
|
|
363
390
|
}
|
|
364
|
-
`,
|
|
391
|
+
`,Uc=Tc`
|
|
365
392
|
mutation createTimelineItem(
|
|
366
393
|
$item_id: ID!
|
|
367
394
|
$custom_activity_id: String!
|
|
@@ -394,7 +421,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
394
421
|
type
|
|
395
422
|
}
|
|
396
423
|
}
|
|
397
|
-
`,
|
|
424
|
+
`,Mc=Tc`
|
|
398
425
|
query fetchCustomActivity {
|
|
399
426
|
custom_activity {
|
|
400
427
|
color
|
|
@@ -404,7 +431,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
404
431
|
type
|
|
405
432
|
}
|
|
406
433
|
}
|
|
407
|
-
`,
|
|
434
|
+
`,Bc=Tc`
|
|
408
435
|
query exportMarkdownFromDoc($docId: ID!, $blockIds: [String!]) {
|
|
409
436
|
export_markdown_from_doc(docId: $docId, blockIds: $blockIds) {
|
|
410
437
|
success
|
|
@@ -412,7 +439,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
412
439
|
error
|
|
413
440
|
}
|
|
414
441
|
}
|
|
415
|
-
`,
|
|
442
|
+
`,qc=Tc`
|
|
416
443
|
query getWorkspaceInfo($workspace_id: ID!) {
|
|
417
444
|
workspaces(ids: [$workspace_id]) {
|
|
418
445
|
id
|
|
@@ -443,7 +470,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
443
470
|
name
|
|
444
471
|
}
|
|
445
472
|
}
|
|
446
|
-
`,
|
|
473
|
+
`,Hc={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 Gc 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 Hc}async loadSchema(e){if(Gc.schemaCache[e])return Gc.schemaCache[e];try{const t=await this.mondayApi.rawRequest(Vc),{data:a}=t,r=Ad(a);return Gc.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}}}}Gc.schemaCache={};const Wc={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.")},Qc={boardId:e.number().describe("The ID of the board that contains the item to be updated"),...Wc};class zc 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?Wc:Qc}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 Yc=Tc`
|
|
447
474
|
query GetObjectSchemas($ids: [ID!], $names: [String!], $limit: Int, $page: Int, $excludeCreatedByMonday: Boolean) {
|
|
448
475
|
get_object_schemas(ids: $ids, names: $names, limit: $limit, page: $page, exclude_created_by_monday: $excludeCreatedByMonday) {
|
|
449
476
|
id
|
|
@@ -455,7 +482,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
455
482
|
connected_boards_count
|
|
456
483
|
}
|
|
457
484
|
}
|
|
458
|
-
`,
|
|
485
|
+
`,Kc={ids:e.array(e.string()).optional().describe("List of object schema IDs to retrieve. Mutually exclusive with names."),names:e.array(e.string()).optional().describe("List of object schema names to retrieve. Mutually exclusive with ids."),limit:e.number().optional().describe("Number of results per page. Default 25, max 100."),page:e.number().optional().describe("1-indexed page number. Default 1."),excludeCreatedByMonday:e.boolean().optional().describe("If true, returns only user-created schemas and excludes default monday.com schemas.")};const Jc=Tc`
|
|
459
486
|
mutation CreateObjectSchema($name: String!, $parentId: ID, $description: String) {
|
|
460
487
|
create_object_schema(name: $name, parent_id: $parentId, description: $description) {
|
|
461
488
|
id
|
|
@@ -465,7 +492,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
465
492
|
revision
|
|
466
493
|
}
|
|
467
494
|
}
|
|
468
|
-
`,
|
|
495
|
+
`,Xc={name:e.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:e.string().optional().describe("The ID of the parent object schema."),description:e.string().optional().describe("The description for this object schema.")};const Zc=Tc`
|
|
469
496
|
mutation UpdateObjectSchema($id: ID!, $revision: Int!, $parentId: ID, $description: String) {
|
|
470
497
|
update_object_schema(id: $id, revision: $revision, parent_id: $parentId, description: $description) {
|
|
471
498
|
id
|
|
@@ -475,14 +502,14 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
475
502
|
revision
|
|
476
503
|
}
|
|
477
504
|
}
|
|
478
|
-
`,
|
|
505
|
+
`,eu={id:e.string().describe("The ID of the object schema to update."),revision:e.number().describe("The current revision number for optimistic locking. Retrieve it first via get_object_schemas."),parentId:e.string().optional().describe("The ID of the parent object schema."),description:e.string().optional().describe("The new description for this object schema.")};const tu=Tc`
|
|
479
506
|
mutation DeleteObjectSchema($id: ID, $name: String) {
|
|
480
507
|
delete_object_schema(id: $id, name: $name) {
|
|
481
508
|
id
|
|
482
509
|
name
|
|
483
510
|
}
|
|
484
511
|
}
|
|
485
|
-
`,
|
|
512
|
+
`,au={id:e.string().optional().describe("The ID of the object schema to delete. Either id or name must be provided."),name:e.string().optional().describe("The name of the object schema to delete. Either id or name must be provided.")};const ru=Tc`
|
|
486
513
|
mutation DeleteObjectSchemaColumns($objectSchemaId: ID, $objectSchemaName: String, $columnIds: [ID!]!) {
|
|
487
514
|
delete_object_schema_columns(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, column_ids: $columnIds) {
|
|
488
515
|
id
|
|
@@ -492,14 +519,14 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
492
519
|
revision
|
|
493
520
|
}
|
|
494
521
|
}
|
|
495
|
-
`,
|
|
522
|
+
`,iu={objectSchemaId:e.string().optional().describe("The ID of the object schema to delete columns from. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:e.string().optional().describe("The name of the object schema to delete columns from. Either objectSchemaId or objectSchemaName must be provided."),columnIds:e.array(e.string()).describe("IDs of the columns to permanently delete. Only allowed when no boards are connected to the schema.")};const ou=Tc`
|
|
496
523
|
mutation ConnectBoardToObjectSchema($boardId: ID!, $objectSchemaId: ID, $objectSchemaName: String) {
|
|
497
524
|
connect_board_to_object_schema(board_id: $boardId, object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName) {
|
|
498
525
|
id
|
|
499
526
|
object_schema_id
|
|
500
527
|
}
|
|
501
528
|
}
|
|
502
|
-
`,
|
|
529
|
+
`,nu=Tc`
|
|
503
530
|
mutation DetachBoardsFromObjectSchema($boardIds: [ID!]!) {
|
|
504
531
|
detach_boards_from_object_schema(board_ids: $boardIds) {
|
|
505
532
|
board_id
|
|
@@ -507,7 +534,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
507
534
|
error
|
|
508
535
|
}
|
|
509
536
|
}
|
|
510
|
-
`,
|
|
537
|
+
`,su={action:e.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:e.string().optional().describe("Required for action=connect. The ID of the board to connect."),boardIds:e.array(e.string()).optional().describe("Required for action=detach. The IDs of the boards to detach."),objectSchemaId:e.string().optional().describe("Required for action=connect. The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:e.string().optional().describe("Required for action=connect. The name of the object schema. Either objectSchemaId or objectSchemaName must be provided.")};const du=Tc`
|
|
511
538
|
mutation CreateObjectSchemaColumns($objectSchemaId: ID, $objectSchemaName: String, $columns: [CreateObjectSchemaColumnInput!]!) {
|
|
512
539
|
create_object_schema_columns(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, columns: $columns) {
|
|
513
540
|
id
|
|
@@ -517,7 +544,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
517
544
|
revision
|
|
518
545
|
}
|
|
519
546
|
}
|
|
520
|
-
`,
|
|
547
|
+
`,pu=Tc`
|
|
521
548
|
mutation UpdateObjectSchemaColumns($objectSchemaId: ID, $objectSchemaName: String, $columns: [UpdateObjectSchemaColumnInput!]!) {
|
|
522
549
|
update_object_schema_columns(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, columns: $columns) {
|
|
523
550
|
id
|
|
@@ -527,7 +554,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
527
554
|
revision
|
|
528
555
|
}
|
|
529
556
|
}
|
|
530
|
-
`,
|
|
557
|
+
`,lu=e.object({can_override:e.array(e.enum(["title","description","settings"])).optional().describe("Fields that boards can override. Allowed values: title, description, settings."),cannot_delete:e.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."),mu=e.object({type:e.string().describe("Column type (e.g. text, status, numbers, date, dropdown, people). Use get_column_type_info to see available types."),title:e.string().describe("Column title."),description:e.string().optional().describe("Column description."),defaults:e.record(e.unknown()).optional().describe("Type-specific column settings. Call get_column_type_info with the column type before populating this field to understand the valid structure."),policy:lu,opt_out_by_default:e.boolean().optional().describe("If true, the column will not be automatically added to boards connected to this schema.")}),cu=e.object({column_id:e.string().describe("The ID of the column to update."),title:e.string().optional().describe("New column title."),description:e.string().optional().describe("New column description."),defaults:e.record(e.unknown()).optional().describe("Type-specific column settings. Call get_column_type_info with the column type before populating this field."),opt_out_by_default:e.boolean().optional().describe("If true, the column will not be automatically added to boards connected to this schema."),policy:lu}),uu={action:e.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 first to understand valid defaults per column type. update: modifies existing columns. Each entry must include column_id. 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:e.string().optional().describe("The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:e.string().optional().describe("The name of the object schema. Either objectSchemaId or objectSchemaName must be provided."),columns:e.array(e.union([mu,cu])).describe("Array of columns to create or update.")};const hu=Tc`
|
|
531
558
|
mutation SetObjectSchemaColumnActiveState($objectSchemaId: ID, $objectSchemaName: String, $columnId: ID!, $action: ColumnActiveStateAction!) {
|
|
532
559
|
set_object_schema_column_active_state(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, column_id: $columnId, action: $action) {
|
|
533
560
|
id
|
|
@@ -537,7 +564,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
537
564
|
revision
|
|
538
565
|
}
|
|
539
566
|
}
|
|
540
|
-
`,
|
|
567
|
+
`,fu={action:e.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:e.string().optional().describe("The ID of the object schema. Either objectSchemaId or objectSchemaName must be provided."),objectSchemaName:e.string().optional().describe("The name of the object schema. Either objectSchemaId or objectSchemaName must be provided."),columnId:e.string().describe("The ID of the column to deactivate or reactivate.")};const vu={boardName:e.string().describe("The name of the board to create"),boardKind:e.nativeEnum(Yd).default(Yd.Public).describe("The kind of board to create"),boardDescription:e.string().optional().describe("The description of the board to create"),workspaceId:e.string().optional().describe("The ID of the workspace to create the board in")};const gu=Tc`
|
|
541
568
|
mutation createView(
|
|
542
569
|
$boardId: ID!
|
|
543
570
|
$type: ViewKind!
|
|
@@ -551,7 +578,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
551
578
|
type
|
|
552
579
|
}
|
|
553
580
|
}
|
|
554
|
-
`,
|
|
581
|
+
`,_u={boardId:e.string().describe("The board ID to create the view on"),type:e.nativeEnum(Kl).default(Kl.Table).describe("The type of board view to create. Use TABLE for standard board views."),name:e.string().optional().describe('The name of the view (e.g. "High Priority Items", "My Tasks")'),filter:e.object({rules:e.array(e.object({column_id:e.string().describe("The column ID to filter by"),compare_value:e.any().default([]).describe("The value(s) to compare against"),operator:e.nativeEnum(Zp).optional().describe("The comparison operator (defaults to any_of)")})).optional().describe("Filter rules"),operator:e.nativeEnum(Xp).optional().describe("Logical operator between rules (defaults to and)")}).optional().describe("Filter configuration for the view"),sort:e.array(e.object({column_id:e.string().describe("The column ID to sort by"),direction:e.nativeEnum(Jp).optional().describe("Sort direction (defaults to asc)")})).optional().describe("Sort configuration for the view")};const yu=Tc`
|
|
555
582
|
fragment QuestionBasic on FormQuestion {
|
|
556
583
|
id
|
|
557
584
|
type
|
|
@@ -561,7 +588,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
561
588
|
required
|
|
562
589
|
page_block_id
|
|
563
590
|
}
|
|
564
|
-
`,
|
|
591
|
+
`,bu=Tc`
|
|
565
592
|
fragment QuestionOptions on FormQuestion {
|
|
566
593
|
options {
|
|
567
594
|
label
|
|
@@ -570,7 +597,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
570
597
|
active
|
|
571
598
|
}
|
|
572
599
|
}
|
|
573
|
-
`,
|
|
600
|
+
`,wu=Tc`
|
|
574
601
|
fragment QuestionSettings on FormQuestion {
|
|
575
602
|
settings {
|
|
576
603
|
prefill {
|
|
@@ -596,17 +623,17 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
596
623
|
default_answer
|
|
597
624
|
}
|
|
598
625
|
}
|
|
599
|
-
`,
|
|
626
|
+
`,Iu=Tc`
|
|
600
627
|
fragment QuestionComplete on FormQuestion {
|
|
601
628
|
...QuestionBasic
|
|
602
629
|
...QuestionOptions
|
|
603
630
|
...QuestionSettings
|
|
604
631
|
showIfRules
|
|
605
632
|
}
|
|
606
|
-
${_u}
|
|
607
633
|
${yu}
|
|
608
634
|
${bu}
|
|
609
|
-
|
|
635
|
+
${wu}
|
|
636
|
+
`,Tu=Tc`
|
|
610
637
|
fragment FormFeatures on FormFeatures {
|
|
611
638
|
isInternal
|
|
612
639
|
reCaptchaChallenge
|
|
@@ -662,7 +689,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
662
689
|
enabled
|
|
663
690
|
}
|
|
664
691
|
}
|
|
665
|
-
`,
|
|
692
|
+
`,Eu=Tc`
|
|
666
693
|
fragment FormAppearance on FormAppearance {
|
|
667
694
|
hideBranding
|
|
668
695
|
showProgressBar
|
|
@@ -690,19 +717,19 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
690
717
|
text
|
|
691
718
|
}
|
|
692
719
|
}
|
|
693
|
-
`,
|
|
720
|
+
`,Su=Tc`
|
|
694
721
|
fragment FormAccessibility on FormAccessibility {
|
|
695
722
|
language
|
|
696
723
|
logoAltText
|
|
697
724
|
}
|
|
698
|
-
`,
|
|
725
|
+
`,Du=Tc`
|
|
699
726
|
fragment FormTag on FormTag {
|
|
700
727
|
id
|
|
701
728
|
name
|
|
702
729
|
value
|
|
703
730
|
columnId
|
|
704
731
|
}
|
|
705
|
-
`,
|
|
732
|
+
`,Nu=Tc`
|
|
706
733
|
mutation createForm(
|
|
707
734
|
$destination_workspace_id: ID!
|
|
708
735
|
$destination_folder_id: ID
|
|
@@ -729,7 +756,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
729
756
|
token
|
|
730
757
|
}
|
|
731
758
|
}
|
|
732
|
-
`,
|
|
759
|
+
`,Au=Tc`
|
|
733
760
|
query getForm($formToken: String!) {
|
|
734
761
|
form(formToken: $formToken) {
|
|
735
762
|
id
|
|
@@ -758,16 +785,16 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
758
785
|
}
|
|
759
786
|
}
|
|
760
787
|
}
|
|
761
|
-
${wu}
|
|
762
788
|
${Iu}
|
|
763
789
|
${Tu}
|
|
764
790
|
${Eu}
|
|
765
791
|
${Su}
|
|
766
|
-
|
|
792
|
+
${Du}
|
|
793
|
+
`,ku=Tc`
|
|
767
794
|
mutation deleteFormQuestion($formToken: String!, $questionId: String!) {
|
|
768
795
|
delete_question(formToken: $formToken, questionId: $questionId)
|
|
769
796
|
}
|
|
770
|
-
`,
|
|
797
|
+
`,Ou=Tc`
|
|
771
798
|
mutation createFormQuestion($formToken: String!, $question: CreateQuestionInput!) {
|
|
772
799
|
create_form_question(formToken: $formToken, question: $question) {
|
|
773
800
|
...QuestionBasic
|
|
@@ -775,10 +802,10 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
775
802
|
...QuestionSettings
|
|
776
803
|
}
|
|
777
804
|
}
|
|
778
|
-
${_u}
|
|
779
805
|
${yu}
|
|
780
806
|
${bu}
|
|
781
|
-
|
|
807
|
+
${wu}
|
|
808
|
+
`,$u=Tc`
|
|
782
809
|
mutation updateFormQuestion($formToken: String!, $questionId: String!, $question: UpdateQuestionInput!) {
|
|
783
810
|
update_form_question(formToken: $formToken, questionId: $questionId, question: $question) {
|
|
784
811
|
...QuestionBasic
|
|
@@ -786,9 +813,9 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
786
813
|
...QuestionSettings
|
|
787
814
|
}
|
|
788
815
|
}
|
|
789
|
-
${_u}
|
|
790
816
|
${yu}
|
|
791
817
|
${bu}
|
|
818
|
+
${wu}
|
|
792
819
|
`;Tc`
|
|
793
820
|
mutation updateForm($formToken: String!, $input: UpdateFormInput!) {
|
|
794
821
|
update_form(formToken: $formToken, input: $input) {
|
|
@@ -813,46 +840,46 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
813
840
|
}
|
|
814
841
|
}
|
|
815
842
|
}
|
|
816
|
-
${Iu}
|
|
817
843
|
${Tu}
|
|
818
844
|
${Eu}
|
|
819
|
-
|
|
845
|
+
${Su}
|
|
846
|
+
`;const Ru=Tc`
|
|
820
847
|
mutation setFormPassword($formToken: String!, $input: SetFormPasswordInput!) {
|
|
821
848
|
set_form_password(formToken: $formToken, input: $input) {
|
|
822
849
|
id
|
|
823
850
|
}
|
|
824
851
|
}
|
|
825
|
-
`,
|
|
852
|
+
`,Pu=Tc`
|
|
826
853
|
mutation shortenFormUrl($formToken: String!) {
|
|
827
854
|
shorten_form_url(formToken: $formToken) {
|
|
828
855
|
enabled
|
|
829
856
|
url
|
|
830
857
|
}
|
|
831
858
|
}
|
|
832
|
-
`,
|
|
859
|
+
`,Cu=Tc`
|
|
833
860
|
mutation deactivateForm($formToken: String!) {
|
|
834
861
|
deactivate_form(formToken: $formToken)
|
|
835
862
|
}
|
|
836
|
-
`,
|
|
863
|
+
`,xu=Tc`
|
|
837
864
|
mutation activateForm($formToken: String!) {
|
|
838
865
|
activate_form(formToken: $formToken)
|
|
839
866
|
}
|
|
840
|
-
`,
|
|
867
|
+
`,Fu=Tc`
|
|
841
868
|
mutation deleteFormTag($formToken: String!, $tagId: String!) {
|
|
842
869
|
delete_form_tag(formToken: $formToken, tagId: $tagId)
|
|
843
870
|
}
|
|
844
|
-
`,
|
|
871
|
+
`,Lu=Tc`
|
|
845
872
|
mutation createFormTag($formToken: String!, $tag: CreateFormTagInput!) {
|
|
846
873
|
create_form_tag(formToken: $formToken, tag: $tag) {
|
|
847
874
|
...FormTag
|
|
848
875
|
}
|
|
849
876
|
}
|
|
850
|
-
${
|
|
851
|
-
`,
|
|
877
|
+
${Du}
|
|
878
|
+
`,Vu=Tc`
|
|
852
879
|
mutation updateFormTag($formToken: String!, $tagId: String!, $tag: UpdateFormTagInput!) {
|
|
853
880
|
update_form_tag(formToken: $formToken, tagId: $tagId, tag: $tag)
|
|
854
881
|
}
|
|
855
|
-
`,
|
|
882
|
+
`,ju=Tc`
|
|
856
883
|
mutation updateFormAppearance($formToken: String!, $appearance: FormAppearanceInput!) {
|
|
857
884
|
update_form_settings(formToken: $formToken, settings: { appearance: $appearance }) {
|
|
858
885
|
appearance {
|
|
@@ -860,8 +887,8 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
860
887
|
}
|
|
861
888
|
}
|
|
862
889
|
}
|
|
863
|
-
${
|
|
864
|
-
`,
|
|
890
|
+
${Eu}
|
|
891
|
+
`,Uu=Tc`
|
|
865
892
|
mutation updateFormAccessibility($formToken: String!, $accessibility: FormAccessibilityInput!) {
|
|
866
893
|
update_form_settings(formToken: $formToken, settings: { accessibility: $accessibility }) {
|
|
867
894
|
accessibility {
|
|
@@ -869,8 +896,8 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
869
896
|
}
|
|
870
897
|
}
|
|
871
898
|
}
|
|
872
|
-
${
|
|
873
|
-
`,
|
|
899
|
+
${Su}
|
|
900
|
+
`,Mu=Tc`
|
|
874
901
|
mutation updateFormFeatures($formToken: String!, $features: FormFeaturesInput!, $is_anonymous: Boolean) {
|
|
875
902
|
update_form_settings(formToken: $formToken, settings: { features: $features, is_anonymous: $is_anonymous }) {
|
|
876
903
|
features {
|
|
@@ -878,8 +905,8 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
878
905
|
}
|
|
879
906
|
}
|
|
880
907
|
}
|
|
881
|
-
${
|
|
882
|
-
`,
|
|
908
|
+
${Tu}
|
|
909
|
+
`,Bu=Tc`
|
|
883
910
|
mutation updateFormQuestionOrder($formToken: String!, $questions: [QuestionOrderInput!]!) {
|
|
884
911
|
update_form(formToken: $formToken, input: { questions: $questions }) {
|
|
885
912
|
questions {
|
|
@@ -888,14 +915,14 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
888
915
|
}
|
|
889
916
|
}
|
|
890
917
|
}
|
|
891
|
-
`,
|
|
918
|
+
`,qu=Tc`
|
|
892
919
|
mutation updateFormHeader($formToken: String!, $title: String, $description: String) {
|
|
893
920
|
update_form(formToken: $formToken, input: { title: $title, description: $description }) {
|
|
894
921
|
title
|
|
895
922
|
description
|
|
896
923
|
}
|
|
897
924
|
}
|
|
898
|
-
`,qu={questionId:"Question ID. Required for update/delete."},Hu={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 update/delete. Auto-generated.",name:"Required for create. Cannot be updated.",value:"Required for create/update.",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/update/delete. Delete: id only. Create: name+value (id/columnId auto-generated). Update: id+new value.",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."}},Gu={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."}},Wu={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."}},Qu={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"}},zu={destination_workspace_id:e.string(),destination_folder_id:e.string().optional(),destination_folder_name:e.string().optional(),board_kind:e.nativeEnum(Yd).optional(),destination_name:e.string().optional().describe(Hu.args.destinationName),board_owner_ids:e.array(e.string()).optional(),board_owner_team_ids:e.array(e.string()).optional(),board_subscriber_ids:e.array(e.string()).optional().describe(Hu.args.boardSubscriberIds),board_subscriber_teams_ids:e.array(e.string()).optional().describe(Hu.args.boardSubscriberTeamsIds)};var Yu,Ku,Ju,Xu,Zu,eh,th,ah,rh,ih,oh,nh,sh,dh,ph,lh;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(Yu||(Yu={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(Ku||(Ku={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(Ju||(Ju={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(Xu||(Xu={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(Zu||(Zu={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(eh||(eh={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(th||(th={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(ah||(ah={})),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"}(rh||(rh={})),function(e){e.Account="account",e.QueryParam="queryParam"}(ih||(ih={})),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"}(oh||(oh={})),function(e){e.Or="OR"}(nh||(nh={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(sh||(sh={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(dh||(dh={})),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"}(ph||(ph={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(lh||(lh={}));const mh=e.object({type:e.nativeEnum(Gp).describe(Wu.properties.type),title:e.string().describe(Wu.properties.title).optional(),description:e.string().describe(Wu.properties.description).optional(),visible:e.boolean().optional(),required:e.boolean().optional(),insert_after_question_id:e.string().nullish().describe(Wu.properties.insertAfterQuestionId),page_block_id:e.string().nullish().describe(Wu.properties.pageBlockId),show_if_rules:e.object({operator:e.nativeEnum(cp),rules:e.array(e.object({operator:e.nativeEnum(cp),conditions:e.array(e.object({building_block_id:e.string().describe(Wu.showIfConditionBuildingBlockId),operator:e.nativeEnum(cp),values:e.array(e.string()).describe(Wu.showIfConditionValues)}))}))}).describe(Wu.showIfRules).optional(),options:e.array(e.object({label:e.string(),value:e.string().optional().describe(Wu.properties.selectOptionsValue),visible:e.boolean().optional()})).describe(Wu.properties.selectOptions).optional(),settings:e.object({checkedByDefault:e.boolean().describe(Qu.properties.checkedByDefault).optional(),defaultCurrentDate:e.boolean().describe(Qu.properties.defaultCurrentDate).optional(),display:e.nativeEnum(qp).describe(Qu.properties.display).optional(),includeTime:e.boolean().describe(Qu.properties.includeTime).optional(),locationAutofilled:e.boolean().describe(Qu.properties.locationAutofilled).optional(),optionsOrder:e.nativeEnum(Hp).describe(Qu.properties.optionsOrder).optional(),prefixAutofilled:e.boolean().describe(Qu.properties.prefixAutofilled).optional(),prefixPredefined:e.object({enabled:e.boolean(),prefix:e.string().describe(Qu.properties.prefixPredefinedPrefix).optional()}).describe(Qu.properties.prefixPredefined).optional(),skipValidation:e.boolean().describe(Qu.properties.skipValidation).optional(),labelLimitCount:e.number().int().describe(Qu.properties.labelLimitCount).optional(),label_limit_count_enabled:e.boolean().describe(Qu.properties.labelLimitCountEnabled).optional(),default_answer:e.string().describe(Qu.properties.defaultAnswer).optional(),prefill:e.object({enabled:e.boolean(),lookup:e.string().describe(Qu.properties.prefillLookup).optional(),source:e.nativeEnum(Bp).optional()}).describe(Qu.properties.prefill).optional()}).describe("Type-specific question settings. Check each field description to see which question type it applies to.").optional()}),ch={action:e.nativeEnum(lh).describe(Wu.actions.type),formToken:e.string(),questionId:e.string().describe(qu.questionId).optional(),question:mh.describe(Wu.actions.question).optional()};class uh{constructor(e){this.mondayApi=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.mondayApi.request(Au,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 r={formToken:e.formToken,questionId:t,question:a};return await this.mondayApi.request(Ou,r),{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}},r=await this.mondayApi.request(ku,a);return{content:{message:"Question created",question_id:r.create_form_question?.id,action_name:"create"}}}}var hh;!function(e){e.activate="activate",e.deactivate="deactivate",e.shortenFormUrl="shortenFormUrl",e.setFormPassword="setFormPassword",e.createTag="createTag",e.deleteTag="deleteTag",e.updateTag="updateTag",e.updateAppearance="updateAppearance",e.updateAccessibility="updateAccessibility",e.updateFeatures="updateFeatures",e.updateQuestionOrder="updateQuestionOrder",e.updateFormHeader="updateFormHeader"}(hh||(hh={}));const fh=e.object({id:e.string().describe(Hu.properties.tags.id).optional(),name:e.string().describe(Hu.properties.tags.name).optional(),value:e.string().describe(Hu.properties.tags.value).optional(),columnId:e.string().describe(Hu.properties.tags.columnId).optional()}),vh=e.object({type:e.nativeEnum(Xu).optional(),value:e.string().describe(Gu.properties.backgroundValue).optional()}),gh=e.object({format:e.nativeEnum(eh).optional(),alignment:e.nativeEnum(th).optional(),direction:e.nativeEnum(Zu).optional()}),_h=e.object({position:e.nativeEnum(Ju).optional(),size:e.nativeEnum(Ku).describe(Gu.properties.logoSize).optional()}),yh=e.object({text:e.string().optional()}),bh=e.object({font:e.string().optional(),color:e.string().optional(),size:e.nativeEnum(ah).optional()}),wh=e.object({enabled:e.boolean().optional(),redirectUrl:e.string().optional()}),Ih=e.object({allowEditSubmission:e.boolean().optional(),allowResubmit:e.boolean().optional(),allowViewSubmission:e.boolean().optional(),description:e.string().optional(),redirectAfterSubmission:wh.optional(),showSuccessImage:e.boolean().optional(),title:e.string().optional()}),Th=e.object({enabled:e.boolean().optional(),date:e.string().describe(Gu.properties.closeDateValue).optional()}),Eh=e.object({enabled:e.boolean().optional()}),Sh=e.object({itemGroupId:e.string().optional(),includeNameQuestion:e.boolean().describe(Gu.properties.includeNameQuestion).optional(),includeUpdateQuestion:e.boolean().describe(Gu.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:e.boolean().describe(Gu.properties.syncQuestionAndColumnsTitles).optional(),allow_create_item:e.boolean().describe(Gu.properties.allowCreateItem).optional()}),Dh=e.object({enabled:e.boolean().describe(Gu.properties.passwordEnabled).optional()}),Nh=e.object({text:e.string().optional()}),Ah=e.object({enabled:e.boolean().optional(),title:e.string().optional(),description:e.string().optional(),startButton:Nh.optional()}),kh=e.object({enabled:e.boolean().optional(),redirectToLogin:e.boolean().optional()}),Oh=e.object({enabled:e.boolean().optional(),limit:e.number().optional()}),$h=e.object({background:vh.optional(),hideBranding:e.boolean().optional(),layout:gh.optional(),logo:_h.optional(),primaryColor:e.string().optional(),showProgressBar:e.boolean().optional(),submitButton:yh.optional(),text:bh.optional()}),Rh=e.object({language:e.string().describe(Gu.properties.language).optional(),logoAltText:e.string().optional()}),Ph=e.object({enabled:e.boolean().optional()}),Ch=e.object({afterSubmissionView:Ih.optional(),ai_translate:Ph.optional(),closeDate:Th.optional(),draftSubmission:Eh.optional(),monday:Sh.optional(),password:Dh.optional(),preSubmissionView:Ah.optional(),reCaptchaChallenge:e.boolean().optional(),requireLogin:kh.optional(),responseLimit:Oh.optional(),is_anonymous:e.boolean().describe(Hu.properties.isAnonymous).optional()}),xh=e.object({id:e.string().describe(Hu.inputs.questionId),page_block_id:e.string().describe(Wu.properties.pageBlockId).optional()}),Fh=e.object({appearance:$h.describe(Hu.inputs.form.appearance).optional(),accessibility:Rh.describe(Hu.inputs.form.accessibility).optional(),features:Ch.describe(Hu.inputs.form.features).optional(),title:e.string().describe(Hu.inputs.title).optional(),description:e.string().describe(Hu.inputs.description).optional(),questions:e.array(xh).describe(Hu.inputs.questions).optional()}),Lh={formToken:e.string(),action:e.nativeEnum(hh).describe(Hu.operations.updateForm.action),formPassword:e.string().describe(Gu.operations.setFormPassword).optional(),tag:fh.describe(Hu.inputs.tag).optional(),form:Fh.describe(Hu.inputs.form.describe).optional()};class Vh{constructor(e){this.mondayApi=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.mondayApi.request($u,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.mondayApi.request(Ru,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.mondayApi.request(Pu,t),{content:{message:"Form successfully deactivated",form_token:e.formToken,action_name:"deactivateForm"}}}async activateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(Cu,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,value:e.tag.value}},a=await this.mondayApi.request(Fu,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.mondayApi.request(xu,t),{content:{message:"Tag deleted",form_token:e.formToken,tag_id:e.tag.id,action_name:"deleteTag"}}}async updateTag(e){if(!e.tag)return{content:'Tag is required for the action "updateTag" in the update form tool.'};if(!e.tag.id||!e.tag.value)return{content:'Tag id and value are required for the action "updateTag" in the update form tool.'};const t={formToken:e.formToken,tagId:e.tag.id,tag:{value:e.tag.value}};return(await this.mondayApi.request(Lu,t)).update_form_tag?{content:{message:"Tag updated",form_token:e.formToken,tag_id:e.tag.id,action_name:"updateTag"}}:{content:`Unable to update tag with id: ${e.tag.id}.`}}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.mondayApi.request(Vu,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.mondayApi.request(ju,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,r={formToken:e.formToken,features:a,is_anonymous:t},i=await this.mondayApi.request(Uu,r);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.mondayApi.request(Mu,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.mondayApi.request(Bu,t);return{content:{message:"Form header updated",form_token:e.formToken,action_name:"updateFormHeader",data:a.update_form}}}}const jh={formToken:e.string()};const Uh=1e3;var Mh,Bh;!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"}(Mh||(Mh={})),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=Uh]="SECOND"}(Bh||(Bh={}));const qh=10*Bh.SECOND;function Hh(e,t){const a=e?.response?.errors?.map((e=>e.message))?.join(", ");if(a)throw new Error(`Failed to ${t}: ${a}`);const r=e instanceof Error?e.message:"Unknown error";throw new Error(`Failed to ${t}: ${r}`)}function Gh(e){if(e instanceof Error&&"AbortError"===e.name)throw new Error("Search has timed out, try providing alternative search term")}const Wh=Tc`
|
|
925
|
+
`,Hu={questionId:"Question ID. Required for update/delete."},Gu={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 update/delete. Auto-generated.",name:"Required for create. Cannot be updated.",value:"Required for create/update.",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/update/delete. Delete: id only. Create: name+value (id/columnId auto-generated). Update: id+new value.",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."}},Wu={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."}},Qu={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."}},zu={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"}},Yu={destination_workspace_id:e.string(),destination_folder_id:e.string().optional(),destination_folder_name:e.string().optional(),board_kind:e.nativeEnum(Yd).optional(),destination_name:e.string().optional().describe(Gu.args.destinationName),board_owner_ids:e.array(e.string()).optional(),board_owner_team_ids:e.array(e.string()).optional(),board_subscriber_ids:e.array(e.string()).optional().describe(Gu.args.boardSubscriberIds),board_subscriber_teams_ids:e.array(e.string()).optional().describe(Gu.args.boardSubscriberTeamsIds)};var Ku,Ju,Xu,Zu,eh,th,ah,rh,ih,oh,nh,sh,dh,ph,lh,mh;!function(e){e.Internal="internal",e.InlineInternal="inline_internal",e.Preview="preview",e.Standard="standard",e.EnforcedItemCreationForm="enforced_item_creation_form"}(Ku||(Ku={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large",e.ExtraLarge="ExtraLarge"}(Ju||(Ju={})),function(e){e.Auto="Auto",e.Left="Left",e.Center="Center",e.Right="Right"}(Xu||(Xu={})),function(e){e.Image="Image",e.Color="Color",e.None="None"}(Zu||(Zu={})),function(e){e.LtR="LtR",e.Rtl="Rtl"}(eh||(eh={})),function(e){e.OneByOne="OneByOne",e.Classic="Classic"}(th||(th={})),function(e){e.FullLeft="FullLeft",e.Left="Left",e.Center="Center",e.Right="Right",e.FullRight="FullRight"}(ah||(ah={})),function(e){e.Small="Small",e.Medium="Medium",e.Large="Large"}(rh||(rh={})),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"}(ih||(ih={})),function(e){e.Account="account",e.QueryParam="queryParam"}(oh||(oh={})),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"}(nh||(nh={})),function(e){e.Or="OR"}(sh||(sh={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Dropdown="dropdown"}(dh||(dh={})),function(e){e.Alphabetical="alphabetical",e.Random="random",e.Custom="custom"}(ph||(ph={})),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"}(lh||(lh={})),function(e){e.Delete="delete",e.Update="update",e.Create="create"}(mh||(mh={}));const ch=e.object({type:e.nativeEnum(Gp).describe(Qu.properties.type),title:e.string().describe(Qu.properties.title).optional(),description:e.string().describe(Qu.properties.description).optional(),visible:e.boolean().optional(),required:e.boolean().optional(),insert_after_question_id:e.string().nullish().describe(Qu.properties.insertAfterQuestionId),page_block_id:e.string().nullish().describe(Qu.properties.pageBlockId),show_if_rules:e.object({operator:e.nativeEnum(cp),rules:e.array(e.object({operator:e.nativeEnum(cp),conditions:e.array(e.object({building_block_id:e.string().describe(Qu.showIfConditionBuildingBlockId),operator:e.nativeEnum(cp),values:e.array(e.string()).describe(Qu.showIfConditionValues)}))}))}).describe(Qu.showIfRules).optional(),options:e.array(e.object({label:e.string(),value:e.string().optional().describe(Qu.properties.selectOptionsValue),visible:e.boolean().optional()})).describe(Qu.properties.selectOptions).optional(),settings:e.object({checkedByDefault:e.boolean().describe(zu.properties.checkedByDefault).optional(),defaultCurrentDate:e.boolean().describe(zu.properties.defaultCurrentDate).optional(),display:e.nativeEnum(qp).describe(zu.properties.display).optional(),includeTime:e.boolean().describe(zu.properties.includeTime).optional(),locationAutofilled:e.boolean().describe(zu.properties.locationAutofilled).optional(),optionsOrder:e.nativeEnum(Hp).describe(zu.properties.optionsOrder).optional(),prefixAutofilled:e.boolean().describe(zu.properties.prefixAutofilled).optional(),prefixPredefined:e.object({enabled:e.boolean(),prefix:e.string().describe(zu.properties.prefixPredefinedPrefix).optional()}).describe(zu.properties.prefixPredefined).optional(),skipValidation:e.boolean().describe(zu.properties.skipValidation).optional(),labelLimitCount:e.number().int().describe(zu.properties.labelLimitCount).optional(),label_limit_count_enabled:e.boolean().describe(zu.properties.labelLimitCountEnabled).optional(),default_answer:e.string().describe(zu.properties.defaultAnswer).optional(),prefill:e.object({enabled:e.boolean(),lookup:e.string().describe(zu.properties.prefillLookup).optional(),source:e.nativeEnum(Bp).optional()}).describe(zu.properties.prefill).optional()}).describe("Type-specific question settings. Check each field description to see which question type it applies to.").optional()}),uh={action:e.nativeEnum(mh).describe(Qu.actions.type),formToken:e.string(),questionId:e.string().describe(Hu.questionId).optional(),question:ch.describe(Qu.actions.question).optional()};class hh{constructor(e){this.mondayApi=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.mondayApi.request(ku,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 r={formToken:e.formToken,questionId:t,question:a};return await this.mondayApi.request($u,r),{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}},r=await this.mondayApi.request(Ou,a);return{content:{message:"Question created",question_id:r.create_form_question?.id,action_name:"create"}}}}var fh;!function(e){e.activate="activate",e.deactivate="deactivate",e.shortenFormUrl="shortenFormUrl",e.setFormPassword="setFormPassword",e.createTag="createTag",e.deleteTag="deleteTag",e.updateTag="updateTag",e.updateAppearance="updateAppearance",e.updateAccessibility="updateAccessibility",e.updateFeatures="updateFeatures",e.updateQuestionOrder="updateQuestionOrder",e.updateFormHeader="updateFormHeader"}(fh||(fh={}));const vh=e.object({id:e.string().describe(Gu.properties.tags.id).optional(),name:e.string().describe(Gu.properties.tags.name).optional(),value:e.string().describe(Gu.properties.tags.value).optional(),columnId:e.string().describe(Gu.properties.tags.columnId).optional()}),gh=e.object({type:e.nativeEnum(Zu).optional(),value:e.string().describe(Wu.properties.backgroundValue).optional()}),_h=e.object({format:e.nativeEnum(th).optional(),alignment:e.nativeEnum(ah).optional(),direction:e.nativeEnum(eh).optional()}),yh=e.object({position:e.nativeEnum(Xu).optional(),size:e.nativeEnum(Ju).describe(Wu.properties.logoSize).optional()}),bh=e.object({text:e.string().optional()}),wh=e.object({font:e.string().optional(),color:e.string().optional(),size:e.nativeEnum(rh).optional()}),Ih=e.object({enabled:e.boolean().optional(),redirectUrl:e.string().optional()}),Th=e.object({allowEditSubmission:e.boolean().optional(),allowResubmit:e.boolean().optional(),allowViewSubmission:e.boolean().optional(),description:e.string().optional(),redirectAfterSubmission:Ih.optional(),showSuccessImage:e.boolean().optional(),title:e.string().optional()}),Eh=e.object({enabled:e.boolean().optional(),date:e.string().describe(Wu.properties.closeDateValue).optional()}),Sh=e.object({enabled:e.boolean().optional()}),Dh=e.object({itemGroupId:e.string().optional(),includeNameQuestion:e.boolean().describe(Wu.properties.includeNameQuestion).optional(),includeUpdateQuestion:e.boolean().describe(Wu.properties.includeUpdateQuestion).optional(),syncQuestionAndColumnsTitles:e.boolean().describe(Wu.properties.syncQuestionAndColumnsTitles).optional(),allow_create_item:e.boolean().describe(Wu.properties.allowCreateItem).optional()}),Nh=e.object({enabled:e.boolean().describe(Wu.properties.passwordEnabled).optional()}),Ah=e.object({text:e.string().optional()}),kh=e.object({enabled:e.boolean().optional(),title:e.string().optional(),description:e.string().optional(),startButton:Ah.optional()}),Oh=e.object({enabled:e.boolean().optional(),redirectToLogin:e.boolean().optional()}),$h=e.object({enabled:e.boolean().optional(),limit:e.number().optional()}),Rh=e.object({background:gh.optional(),hideBranding:e.boolean().optional(),layout:_h.optional(),logo:yh.optional(),primaryColor:e.string().optional(),showProgressBar:e.boolean().optional(),submitButton:bh.optional(),text:wh.optional()}),Ph=e.object({language:e.string().describe(Wu.properties.language).optional(),logoAltText:e.string().optional()}),Ch=e.object({enabled:e.boolean().optional()}),xh=e.object({afterSubmissionView:Th.optional(),ai_translate:Ch.optional(),closeDate:Eh.optional(),draftSubmission:Sh.optional(),monday:Dh.optional(),password:Nh.optional(),preSubmissionView:kh.optional(),reCaptchaChallenge:e.boolean().optional(),requireLogin:Oh.optional(),responseLimit:$h.optional(),is_anonymous:e.boolean().describe(Gu.properties.isAnonymous).optional()}),Fh=e.object({id:e.string().describe(Gu.inputs.questionId),page_block_id:e.string().describe(Qu.properties.pageBlockId).optional()}),Lh=e.object({appearance:Rh.describe(Gu.inputs.form.appearance).optional(),accessibility:Ph.describe(Gu.inputs.form.accessibility).optional(),features:xh.describe(Gu.inputs.form.features).optional(),title:e.string().describe(Gu.inputs.title).optional(),description:e.string().describe(Gu.inputs.description).optional(),questions:e.array(Fh).describe(Gu.inputs.questions).optional()}),Vh={formToken:e.string(),action:e.nativeEnum(fh).describe(Gu.operations.updateForm.action),formPassword:e.string().describe(Wu.operations.setFormPassword).optional(),tag:vh.describe(Gu.inputs.tag).optional(),form:Lh.describe(Gu.inputs.form.describe).optional()};class jh{constructor(e){this.mondayApi=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.mondayApi.request(Ru,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.mondayApi.request(Pu,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.mondayApi.request(Cu,t),{content:{message:"Form successfully deactivated",form_token:e.formToken,action_name:"deactivateForm"}}}async activateForm(e){const t={formToken:e.formToken};return await this.mondayApi.request(xu,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,value:e.tag.value}},a=await this.mondayApi.request(Lu,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.mondayApi.request(Fu,t),{content:{message:"Tag deleted",form_token:e.formToken,tag_id:e.tag.id,action_name:"deleteTag"}}}async updateTag(e){if(!e.tag)return{content:'Tag is required for the action "updateTag" in the update form tool.'};if(!e.tag.id||!e.tag.value)return{content:'Tag id and value are required for the action "updateTag" in the update form tool.'};const t={formToken:e.formToken,tagId:e.tag.id,tag:{value:e.tag.value}};return(await this.mondayApi.request(Vu,t)).update_form_tag?{content:{message:"Tag updated",form_token:e.formToken,tag_id:e.tag.id,action_name:"updateTag"}}:{content:`Unable to update tag with id: ${e.tag.id}.`}}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.mondayApi.request(ju,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.mondayApi.request(Uu,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,r={formToken:e.formToken,features:a,is_anonymous:t},i=await this.mondayApi.request(Mu,r);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.mondayApi.request(Bu,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.mondayApi.request(qu,t);return{content:{message:"Form header updated",form_token:e.formToken,action_name:"updateFormHeader",data:a.update_form}}}}const Uh={formToken:e.string()};const Mh=1e3;var Bh,qh;!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"}(Bh||(Bh={})),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=Mh]="SECOND"}(qh||(qh={}));const Hh=10*qh.SECOND;function Gh(e,t){const a=e?.response?.errors?.map((e=>e.message))?.join(", ");if(a)throw new Error(`Failed to ${t}: ${a}`);const r=e instanceof Error?e.message:"Unknown error";throw new Error(`Failed to ${t}: ${r}`)}function Wh(e){if(e instanceof Error&&"AbortError"===e.name)throw new Error("Search has timed out, try providing alternative search term")}const Qh=Tc`
|
|
899
926
|
mutation CreateFormSubmission(
|
|
900
927
|
$form_token: String!
|
|
901
928
|
$answers: [FormAnswerInput!]!
|
|
@@ -913,13 +940,13 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
913
940
|
id
|
|
914
941
|
}
|
|
915
942
|
}
|
|
916
|
-
`,
|
|
943
|
+
`,zh=e.object({phone:e.string().describe("The phone number."),country_short_name:e.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Yh=e.object({country_name:e.string().describe('The full country name (e.g. "United States").'),country_code:e.string().describe('The ISO 3166-1 alpha-2 country code (e.g. "US").')}),Kh=e.object({date:e.string().describe("The date in YYYY-MM-DD format."),zone_diff:e.number().int().optional().describe("UTC offset in minutes.")}),Jh=e.object({from:e.string().describe("Start date in YYYY-MM-DD format."),to:e.string().describe("End date in YYYY-MM-DD format.")}),Xh=e.object({lat:e.number().describe("Latitude."),lng:e.number().describe("Longitude."),place_id:e.string().describe("Google Maps place ID."),address:e.string().describe("Full formatted address."),country:e.object({long_name:e.string().describe("Full country name."),short_name:e.string().describe("ISO 3166-1 alpha-2 country code.")}),city:e.object({long_name:e.string().describe("Full city name."),short_name:e.string().describe("Abbreviated city name.")}),street:e.object({long_name:e.string().describe("Full street name."),short_name:e.string().describe("Abbreviated street name.")}),street_number:e.object({long_name:e.string().describe("Full street number."),short_name:e.string().describe("Abbreviated street number.")})}),Zh=e.object({id:e.string().describe("The file ID returned by the workforms upload endpoint."),name:e.string().describe('Original file name (e.g. "image.png").'),extension:e.string().optional().describe('File extension (e.g. "pdf", "png").'),is_image:e.boolean().optional().describe("Whether the file is an image.")}),ef=e.object({question_id:e.string().describe("The ID of the question being answered."),name:e.string().optional().describe("Answer for name questions."),email:e.string().optional().describe("Answer for email questions."),short_text:e.string().optional().describe("Answer for short text questions."),long_text:e.string().optional().describe("Answer for long text questions."),link:e.string().optional().describe("Answer for link questions."),updates:e.string().optional().describe("Answer for updates questions."),boolean:e.boolean().optional().describe("Answer for boolean questions."),number:e.number().optional().describe("Answer for number questions."),rating:e.number().positive().optional().describe("Answer for rating questions. Must be a positive number within the question's configured limit."),single_select:e.string().optional().describe("Answer for single-select questions — the selected option ID."),multi_select:e.array(e.number()).optional().describe("Answer for multi-select questions — list of selected option IDs."),people:e.array(e.string()).optional().describe("Answer for people questions — list of user IDs. Obtain user IDs via the list_users_and_teams tool."),connected_boards:e.array(e.string()).optional().describe("Answer for connected boards questions — list of connected item IDs."),phone:zh.optional().describe("Answer for phone questions."),country:Yh.optional().describe("Answer for country questions."),date:Kh.optional().describe("Answer for date questions."),date_range:Jh.optional().describe("Answer for date range questions."),location:Xh.optional().describe("Answer for location questions. Requires a Google Maps place ID and structured address components."),file:e.array(Zh).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:Zh.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."),tf={form_token:e.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:e.array(ef).describe("Array of answers to submit. Each answer specifies a question_id and the value for that question type."),form_timezone_offset:e.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:e.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:e.array(e.object({column_id:e.string().describe("The column ID this tag maps to."),value:e.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 af=Object.fromEntries(Object.entries(mp).filter((([e])=>"Person"!==e))),rf={columnType:e.nativeEnum(af).describe("The type of the column to be created"),columnTitle:e.string().describe("The title of the column to be created"),columnDescription:e.string().optional().describe("The description of the column to be created"),columnSettings:e.string().optional().describe("Column-specific configuration settings as a JSON string. Use the get_column_type_info tool to fetch the JSON schema for the given column type.")},of={boardId:e.number().describe("The id of the board to which the new column will be added"),...rf};const nf={columnId:e.string().describe("The id of the column to update"),columnType:e.nativeEnum(af).describe("The type of the column being updated. Must match the existing column type."),revision:e.string().describe("The current revision of the column, obtained from get_board_schema. Used for optimistic concurrency control: if the column changed since you read it, the request will fail and you should re-fetch the latest revision before retrying."),columnTitle:e.string().optional().describe("The new title of the column. If omitted, the title is unchanged."),columnDescription:e.string().optional().describe("The new description of the column. If omitted, the description is unchanged."),columnSettings:e.string().optional().describe("Type-specific configuration as a JSON string. Use the get_column_type_info tool to fetch the JSON schema for the given column type. If omitted, settings are unchanged.")},sf={boardId:e.number().describe("The id of the board containing the column"),...nf};const df={color:e.nativeEnum(up).describe("The color of the custom activity"),icon_id:e.nativeEnum(hp).describe("The icon ID of the custom activity"),name:e.string().describe("The name of the custom activity")};const pf=Tc`
|
|
917
944
|
mutation createNotification($user_id: ID!, $target_id: ID!, $text: String!, $target_type: NotificationTargetType!) {
|
|
918
945
|
create_notification(user_id: $user_id, target_id: $target_id, text: $text, target_type: $target_type) {
|
|
919
946
|
text
|
|
920
947
|
}
|
|
921
948
|
}
|
|
922
|
-
`,
|
|
949
|
+
`,lf={user_id:e.string().describe("The user ID to send the notification to"),target_id:e.string().describe("The target ID (update/reply ID for Post type, item/board ID for Project type)"),text:e.string().describe("The notification text"),target_type:e.nativeEnum(dl).describe("The target type (Post for update/reply, Project for item/board)")};const mf=Tc`
|
|
923
950
|
mutation createGroup(
|
|
924
951
|
$boardId: ID!
|
|
925
952
|
$groupName: String!
|
|
@@ -938,7 +965,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
938
965
|
title
|
|
939
966
|
}
|
|
940
967
|
}
|
|
941
|
-
`,
|
|
968
|
+
`,cf=["#037f4c","#00c875","#9cd326","#cab641","#ffcb00","#784bd1","#9d50dd","#007eb5","#579bfc","#66ccff","#bb3354","#df2f4a","#ff007f","#ff5ac4","#ff642e","#fdab3d","#7f5347","#c4c4c4","#757575"],uf={boardId:e.string().describe("The ID of the board to create the group in"),groupName:e.string().max(255).describe("The name of the new group (maximum 255 characters)"),groupColor:e.enum(cf).optional().describe(`The color for the group. Must be one of the predefined Monday.com group colors: ${cf.join(", ")}`),relativeTo:e.string().optional().describe("The ID of the group to position this new group relative to"),positionRelativeMethod:e.nativeEnum(hl).optional().describe("Whether to position the new group before or after the relativeTo group")};const hf=Tc`
|
|
942
969
|
mutation duplicateItem($boardId: ID!, $itemId: ID!, $withUpdates: Boolean) {
|
|
943
970
|
duplicate_item(board_id: $boardId, item_id: $itemId, with_updates: $withUpdates) {
|
|
944
971
|
id
|
|
@@ -946,7 +973,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
946
973
|
url
|
|
947
974
|
}
|
|
948
975
|
}
|
|
949
|
-
`,
|
|
976
|
+
`,ff=Tc`
|
|
950
977
|
mutation createSubitem($parentItemId: ID!, $itemName: String!, $columnValues: JSON) {
|
|
951
978
|
create_subitem(parent_item_id: $parentItemId, item_name: $itemName, column_values: $columnValues) {
|
|
952
979
|
id
|
|
@@ -957,7 +984,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
957
984
|
}
|
|
958
985
|
}
|
|
959
986
|
}
|
|
960
|
-
`,
|
|
987
|
+
`,vf={name:e.string().describe("The name of the new item to be created, must be relevant to the user's request"),groupId:e.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: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\\"},\\"dropdown_id\\":\\"value\\", \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"'),parentItemId:e.number().optional().describe("The id of the parent item under which the new subitem will be created"),duplicateFromItemId:e.number().optional().describe("The id of existing item to duplicate and update with new values (only provide when duplicating)")},gf={boardId:e.number().describe("The id of the board to which the new item will be added"),...vf};const _f={item_id:e.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:e.string().describe("The ID of the custom activity for the timeline item"),title:e.string().describe("The title of the new timeline item"),summary:e.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:e.string().optional().describe("The content of the new timeline item"),timestamp:e.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:e.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:e.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:e.string().optional().describe("The location to add to the new timeline item"),phone:e.string().optional().describe("The phone number to add to the new timeline item"),url:e.string().optional().describe("The URL to add to the new timeline item")};const yf=Tc`
|
|
961
988
|
mutation createUpdate($itemId: ID!, $body: String!, $mentionsList: [UpdateMention], $parentId: ID) {
|
|
962
989
|
create_update(body: $body, item_id: $itemId, mentions_list: $mentionsList, parent_id: $parentId) {
|
|
963
990
|
id
|
|
@@ -968,7 +995,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
968
995
|
}
|
|
969
996
|
}
|
|
970
997
|
}
|
|
971
|
-
`,
|
|
998
|
+
`,bf=e.object({id:e.string().describe("The ID of the entity to mention"),type:e.nativeEnum(nl).describe("The type of mention: User, Team, Board, or Project")}),wf=e.array(bf),If={itemId:e.number().describe("The id of the item to which the update will be added"),body:e.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:e.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:e.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")};const Tf=Tc`
|
|
972
999
|
query GetItemUpdates($itemId: ID!, $limit: Int, $page: Int, $includeReplies: Boolean!, $includeAssets: Boolean!) {
|
|
973
1000
|
items(ids: [$itemId]) {
|
|
974
1001
|
id
|
|
@@ -1004,7 +1031,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1004
1031
|
}
|
|
1005
1032
|
}
|
|
1006
1033
|
}
|
|
1007
|
-
`,
|
|
1034
|
+
`,Ef=Tc`
|
|
1008
1035
|
query GetBoardUpdates($boardId: ID!, $limit: Int, $page: Int, $includeReplies: Boolean!, $includeAssets: Boolean!, $fromDate: ISO8601DateTime, $toDate: ISO8601DateTime, $boardUpdatesOnly: Boolean) {
|
|
1009
1036
|
boards(ids: [$boardId]) {
|
|
1010
1037
|
id
|
|
@@ -1040,7 +1067,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1040
1067
|
}
|
|
1041
1068
|
}
|
|
1042
1069
|
}
|
|
1043
|
-
`;var
|
|
1070
|
+
`;var Sf;!function(e){e.Item="Item",e.Board="Board"}(Sf||(Sf={}));const Df={objectId:e.string().describe("The ID of the item or board to get updates from"),objectType:e.enum([Sf.Item,Sf.Board]).describe("Type of object for which objectId was provided"),limit:e.number().min(1).max(100).optional().default(25).describe("Number of updates per page (default: 25, max: 100)"),page:e.number().min(1).optional().default(1).describe("Page number for pagination (default: 1)"),includeReplies:e.boolean().optional().default(!1).describe("Include update replies in the response"),includeAssets:e.boolean().optional().default(!1).describe("Include file attachments in the response"),fromDate:e.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:e.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:e.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 Nf(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e}const Af={columnId:e.string().describe("The id of the column to be deleted")},kf={boardId:e.number().describe("The id of the board to which the new column will be added"),...Af};const Of={itemId:e.number()};const $f={};const Rf=Tc`
|
|
1044
1071
|
query getBoardData($boardId: ID!, $itemsLimit: Int!, $queryParams: ItemsQuery) {
|
|
1045
1072
|
boards(ids: [$boardId]) {
|
|
1046
1073
|
id
|
|
@@ -1083,7 +1110,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1083
1110
|
}
|
|
1084
1111
|
}
|
|
1085
1112
|
}
|
|
1086
|
-
`,
|
|
1113
|
+
`,Pf=Tc`
|
|
1087
1114
|
query getUsersByIds($userIds: [ID!]!) {
|
|
1088
1115
|
users(ids: $userIds) {
|
|
1089
1116
|
id
|
|
@@ -1091,7 +1118,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1091
1118
|
photo_tiny
|
|
1092
1119
|
}
|
|
1093
1120
|
}
|
|
1094
|
-
|
|
1121
|
+
`,Cf=e.array(e.object({columnId:e.string().describe("The id of the column to filter by"),compareAttribute:e.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:e.union([e.string(),e.number(),e.boolean(),e.array(e.union([e.string(),e.number()]))]).describe("The value to compare the attribute to. This can be a string or index value depending on the column type."),operator:e.nativeEnum(Zp).optional().default(Zp.AnyOf).describe("The operator to use for the filter")})).optional().describe('The configuration of filters to apply on the items. Before sending the filters, use get_board_info tool to check "filteringGuidelines" key for filtering by the column.'),xf=e.nativeEnum(Xp).optional().default(Xp.And).describe("The operator to use for the filters"),Ff={boardId:e.string().describe("The ID of the board to fetch complete data for"),filters:Cf,filtersOperator:xf};const Lf=Tc`
|
|
1095
1122
|
query GetBoardAllActivity(
|
|
1096
1123
|
$boardId: ID!
|
|
1097
1124
|
$fromDate: ISO8601DateTime!
|
|
@@ -1112,7 +1139,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1112
1139
|
}
|
|
1113
1140
|
}
|
|
1114
1141
|
}
|
|
1115
|
-
`,
|
|
1142
|
+
`,Vf={boardId:e.number().describe("The id of the board to get activity for"),fromDate:e.string().optional().describe("Start date for activity range (ISO8601DateTime format). Defaults to 30 days ago"),toDate:e.string().optional().describe("End date for activity range (ISO8601DateTime format). Defaults to now"),includeData:e.boolean().optional().default(!1).describe("Whether to include the raw data payload for each activity entry. The data field contains the full before/after state of changes and can be very large. Only set to true when you need the detailed change data.")};const jf=Tc`
|
|
1116
1143
|
query GetBoardInfo($boardId: ID!) {
|
|
1117
1144
|
boards(ids: [$boardId]) {
|
|
1118
1145
|
# Basic Board Metadata
|
|
@@ -1156,6 +1183,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1156
1183
|
description
|
|
1157
1184
|
type
|
|
1158
1185
|
settings
|
|
1186
|
+
revision
|
|
1159
1187
|
}
|
|
1160
1188
|
|
|
1161
1189
|
# All Groups with Metadata
|
|
@@ -1199,7 +1227,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1199
1227
|
}
|
|
1200
1228
|
}
|
|
1201
1229
|
}
|
|
1202
|
-
`,
|
|
1230
|
+
`,Uf=Tc`
|
|
1203
1231
|
query GetBoardInfoJustColumns($boardId: ID!) {
|
|
1204
1232
|
boards(ids: [$boardId]) {
|
|
1205
1233
|
columns {
|
|
@@ -1208,10 +1236,11 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1208
1236
|
description
|
|
1209
1237
|
type
|
|
1210
1238
|
settings
|
|
1239
|
+
revision
|
|
1211
1240
|
}
|
|
1212
1241
|
}
|
|
1213
1242
|
}
|
|
1214
|
-
`,
|
|
1243
|
+
`,Mf=(e,t)=>({board:{...e,subItemColumns:t?.columns??void 0},filteringGuidelines:Gf(e.columns.filter(Bf)),aggregationGuidelines:Hf()});function Bf(e){return!!e&&["id","type"].every((t=>t in e))}const qf={last_updated:'Supported operators: any_of, not_any_of. CompareValue should be either:\n - "TODAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "YESTERDAY" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_WEEK" - requires to also specify compareAttribute: "UPDATED_AT"\n - "THIS_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\n - "LAST_MONTH" - requires to also specify compareAttribute: "UPDATED_AT"\nEXAMPLES:\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // using TODAY with correct compareAttribute\n ✅ Correct: {"columnId": "last_updated", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "UPDATED_AT"} // using THIS_WEEK with not_any_of\n ❌ Wrong: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of"} // missing required compareAttribute\n ❌ Wrong: {"columnId": "last_updated", "compareValue": "TODAY", "operator": "any_of", "compareAttribute": "UPDATED_AT"} // not using array for any_of operator',date:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue should be either:\n - Date in "YYYY-MM-DD" format must be passed along with "EXACT" string e.g. compareValue:["2025-01-01", "EXACT"]\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\nEXAMPLES:\n ✅ Correct: {"columnId": "date", "compareValue": ["2025-01-01", "EXACT"], "operator": "any_of"} // using exact date format with EXACT\n ✅ Correct: {"columnId": "date", "compareValue": "TODAY", "operator": "greater_than"} // using TODAY with greater_than\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',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'},Hf=()=>`\n## [IMPORTANT] Best Practices\n- When asked to get count of items you MUST USE ${Rd.CountItems} function. Do not use ${Rd.Count} function for that purpose.\n `,Gf=e=>{const t=e.reduce(((e,t)=>qf[t.type]?(e[t.type]||(e[t.type]=[]),e[t.type].push(t.id),e):e),{});return 0===Object.keys(t).length?"":`\n[MEMORY] Remember the filtering guidelines for subsequent requests for the same board.\n# 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, ends_with operators\n\n## [IMPORTANT] Column type Guidelines\n${Object.entries(t).map((([e,t])=>`- Column Type: ${e} (Column IDs: ${t.join(", ")}) - ${qf[e]}`)).join("\n\n")}\n\n## [IMPORTANT] Sub Items Columns MUST NOT BE USED FOR FILTERING.\n `},Wf={boardId:e.number().describe("The id of the board to get information for")};const Qf=Tc`
|
|
1215
1244
|
fragment ItemDataFragment on Item {
|
|
1216
1245
|
id
|
|
1217
1246
|
name
|
|
@@ -1274,7 +1303,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1274
1303
|
}
|
|
1275
1304
|
}
|
|
1276
1305
|
}
|
|
1277
|
-
`,
|
|
1306
|
+
`,zf=Tc`
|
|
1278
1307
|
query SearchItemsDev($query: String!, $limit: Int, $boardIds: [ID!]) {
|
|
1279
1308
|
search {
|
|
1280
1309
|
items(query: $query, limit: $limit, board_ids: $boardIds) {
|
|
@@ -1284,11 +1313,11 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1284
1313
|
}
|
|
1285
1314
|
}
|
|
1286
1315
|
}
|
|
1287
|
-
`,
|
|
1316
|
+
`,Yf={boardId:e.number().describe("The id of the board to get items from"),itemIds:e.array(e.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:e.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:e.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:e.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:e.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeItemDescription:e.boolean().optional().default(!1).describe("Whether to include the item's description in the response. The item description is the rich-text body content that appears inside a monday.com item (similar to a task description or issue body). Set this to true when the user asks about an item's description, details, body, or notes. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the item description content."),includeSubItems:e.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:e.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filters:Cf,filtersOperator:xf,columnIds:e.array(e.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderBy:e.array(e.object({columnId:e.string().describe("The id of the column to order by"),direction:e.nativeEnum(Jp).optional().default(Jp.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 Kf={boardId:e.number().describe("The id of the board to get the schema of")};const Jf=Tc`
|
|
1288
1317
|
query GetColumnTypeSchema($type: ColumnType!) {
|
|
1289
1318
|
get_column_type_schema(type: $type)
|
|
1290
1319
|
}
|
|
1291
|
-
`,
|
|
1320
|
+
`,Xf="https://developer.monday.com/api-reference",Zf={columnType:e.nativeEnum(af).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const ev={random_string:e.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:e.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const tv={typeName:e.string().describe("The name of the GraphQL type to get details for")};const av=Tc`
|
|
1292
1321
|
fragment UserDetails on User {
|
|
1293
1322
|
# Basic User Information
|
|
1294
1323
|
id
|
|
@@ -1320,31 +1349,31 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1320
1349
|
time_zone_identifier
|
|
1321
1350
|
utc_hours_diff
|
|
1322
1351
|
}
|
|
1323
|
-
`,
|
|
1352
|
+
`,rv=Tc`
|
|
1324
1353
|
fragment UserTeamMembership on Team {
|
|
1325
1354
|
id
|
|
1326
1355
|
name
|
|
1327
1356
|
is_guest
|
|
1328
1357
|
picture_url
|
|
1329
1358
|
}
|
|
1330
|
-
`,
|
|
1359
|
+
`,iv=Tc`
|
|
1331
1360
|
fragment TeamBasicInfo on Team {
|
|
1332
1361
|
id
|
|
1333
1362
|
name
|
|
1334
1363
|
}
|
|
1335
|
-
`,
|
|
1364
|
+
`,ov=Tc`
|
|
1336
1365
|
fragment TeamExtendedInfo on Team {
|
|
1337
1366
|
...TeamBasicInfo
|
|
1338
1367
|
is_guest
|
|
1339
1368
|
picture_url
|
|
1340
1369
|
}
|
|
1341
|
-
`,
|
|
1370
|
+
`,nv=Tc`
|
|
1342
1371
|
fragment TeamOwner on User {
|
|
1343
1372
|
id
|
|
1344
1373
|
name
|
|
1345
1374
|
email
|
|
1346
1375
|
}
|
|
1347
|
-
`,
|
|
1376
|
+
`,sv=Tc`
|
|
1348
1377
|
fragment TeamMember on User {
|
|
1349
1378
|
id
|
|
1350
1379
|
name
|
|
@@ -1364,7 +1393,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1364
1393
|
time_zone_identifier
|
|
1365
1394
|
utc_hours_diff
|
|
1366
1395
|
}
|
|
1367
|
-
`,
|
|
1396
|
+
`,dv=Tc`
|
|
1368
1397
|
fragment TeamMemberSimplified on User {
|
|
1369
1398
|
id
|
|
1370
1399
|
name
|
|
@@ -1373,15 +1402,15 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1373
1402
|
is_admin
|
|
1374
1403
|
is_guest
|
|
1375
1404
|
}
|
|
1376
|
-
`,
|
|
1405
|
+
`,pv=Tc`
|
|
1377
1406
|
fragment UserTeamMembershipSimplified on Team {
|
|
1378
1407
|
id
|
|
1379
1408
|
name
|
|
1380
1409
|
is_guest
|
|
1381
1410
|
}
|
|
1382
|
-
`,
|
|
1383
|
-
${
|
|
1384
|
-
${
|
|
1411
|
+
`,lv=Tc`
|
|
1412
|
+
${av}
|
|
1413
|
+
${rv}
|
|
1385
1414
|
|
|
1386
1415
|
query listUsersWithTeams($userIds: [ID!], $limit: Int = 1000) {
|
|
1387
1416
|
users(ids: $userIds, limit: $limit) {
|
|
@@ -1393,21 +1422,21 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1393
1422
|
}
|
|
1394
1423
|
}
|
|
1395
1424
|
}
|
|
1396
|
-
`,
|
|
1397
|
-
${
|
|
1425
|
+
`,mv=Tc`
|
|
1426
|
+
${av}
|
|
1398
1427
|
|
|
1399
1428
|
query listUsersOnly($userIds: [ID!], $limit: Int = 1000) {
|
|
1400
1429
|
users(ids: $userIds, limit: $limit) {
|
|
1401
1430
|
...UserDetails
|
|
1402
1431
|
}
|
|
1403
1432
|
}
|
|
1404
|
-
`,
|
|
1405
|
-
${Zf}
|
|
1406
|
-
${nv}
|
|
1433
|
+
`,cv=Tc`
|
|
1407
1434
|
${av}
|
|
1408
|
-
${
|
|
1409
|
-
${rv}
|
|
1435
|
+
${pv}
|
|
1410
1436
|
${ov}
|
|
1437
|
+
${iv}
|
|
1438
|
+
${nv}
|
|
1439
|
+
${dv}
|
|
1411
1440
|
|
|
1412
1441
|
query listUsersAndTeams($userIds: [ID!], $teamIds: [ID!], $limit: Int = 1000) {
|
|
1413
1442
|
users(ids: $userIds, limit: $limit) {
|
|
@@ -1433,19 +1462,19 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1433
1462
|
}
|
|
1434
1463
|
}
|
|
1435
1464
|
}
|
|
1436
|
-
`,
|
|
1437
|
-
${
|
|
1465
|
+
`,uv=Tc`
|
|
1466
|
+
${iv}
|
|
1438
1467
|
|
|
1439
1468
|
query listTeamsOnly($teamIds: [ID!]) {
|
|
1440
1469
|
teams(ids: $teamIds) {
|
|
1441
1470
|
...TeamBasicInfo
|
|
1442
1471
|
}
|
|
1443
1472
|
}
|
|
1444
|
-
`,
|
|
1445
|
-
${
|
|
1446
|
-
${tv}
|
|
1447
|
-
${rv}
|
|
1473
|
+
`,hv=Tc`
|
|
1474
|
+
${ov}
|
|
1448
1475
|
${iv}
|
|
1476
|
+
${nv}
|
|
1477
|
+
${sv}
|
|
1449
1478
|
|
|
1450
1479
|
query listTeamsWithMembers($teamIds: [ID!]) {
|
|
1451
1480
|
teams(ids: $teamIds) {
|
|
@@ -1462,9 +1491,9 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1462
1491
|
}
|
|
1463
1492
|
}
|
|
1464
1493
|
}
|
|
1465
|
-
`,
|
|
1466
|
-
${
|
|
1467
|
-
${
|
|
1494
|
+
`,fv=Tc`
|
|
1495
|
+
${av}
|
|
1496
|
+
${rv}
|
|
1468
1497
|
|
|
1469
1498
|
query getUserByName($name: String) {
|
|
1470
1499
|
users(name: $name) {
|
|
@@ -1476,7 +1505,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1476
1505
|
}
|
|
1477
1506
|
}
|
|
1478
1507
|
}
|
|
1479
|
-
`,
|
|
1508
|
+
`,vv=Tc`
|
|
1480
1509
|
query getCurrentUser {
|
|
1481
1510
|
me {
|
|
1482
1511
|
id
|
|
@@ -1488,7 +1517,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1488
1517
|
photo_thumb
|
|
1489
1518
|
}
|
|
1490
1519
|
}
|
|
1491
|
-
`;const
|
|
1520
|
+
`;const gv=[["is_pending","Pending"],["is_verified","Verified"],["is_view_only","View Only"],["join_date","Join Date"],["last_activity","Last Activity"],["location","Location"],["mobile_phone","Mobile Phone"],["phone","Phone"],["photo_thumb","Photo Thumb"],["time_zone_identifier","Timezone"],["utc_hours_diff","UTC Hours Diff"]];function _v(e,t=""){return gv.filter((([t])=>{const a=e[t];return null!=a})).map((([a,r])=>`${t}${r}: ${e[a]}`))}const yv=e=>{const t=[];return"users"in e&&e.users&&e.users.length>0&&(t.push("Users:"),e.users.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),t.push(` Email: ${e.email}`),t.push(` Title: ${e.title||"N/A"}`),t.push(` Enabled: ${e.enabled}`),t.push(` Admin: ${e.is_admin||!1}`),t.push(` Guest: ${e.is_guest||!1}`),t.push(..._v(e," ")),e.teams&&e.teams.length>0&&(t.push(" Teams:"),e.teams.forEach((e=>{e&&t.push(` - ID: ${e.id}, Name: ${e.name}, Guest Team: ${e.is_guest||!1}, Picture URL: ${e.picture_url||"N/A"}`)}))),t.push(""))}))),"teams"in e&&e.teams&&e.teams.length>0&&(t.push("Teams:"),e.teams.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),function(e){return"owners"in e}(e)&&(t.push(` Guest Team: ${e.is_guest||!1}`),t.push(` Picture URL: ${e.picture_url||"N/A"}`),e.owners&&e.owners.length>0&&(t.push(" Owners:"),e.owners.forEach((e=>{t.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}`)}))),e.users&&e.users.length>0&&(t.push(" Members:"),e.users.forEach((e=>{if(e){const a=[`ID: ${e.id}`,`Name: ${e.name}`,`Email: ${e.email}`,`Title: ${e.title||"N/A"}`,`Admin: ${e.is_admin||!1}`,`Guest: ${e.is_guest||!1}`,..._v(e)];t.push(` - ${a.join(", ")}`)}})))),t.push(""))}))),0===t.length?"No users or teams found with the specified filters.":t.join("\n").trim()},bv=500,wv=500,Iv=1e3,Tv=Tc`
|
|
1492
1521
|
query getAccountSlug {
|
|
1493
1522
|
me {
|
|
1494
1523
|
account {
|
|
@@ -1496,7 +1525,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1496
1525
|
}
|
|
1497
1526
|
}
|
|
1498
1527
|
}
|
|
1499
|
-
`;async function
|
|
1528
|
+
`;async function Ev(e){const t=await e.request(Tv);return t.me?.account?.slug??null}function Sv(e,t){return`https://${e}.monday.com/workspaces/${t}`}const Dv={userIds:e.array(e.string()).max(bv).optional().describe("Specific user IDs to fetch.[IMPORTANT] ALWAYS use when you have user IDs in context. PREFER over general search. RETURNS: user profiles including team memberships"),teamIds:e.array(e.string()).max(wv).optional().describe("Specific team IDs to fetch.[IMPORTANT] ALWAYS use when you have team IDs in context, NEVER fetch all teams if specific IDs are available.\n RETURNS: Team details with owners and optional member data."),name:e.string().optional().describe("Name-based USER search ONLY. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n CRITICAL: This parameter searches for USERS ONLY, NOT teams. To search for teams, use teamIds parameter instead."),getMe:e.boolean().optional().describe('[TOP PRIORITY] Use ALWAYS when requesting current user information. Examples of when it should be used: ["get my user" or "get my teams"].\n This parameter CONFLICTS with all others. '),includeTeams:e.boolean().optional().describe("[AVOID] This fetches all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get their team memberships."),teamsOnly:e.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:e.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const Nv={itemId:e.number().describe("The id of the item to which the update will be added"),groupId:e.string().describe("The id of the group to which the item will be moved")};const Av="content",kv="version_history",Ov=e.enum(["ids","object_ids","workspace_ids"]),$v={mode:e.enum([Av,kv]).optional().default(Av).describe('The operation mode. "content" (default) fetches documents with their markdown content. "version_history" fetches the edit history of a single document.'),type:Ov.optional().describe('Query type for content mode: "ids", "object_ids", or "workspace_ids". Required when mode is "content".'),ids:e.array(e.string()).optional().describe('Array of ID values. In content mode: matches the query type (ids/object_ids/workspace_ids). In version_history mode: provide the single document object_id here (e.g., ids: ["5001466606"]).'),limit:e.number().optional().describe("Number of docs per page (default: 25). Only used in content mode."),order_by:e.nativeEnum(Ep).optional().describe("Order in which to retrieve docs. Only used in content mode."),page:e.number().optional().describe("Page number to return (starts at 1). Only used in content mode."),include_blocks:e.boolean().optional().default(!1).describe("If true, includes the blocks array (block IDs, types, positions, content) in the response. Required when you plan to call update_doc. Defaults to false to reduce response size. Only used in content mode."),blocks_limit:e.number().optional().describe("Maximum number of blocks to return per document (default: 25). Only used in content mode when include_blocks is true."),blocks_page:e.number().optional().describe("Page number for block pagination, starting at 1. Omit to use the API default. Use with blocks_limit to page through documents with more than 25 blocks. Only used in content mode when include_blocks is true."),include_comments:e.boolean().optional().default(!1).describe("If true, fetches all comments and replies on the document. Comments are stored at the item level within the doc backing board. Defaults to false. Only used in content mode."),comments_limit:e.number().optional().default(50).describe("Maximum number of comments (updates) to fetch per item when include_comments is true. Defaults to 50. Only used in content mode."),version_history_limit:e.number().optional().describe('Maximum number of restoring points to return. Use this when the user asks for "last N changes". Only used in version_history mode.'),since:e.string().optional().describe('ISO 8601 date string to filter version history from (e.g., "2026-03-15T00:00:00Z"). If omitted, returns the full history. Only used in version_history mode.'),until:e.string().optional().describe('ISO 8601 date string to filter version history until (e.g., "2026-03-16T23:59:59Z"). Defaults to now. Only used in version_history mode.'),include_diff:e.boolean().optional().default(!1).describe("If true, fetches content diffs between consecutive restoring points. May be slower due to additional API calls. Only used in version_history mode.")};const Rv={workspace_id:e.number().describe("The ID of the workspace to get information for")};const Pv=Tc`
|
|
1500
1529
|
query listWorkspaces($limit: Int!, $page: Int!, $membershipKind: WorkspaceMembershipKind!) {
|
|
1501
1530
|
workspaces(limit: $limit, page: $page, membership_kind: $membershipKind) {
|
|
1502
1531
|
id
|
|
@@ -1504,7 +1533,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1504
1533
|
description
|
|
1505
1534
|
}
|
|
1506
1535
|
}
|
|
1507
|
-
|
|
1536
|
+
`,Cv=100,xv=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,"");function Fv(e){const t=e.workspaces?.filter((e=>null!==e));return t||[]}function Lv(e){return Array.isArray(e)&&e.length>0}const Vv={searchTerm:e.string().optional().describe("Optional search term used to filter workspaces. [IMPORTANT] Only alphanumeric characters are supported."),limit:e.number().min(1).max(Cv).default(Cv).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:e.number().min(1).default(1).describe("Page number to return. Default is 1.")};const jv=Tc`
|
|
1508
1537
|
query getItemBoard($itemId: ID!) {
|
|
1509
1538
|
items(ids: [$itemId]) {
|
|
1510
1539
|
id
|
|
@@ -1517,7 +1546,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1517
1546
|
}
|
|
1518
1547
|
}
|
|
1519
1548
|
}
|
|
1520
|
-
`,
|
|
1549
|
+
`,Uv=Tc`
|
|
1521
1550
|
mutation createDoc($location: CreateDocInput!) {
|
|
1522
1551
|
create_doc(location: $location) {
|
|
1523
1552
|
id
|
|
@@ -1526,7 +1555,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1526
1555
|
name
|
|
1527
1556
|
}
|
|
1528
1557
|
}
|
|
1529
|
-
`,
|
|
1558
|
+
`,Mv=Tc`
|
|
1530
1559
|
mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
|
|
1531
1560
|
add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
|
|
1532
1561
|
success
|
|
@@ -1534,11 +1563,11 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1534
1563
|
error
|
|
1535
1564
|
}
|
|
1536
1565
|
}
|
|
1537
|
-
`,
|
|
1566
|
+
`,Bv=Tc`
|
|
1538
1567
|
mutation updateDocName($docId: ID!, $name: String!) {
|
|
1539
1568
|
update_doc_name(docId: $docId, name: $name)
|
|
1540
1569
|
}
|
|
1541
|
-
`,
|
|
1570
|
+
`,qv=e.enum(["workspace","item"]),Hv=e.discriminatedUnion("type",[e.object({type:e.literal(qv.enum.workspace).describe("Create document in workspace"),workspace_id:e.number().describe("Workspace ID under which to create the new document"),doc_kind:e.nativeEnum(Yd).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:e.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),e.object({type:e.literal(qv.enum.item).describe("Create document attached to item"),item_id:e.number().describe("Item ID to attach the new document to"),column_id:e.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]),Gv={doc_name:e.string().describe("Name for the new document."),markdown:e.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:e.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:e.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:e.nativeEnum(Yd).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:e.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:e.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:e.string().optional().describe('[OPTIONAL - use only when location="item"] ID of an existing "doc" column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.')};const Wv=Tc`
|
|
1542
1571
|
mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
|
|
1543
1572
|
add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
|
|
1544
1573
|
success
|
|
@@ -1546,7 +1575,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1546
1575
|
error
|
|
1547
1576
|
}
|
|
1548
1577
|
}
|
|
1549
|
-
`,
|
|
1578
|
+
`,Qv=Tc`
|
|
1550
1579
|
query getDocByObjectId($objectId: [ID!]) {
|
|
1551
1580
|
docs(object_ids: $objectId) {
|
|
1552
1581
|
id
|
|
@@ -1554,7 +1583,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1554
1583
|
url
|
|
1555
1584
|
}
|
|
1556
1585
|
}
|
|
1557
|
-
`,
|
|
1586
|
+
`,zv=Tc`
|
|
1558
1587
|
query getDocById($docId: [ID!]) {
|
|
1559
1588
|
docs(ids: $docId) {
|
|
1560
1589
|
id
|
|
@@ -1562,11 +1591,11 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1562
1591
|
url
|
|
1563
1592
|
}
|
|
1564
1593
|
}
|
|
1565
|
-
`,
|
|
1594
|
+
`,Yv={doc_id:e.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:e.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:e.string().describe("Markdown content to add to the document."),after_block_id:e.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.")};const Kv=Tc`
|
|
1566
1595
|
mutation updateDocName($docId: ID!, $name: String!) {
|
|
1567
1596
|
update_doc_name(docId: $docId, name: $name)
|
|
1568
1597
|
}
|
|
1569
|
-
`,
|
|
1598
|
+
`,Jv=Tc`
|
|
1570
1599
|
mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
|
|
1571
1600
|
add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
|
|
1572
1601
|
success
|
|
@@ -1574,13 +1603,13 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1574
1603
|
error
|
|
1575
1604
|
}
|
|
1576
1605
|
}
|
|
1577
|
-
`,
|
|
1606
|
+
`,Xv=Tc`
|
|
1578
1607
|
query getDocIdByObjectId($objectId: [ID!]) {
|
|
1579
1608
|
docs(object_ids: $objectId) {
|
|
1580
1609
|
id
|
|
1581
1610
|
}
|
|
1582
1611
|
}
|
|
1583
|
-
`,
|
|
1612
|
+
`,Zv=Tc`
|
|
1584
1613
|
mutation updateDocBlock($blockId: String!, $content: JSON!) {
|
|
1585
1614
|
update_doc_block(block_id: $blockId, content: $content) {
|
|
1586
1615
|
id
|
|
@@ -1588,20 +1617,20 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1588
1617
|
created_at
|
|
1589
1618
|
}
|
|
1590
1619
|
}
|
|
1591
|
-
`,
|
|
1620
|
+
`,eg=Tc`
|
|
1592
1621
|
mutation deleteDocBlock($blockId: String!) {
|
|
1593
1622
|
delete_doc_block(block_id: $blockId) {
|
|
1594
1623
|
id
|
|
1595
1624
|
}
|
|
1596
1625
|
}
|
|
1597
|
-
`,
|
|
1626
|
+
`,tg=Tc`
|
|
1598
1627
|
query getDocObjectIdByDocId($docId: [ID!]) {
|
|
1599
1628
|
docs(ids: $docId) {
|
|
1600
1629
|
id
|
|
1601
1630
|
object_id
|
|
1602
1631
|
}
|
|
1603
1632
|
}
|
|
1604
|
-
`,
|
|
1633
|
+
`,ag=Tc`
|
|
1605
1634
|
query getDocBoardItem($boardId: ID!) {
|
|
1606
1635
|
boards(ids: [$boardId]) {
|
|
1607
1636
|
items_page(limit: 1) {
|
|
@@ -1611,7 +1640,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1611
1640
|
}
|
|
1612
1641
|
}
|
|
1613
1642
|
}
|
|
1614
|
-
`,
|
|
1643
|
+
`,rg=Tc`
|
|
1615
1644
|
query getDocBlockContent($docId: [ID!]) {
|
|
1616
1645
|
docs(ids: $docId) {
|
|
1617
1646
|
blocks {
|
|
@@ -1621,7 +1650,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1621
1650
|
}
|
|
1622
1651
|
}
|
|
1623
1652
|
}
|
|
1624
|
-
`,
|
|
1653
|
+
`,ig=Tc`
|
|
1625
1654
|
mutation createDocComment($itemId: ID!, $body: String!, $parentId: ID, $mentionsList: [UpdateMention]) {
|
|
1626
1655
|
create_update(body: $body, item_id: $itemId, parent_id: $parentId, mentions_list: $mentionsList) {
|
|
1627
1656
|
id
|
|
@@ -1629,7 +1658,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1629
1658
|
created_at
|
|
1630
1659
|
}
|
|
1631
1660
|
}
|
|
1632
|
-
`,
|
|
1661
|
+
`,og=Tc`
|
|
1633
1662
|
mutation createDocBlocks($docId: ID!, $afterBlockId: String, $blocksInput: [CreateBlockInput!]!) {
|
|
1634
1663
|
create_doc_blocks(docId: $docId, afterBlockId: $afterBlockId, blocksInput: $blocksInput) {
|
|
1635
1664
|
id
|
|
@@ -1697,7 +1726,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1697
1726
|
}
|
|
1698
1727
|
}
|
|
1699
1728
|
}
|
|
1700
|
-
`;function rg(e){if(e)return e}function ig(e){if(e)return e}function og(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 ng(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:og(e.attributes)}}))}function sg(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:n(),macroData:{itemId:Number(e.insert.column_value.item_id),columnId:e.insert.column_value.column_id}}}}:{insert:e.insert.text,attributes:og(e.attributes)}}))}function dg(e,t){const a=e.attributes||{},r=a.comments||[];return{...e,attributes:{...a,comments:[...r,t]}}}function pg(e,t,a,r){const i=a+r;let o=0;const n=[];for(const r of e){const e=r.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?n.push(r):"string"!=typeof e?n.push(dg(r,t)):(p>s&&n.push({...r,insert:e.slice(0,p-s)}),n.push(dg({...r,insert:e.slice(p-s,l-s)},t)),l<d&&n.push({...r,insert:e.slice(l-s)})),o=d}return n}const lg=e.object({bold:e.boolean().optional(),italic:e.boolean().optional(),underline:e.boolean().optional(),strike:e.boolean().optional(),code:e.boolean().optional(),link:e.string().optional(),color:e.string().optional(),background:e.string().optional()}).optional(),mg=e.object({mention:e.object({id:e.union([e.string(),e.number()]).describe("User, doc, or board ID. Get user IDs from list_users_and_teams."),type:e.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.")}),cg=e.object({column_value:e.object({item_id:e.union([e.string(),e.number()]).describe("The board item ID."),column_id:e.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.")}),ug=e.object({insert:e.union([e.object({text:e.string()}),mg,cg]).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:lg.describe("Optional formatting: bold, italic, underline, strike, code, link, color, background. Not applicable to mention or column_value ops.")}),hg=e.object({block_content_type:e.literal("text"),delta_format:e.array(ug).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:e.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:e.enum(["LTR","RTL"]).optional()}),fg=e.object({block_content_type:e.literal("code"),delta_format:e.array(ug).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:e.string().optional().describe('Programming language (e.g. "javascript", "python").')}),vg=e.object({block_content_type:e.literal("list_item"),delta_format:e.array(ug).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),checked:e.boolean().optional().describe("Check state for CHECK_LIST items."),indentation:e.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),gg=e.discriminatedUnion("block_content_type",[hg,fg,vg]),_g=e.object({block_type:e.literal("text"),text_block_type:e.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:e.array(ug).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:e.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:e.enum(["LTR","RTL"]).optional()}),yg=e.object({block_type:e.literal("list_item"),list_block_type:e.enum(["BULLETED_LIST","NUMBERED_LIST","CHECK_LIST"]).optional().describe("List type. Defaults to BULLETED_LIST."),delta_format:e.array(ug).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),indentation:e.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),bg=e.object({block_type:e.literal("code"),delta_format:e.array(ug).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:e.string().optional().describe('Programming language (e.g. "javascript", "python").')}),wg=e.object({block_type:e.literal("divider")}),Ig=e.object({block_type:e.literal("page_break")}),Tg=e.object({block_type:e.literal("image"),public_url:e.string().url().optional().describe("Publicly accessible image URL. Provide either public_url or asset_id."),asset_id:e.union([e.number().int(),e.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:e.number().int().min(1).optional().describe("Width in pixels.")}),Eg=e.object({block_type:e.literal("video"),raw_url:e.string().url().describe("Video URL (YouTube, Vimeo, or direct video URL)."),width:e.number().int().min(1).optional().describe("Width in pixels.")}),Sg=e.object({block_type:e.literal("notice_box"),theme:e.enum(["INFO","TIPS","WARNING","GENERAL"]).describe("Visual style of the notice box.")}),Dg=e.object({block_type:e.literal("table"),row_count:e.number().int().min(1).max(25).describe("Number of rows (1–25)."),column_count:e.number().int().min(1).max(10).describe("Number of columns (1–10)."),width:e.number().int().optional().describe("Table width in pixels."),column_style:e.array(e.object({width:e.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),Ng=e.object({block_type:e.literal("layout"),column_count:e.number().int().min(2).max(6).describe("Number of columns (2–6)."),column_style:e.array(e.object({width:e.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),Ag=e.discriminatedUnion("block_type",[_g,yg,bg,wg,Ig,Tg,Eg,Sg,Dg,Ng]),kg=e.object({operation_type:e.literal("set_name"),name:e.string().min(1).describe("New document name.")}),Og=e.object({operation_type:e.literal("add_markdown_content"),markdown:e.string().describe("Markdown content to convert and append (or insert) as blocks."),after_block_id:e.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs.")}),$g=e.object({operation_type:e.literal("update_block"),block_id:e.string().describe("ID of the block to update. Get block IDs from read_docs."),content:gg.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.")}),Rg=e.object({operation_type:e.literal("create_block"),after_block_id:e.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs."),parent_block_id:e.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:Ag.describe("The block to create. Use block_type to select the block type.")}),Pg=e.object({operation_type:e.literal("delete_block"),block_id:e.string().describe("ID of the block to permanently delete. Works for all block types including BOARD, WIDGET, DOC embed, GIPHY.")}),Cg=e.object({operation_type:e.literal("replace_block"),block_id:e.string().describe("ID of the block to delete."),after_block_id:e.string().optional().describe("Insert replacement after this block ID. Provide the ID of the block that precedes the deleted block."),parent_block_id:e.string().optional().describe("Parent block ID for the replacement block."),block:Ag.describe("The new block to create in place of the deleted one.")}),xg=e.object({operation_type:e.literal("add_comment"),body:e.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:e.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:e.string().optional().describe('Optional JSON array of mentions: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types: User, Team, Board, Project.'),block_id:e.union([e.string(),e.array(e.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:e.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:e.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.")}),Fg=e.discriminatedUnion("operation_type",[kg,Og,$g,Rg,Pg,Cg,xg]),Lg={doc_id:e.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:e.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:e.array(Fg).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_block: Permanently remove a block. Works for ALL block types including BOARD, WIDGET, DOC embed, 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_block 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\nBlock IDs are available in the blocks array returned by read_docs.')};const Vg=Tc`
|
|
1729
|
+
`;function ng(e){if(e)return e}function sg(e){if(e)return e}function dg(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 pg(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:dg(e.attributes)}}))}function lg(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:n(),macroData:{itemId:Number(e.insert.column_value.item_id),columnId:e.insert.column_value.column_id}}}}:{insert:e.insert.text,attributes:dg(e.attributes)}}))}function mg(e,t){const a=e.attributes||{},r=a.comments||[];return{...e,attributes:{...a,comments:[...r,t]}}}function cg(e,t,a,r){const i=a+r;let o=0;const n=[];for(const r of e){const e=r.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?n.push(r):"string"!=typeof e?n.push(mg(r,t)):(p>s&&n.push({...r,insert:e.slice(0,p-s)}),n.push(mg({...r,insert:e.slice(p-s,l-s)},t)),l<d&&n.push({...r,insert:e.slice(l-s)})),o=d}return n}const ug=e.object({bold:e.boolean().optional(),italic:e.boolean().optional(),underline:e.boolean().optional(),strike:e.boolean().optional(),code:e.boolean().optional(),link:e.string().optional(),color:e.string().optional(),background:e.string().optional()}).optional(),hg=e.object({mention:e.object({id:e.union([e.string(),e.number()]).describe("User, doc, or board ID. Get user IDs from list_users_and_teams."),type:e.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.")}),fg=e.object({column_value:e.object({item_id:e.union([e.string(),e.number()]).describe("The board item ID."),column_id:e.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.")}),vg=e.object({insert:e.union([e.object({text:e.string()}),hg,fg]).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:ug.describe("Optional formatting: bold, italic, underline, strike, code, link, color, background. Not applicable to mention or column_value ops.")}),gg=e.object({block_content_type:e.literal("text"),delta_format:e.array(vg).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:e.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:e.enum(["LTR","RTL"]).optional()}),_g=e.object({block_content_type:e.literal("code"),delta_format:e.array(vg).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:e.string().optional().describe('Programming language (e.g. "javascript", "python").')}),yg=e.object({block_content_type:e.literal("list_item"),delta_format:e.array(vg).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),checked:e.boolean().optional().describe("Check state for CHECK_LIST items."),indentation:e.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),bg=e.discriminatedUnion("block_content_type",[gg,_g,yg]),wg=e.object({block_type:e.literal("text"),text_block_type:e.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:e.array(vg).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:e.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:e.enum(["LTR","RTL"]).optional()}),Ig=e.object({block_type:e.literal("list_item"),list_block_type:e.enum(["BULLETED_LIST","NUMBERED_LIST","CHECK_LIST"]).optional().describe("List type. Defaults to BULLETED_LIST."),delta_format:e.array(vg).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),indentation:e.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),Tg=e.object({block_type:e.literal("code"),delta_format:e.array(vg).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:e.string().optional().describe('Programming language (e.g. "javascript", "python").')}),Eg=e.object({block_type:e.literal("divider")}),Sg=e.object({block_type:e.literal("page_break")}),Dg=e.object({block_type:e.literal("image"),public_url:e.string().url().optional().describe("Publicly accessible image URL. Provide either public_url or asset_id."),asset_id:e.union([e.number().int(),e.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:e.number().int().min(1).optional().describe("Width in pixels.")}),Ng=e.object({block_type:e.literal("video"),raw_url:e.string().url().describe("Video URL (YouTube, Vimeo, or direct video URL)."),width:e.number().int().min(1).optional().describe("Width in pixels.")}),Ag=e.object({block_type:e.literal("notice_box"),theme:e.enum(["INFO","TIPS","WARNING","GENERAL"]).describe("Visual style of the notice box.")}),kg=e.object({block_type:e.literal("table"),row_count:e.number().int().min(1).max(25).describe("Number of rows (1–25)."),column_count:e.number().int().min(1).max(10).describe("Number of columns (1–10)."),width:e.number().int().optional().describe("Table width in pixels."),column_style:e.array(e.object({width:e.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),Og=e.object({block_type:e.literal("layout"),column_count:e.number().int().min(2).max(6).describe("Number of columns (2–6)."),column_style:e.array(e.object({width:e.number().int()})).optional().describe("Column widths. Array length must match column_count. Widths must sum to 100.")}),$g=e.discriminatedUnion("block_type",[wg,Ig,Tg,Eg,Sg,Dg,Ng,Ag,kg,Og]),Rg=e.object({operation_type:e.literal("set_name"),name:e.string().min(1).describe("New document name.")}),Pg=e.object({operation_type:e.literal("add_markdown_content"),markdown:e.string().describe("Markdown content to convert and append (or insert) as blocks."),after_block_id:e.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs.")}),Cg=e.object({operation_type:e.literal("update_block"),block_id:e.string().describe("ID of the block to update. Get block IDs from read_docs."),content:bg.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.")}),xg=e.object({operation_type:e.literal("create_block"),after_block_id:e.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs."),parent_block_id:e.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:$g.describe("The block to create. Use block_type to select the block type.")}),Fg=e.object({operation_type:e.literal("delete_block"),block_id:e.string().describe("ID of the block to permanently delete. Works for all block types including BOARD, WIDGET, DOC embed, GIPHY.")}),Lg=e.object({operation_type:e.literal("replace_block"),block_id:e.string().describe("ID of the block to delete."),after_block_id:e.string().optional().describe("Insert replacement after this block ID. Provide the ID of the block that precedes the deleted block."),parent_block_id:e.string().optional().describe("Parent block ID for the replacement block."),block:$g.describe("The new block to create in place of the deleted one.")}),Vg=e.object({operation_type:e.literal("add_comment"),body:e.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:e.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:e.string().optional().describe('Optional JSON array of mentions: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types: User, Team, Board, Project.'),block_id:e.union([e.string(),e.array(e.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:e.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:e.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.")}),jg=e.discriminatedUnion("operation_type",[Rg,Pg,Cg,xg,Fg,Lg,Vg]),Ug={doc_id:e.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:e.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:e.array(jg).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_block: Permanently remove a block. Works for ALL block types including BOARD, WIDGET, DOC embed, 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_block 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\nBlock IDs are available in the blocks array returned by read_docs.')};const Mg=Tc`
|
|
1701
1730
|
mutation CreateDashboard(
|
|
1702
1731
|
$name: String!
|
|
1703
1732
|
$workspace_id: ID!
|
|
@@ -1719,14 +1748,14 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1719
1748
|
board_folder_id
|
|
1720
1749
|
}
|
|
1721
1750
|
}
|
|
1722
|
-
`,
|
|
1751
|
+
`,Bg=Tc`
|
|
1723
1752
|
query GetAllWidgetsSchema {
|
|
1724
1753
|
all_widgets_schema {
|
|
1725
1754
|
widget_type
|
|
1726
1755
|
schema
|
|
1727
1756
|
}
|
|
1728
1757
|
}
|
|
1729
|
-
`,
|
|
1758
|
+
`,qg=Tc`
|
|
1730
1759
|
mutation CreateWidget($parent: WidgetParentInput!, $kind: ExternalWidget!, $name: String!, $settings: JSON!) {
|
|
1731
1760
|
create_widget(parent: $parent, kind: $kind, name: $name, settings: $settings) {
|
|
1732
1761
|
id
|
|
@@ -1738,14 +1767,14 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1738
1767
|
}
|
|
1739
1768
|
}
|
|
1740
1769
|
}
|
|
1741
|
-
`,
|
|
1770
|
+
`,Hg={name:e.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:e.string().describe("ID of the workspace that will own the dashboard"),board_ids:e.array(e.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:e.nativeEnum(vp).default(vp.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:e.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const Gg={parent_container_id:e.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:e.nativeEnum(Zl).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:e.nativeEnum(Np).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:e.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:e.record(e.unknown()).optional().describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const Wg=Tc`
|
|
1742
1771
|
mutation updateWorkspace($id: ID!, $attributes: UpdateWorkspaceAttributesInput!) {
|
|
1743
1772
|
update_workspace(id: $id, attributes: $attributes) {
|
|
1744
1773
|
id
|
|
1745
1774
|
name
|
|
1746
1775
|
}
|
|
1747
1776
|
}
|
|
1748
|
-
`,
|
|
1777
|
+
`,Qg={id:e.string().describe("The ID of the workspace to update"),attributeAccountProductId:e.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:e.string().optional().describe("The description of the workspace to update"),attributeKind:e.nativeEnum(em).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:e.string().optional().describe("The name of the workspace to update")};const zg=Tc`
|
|
1749
1778
|
mutation updateFolder(
|
|
1750
1779
|
$folderId: ID!
|
|
1751
1780
|
$name: String
|
|
@@ -1772,7 +1801,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1772
1801
|
name
|
|
1773
1802
|
}
|
|
1774
1803
|
}
|
|
1775
|
-
`,
|
|
1804
|
+
`,Yg={folderId:e.string().describe("The ID of the folder to update"),name:e.string().optional().describe("The new name of the folder"),color:e.nativeEnum($p).optional().describe("The new color of the folder"),fontWeight:e.nativeEnum(Pp).optional().describe("The new font weight of the folder"),customIcon:e.nativeEnum(Rp).optional().describe("The new custom icon of the folder"),parentFolderId:e.string().optional().describe("The ID of the new parent folder"),workspaceId:e.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:e.string().optional().describe("The account product ID associated with the folder"),position_object_id:e.string().optional().describe("The ID of the object to position the folder relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:e.nativeEnum(ml).optional().describe("The type of object to position the folder relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:e.boolean().optional().describe("Whether to position the folder after the object")};const Kg=Tc`
|
|
1776
1805
|
mutation createWorkspace(
|
|
1777
1806
|
$name: String!
|
|
1778
1807
|
$workspaceKind: WorkspaceKind!
|
|
@@ -1789,7 +1818,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1789
1818
|
name
|
|
1790
1819
|
}
|
|
1791
1820
|
}
|
|
1792
|
-
`,
|
|
1821
|
+
`,Jg={name:e.string().describe("The name of the new workspace to be created"),workspaceKind:e.nativeEnum(em).describe("The kind of workspace to create"),description:e.string().optional().describe("The description of the new workspace"),accountProductId:e.string().optional().describe("The account product ID associated with the workspace")};const Xg=Tc`
|
|
1793
1822
|
mutation createFolder(
|
|
1794
1823
|
$workspaceId: ID!
|
|
1795
1824
|
$name: String!
|
|
@@ -1810,7 +1839,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1810
1839
|
name
|
|
1811
1840
|
}
|
|
1812
1841
|
}
|
|
1813
|
-
`,
|
|
1842
|
+
`,Zg={workspaceId:e.string().describe("The ID of the workspace where the folder will be created"),name:e.string().describe("The name of the folder to be created"),color:e.nativeEnum($p).optional().describe("The color of the folder"),fontWeight:e.nativeEnum(Pp).optional().describe("The font weight of the folder"),customIcon:e.nativeEnum(Rp).optional().describe("The custom icon of the folder"),parentFolderId:e.string().optional().describe("The ID of the parent folder")};const e_=Tc`
|
|
1814
1843
|
mutation updateBoardHierarchy($boardId: ID!, $attributes: UpdateBoardHierarchyAttributesInput!) {
|
|
1815
1844
|
update_board_hierarchy(board_id: $boardId, attributes: $attributes) {
|
|
1816
1845
|
success
|
|
@@ -1820,7 +1849,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1820
1849
|
}
|
|
1821
1850
|
}
|
|
1822
1851
|
}
|
|
1823
|
-
`,
|
|
1852
|
+
`,t_=Tc`
|
|
1824
1853
|
mutation updateOverviewHierarchy($overviewId: ID!, $attributes: UpdateOverviewHierarchyAttributesInput!) {
|
|
1825
1854
|
update_overview_hierarchy(overview_id: $overviewId, attributes: $attributes) {
|
|
1826
1855
|
success
|
|
@@ -1830,7 +1859,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1830
1859
|
}
|
|
1831
1860
|
}
|
|
1832
1861
|
}
|
|
1833
|
-
`,
|
|
1862
|
+
`,a_={objectType:e.nativeEnum(ml).describe("The type of object to move"),id:e.string().describe("The ID of the object to move"),position_object_id:e.string().optional().describe("The ID of the object to position the object relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:e.nativeEnum(ml).optional().describe("The type of object to position the object relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:e.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:e.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:e.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:e.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const r_=Tc`
|
|
1834
1863
|
query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {
|
|
1835
1864
|
boards(ids: [$boardId]) {
|
|
1836
1865
|
name
|
|
@@ -1852,7 +1881,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1852
1881
|
}
|
|
1853
1882
|
}
|
|
1854
1883
|
}
|
|
1855
|
-
`,
|
|
1884
|
+
`,i_=new Set([Rd.Case,Rd.Between,Rd.Left,Rd.Raw,Rd.None,Rd.CountKeys]),o_=Object.values(Rd).filter((e=>!i_.has(e))),n_=new Set([Rd.Left,Rd.Trim,Rd.Upper,Rd.Lower,Rd.DateTruncDay,Rd.DateTruncWeek,Rd.DateTruncMonth,Rd.DateTruncQuarter,Rd.DateTruncYear,Rd.Color,Rd.Label,Rd.EndDate,Rd.StartDate,Rd.Hour,Rd.PhoneCountryShortName,Rd.Person,Rd.Upper,Rd.Lower,Rd.Order,Rd.Length,Rd.Flatten,Rd.IsDone]);function s_(e){return{column_id:e}}new Set([Rd.Count,Rd.CountDistinct,Rd.CountSubitems,Rd.CountItems,Rd.First,Rd.Sum,Rd.Average,Rd.Median,Rd.Min,Rd.Max,Rd.MinMax]);const d_={boardId:e.number().describe("The id of the board to get insights for"),aggregations:e.array(e.object({function:e.enum(o_).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:e.string().describe("The id of the column to aggregate")})).describe('The aggregations to get. Before sending the aggregations, use get_board_info tool to check "aggregationGuidelines" key for information. Transformative functions and plain columns (no function) must be in group by.').optional(),groupBy:e.array(e.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:e.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:Cf,filtersOperator:xf,orderBy:e.array(e.object({columnId:e.string().describe("The id of the column to order by"),direction:e.nativeEnum(Jp).optional().default(Jp.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 p_=Tc`
|
|
1856
1885
|
query GetBoards($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
|
|
1857
1886
|
boards(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
|
|
1858
1887
|
id
|
|
@@ -1860,7 +1889,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1860
1889
|
url
|
|
1861
1890
|
}
|
|
1862
1891
|
}
|
|
1863
|
-
`,
|
|
1892
|
+
`,l_=Tc`
|
|
1864
1893
|
query GetDocs($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
|
|
1865
1894
|
docs(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
|
|
1866
1895
|
id
|
|
@@ -1868,14 +1897,14 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1868
1897
|
url
|
|
1869
1898
|
}
|
|
1870
1899
|
}
|
|
1871
|
-
`,
|
|
1900
|
+
`,m_=Tc`
|
|
1872
1901
|
query GetFolders($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
|
|
1873
1902
|
folders(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
|
|
1874
1903
|
id
|
|
1875
1904
|
name
|
|
1876
1905
|
}
|
|
1877
1906
|
}
|
|
1878
|
-
`,
|
|
1907
|
+
`,c_=Tc`
|
|
1879
1908
|
query SearchBoardsDev($query: String!, $limit: Int, $workspaceIds: [ID!]) {
|
|
1880
1909
|
search {
|
|
1881
1910
|
boards(query: $query, limit: $limit, workspace_ids: $workspaceIds) {
|
|
@@ -1890,7 +1919,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1890
1919
|
}
|
|
1891
1920
|
}
|
|
1892
1921
|
}
|
|
1893
|
-
`,
|
|
1922
|
+
`,u_=Tc`
|
|
1894
1923
|
query SearchDocsDev($query: String!, $limit: Int, $workspaceIds: [ID!]) {
|
|
1895
1924
|
search {
|
|
1896
1925
|
docs(query: $query, limit: $limit, workspace_ids: $workspaceIds) {
|
|
@@ -1904,14 +1933,14 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1904
1933
|
}
|
|
1905
1934
|
}
|
|
1906
1935
|
}
|
|
1907
|
-
`;var
|
|
1936
|
+
`;var h_,f_;!function(e){e.BOARD="board-",e.DOCUMENT="doc-",e.FOLDER="folder-"}(h_||(h_={})),function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS"}(f_||(f_={}));const v_={searchTerm:e.string().optional().describe("The search term to use for the search."),searchType:e.nativeEnum(f_).describe("The type of search to perform."),limit:e.number().max(20).optional().default(20).describe("The number of items to get. The max and default value is 20."),page:e.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:e.array(e.number()).optional().describe("The ids of the workspaces to search in. [IMPORTANT] Only pass this param if user explicitly asked to search within specific workspaces.")};const g_=e.object({id:e.string().describe("The ID of the entity to mention"),type:e.nativeEnum(nl).describe("The type of mention: User, Team, Board, or Project")}),__=e.array(g_),y_={itemId:e.number().describe("The id of the item to which the update will be added"),body:e.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:e.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 b_=Tc`
|
|
1908
1937
|
mutation updateAssetsOnItem($boardId: ID!, $itemId: ID!, $columnId: String!, $files: [FileInput!]!) {
|
|
1909
1938
|
update_assets_on_item(board_id: $boardId, item_id: $itemId, column_id: $columnId, files: $files) {
|
|
1910
1939
|
id
|
|
1911
1940
|
name
|
|
1912
1941
|
}
|
|
1913
1942
|
}
|
|
1914
|
-
`,
|
|
1943
|
+
`,w_=e.object({fileType:e.enum(["google_drive","dropbox","box","onedrive","link","asset","doc"]).describe('The type of file: "asset" for uploaded files (requires assetId), "doc" for monday docs (requires objectId), "link" for generic links, "google_drive", "dropbox", "box", "onedrive" for cloud storage links (all link types require linkToFile)'),name:e.string().describe("File display name"),linkToFile:e.string().optional().describe("File link URL. Required for link, google_drive, dropbox, box, and onedrive file types"),assetId:e.number().optional().describe("The asset's ID. Required when fileType is 'asset'"),objectId:e.number().optional().describe("The doc's ID. Required when fileType is 'doc'")}),I_={boardId:e.string().describe("The board's unique identifier"),itemId:e.string().describe("The item's unique identifier"),columnId:e.string().describe("The file or doc column's unique identifier"),files:e.array(w_).describe("Array of file values to set on the column")};const T_=Tc`
|
|
1915
1944
|
query getAssets($ids: [ID!]!) {
|
|
1916
1945
|
assets(ids: $ids) {
|
|
1917
1946
|
id
|
|
@@ -1929,7 +1958,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1929
1958
|
}
|
|
1930
1959
|
}
|
|
1931
1960
|
}
|
|
1932
|
-
`,
|
|
1961
|
+
`,E_={ids:e.array(e.string()).min(1).describe("Array of asset IDs to fetch")};const S_=Tc`
|
|
1933
1962
|
query getUserContext {
|
|
1934
1963
|
me {
|
|
1935
1964
|
id
|
|
@@ -1966,7 +1995,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1966
1995
|
}
|
|
1967
1996
|
}
|
|
1968
1997
|
}
|
|
1969
|
-
`,
|
|
1998
|
+
`,D_=Tc`
|
|
1970
1999
|
query getFavoriteDetails(
|
|
1971
2000
|
$boardIds: [ID!]
|
|
1972
2001
|
$folderIds: [ID!]
|
|
@@ -1990,7 +2019,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
1990
2019
|
name
|
|
1991
2020
|
}
|
|
1992
2021
|
}
|
|
1993
|
-
`,
|
|
2022
|
+
`,N_={[Wp.Board]:"boardIds",[Wp.Folder]:"folderIds",[Wp.Workspace]:"workspaceIds",[Wp.Dashboard]:"dashboardIds"},A_={[Wp.Board]:"boards",[Wp.Folder]:"folders",[Wp.Workspace]:"workspaces",[Wp.Dashboard]:"dashboards"};const k_=Tc`
|
|
1994
2023
|
query GetNotetakerMeetings(
|
|
1995
2024
|
$limit: Int
|
|
1996
2025
|
$cursor: String
|
|
@@ -2043,13 +2072,13 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
2043
2072
|
}
|
|
2044
2073
|
}
|
|
2045
2074
|
}
|
|
2046
|
-
`,
|
|
2075
|
+
`,O_={ids:e.array(e.string()).optional().describe("Filter by specific meeting IDs. Use this to fetch one or more specific meetings in a single call."),access:e.enum(["OWN","SHARED_WITH_ME","SHARED_WITH_ACCOUNT","ALL"]).optional().default("OWN").describe("Filter meetings by access level. OWN: meetings the user participated in or invited the bot to. SHARED_WITH_ME: meetings shared with the user or their team. SHARED_WITH_ACCOUNT: meetings shared with the entire account. ALL: all meetings the user has access to."),limit:e.number().min(1).max(100).optional().default(25).describe("Maximum number of notetaker meetings to return per page (1-100)."),cursor:e.string().optional().describe("Cursor for pagination. Use cursor from the previous page_info to fetch the next page."),search:e.string().optional().describe("Search notetaker meetings by title, participant name, or email."),include_summary:e.boolean().optional().default(!1).describe("Whether to include the AI-generated summary for each meeting."),include_topics:e.boolean().optional().default(!1).describe("Whether to include discussion topics and talking points for each meeting."),include_action_items:e.boolean().optional().default(!1).describe("Whether to include action items for each meeting."),include_transcript:e.boolean().optional().default(!1).describe("Whether to include the full transcript for each meeting. Transcripts can be very large.")};const $_=Tc`
|
|
2047
2076
|
mutation BatchUndo($boardId: ID!, $undoRecordId: ID!) {
|
|
2048
2077
|
batch_undo(board_id: $boardId, undo_record_id: $undoRecordId) {
|
|
2049
2078
|
success
|
|
2050
2079
|
}
|
|
2051
2080
|
}
|
|
2052
|
-
`,
|
|
2081
|
+
`,R_={boardId:e.number().describe("The id of the board where the action was performed"),undoRecordId:e.string().describe("The undo record ID (action_record_uuid) from the activity log data field. Use get_board_activity with includeData=true to find this value.")};const P_="\n**Board-relation linking — do in order**\n\n1. **Fetch (target board, one query)**\n- **has_more: true** (and under **~500** items / **~5** pages for this pass) → your **only** next action is\n **get_board_items_page** with **cursor=nextCursor**; same **boardId** and the same **searchTerm** / **filters**\n / **itemIds** — **do not** change **filters** on a cursor call. **No** user turn until **has_more** is false\n or you stop at the cap. The first page alone is never “the whole board” while **has_more** is still true.\n- **Shrink the query first** when you can: **columnIds**;\n **filters**; **searchTerm**; or **itemIds** (max **100** per call, split big lists). Search **timeout** or\n error → **narrower** **searchTerm** or smaller **limit** / columns, then continue with **nextCursor** as\n in the first bullet.\n\n2. **Match (after the fetch for that pass is done)**\n- Apply a **clear** rule to names/values you already loaded (e.g. same name as source, or value user gave).\n- One unambiguous match → link without asking. **No** vague “best” pick without a rule.\n\n3. **If the user must be involved (only after step 1 is done for that query)**\n- If step 1 is incomplete, **no** questions (see step 1’s first bullet).\n- **True tie** (2+ items match the rule equally) → show **only those tied rows** (or a tiny shortlist),\n not the full result set and never all ~500.\n- **No way to name a target yet** (not a tie) → ask **once** for a **name** or **search phrase** to use in\n **searchTerm** / **filters**, not a menu of the board.\n\n4. **Write** — On the owning board’s board-relation column using change_item_column_values\n".trim(),C_={};const x_=Tc`
|
|
2053
2082
|
query GetItemAssets($itemId: [ID!]!, $columnId: [String!]!) {
|
|
2054
2083
|
items(ids: $itemId) {
|
|
2055
2084
|
assets(column_ids: $columnId) {
|
|
@@ -2059,7 +2088,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
2059
2088
|
}
|
|
2060
2089
|
}
|
|
2061
2090
|
}
|
|
2062
|
-
`,
|
|
2091
|
+
`,F_=10485760,L_=5e4,V_=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico"]),j_=new Set([".pdf"]),U_=new Set([".docx"]),M_=new Set([".xlsx"]),B_=new Set([".xls"]),q_=new Set([".txt",".md",".csv",".json"]),H_={item_id:e.string().describe("The ID of the item that contains the file. Obtained from get_board_items_page results."),column_id:e.string().describe("The ID of the files column containing the file. Obtained from the board schema."),file_name:e.string().optional().describe('Optional file name hint used to determine the file type when the asset name is ambiguous. Include the extension (e.g. "report.pdf").'),offset:e.number().int().min(0).optional().describe("Character offset to start reading from. Use when a previous response indicated the content was truncated (has_more: true). Defaults to 0.")};function G_(e){const t=e.lastIndexOf(".");return-1===t?"":e.slice(t).toLowerCase()}function W_(e){if(null==e)return"";if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return String(e);if(e instanceof Date)return e.toISOString();if("object"==typeof e){if("result"in e)return W_(e.result);if("richText"in e)return e.richText.map((e=>e.text)).join("");if("hyperlink"in e)return e.text??""}return""}async function Q_(e,t,a){const r=function(e,t){if(t){const e=G_(t);if(e)return e}return e.file_extension?e.file_extension.startsWith(".")?e.file_extension.toLowerCase():`.${e.file_extension.toLowerCase()}`:G_(e.name)}(e,a);try{if(V_.has(r))return{file_name:e.name,file_extension:r,content_type:"image",public_url:e.public_url,message:"Image file — use the public_url to view or analyze its content."};if(B_.has(r))return{file_name:e.name,file_extension:r,message:"Legacy .xls format is not supported. Please convert the file to .xlsx and re-upload."};const a=await async function(e){const t=await fetch(e,{signal:AbortSignal.timeout(3e4)});if(!t.ok)throw new Error(`Failed to download file: HTTP ${t.status}`);const a=t.headers.get("content-length");if(a&&parseInt(a,10)>F_)throw new Error(`File exceeds the 10 MB size limit (Content-Length: ${a} bytes)`);if(!t.body)throw new Error("Response body is empty");const r=t.body.getReader(),i=[];let o=0;try{let e=await r.read();for(;!e.done;){const{value:t}=e;if(o+=t.byteLength,o>F_)throw await r.cancel().catch((()=>{})),new Error("File exceeds the 10 MB size limit");i.push(t),e=await r.read()}}catch(e){throw await r.cancel().catch((()=>{})),e}return Buffer.concat(i)}(e.public_url);let i,o;j_.has(r)?(i=await async function(e){const t=await g(new Uint8Array(e)),{text:a}=await _(t,{mergePages:!0});return a}(a),o="pdf"):U_.has(r)?(i=await async function(e){return(await f.extractRawText({buffer:e})).value}(a),o="word"):M_.has(r)?(i=await async function(e){const t=new v.Workbook;await t.xlsx.load(e);const a=[];return t.eachSheet((e=>{const t=[];e.eachRow((e=>{const a=e.values.slice(1);t.push(a.map(W_).join(","))})),a.push(`=== Sheet: ${e.name} ===\n${t.join("\n")}`)})),a.join("\n\n")}(a),o="excel"):q_.has(r)?(i=a.toString("utf-8"),o="text"):(i=a.toString("utf-8"),o="unknown");const n=i.slice(t,t+L_),s=i.length>t+L_;return{file_name:e.name,file_extension:r,content_type:o,text:n,total_length:i.length,...j_.has(r)&&{public_url:e.public_url},...s&&{has_more:!0,next_offset:t+L_}}}catch(t){return{message:`Failed to fetch file content: ${t instanceof Error?t.message:String(t)}`,file_name:e.name,file_extension:r}}}const z_=Tc`
|
|
2063
2092
|
fragment AgentFields on Agent {
|
|
2064
2093
|
id
|
|
2065
2094
|
kind
|
|
@@ -2078,47 +2107,47 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
2078
2107
|
created_at
|
|
2079
2108
|
updated_at
|
|
2080
2109
|
}
|
|
2081
|
-
`,
|
|
2082
|
-
${
|
|
2110
|
+
`,Y_=Tc`
|
|
2111
|
+
${z_}
|
|
2083
2112
|
|
|
2084
2113
|
query getAgent($id: ID!) {
|
|
2085
2114
|
agent(id: $id) {
|
|
2086
2115
|
...AgentFields
|
|
2087
2116
|
}
|
|
2088
2117
|
}
|
|
2089
|
-
`,
|
|
2090
|
-
${
|
|
2118
|
+
`,K_=Tc`
|
|
2119
|
+
${z_}
|
|
2091
2120
|
|
|
2092
2121
|
query listAgents {
|
|
2093
2122
|
agents {
|
|
2094
2123
|
...AgentFields
|
|
2095
2124
|
}
|
|
2096
2125
|
}
|
|
2097
|
-
`,
|
|
2098
|
-
${
|
|
2126
|
+
`,J_=Tc`
|
|
2127
|
+
${z_}
|
|
2099
2128
|
|
|
2100
2129
|
mutation createAgent($input: CreateAgentInput!) {
|
|
2101
2130
|
create_agent(input: $input) {
|
|
2102
2131
|
...AgentFields
|
|
2103
2132
|
}
|
|
2104
2133
|
}
|
|
2105
|
-
`,
|
|
2106
|
-
${
|
|
2134
|
+
`,X_=Tc`
|
|
2135
|
+
${z_}
|
|
2107
2136
|
|
|
2108
2137
|
mutation createBlankAgent($input: CreateBlankAgentInput) {
|
|
2109
2138
|
create_blank_agent(input: $input) {
|
|
2110
2139
|
...AgentFields
|
|
2111
2140
|
}
|
|
2112
2141
|
}
|
|
2113
|
-
`,
|
|
2114
|
-
${
|
|
2142
|
+
`,Z_=Tc`
|
|
2143
|
+
${z_}
|
|
2115
2144
|
|
|
2116
2145
|
mutation deleteAgent($id: ID!) {
|
|
2117
2146
|
delete_agent(id: $id) {
|
|
2118
2147
|
...AgentFields
|
|
2119
2148
|
}
|
|
2120
2149
|
}
|
|
2121
|
-
`,
|
|
2150
|
+
`,ey={id:e.string().trim().min(1,"Agent id must be a non-empty string").optional().describe("Unique identifier of a monday platform agent. When provided, returns that single agent. When omitted, returns every non-deleted personal agent owned by the authenticated user.")};const ty={prompt:e.string().trim().min(1,"Prompt must be a non-empty string").optional().describe("Plain-language description of what the monday platform agent should do. When provided, the platform uses this prompt to generate the agent profile (name, role, avatar), goal, and execution plan via AI. Be specific about the domain and the tasks the agent should automate."),agent_model:e.string().optional().describe("STRONGLY DISCOURAGED — omit this field. Only set when the user explicitly names a monday-supported model. Do not invent or guess model identifiers (e.g. gpt-4o, claude-3-opus). Invalid values are rejected by the platform. When omitted the platform default is used, which is the right choice in almost every case."),name:e.string().trim().min(1,"Name must be a non-empty string").optional().describe("Display name of the agent."),role:e.string().trim().min(1,"Role must be a non-empty string").optional().describe("Role of the agent."),role_description:e.string().trim().min(1,"Role description must be a non-empty string").optional().describe("Description of the role."),avatar_url:e.string().trim().min(1,"Avatar URL must be a non-empty string").optional().describe("HTTPS URL of the avatar image. Prefer dapulse-res.cloudinary.com or cdn.monday.com for full renderer compatibility."),gender:e.enum(["male","female"]).optional().describe("Hint for generated avatar/name when profile fields are omitted."),background_color:e.string().trim().min(1,"Background color must be a non-empty string").optional().describe('Background color string, usually lowercase hex like "#9450fd".'),user_prompt:e.string().trim().min(1,"User prompt must be a non-empty string").optional().describe("Stored as metadata only. Not used for AI generation.")};const ay={id:e.string().trim().min(1,"Agent id must be a non-empty string").describe("Unique identifier of the monday platform agent to delete.")};const ry={action:e.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),toolName:e.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)")};class iy{constructor(){this.name="manage_tools",this.type=jr.READ,this.enabledByDefault=!0,this.annotations={title:"Discover & Manage monday.com Tools",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}}setToolkitManager(e){this.toolkitManager=e}getDescription(){return"Discover and manage available monday.com tools. Use this tool first to see what tools are available, check which ones are active/inactive, and enable any tools you need for your tasks. When enabling a tool, you will be asked for confirmation first. Essential for understanding your monday.com toolkit capabilities."}getInputSchema(){return ry}async execute(e){if(!this.toolkitManager)throw new Error("Toolkit manager not initialized");if(!e)throw new Error("Input parameters are required");const{action:t,toolName:a}=e;switch(t){case"enable":{if(!a)throw new Error("Tool name is required for enable action");if(this.toolkitManager.isToolEnabled(a))return{content:{action:"enable",tool_name:a,success:!0,message:`Tool '${a}' is already enabled`,enabled:!0}};const e=this.toolkitManager.enableTool(a);return{content:{action:"enable",tool_name:a,success:e,message:e?`Tool '${a}' has been enabled and is now available for use`:`Failed to enable tool '${a}' (tool not found)`,enabled:e}}}case"disable":{if(!a)throw new Error("Tool name is required for disable action");const e=this.toolkitManager.disableTool(a);return{content:{action:"disable",tool_name:a,success:e,message:e?`Tool '${a}' has been disabled`:`Failed to disable tool '${a}' (tool not found)`,enabled:!e}}}case"status":if(a){return{content:{action:"status",tool_name:a,enabled:this.toolkitManager.isToolEnabled(a)}}}return{content:{action:"status",tools:this.toolkitManager.getToolsStatus()}};case"detailed":{const e=this.toolkitManager.getDetailedToolsStatus();return{content:{action:"detailed",active_tools:Object.entries(e).filter((([,e])=>e.enabled)).map((([e,t])=>({name:e,enabled_by_default:t.enabledByDefault}))),inactive_tools:Object.entries(e).filter((([,e])=>!e.enabled)).map((([e,t])=>({name:e,enabled_by_default:t.enabledByDefault,activate_hint:`{"action": "enable", "toolName": "${e}"}`})))}}}case"reset":{if(!a)throw new Error("Tool name is required for reset action");const e=this.toolkitManager.resetToolToDefault(a);return{content:{action:"reset",tool_name:a,success:e,message:e?`Tool '${a}' has been reset to its default state`:`Failed to reset tool '${a}' (tool not found)`,default_state:this.toolkitManager.isToolEnabledByDefault(a)}}}case"list":return{content:{action:"list",tools:this.toolkitManager.getToolsStatus()}};default:throw new Error("Invalid action. Use: enable, disable, status, list, detailed, or reset")}}}const oy=Tc`
|
|
2122
2151
|
query getSprintsByIds($ids: [ID!]) {
|
|
2123
2152
|
items(ids: $ids) {
|
|
2124
2153
|
id
|
|
@@ -2153,7 +2182,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
2153
2182
|
}
|
|
2154
2183
|
}
|
|
2155
2184
|
}
|
|
2156
|
-
`,
|
|
2185
|
+
`,ny={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"},sy={...ny,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},dy="BOARD_NOT_FOUND:",py="SPRINT_NOT_FOUND:",ly="DOCUMENT_NOT_FOUND:",my="DOCUMENT_INVALID:",cy="DOCUMENT_EMPTY:",uy="EXPORT_FAILED:",hy="INTERNAL_ERROR:",fy="VALIDATION_ERROR:",vy="task_sprint",gy={[sy.SPRINT_TASKS]:"Sprint Tasks",[sy.SPRINT_TIMELINE]:"Sprint Timeline",[sy.SPRINT_COMPLETION]:"Sprint Completion",[sy.SPRINT_START_DATE]:"Sprint Start Date",[sy.SPRINT_END_DATE]:"Sprint End Date",[sy.SPRINT_ACTIVATION]:"Sprint Activation",[sy.SPRINT_SUMMARY]:"Sprint Summary",[sy.SPRINT_CAPACITY]:"Sprint Capacity"},_y=Nl,yy={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},by=(e,t)=>e.column_values?.find((e=>e.id===t)),wy=(e,t)=>{const a=by(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},Iy=(e,t)=>{const a=by(e,t);return"DateValue"===a?.__typename?a.date??null:null},Ty=(e,t)=>{const a=by(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},Ey=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},Sy=(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)))},Dy=e=>Sy(e,Object.values(ny)),Ny=e=>Sy(e,Object.values(yy)),Ay=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},ky=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===af.BoardRelation))||null,Oy={sprintId:e.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const $y=Tc`
|
|
2157
2186
|
query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
|
|
2158
2187
|
boards(ids: [$boardId]) {
|
|
2159
2188
|
items_page(limit: $limit) {
|
|
@@ -2189,7 +2218,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
2189
2218
|
}
|
|
2190
2219
|
}
|
|
2191
2220
|
}
|
|
2192
|
-
`,
|
|
2221
|
+
`,Ry={sprintsBoardId:e.number().describe("The ID of the monday-dev board containing the sprints"),limit:e.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const Py=Tc`
|
|
2193
2222
|
query GetRecentBoards($limit: Int) {
|
|
2194
2223
|
boards(limit: $limit, order_by: used_at, state: active) {
|
|
2195
2224
|
id
|
|
@@ -2205,7 +2234,7 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
2205
2234
|
}
|
|
2206
2235
|
}
|
|
2207
2236
|
}
|
|
2208
|
-
`,$y={};const Ry=[class extends Ei{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=jr.READ,this.annotations=Ti({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 $y}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(Oy,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${oy} 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:`${my} 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 r=Dy(e,ry.SPRINT_TASKS);if(!r)return;const i=Sy(r);if(!i)return;const o=`${e.id}:${i}`;if(a.has(o))return;const n=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(i,n,`Tasks Board ${i}`)})}processTasksBoard(e,t,a){const r=Dy(e,uy);if(!r)return;const i=Sy(r);if(!i)return;const o=`${i}:${e.id}`;if(a.has(o))return;const n=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(i,n,`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 r of e)r.columns&&(Ty(r)&&this.processSprintsBoard(r,a,t),Ey(r)&&this.processTasksBoard(r,a,t));return Array.from(t.values())}},class extends Ei{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=jr.READ,this.annotations=Ti({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive sprint metadata from a monday-dev sprints board 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."}getInputSchema(){return ky}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},r=await this.mondayApi.request(Ay,a),i=r.boards?.[0],o=i?.items_page?.items||[],n=this.buildSprintsMetadata(o);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:o.length,data:n}}}catch(e){return{content:`${my} 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(Oc,t),r=a.boards?.[0];if(!r)return{success:!1,error:`${oy} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const i=r.columns||[],o=this.validateSprintsBoardSchemaFromColumns(i);return o.isValid?{success:!0}:{success:!1,error:`${cy} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${my} 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(ry),r=wy(t,a);if(!r.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return r.missingColumns.forEach((t=>{const a=(e=>hy[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=_y(e,iy.SPRINT_ACTIVATION),a=_y(e,iy.SPRINT_COMPLETION),r=yy(e,iy.SPRINT_START_DATE),i=yy(e,iy.SPRINT_END_DATE),o=((e,t)=>{const a=gy(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,iy.SPRINT_TIMELINE),n=by(e,iy.SPRINT_SUMMARY);let s=fy.Planned;return a?s=fy.Completed:(t||r)&&(s=fy.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:r||null,end_date:i||null,is_completed:a,document_object_id:n||null}}))}},class extends Ei{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=jr.READ,this.annotations=Ti({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\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 Ny}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${my} 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||`${my} Unknown error occurred while reading document content`}}catch(e){return{content:`${my} 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(ay,t)).items||[];if(0===a.length)return{success:!1,error:`${ny} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const r=a[0];if(!r)return{success:!1,error:`${ny} Sprint with ID ${e} not found.`};const i=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),r=[...Object.values(ry),...t];return wy(a,r)})(r,[iy.SPRINT_SUMMARY]);if(!i.isValid)return{success:!1,error:`${cy} Sprint item is missing required columns: ${i.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=by(r,iy.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:r.name}:{success:!1,error:`${sy} No sprint summary document found for sprint "${r.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${my} 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(Ec,t)).docs||[];if(0===a.length)return{success:!1,error:`${sy} Document with object ID ${e} not found or not accessible.`};const r=a[0];if(!r||!r.id)return{success:!1,error:`${dy} Document data is invalid for object ID ${e}.`};const i={docId:r.id,blockIds:[]},o=await this.mondayApi.request(Mc,i);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${ly} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const n=o.export_markdown_from_doc.markdown;return n?{success:!0,content:n}:{success:!1,error:`${py} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${my} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],Py=[class extends Ei{constructor(){super(...arguments),this.name="delete_item",this.type=jr.WRITE,this.annotations=Ti({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Nf}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(Ac,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends Ei{constructor(){super(...arguments),this.name="get_board_items_page",this.type=jr.READ,this.annotations=Ti({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. [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 to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available. [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 to get the board views, find the matching view by name, then extract its filter field and pass it as the filters argument here.'}getInputSchema(){return Wf}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){Gh(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};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 r=await this.mondayApi.request(Hf,a);return{content:this.mapResult(r,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:Zp.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],r=a?.items_page,i=r?.items||[];return{board:{id:a?.id,name:a?.name},items:i.map((e=>this.mapItem(e,t))),pagination:{has_more:!!r?.cursor,nextCursor:r?.cursor||null,count:i.length}}}mapItem(e,t){const a={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}if(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})));a.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case tf.BoardRelation:return e.linked_items;case tf.Formula:return e.display_value;case tf.Mirror:return"Column value type is not supported"}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(Gf,t,{versionOverride:"dev",timeout:qh})).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 r=e.itemIds??[];if(0===r.length)return a;const i=new Set(r);return a.filter((e=>i.has(e)))}},class extends Ei{constructor(){super(...arguments),this.name="create_item",this.type=jr.WRITE,this.annotations=Ti({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"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 to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?uf:hf}async executeInternal(e){const t=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,t):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,t)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},r=await this.mondayApi.request(mf,a);if(!r.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let i;try{i=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...i,name:e.name},n=new Qc(this.mondayApi,{boardId:t});return await n.execute({itemId:parseInt(r.duplicate_item.id),columnValues:JSON.stringify(o)}),{content:{message:`Item ${r.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:r.duplicate_item.id,item_name:r.duplicate_item.name,item_url:r.duplicate_item.url,board_id:t}}}catch(e){Hh(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const a=await this.mondayApi.request(cf,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");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){Hh(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},r=await this.mondayApi.request(kc,a);return{content:{message:`Item ${r.create_item?.id} successfully created`,item_id:r.create_item?.id,item_name:r.create_item?.name,item_url:r.create_item?.url,board_id:t}}}catch(e){Hh(e,"create item")}}},class extends Ei{constructor(){super(...arguments),this.name="create_update",this.type=jr.WRITE,this.annotations=Ti({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 yf}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),r=_f.safeParse(a);if(!r.success)throw new Error(`Invalid mentionsList format: ${r.error.message}`);t=r.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()},r=await this.mondayApi.request(vf,a);if(!r.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${r.create_update.id} created on item ${e.itemId}`,update_id:r.create_update.id,item_id:e.itemId,item_name:r.create_update.item?.name,item_url:r.create_update.item?.url}}}catch(e){Hh(e,"create update")}}},class extends Ei{constructor(){super(...arguments),this.name="get_updates",this.type=jr.READ,this.annotations=Ti({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. 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. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return Tf}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===If.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const r={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let i;i=e.objectType===If.Item?await this.mondayApi.request(bf,{...r,itemId:e.objectId}):await this.mondayApi.request(wf,{...r,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:Ef(e.fromDate),toDate:Ef(e.toDate)}:{}});const o=e.objectType===If.Item?i.items?.[0]?.updates:i.boards?.[0]?.updates;if(!o||0===o.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const n=o.map((t=>{const a={id:t.id,text_body:t.text_body,created_at:t.created_at,updated_at:t.updated_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:t.item_id};return e.includeReplies&&t.replies&&(a.replies=t.replies.map((e=>({id:e.id,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&t.assets&&(a.assets=t.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})),s=e.objectType===If.Item?i.items?.[0]?.url:i.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:n,pagination:{page:e.page??1,limit:e.limit??25,count:n.length}}}}catch(e){Hh(e,"get updates")}}},class extends Ei{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=jr.WRITE,this.annotations=Ti({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 v_}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),r=f_.safeParse(a);if(!r.success)throw new Error(`Invalid mentionsList format: ${r.error.message}`);t=r.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},r=await this.mondayApi.request(vf,a);if(!r.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${r.create_update.id} successfully created on item ${e.itemId}`,update_id:r.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){Hh(e,"create update")}}},class extends Ei{constructor(){super(...arguments),this.name="get_board_schema",this.type=jr.READ,this.annotations=Ti({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return Qf}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},r=await this.mondayApi.request(Oc,a);return{content:{message:"Board schema retrieved",board_id:t,columns:r.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type})))??[],groups:r.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends Ei{constructor(){super(...arguments),this.name="get_board_activity",this.type=jr.READ,this.annotations=Ti({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)"}getInputSchema(){return xf}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-Bh.MONTH30Days),r=e?.fromDate||a.toISOString(),i=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:r,toDate:i,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},n=await this.mondayApi.request(Cf,o),s=n.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${r} to ${i}).`};const d=n.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 Ei{constructor(){super(...arguments),this.name="get_board_info",this.type=jr.READ,this.annotations=Ti({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. Also returns the board's views (e.g. table views, filter views) — each view includes its id, name, type, and a structured filter object. "}getInputSchema(){return qf}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(Ff,t),r=a.boards?.[0];if(!r)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const i=await this.getSubItemsBoardAsync(r);return{content:Vf(r,i)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===tf.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],r=await this.mondayApi.request(Lf,{boardId:a});return r.boards?.[0]??null}},class extends Ei{constructor(){super(...arguments),this.name="get_full_board_data",this.type=jr.READ,this.annotations=Ti({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 Pf}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(kf,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const r=a.boards[0],i=new Set;r.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 n=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(Of,e);n=t.users?.filter((e=>null!==e))||[]}const s=new Map(n.map((e=>[e.id,e])));return{content:{board:{id:r.id,name:r.name,columns:r.columns,items:r.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:n,stats:{total_items:r.items_page.items.length,total_updates:r.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:n.length}}}}catch(e){Hh(e,"get full board data")}}},class extends Ei{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=jr.READ,this.annotations=Ti({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 Tv}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,r=e.includeTeams||!1,i=e.teamsOnly||!1,o=e.includeTeamMembers||!1,n=!!e.name;if(e.getMe||!1){if(t||a||r||i||o||n)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(uv);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=vv(s),p=await wv(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}if(n){if(t||a||r||i||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const n={name:e.name},s=await this.mondayApi.request(cv,n);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 wv(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(i&&r)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>gv)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>_v)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&&!r)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(mv,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(lv,t)}else if(r){const t={userIds:e.userIds,teamIds:e.teamIds,limit:yv};s=await this.mondayApi.request(pv,t)}else if(t){const t={userIds:e.userIds,limit:yv};s=await this.mondayApi.request(sv,t)}else{const e={userIds:void 0,limit:yv};s=await this.mondayApi.request(dv,e)}const d=vv(s),p=await wv(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},Qc,class extends Ei{constructor(){super(...arguments),this.name="move_item_to_group",this.type=jr.WRITE,this.annotations=Ti({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return Ev}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(Rc,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends Ei{constructor(){super(...arguments),this.name="create_board",this.type=jr.WRITE,this.annotations=Ti({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return fu}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(Pc,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 Ei{constructor(){super(...arguments),this.name="create_form",this.type=jr.WRITE,this.annotations=Ti({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 zu}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(Du,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends Ei{constructor(){super(...arguments),this.name="update_form",this.type=jr.WRITE,this.annotations=Ti({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Vh(this.mondayApi),this.actionHandlers=new Map([[hh.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[hh.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[hh.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[hh.activate,this.helpers.activateForm.bind(this.helpers)],[hh.createTag,this.helpers.createTag.bind(this.helpers)],[hh.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[hh.updateTag,this.helpers.updateTag.bind(this.helpers)],[hh.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[hh.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[hh.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[hh.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[hh.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return"Update a monday.com form. Use the action field to specify the operation."}getInputSchema(){return Lh}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 Ei{constructor(){super(...arguments),this.name="get_form",this.type=jr.READ,this.annotations=Ti({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token. 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."}getInputSchema(){return jh}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Nu,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 Ei{constructor(){super(...arguments),this.name="form_questions_editor",this.type=jr.WRITE,this.annotations=Ti({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new uh(this.mondayApi),this.actionHandlers=new Map([[lh.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[lh.Update,this.helpers.updateQuestion.bind(this.helpers)],[lh.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return ch}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends Ei{constructor(){super(...arguments),this.name="create_form_submission",this.type=jr.WRITE,this.annotations=Ti({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 ef}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(e){if(e.includes("wkf.ms")){const t=(await i.head(e,{maxRedirects:0,validateStatus:e=>e<400})).headers.location;return t?this.extractTokenFromUrl(t):null}return e.startsWith("http://")||e.startsWith("https://")?this.extractTokenFromUrl(e):e}async executeInternal(e){const t=await this.resolveFormToken(e.form_token);if(!t)return{content:`Could not resolve a WorkForm token from "${e.form_token}". Please provide a valid WorkForm token or full WorkForm URL (e.g. https://forms.monday.com/forms/abc123).`};const a={form_token:t,answers:e.answers,form_timezone_offset:e.form_timezone_offset,password:e.password,tags:e.tags};try{const e=await this.mondayApi.request(Wh,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){Hh(e,"submit form")}}},class extends Ei{constructor(){super(...arguments),this.name="create_column",this.type=jr.WRITE,this.annotations=Ti({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?af:rf}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},r=await this.mondayApi.request(Cc,a);return{content:{message:"Column successfully created",column_id:r.create_column?.id,column_title:r.create_column?.title}}}},class extends Ei{constructor(){super(...arguments),this.name="create_group",this.type=jr.WRITE,this.annotations=Ti({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 lf}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(df,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 Ei{constructor(){super(...arguments),this.name="delete_column",this.type=jr.WRITE,this.annotations=Ti({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?Sf:Df}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(xc,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Hc,class extends Ei{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=jr.ALL_API,this.annotations=Ti({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 Jf}async executeInternal(e){try{const t=await this.mondayApi.request(Fc),a=e?.operationType,r=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,n=r?.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:n}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends Ei{constructor(){super(...arguments),this.name="get_column_type_info",this.type=jr.READ,this.annotations=Ti({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieves comprehensive information about a specific column type, including JSON schema definition and other metadata. Use this before creating columns with the create_column tool to understand the structure, validation rules, and available properties for column settings."}getInputSchema(){return Kf}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(zf,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const r={schema:a.get_column_type_schema};return{content:{message:`Column type info for ${e.columnType}`,data:r,url:Yf}}}},class extends Ei{constructor(){super(...arguments),this.name="get_type_details",this.type=jr.ALL_API,this.annotations=Ti({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"}getInputSchema(){return Xf}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,Tc`
|
|
2237
|
+
`,Cy={};const xy=[class extends Ei{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=jr.READ,this.annotations=Ti({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 Cy}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(Py,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${dy} 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:`${hy} 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 r=ky(e,ny.SPRINT_TASKS);if(!r)return;const i=Ay(r);if(!i)return;const o=`${e.id}:${i}`;if(a.has(o))return;const n=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(i,n,`Tasks Board ${i}`)})}processTasksBoard(e,t,a){const r=ky(e,vy);if(!r)return;const i=Ay(r);if(!i)return;const o=`${i}:${e.id}`;if(a.has(o))return;const n=t.get(i);a.set(o,{sprintsBoard:this.createBoardInfo(i,n,`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 r of e)r.columns&&(Dy(r)&&this.processSprintsBoard(r,a,t),Ny(r)&&this.processTasksBoard(r,a,t));return Array.from(t.values())}},class extends Ei{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=jr.READ,this.annotations=Ti({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive sprint metadata from a monday-dev sprints board 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."}getInputSchema(){return Ry}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},r=await this.mondayApi.request($y,a),i=r.boards?.[0],o=i?.items_page?.items||[],n=this.buildSprintsMetadata(o);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:o.length,data:n}}}catch(e){return{content:`${hy} 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(Oc,t),r=a.boards?.[0];if(!r)return{success:!1,error:`${dy} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const i=r.columns||[],o=this.validateSprintsBoardSchemaFromColumns(i);return o.isValid?{success:!0}:{success:!1,error:`${fy} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${hy} 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(ny),r=Ey(t,a);if(!r.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return r.missingColumns.forEach((t=>{const a=(e=>gy[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=wy(e,sy.SPRINT_ACTIVATION),a=wy(e,sy.SPRINT_COMPLETION),r=Iy(e,sy.SPRINT_START_DATE),i=Iy(e,sy.SPRINT_END_DATE),o=((e,t)=>{const a=by(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,sy.SPRINT_TIMELINE),n=Ty(e,sy.SPRINT_SUMMARY);let s=_y.Planned;return a?s=_y.Completed:(t||r)&&(s=_y.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:r||null,end_date:i||null,is_completed:a,document_object_id:n||null}}))}},class extends Ei{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=jr.READ,this.annotations=Ti({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\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 Oy}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${hy} 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||`${hy} Unknown error occurred while reading document content`}}catch(e){return{content:`${hy} 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(oy,t)).items||[];if(0===a.length)return{success:!1,error:`${py} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const r=a[0];if(!r)return{success:!1,error:`${py} Sprint with ID ${e} not found.`};const i=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),r=[...Object.values(ny),...t];return Ey(a,r)})(r,[sy.SPRINT_SUMMARY]);if(!i.isValid)return{success:!1,error:`${fy} Sprint item is missing required columns: ${i.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=Ty(r,sy.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:r.name}:{success:!1,error:`${ly} No sprint summary document found for sprint "${r.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${hy} 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(Ec,t)).docs||[];if(0===a.length)return{success:!1,error:`${ly} Document with object ID ${e} not found or not accessible.`};const r=a[0];if(!r||!r.id)return{success:!1,error:`${my} Document data is invalid for object ID ${e}.`};const i={docId:r.id,blockIds:[]},o=await this.mondayApi.request(Bc,i);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${uy} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const n=o.export_markdown_from_doc.markdown;return n?{success:!0,content:n}:{success:!1,error:`${cy} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${hy} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],Fy=[class extends Ei{constructor(){super(...arguments),this.name="delete_item",this.type=jr.WRITE,this.annotations=Ti({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return Of}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(Ac,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends Ei{constructor(){super(...arguments),this.name="get_board_items_page",this.type=jr.READ,this.annotations=Ti({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. [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 to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available. [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 to get the board views, find the matching view by name, then extract its filter field and pass it as the filters argument here.'}getInputSchema(){return Yf}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){Wh(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};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 r=await this.mondayApi.request(Qf,a);return{content:this.mapResult(r,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:Zp.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],r=a?.items_page,i=r?.items||[];return{board:{id:a?.id,name:a?.name},items:i.map((e=>this.mapItem(e,t))),pagination:{has_more:!!r?.cursor,nextCursor:r?.cursor||null,count:i.length}}}mapItem(e,t){const a={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}if(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})));a.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case af.BoardRelation:return e.linked_items;case af.Formula:return e.display_value;case af.Mirror:return"Column value type is not supported"}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(zf,t,{versionOverride:"dev",timeout:Hh})).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 r=e.itemIds??[];if(0===r.length)return a;const i=new Set(r);return a.filter((e=>i.has(e)))}},class extends Ei{constructor(){super(...arguments),this.name="create_item",this.type=jr.WRITE,this.annotations=Ti({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"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 to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?vf:gf}async executeInternal(e){const t=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,t):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,t)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},r=await this.mondayApi.request(hf,a);if(!r.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let i;try{i=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...i,name:e.name},n=new zc(this.mondayApi,{boardId:t});return await n.execute({itemId:parseInt(r.duplicate_item.id),columnValues:JSON.stringify(o)}),{content:{message:`Item ${r.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:r.duplicate_item.id,item_name:r.duplicate_item.name,item_url:r.duplicate_item.url,board_id:t}}}catch(e){Gh(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const a=await this.mondayApi.request(ff,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");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){Gh(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},r=await this.mondayApi.request(kc,a);return{content:{message:`Item ${r.create_item?.id} successfully created`,item_id:r.create_item?.id,item_name:r.create_item?.name,item_url:r.create_item?.url,board_id:t}}}catch(e){Gh(e,"create item")}}},class extends Ei{constructor(){super(...arguments),this.name="create_update",this.type=jr.WRITE,this.annotations=Ti({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 If}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),r=wf.safeParse(a);if(!r.success)throw new Error(`Invalid mentionsList format: ${r.error.message}`);t=r.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()},r=await this.mondayApi.request(yf,a);if(!r.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${r.create_update.id} created on item ${e.itemId}`,update_id:r.create_update.id,item_id:e.itemId,item_name:r.create_update.item?.name,item_url:r.create_update.item?.url}}}catch(e){Gh(e,"create update")}}},class extends Ei{constructor(){super(...arguments),this.name="get_updates",this.type=jr.READ,this.annotations=Ti({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. 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. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return Df}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===Sf.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const r={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let i;i=e.objectType===Sf.Item?await this.mondayApi.request(Tf,{...r,itemId:e.objectId}):await this.mondayApi.request(Ef,{...r,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:Nf(e.fromDate),toDate:Nf(e.toDate)}:{}});const o=e.objectType===Sf.Item?i.items?.[0]?.updates:i.boards?.[0]?.updates;if(!o||0===o.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const n=o.map((t=>{const a={id:t.id,text_body:t.text_body,created_at:t.created_at,updated_at:t.updated_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:t.item_id};return e.includeReplies&&t.replies&&(a.replies=t.replies.map((e=>({id:e.id,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&t.assets&&(a.assets=t.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})),s=e.objectType===Sf.Item?i.items?.[0]?.url:i.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:n,pagination:{page:e.page??1,limit:e.limit??25,count:n.length}}}}catch(e){Gh(e,"get updates")}}},class extends Ei{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=jr.WRITE,this.annotations=Ti({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 y_}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),r=__.safeParse(a);if(!r.success)throw new Error(`Invalid mentionsList format: ${r.error.message}`);t=r.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},r=await this.mondayApi.request(yf,a);if(!r.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${r.create_update.id} successfully created on item ${e.itemId}`,update_id:r.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){Gh(e,"create update")}}},class extends Ei{constructor(){super(...arguments),this.name="get_board_schema",this.type=jr.READ,this.annotations=Ti({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return Kf}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},r=await this.mondayApi.request(Oc,a);return{content:{message:"Board schema retrieved",board_id:t,columns:r.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type,revision:e?.revision})))??[],groups:r.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends Ei{constructor(){super(...arguments),this.name="get_board_activity",this.type=jr.READ,this.annotations=Ti({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)"}getInputSchema(){return Vf}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-qh.MONTH30Days),r=e?.fromDate||a.toISOString(),i=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:r,toDate:i,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},n=await this.mondayApi.request(Lf,o),s=n.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${r} to ${i}).`};const d=n.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 Ei{constructor(){super(...arguments),this.name="get_board_info",this.type=jr.READ,this.annotations=Ti({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. Also returns the board's views (e.g. table views, filter views) — each view includes its id, name, type, and a structured filter object. "}getInputSchema(){return Wf}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(jf,t),r=a.boards?.[0];if(!r)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const i=await this.getSubItemsBoardAsync(r);return{content:Mf(r,i)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===af.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],r=await this.mondayApi.request(Uf,{boardId:a});return r.boards?.[0]??null}},class extends Ei{constructor(){super(...arguments),this.name="get_full_board_data",this.type=jr.READ,this.annotations=Ti({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 Ff}async executeInternal(e){try{const t={boardId:e.boardId,itemsLimit:7};e.filters&&(t.queryParams={operator:e.filtersOperator,rules:e.filters.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute})))});const a=await this.mondayApi.request(Rf,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const r=a.boards[0],i=new Set;r.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 n=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(Pf,e);n=t.users?.filter((e=>null!==e))||[]}const s=new Map(n.map((e=>[e.id,e])));return{content:{board:{id:r.id,name:r.name,columns:r.columns,items:r.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:n,stats:{total_items:r.items_page.items.length,total_updates:r.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:n.length}}}}catch(e){Gh(e,"get full board data")}}},class extends Ei{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=jr.READ,this.annotations=Ti({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 Dv}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,r=e.includeTeams||!1,i=e.teamsOnly||!1,o=e.includeTeamMembers||!1,n=!!e.name;if(e.getMe||!1){if(t||a||r||i||o||n)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(vv);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},d=yv(s),p=await Ev(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}if(n){if(t||a||r||i||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const n={name:e.name},s=await this.mondayApi.request(fv,n);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 Ev(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:l?`https://${l}.monday.com/teams/all`:void 0}}}if(i&&r)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>bv)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>wv)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&&!r)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(hv,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(uv,t)}else if(r){const t={userIds:e.userIds,teamIds:e.teamIds,limit:Iv};s=await this.mondayApi.request(cv,t)}else if(t){const t={userIds:e.userIds,limit:Iv};s=await this.mondayApi.request(lv,t)}else{const e={userIds:void 0,limit:Iv};s=await this.mondayApi.request(mv,e)}const d=yv(s),p=await Ev(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:p?`https://${p}.monday.com/teams/all`:void 0}}}},zc,class extends Ei{constructor(){super(...arguments),this.name="move_item_to_group",this.type=jr.WRITE,this.annotations=Ti({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return Nv}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(Rc,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends Ei{constructor(){super(...arguments),this.name="create_board",this.type=jr.WRITE,this.annotations=Ti({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return vu}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(Pc,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 Ei{constructor(){super(...arguments),this.name="create_form",this.type=jr.WRITE,this.annotations=Ti({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 Yu}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(Nu,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends Ei{constructor(){super(...arguments),this.name="update_form",this.type=jr.WRITE,this.annotations=Ti({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new jh(this.mondayApi),this.actionHandlers=new Map([[fh.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[fh.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[fh.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[fh.activate,this.helpers.activateForm.bind(this.helpers)],[fh.createTag,this.helpers.createTag.bind(this.helpers)],[fh.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[fh.updateTag,this.helpers.updateTag.bind(this.helpers)],[fh.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[fh.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[fh.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[fh.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[fh.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return"Update a monday.com form. Use the action field to specify the operation."}getInputSchema(){return Vh}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 Ei{constructor(){super(...arguments),this.name="get_form",this.type=jr.READ,this.annotations=Ti({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token. 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."}getInputSchema(){return Uh}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Au,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 Ei{constructor(){super(...arguments),this.name="form_questions_editor",this.type=jr.WRITE,this.annotations=Ti({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new hh(this.mondayApi),this.actionHandlers=new Map([[mh.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[mh.Update,this.helpers.updateQuestion.bind(this.helpers)],[mh.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return uh}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends Ei{constructor(){super(...arguments),this.name="create_form_submission",this.type=jr.WRITE,this.annotations=Ti({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 tf}extractTokenFromUrl(e){const t=e.match(/\/forms\/([^/?]+)/);return t?t[1]:null}async resolveFormToken(e){if(e.includes("wkf.ms")){const t=(await i.head(e,{maxRedirects:0,validateStatus:e=>e<400})).headers.location;return t?this.extractTokenFromUrl(t):null}return e.startsWith("http://")||e.startsWith("https://")?this.extractTokenFromUrl(e):e}async executeInternal(e){const t=await this.resolveFormToken(e.form_token);if(!t)return{content:`Could not resolve a WorkForm token from "${e.form_token}". Please provide a valid WorkForm token or full WorkForm URL (e.g. https://forms.monday.com/forms/abc123).`};const a={form_token:t,answers:e.answers,form_timezone_offset:e.form_timezone_offset,password:e.password,tags:e.tags};try{const e=await this.mondayApi.request(Qh,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){Gh(e,"submit form")}}},class extends Ei{constructor(){super(...arguments),this.name="create_column",this.type=jr.WRITE,this.annotations=Ti({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?rf:of}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},r=await this.mondayApi.request(Cc,a);return{content:{message:"Column successfully created",column_id:r.create_column?.id,column_title:r.create_column?.title}}}},class extends Ei{constructor(){super(...arguments),this.name="update_column",this.type=jr.WRITE,this.annotations=Ti({title:"Update Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Update properties of an existing monday.com column (title, description, settings). Uses optimistic concurrency control via the revision field — fetch the current revision via get_board_schema first, then call this tool. If the update fails because the revision is stale, re-fetch and try again."}getInputSchema(){return this.context?.boardId?nf:sf}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},r=await this.mondayApi.request(Fc,a);return{content:{message:"Column successfully updated. Use the new revision below for any subsequent update to this column.",column_id:r.update_column?.id,column_title:r.update_column?.title,revision:r.update_column?.revision}}}},class extends Ei{constructor(){super(...arguments),this.name="create_group",this.type=jr.WRITE,this.annotations=Ti({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 uf}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(mf,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 Ei{constructor(){super(...arguments),this.name="delete_column",this.type=jr.WRITE,this.annotations=Ti({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?Af:kf}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(xc,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Gc,class extends Ei{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=jr.ALL_API,this.annotations=Ti({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 ev}async executeInternal(e){try{const t=await this.mondayApi.request(Lc),a=e?.operationType,r=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,n=r?.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:n}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends Ei{constructor(){super(...arguments),this.name="get_column_type_info",this.type=jr.READ,this.annotations=Ti({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieves comprehensive information about a specific column type, including JSON schema definition and other metadata. Use this before creating columns with the create_column tool to understand the structure, validation rules, and available properties for column settings."}getInputSchema(){return Zf}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(Jf,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const r={schema:a.get_column_type_schema};return{content:{message:`Column type info for ${e.columnType}`,data:r,url:Xf}}}},class extends Ei{constructor(){super(...arguments),this.name="get_type_details",this.type=jr.ALL_API,this.annotations=Ti({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"}getInputSchema(){return tv}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,Tc`
|
|
2209
2238
|
query getTypeDetails {
|
|
2210
2239
|
__type(name: "${t}") {
|
|
2211
2240
|
name
|
|
@@ -2293,5 +2322,5 @@ import{z as e,ZodType as t}from"zod";import{zodToJsonSchema as a}from"zod-to-jso
|
|
|
2293
2322
|
}
|
|
2294
2323
|
}
|
|
2295
2324
|
}
|
|
2296
|
-
`),r=await this.mondayApi.request(a);return r.__type?{content:{message:"Type details retrieved",data:{name:r.__type.name,kind:r.__type.kind,description:r.__type.description??null,fields:r.__type.fields??[],inputFields:r.__type.inputFields??[],interfaces:r.__type.interfaces??[],enumValues:r.__type.enumValues??[],possibleTypes:r.__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 Ei{constructor(){super(...arguments),this.name="create_custom_activity",this.type=jr.WRITE,this.annotations=Ti({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return of}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(Vc,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 Ei{constructor(){super(...arguments),this.name="create_notification",this.type=jr.WRITE,this.annotations=Ti({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 sf}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{await this.mondayApi.request(nf,t);return{content:{message:"Notification sent",user_id:e.user_id,text:e.text}}}catch(t){return{content:`Failed to send notification to user ${e.user_id}`}}}},class extends Ei{constructor(){super(...arguments),this.name="create_timeline_item",this.type=jr.WRITE,this.annotations=Ti({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return ff}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(jc,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 Ei{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=jr.READ,this.annotations=Ti({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return Af}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 Ei{constructor(){super(...arguments),this.name="read_docs",this.type=jr.READ,this.annotations=Ti({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- Set include_comments: true to fetch all comments and replies on the document. 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 Av}async executeInternal(e){return e.mode===Dv?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,r;switch(this.sessionContext.metadata={...this.sessionContext.metadata,mode:e.mode??Sv,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":r=e.ids}const i=e.include_blocks??!1,o={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:r,includeBlocks:i};let n=await this.mondayApi.request(Ec,o);if((!n.docs||0===n.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:r,includeBlocks:i};n=await this.mondayApi.request(Ec,a)}if(!n.docs||0===n.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const s=e.include_comments??!1,d=e.comments_limit??50;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:n.docs.flatMap((e=>e?[e.id]:[])),object_ids:n.docs.flatMap((e=>e?.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(n.docs,o,i,s,d)}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:r,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:Dv,object_ids:[o]};try{const e={docId:o,since:a,until:r},n=await this.mondayApi.request(Sc,e);let s=n?.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:r,restoring_points:s}};const d=Math.min(i??10,10),p=s.slice(0,d+1),l=s.length>d,m=(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 r={docId:o,date:e.date,prevDate:a.date},i=await this.mondayApi.request(Nc,r);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:r,restoring_points:m,...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"}`}}}async fetchDocComments(e,t){try{const a={boardId:e,itemsLimit:100,updatesLimit:t},r=await this.mondayApi.request(Dc,a),i=r.boards?.[0]?.items_page?.items;if(!i)return[];const o=[];for(const e of i)if(e.updates&&0!==e.updates.length)for(const t of e.updates)o.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,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 o}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,r=!1,i=50){const o=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t,o="";try{const t={docId:e.id},a=await this.mondayApi.request(Mc,t);o=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){o=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return r&&e.object_id&&(t=await this.fetchDocComments(e.object_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})))},blocks_as_markdown:o,...r&&{comments:t}}}))),n=t.page||1,s=t.limit||25,d=o.length,p=d===s;return{content:{message:`Documents retrieved (${o.length})`,pagination:{current_page:n,limit:s,count:d,has_more_pages:p},data:o}}}},class extends Ei{constructor(){super(...arguments),this.name="workspace_info",this.type=jr.READ,this.annotations=Ti({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 kv}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(Bc,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const r=function(e,t){const{workspaces:a,boards:r,docs:i,folders:o}=e,n=a?.[0];if(!n)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=[];(r||[]).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:n.id,name:n.name,url:t?Iv(t,n.id):void 0,description:n.description||"",kind:n.kind||"",created_at:n.created_at||"",state:n.state||"",is_default_workspace:n.is_default_workspace||!1,owners_subscribers:(n.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 wv(this.mondayApi));return{content:{message:"Workspace info retrieved",data:r}}}},class extends Ei{constructor(){super(...arguments),this.name="list_workspaces",this.type=jr.READ,this.annotations=Ti({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List all workspaces available to the user. Returns up to 500 workspaces with their ID, name, and description."}getInputSchema(){return xv}async executeInternal(e){const t=e.searchTerm?1e4:e.limit,a=e.searchTerm?1:e.page;let r=null;if(e.searchTerm&&(r=Rv(e.searchTerm),0===r.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const i=e=>({limit:t,page:a,membershipKind:e}),o=Pv(await this.mondayApi.request(Ov,i(tm.Member))),n=!Cv(o)||r&&!function(e,t){return t.some((t=>Rv(t.name).includes(e)))}(r,o);let s=o;if(n){s=Pv(await this.mondayApi.request(Ov,i(tm.All)))}if(!Cv(s))return{content:{message:"No workspaces found.",data:[]}};const d=r&&s?.length<=$v,p=function(e,t,a,r){if(!e||t.length<=$v)return t;const i=(a-1)*r,o=i+r;return t.filter((t=>Rv(t.name).includes(e))).slice(i,o)}(r,s,e.page,e.limit);if(!Cv(p))return{content:{message:"No workspaces found matching the search term. Try using the tool without a search term",data:[]}};const l=p.length===e.limit,m=await wv(this.mondayApi),c=p.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:m&&e.id?Iv(m,e.id):void 0})));return{content:{message:"Workspaces retrieved",...d?{disclaimer:"Search term not applied - returning all workspaces. Perform the filtering manually."}:{},...l?{next_page:e.page+1}:{},data:c}}}},class extends Ei{constructor(){super(...arguments),this.name="create_doc",this.type=jr.WRITE,this.annotations=Ti({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)\n- item: Creates a document attached to an item (requires item_id, optional column_id)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }'}getInputSchema(){return Bv}async executeInternal(e){const t=Mv.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,r,i;if(a.type===Uv.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||Yd.Public,folder_id:a.folder_id?.toString()}}},n=await this.mondayApi.request(Lv,o);t=n?.create_doc?.id??void 0,r=n?.create_doc?.object_id??void 0,i=n?.create_doc?.url??void 0}else if(a.type===Uv.enum.item){const o={itemId:a.item_id.toString()},n=await this.mondayApi.request(Fv,o),s=n.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===tf.Doc));let l=a.column_id;if(!l)if(p)l=p.id;else{const e={boardId:d.toString(),columnType:tf.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(Cc,e);if(l=t?.create_column?.id,!l)return{content:"Error: Failed to create doc column."}}const m={location:{board:{item_id:a.item_id.toString(),column_id:l}}},c=await this.mondayApi.request(Lv,m);if(t=c.create_doc?.id??void 0,r=c.create_doc?.object_id??void 0,i=c.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(jv,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},n=await this.mondayApi.request(Vv,o),s=n?.add_content_to_doc_from_markdown?.success,d=n?.add_content_to_doc_from_markdown?.error;return s?(this.sessionContext.metadata={...this.sessionContext.metadata,location:e.location,...t&&{doc_id:t},...r&&{object_id:r}},{content:{message:"Document successfully created",doc_id:t,object_id:r,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 Ei{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=jr.WRITE,this.annotations=Ti({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 Wv}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(Gv,{docId:[e.doc_id]});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(Hv,{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},r=await this.mondayApi.request(qv,a);if(!r?.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:n}=r.add_content_to_doc_from_markdown;if(!i)return{content:`Error adding content to document: ${n||"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 Ei{constructor(){super(...arguments),this.name="update_doc",this.type=jr.WRITE,this.annotations=Ti({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_block: Remove any block. 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_block 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\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 Lg}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(Yv,{objectId:[e.object_id]}),r=a.docs?.[0];if(!r)return{content:`Error: No document found for object_id ${e.object_id}.`};t=r.id}const a=[];let r=null;for(let i=0;i<e.operations.length;i++){const o=e.operations[i];try{const r=await this.executeOperation(t,o,e.object_id);a.push(`- [OK] ${o.operation_type}${r?`: ${r}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";a.push(`- [FAILED] ${o.operation_type}: ${t}`),r=i;break}}const i=null!==r?r:e.operations.length,o=e.operations.length,n=`Completed ${i}/${o} operation${1===o?"":"s"} on doc ${t}.`;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t},{content:`${n}\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_block":return this.executeDeleteBlock(t.block_id);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},r=await this.mondayApi.request(Qv,a);if(!r?.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 r={docId:e,markdown:t,afterBlockId:a},i=await this.mondayApi.request(zv,r),o=i?.add_content_to_doc_from_markdown;if(!o?.success)throw new Error(o?.error||"Failed to add markdown content");const n=o.block_ids?.length??0;return`${n} block${1===n?"":"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:sg(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:sg(e.delta_format),language:e.language};case"list_item":return{deltaFormat:sg(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),r={blockId:e,content:JSON.stringify(a)},i=await this.mondayApi.request(Kv,r);if(!i?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,r){const i=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:ng(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:rg(e.alignment),direction:ig(e.direction)}};case"list_item":return{list_block:{delta_format:ng(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:ng(e.delta_format),text_block_type:Ll.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(r){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=r}const o={docId:e,afterBlockId:a,blocksInput:[i]},n=await this.mondayApi.request(ag,o),s=n?.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(Jv,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(Xv,{docId:[e]}),r=a.docs?.[0];if(!r?.object_id)throw new Error(`Could not resolve object_id for doc ${e}`);return r.object_id}async resolveDocItemId(e){const t=await this.mondayApi.request(Zv,{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(eg,{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,r,i,o,n,s){if((null!=n||null!=s)&&!o)throw new Error("selection_from and selection_length require block_id");if(null!=n!=(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!=n||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 m;if(i){const e=JSON.parse(i),t=_f.safeParse(e);if(!t.success)throw new Error(`Invalid mentions_list format: ${t.error.message}`);m=t.data}const c={itemId:l,body:a,parentId:r?.toString(),mentionsList:m},u=await this.mondayApi.request(tg,c);if(!u.create_update?.id)throw new Error("Failed to create comment: no update returned");const h=u.create_update.id,f=Number(h),v=r?`Reply to update ${r}`:"Comment";if(d.length>0){if(Number.isNaN(f))throw new Error(`${v} 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 r=t.find((e=>e.id===a));if(!r)throw new Error(`${v} created (update ID: ${h}) but block annotation failed: block ${a} not found in doc ${e}`);const i=r.content.deltaFormat;if(!i)throw new Error(`${v} 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(`${v} created (update ID: ${h}) but block annotation failed: block ${a} has an empty deltaFormat and cannot be annotated`);const d=n??0,p=s??o;if(d+p>o)throw new Error(`${v} 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=pg(i,f,d,p)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`${v} created (update ID: ${h}) but delta annotation failed for block ${a}: ${t}`)}const m={...r.content,deltaFormat:l},c=await this.mondayApi.request(Kv,{blockId:a,content:JSON.stringify(m)});if(!c?.update_doc_block)throw new Error(`${v} created (update ID: ${h}) but block annotation write returned no confirmation for block ${a}`)}}const g=d.length;return`${v} created${g>1?` across ${g} blocks`:1===g?" on block":""} (update ID: ${h})`}async executeReplaceBlock(e,t,a,r,i){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,r,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 Ei{constructor(){super(...arguments),this.name="update_workspace",this.type=jr.WRITE,this.annotations=Ti({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(qg,t),r=await wv(this.mondayApi),i=r?Iv(r,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 Ei{constructor(){super(...arguments),this.name="update_folder",this.type=jr.WRITE,this.annotations=Ti({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return Wg}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:r}=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?{position_is_after:r,position_object_id:t,position_object_type:a}:void 0},o=await this.mondayApi.request(Gg,i);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends Ei{constructor(){super(...arguments),this.name="create_workspace",this.type=jr.WRITE,this.annotations=Ti({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return zg}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(Qg,t),r=await wv(this.mondayApi),i=r&&a.create_workspace?.id?Iv(r,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 Ei{constructor(){super(...arguments),this.name="create_folder",this.type=jr.WRITE,this.annotations=Ti({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return Kg}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 Ei{constructor(){super(...arguments),this.name="move_object",this.type=jr.WRITE,this.annotations=Ti({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 Zg}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:r,position_is_after:i,parentFolderId:o,workspaceId:n,accountProductId:s}=e;if(!!a!=!!r)throw new Error("position_object_id and position_object_type must be provided together");const d={folderId:t,position:a?{position_is_after:i,position_object_id:a,position_object_type:r}:void 0,parentFolderId:o,workspaceId:n,accountProductId:s},p=await this.mondayApi.request(Gg,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:r,position_is_after:i,parentFolderId:o,workspaceId:n,accountProductId:s}=e;if(!!a!=!!r)throw new Error("position_object_id and position_object_type must be provided together");const d={boardId:t,attributes:{position:a?{position_is_after:i,position_object_id:a,position_object_type:r}:void 0,folder_id:o,workspace_id:n,account_product_id:s}},p=await this.mondayApi.request(Jg,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:r,position_is_after:i,parentFolderId:o,workspaceId:n,accountProductId:s}=e;if(!!a!=!!r)throw new Error("position_object_id and position_object_type must be provided together");const d={overviewId:t,attributes:{position:a?{position_is_after:i,position_object_id:a,position_object_type:r}:void 0,folder_id:o,workspace_id:n,account_product_id:s}},p=await this.mondayApi.request(Xg,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 ml.Folder:return this.executeUpdateFolder(e);case ml.Board:return this.executeUpdateBoardHierarchy(e);case ml.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends Ei{constructor(){super(...arguments),this.name="create_dashboard",this.type=jr.WRITE,this.annotations=Ti({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 Mg}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(Vg,t);if(!a.create_dashboard)throw new Error("Failed to create dashboard");const r=a.create_dashboard;return{content:{message:`Dashboard ${r.id} successfully created`,dashboard_id:r.id,dashboard_name:r.name}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${t}`)}}},class extends Ei{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=jr.READ,this.annotations=Ti({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(jg,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 r=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},r++}if(0===r)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:Yf}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends Ei{constructor(){super(...arguments),this.name="create_widget",this.type=jr.WRITE,this.annotations=Ti({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 Bg}async executeInternal(e){if(!e.settings)throw new Error("You must pass the settings parameter");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(Ug,t);if(!a.create_widget)throw new Error("Failed to create widget");const r=a.create_widget;r.parent?.kind===Zl.Dashboard?r.parent.id:r.parent;return{content:{message:`Widget ${r.id} created`,widget_id:r.id,widget_name:r.name,dashboard_id:r.parent?.id}}}catch(t){const a=t instanceof Error?t.message:String(t);throw new Error(`Failed to create ${e.widget_kind} widget: ${a}`)}}},class extends Ei{constructor(){super(...arguments),this.name="board_insights",this.type=jr.READ,this.annotations=Ti({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 to understand the board metadata. 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 o_}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],r=new Set(e.aggregations.filter((e=>e.function===Rd.Label)).map((e=>e.columnId))),i=e.groupBy?.filter((e=>!r.has(e))).map((e=>({function:Rd.Label,columnId:e})))??[],o=e.aggregations.concat(i).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,n=t[o]||0;t[o]=n+1;const s=`${o}_${n}`;return r_.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:$d.Function,function:(r=e.function,i=e.columnId,{function:r,params:r===Rd.CountItems?[]:[{type:$d.Column,column:i_(i),as:i}]}),as:s}}var r,i;const o={type:$d.Column,column:i_(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:$d.Column,column:i_(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),r=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:Od.Table}}(e),o={query:{from:i,query:r,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},n=await this.mondayApi.request(e_,o),s=(n.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const r=e.value;if(!r)return void(t[a]=null);const i=r.result??r.value??null;t[a]=i})),t}));return s.length?{content:{message:"Board insights retrieved",board_name:n.boards?.[0]?.name,board_url:n.boards?.[0]?.url,data:s}}:{content:"No board insights found for the given query."}}},class extends Ei{constructor(){super(...arguments),this.name="search",this.type=jr.READ,this.annotations=Ti({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Search within monday.com platform. Can search for boards, documents, forms, folders.\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 workspaces, use list_workspaces tool.\nFor items and groups, use get_board_items_page tool.\nFor groups, use get_board_info tool.\nIMPORTANT: ids returned by this tool are prefixed with the type of the object (e.g doc-123, board-456, folder-789). When passing the ids to other tools, you need to remove the prefix and just pass the number.\n "}getInputSchema(){return u_}async executeInternal(e){if(e.searchType!==c_.FOLDERS&&e.searchTerm)try{return{content:{message:"Search results",data:(await this.searchWithDevEndpointAsync(e)).items}}}catch(e){Gh(e)}const t={[c_.BOARD]:this.searchBoardsAsync.bind(this),[c_.DOCUMENTS]:this.searchDocsAsync.bind(this),[c_.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!t)throw new Error(`Unsupported search type: ${e.searchType}`);const a=await t(e);return{content:{message:"Search results",disclaimer:a.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",data:a.items}}}async searchWithDevEndpointAsync(e){if(e.page>1)throw new Error("Pagination is not supported for search, increase the limit parameter instead");const t=e.workspaceIds?.map((e=>e.toString()));if(e.searchType===c_.BOARD)return this.searchBoardsWithDevEndpointAsync(e.searchTerm,e.limit,t);if(e.searchType===c_.DOCUMENTS)return this.searchDocsWithDevEndpointAsync(e.searchTerm,e.limit,t);throw new Error(`Unsupported search type for dev endpoint: ${e.searchType}`)}async searchBoardsWithDevEndpointAsync(e,t,a){const r={query:e,limit:t,workspaceIds:a};return{items:(await this.mondayApi.request(p_,r,{versionOverride:"dev",timeout:qh})).search.boards.results.map((e=>({id:m_.BOARD+e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url}))),wasFiltered:!0}}async searchDocsWithDevEndpointAsync(e,t,a){const r={query:e,limit:t,workspaceIds:a};return{items:(await this.mondayApi.request(l_,r,{versionOverride:"dev",timeout:qh})).search.docs.results.map((e=>({id:m_.DOCUMENT+e.indexed_data.id,title:e.indexed_data.name}))),wasFiltered:!0}}async searchFoldersAsync(e){const t={...this.getPagingParamsForSearch(e,100),workspace_ids:e.workspaceIds?.map((e=>e.toString()))};t.workspace_ids??=[],0===t.workspace_ids.length&&Hh(new Error("Searching for folders require specifying workspace ids"),"search folders");const a=await this.mondayApi.request(d_,t),r=this.searchAndVirtuallyPaginate(e,a.folders||[],(e=>e.name));return{items:r.items.map((e=>({id:m_.FOLDER+e.id,title:e.name}))),wasFiltered:r.wasFiltered}}async searchDocsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(s_,t),r=this.searchAndVirtuallyPaginate(e,a.docs||[],(e=>e.name));return{items:r.items.map((e=>({id:m_.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:r.wasFiltered}}async searchBoardsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(n_,t),r=this.searchAndVirtuallyPaginate(e,a.boards||[],(e=>e.name));return{items:r.items.map((e=>({id:m_.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:r.wasFiltered}}getPagingParamsForSearch(e,t=1e3){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?Math.min(1e3,t):e.limit}}searchAndVirtuallyPaginate(e,t,a){if(t.length<=20)return{items:t,wasFiltered:!1};const r=Rv(e.searchTerm??""),i=(e.page-1)*e.limit,o=i+e.limit;return{items:t.filter((e=>Rv(a(e)).includes(r))).slice(i,o),wasFiltered:!0}}},class extends Ei{constructor(){super(...arguments),this.name="get_user_context",this.type=jr.READ,this.annotations=Ti({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information, account information, and their relevant items (boards, 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 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(I_,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};const r=await this.fetchFavorites(t||[]),i=this.extractRelevantBoards(a),o=this.extractRelevantPeople(a),{account:n,...s}=e;return{content:{message:"User context",...{user:s,account:n?{tier:n.tier,active_members_count:n.active_members_count,is_during_trial:n.is_during_trial,products:n.products?.filter(Boolean).map((e=>({kind:e.kind,tier:e.tier})))??[]}:null,favorites:r,relevantBoards:i,relevantPeople:o}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const r={};for(const e of a)r[E_[e]]=t[e];const i=await this.mondayApi.request(T_,r),o=[];for(const e of a){const t=S_[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}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 Ei{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=jr.WRITE,this.annotations=Ti({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 y_}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(g_,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends Ei{constructor(){super(...arguments),this.name="get_assets",this.type=jr.READ,this.annotations=Ti({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 w_}async executeInternal(e){const t=await this.mondayApi.request(b_,{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 Ei{constructor(){super(...arguments),this.name="get_notetaker_meetings",this.type=jr.READ,this.annotations=Ti({title:"Get Notetaker Meetings",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve notetaker meetings with optional detailed fields. Use include_summary, include_topics, include_action_items, and include_transcript flags to control which details are returned. Use access to filter by meeting access level (OWN, SHARED_WITH_ME, SHARED_WITH_ACCOUNT, ALL). Defaults to OWN. Supports filtering by ids, search term, and cursor-based pagination."}getInputSchema(){return N_}async executeInternal(e){const t={access:e.access};e.ids&&e.ids.length>0&&(t.ids=e.ids),e.search&&(t.search=e.search);const a={limit:e.limit,cursor:e.cursor||void 0,filters:t,includeSummary:e.include_summary,includeTopics:e.include_topics,includeActionItems:e.include_action_items,includeTranscript:e.include_transcript},r=await this.mondayApi.request(D_,a,{versionOverride:"2026-04"}),i=r.notetaker?.meetings;if(!i?.meetings||0===i.meetings.length)return{content:"No notetaker meetings found matching the specified criteria."};return{content:{message:"Meetings retrieved",data:{meetings:i.meetings,pagination:{has_next_page:i.page_info?.has_next_page??!1,cursor:i.page_info?.cursor??null,count:i.meetings.length}}}}}},class extends Ei{constructor(){super(...arguments),this.name="create_view",this.type=jr.WRITE,this.annotations=Ti({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\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 gu}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort},a=await this.mondayApi.request(vu,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 Ei{constructor(){super(...arguments),this.name="undo_action",this.type=jr.WRITE,this.annotations=Ti({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 k_}async executeInternal(e){return await this.mondayApi.request(A_,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}},class extends Ei{constructor(){super(...arguments),this.name="get_object_schemas",this.type=jr.READ,this.annotations=Ti({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)."}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(zc,t)).get_object_schemas??[];return{content:{message:`Retrieved ${a.length} object schema(s)`,schemas:a}}}},class extends Ei{constructor(){super(...arguments),this.name="create_object_schema",this.type=jr.WRITE,this.annotations=Ti({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."}getInputSchema(){return Jc}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 Ei{constructor(){super(...arguments),this.name="update_object_schema",this.type=jr.WRITE,this.annotations=Ti({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(Xc,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 Ei{constructor(){super(...arguments),this.name="delete_object_schema",this.type=jr.WRITE,this.annotations=Ti({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 tu}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(eu,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 Ei{constructor(){super(...arguments),this.name="delete_object_schema_columns",this.type=jr.WRITE,this.annotations=Ti({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."}getInputSchema(){return ru}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(au,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 Ei{constructor(){super(...arguments),this.name="manage_object_schema_board_connection",this.type=jr.WRITE,this.annotations=Ti({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 nu}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(iu,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(ou,t)).detach_boards_from_object_schema??[],r=a.filter((e=>e.success)).length,i=a.filter((e=>!e.success));return{content:{message:`${r} board(s) successfully detached`,results:a,...i.length>0&&{failures:i}}}}}},class extends Ei{constructor(){super(...arguments),this.name="manage_object_schema_columns",this.type=jr.WRITE,this.annotations=Ti({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 first to understand valid defaults per column type. update: modifies existing columns. Each entry must include column_id. 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 cu}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},r=await this.mondayApi.request(su,a);return{content:{message:`Columns successfully added to object schema "${r.create_object_schema_columns?.name}"`,schema_id:r.create_object_schema_columns?.id,schema_name:r.create_object_schema_columns?.name,revision:r.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(du,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 Ei{constructor(){super(...arguments),this.name="set_object_schema_column_active_state",this.type=jr.WRITE,this.annotations=Ti({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. 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 hu}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={deactivate:dp.Deactivate,reactivate:dp.Reactivate},a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnId:e.columnId,action:t[e.action]},r=await this.mondayApi.request(uu,a);return{content:{message:`Column successfully ${e.action}d on object schema "${r.set_object_schema_column_active_state?.name}"`,schema_id:r.set_object_schema_column_active_state?.id,schema_name:r.set_object_schema_column_active_state?.name,revision:r.set_object_schema_column_active_state?.revision}}}},class extends Ei{constructor(){super(...arguments),this.name="link_board_items_workflow",this.type=jr.READ,this.annotations=Ti({title:"Link Board Items Workflow",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'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 $_}async executeInternal(e){return{content:O_}}},class extends Ei{constructor(){super(...arguments),this.name="fetch_file_content",this.type=jr.READ,this.annotations=Ti({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 M_}async executeInternal(e){const{item_id:t,column_id:a,file_name:r,offset:i=0}=e,o=await this.mondayApi.request(R_,{itemId:[t],columnId:[a]}),n=o?.items?.[0]?.assets;if(!n||0===n.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(n.map((e=>H_(e,i,r))))}}}},class extends Ei{constructor(){super(...arguments),this.name="get_agent",this.type=jr.READ,this.annotations=Ti({title:"Get monday Platform Agent(s)",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Fetch one or more personal/custom agents on the monday.com platform.\n\nmonday platform agents are user-built work orchestrators and executors that live on the monday.com platform — each has a profile (name, role, avatar), a goal, and an execution plan in markdown describing capabilities and operating principles. Agents in state ACTIVE can be triggered to perform automated work on monday boards. They are NOT local LangChain or MCP agents — they are managed entities on the monday.com platform owned by a specific user.\n\nTerminology note: users might ask for "agent" in natural language (for example: "create me an agent"), but in this API context this refers to monday personal/custom agents.\n\nAgent state in get_agent results is one of ACTIVE, INACTIVE, ARCHIVED, or FAILED. DELETED agents are filtered from these queries — DELETED only appears as the return value of delete_agent. Agent kind is one of PERSONAL, ACCOUNT_LEVEL, or EXTERNAL.\n\nPass id to fetch one specific agent by its unique identifier. Omit id to list every non-deleted personal agent owned by the authenticated user. An empty list means the user owns no agents, which is not an error.\n\nUSAGE EXAMPLES:\n- Fetch one agent: { "id": "42" }\n- List all my agents: {}'}getInputSchema(){return J_}async executeInternal(e){if(void 0!==e.id)try{const{agent:t}=await this.mondayApi.request(W_,{id:e.id},{versionOverride:"dev"});return t?{content:{message:"monday platform agent",agent:t}}:{content:`monday platform agent ${e.id} not found, or the authenticated user does not have access to it.`}}catch(e){Hh(e,"get monday platform agent")}try{const{agents:e}=await this.mondayApi.request(Q_,{},{versionOverride:"dev"}),t=e??[];return{content:{message:"monday platform agents owned by the authenticated user",count:t.length,agents:t}}}catch(e){Hh(e,"list monday platform agents")}}},class extends Ei{constructor(){super(...arguments),this.name="create_agent",this.type=jr.WRITE,this.annotations=Ti({title:"Create monday Platform Agent",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a personal/custom agent on the monday.com platform. See get_agent for what a monday platform agent is.\n\nTerminology note: users might ask for "agent" in natural language (for example: "create me an agent"), but in this API context this refers to monday personal/custom agents.\n\nTwo modes:\n- Prompt mode (recommended): pass prompt (and optional agent_model) and the platform generates profile + goal + plan via AI.\n- Manual mode: omit prompt and pass any of name/role/role_description/user_prompt to create a blank agent profile quickly.\n\nDo not mix prompt with manual profile fields in one request.\n\nCreated agents start in state INACTIVE and must be activated before they can be triggered. Instruct the user to activate from the monday.com agent settings UI.\n\ncreated_at and updated_at are null in the response — call get_agent with the returned id afterward to fetch them.\n\nUSAGE EXAMPLES:\n- AI-generated: { "prompt": "Run my daily standup — collect status updates, summarize blockers, and post recap every weekday at 9am." }\n- Blank/manual: { "name": "Standup Bot", "role": "Project Manager", "gender": "female" }\n- Blank/defaults: {}'}getInputSchema(){return X_}async executeInternal(e){const t=void 0!==e.prompt,a=void 0!==e.name||void 0!==e.role||void 0!==e.role_description||void 0!==e.avatar_url||void 0!==e.gender||void 0!==e.background_color||void 0!==e.user_prompt;if(t&&a)throw new Error("create_agent accepts either prompt mode or manual mode. Do not pass prompt together with manual profile fields.");if(!t&&void 0!==e.agent_model)throw new Error("agent_model can only be used when prompt is provided.");if(!t)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},r=await this.mondayApi.request(Y_,a,{versionOverride:"dev"});if(!r.create_blank_agent?.id)throw new Error("monday platform agent creation returned no id");return{content:{message:`monday platform agent ${r.create_blank_agent.id} created in state INACTIVE — user must activate it from the monday.com UI before it can be triggered`,agent:r.create_blank_agent}}}catch(e){Hh(e,"create blank monday platform agent")}try{const t={input:{prompt:e.prompt,agent_model:e.agent_model}},a=await this.mondayApi.request(z_,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 — user must activate it from the monday.com UI before it can be triggered`,agent:a.create_agent}}}catch(e){Hh(e,"create monday platform agent")}}},class extends Ei{constructor(){super(...arguments),this.name="delete_agent",this.type=jr.WRITE,this.annotations=Ti({title:"Delete monday Platform Agent",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Permanently delete a personal/custom agent on the monday.com platform. Removes the agent and all of its versions. The agent stops appearing in get_agent results and can no longer be triggered. This action cannot be undone. Only the agent owner can delete it.\n\nTerminology note: users might ask for "agent" in natural language (for example: "delete my standup agent"), but in this API context this refers to monday personal/custom agents.\n\nVERIFY BEFORE DELETING: When the user refers to an agent by name or description (e.g. "delete my standup bot"), call get_agent (no id) first to list all the user\'s agents and confirm the correct id. Do not infer ids — pick the matching agent by inspecting profile.name / role / goal.\n\nUSAGE EXAMPLE:\n{ "id": "42" }'}getInputSchema(){return Z_}async executeInternal(e){try{const t={id:e.id},a=await this.mondayApi.request(K_,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){Hh(e,"delete monday platform agent")}}}];var Cy;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(Cy||(Cy={}));const xy=(e,t)=>{let a=[];t?.mode===Cy.APPS?a=[...Ii]:t?.mode!==Cy.API&&t?.mode||(a=[...Py,...Ry]);const r=a.map((t=>((e,t)=>e.prototype instanceof Ei?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof ei?new e(t.apiToken):new e)(t,e)));return r.filter((e=>{if(!t)return e.type!==jr.ALL_API;if(t.mode===Cy.API&&"only"===t.enableDynamicApiTools)return e.type===jr.ALL_API;let a=!1;return t.mode===Cy.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===jr.ALL_API),t.readOnlyMode&&(a=a||e.type!==jr.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))};class Fy{constructor(){this.dynamicTools=new Map}registerTool(e,t){const a=e.enabledByDefault??!0,r=a;this.dynamicTools.set(e.name,{instance:e,mcpTool:t,enabled:r,enabledByDefault:a}),a||t.disable()}enableTool(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabled||(t.mcpTool.enable(),t.enabled=!0),!0)}disableTool(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabled&&(t.mcpTool.disable(),t.enabled=!1),!0)}isToolEnabled(e){const t=this.dynamicTools.get(e);return!!t&&t.enabled}isToolEnabledByDefault(e){const t=this.dynamicTools.get(e);return!t||t.enabledByDefault}getToolsStatus(){const e={};return this.dynamicTools.forEach(((t,a)=>{e[a]=t.enabled})),e}getDynamicToolNames(){return Array.from(this.dynamicTools.keys())}getDetailedToolsStatus(){const e={};return this.dynamicTools.forEach(((t,a)=>{e[a]={enabled:t.enabled,enabledByDefault:t.enabledByDefault}})),e}resetToolToDefault(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabledByDefault&&!t.enabled?(t.mcpTool.enable(),t.enabled=!0,!0):!(!t.enabledByDefault&&t.enabled)||(t.mcpTool.disable(),t.enabled=!1,!0))}getAllDynamicTools(){return this.dynamicTools}clear(){this.dynamicTools.clear()}}class Ly extends Pr{constructor(e){super({name:"monday.com",version:"1.0.0"},{capabilities:{tools:{listChanged:!0}}}),this.dynamicToolManager=new Fy,this.toolInstances=[],this.managementTool=null,this.mondayApiClient=this.createApiClient(e),this.mondayApiToken=e.mondayApiToken,this.context={...e.context,apiVersion:e.mondayApiVersion??Xr},this.registerTools(e)}createApiClient(e){return new r({token:e.mondayApiToken,apiVersion:e.mondayApiVersion??Xr,endpoint:e.mondayApiEndpoint,requestConfig:{...e.mondayApiRequestConfig,headers:{...e.mondayApiRequestConfig?.headers||{},"user-agent":"monday-api-mcp"}}})}registerTools(e){try{this.toolInstances=this.initializeTools(e),this.toolInstances.forEach((e=>this.registerSingleTool(e))),!0===e.toolsConfiguration?.enableToolManager&&this.registerManagementTool()}catch(e){throw new Error(`Failed to initialize Monday Agent Toolkit: ${e instanceof Error?e.message:String(e)}`)}}registerManagementTool(){const e=new ty;e.setToolkitManager(this.dynamicToolManager),this.managementTool=e,this.registerSingleTool(this.managementTool)}initializeTools(e){const t={apiClient:this.mondayApiClient,apiToken:this.mondayApiToken,context:this.context};return xy(t,e.toolsConfiguration)}registerSingleTool(t){const a=t.getInputSchema(),r=this.registerTool(t.name,{...t,title:t.annotations?.title,description:t.getDescription(),inputSchema:a,annotations:t.annotations},(async(r,i)=>{try{let i;if(a){const o=e.object(a).safeParse(r);if(!o.success)throw new Error(`Invalid arguments: ${o.error.message}`);i=await t.execute(o.data)}else i=await t.execute();return this.formatToolResult(i.content)}catch(e){return this.handleToolError(e,t.name)}}));this.dynamicToolManager.registerTool(t,r)}enableTool(e){return this.dynamicToolManager.enableTool(e)}disableTool(e){return this.dynamicToolManager.disableTool(e)}isToolEnabled(e){return this.dynamicToolManager.isToolEnabled(e)}getToolsStatus(){return this.dynamicToolManager.getToolsStatus()}getDynamicToolNames(){return this.dynamicToolManager.getDynamicToolNames()}getServer(){return this}getTools(e){const t=[...this.toolInstances];return this.managementTool&&t.push(this.managementTool),t.map((t=>({name:t.name,description:t.getDescription(),schema:this.getSchemaForTool(t,e),annotations:t.annotations,handler:this.createToolHandler(t)})))}getToolsForMcp(e){const t=[...this.toolInstances];return this.managementTool&&t.push(this.managementTool),t.map((t=>({name:t.name,description:t.getDescription(),schema:this.getSchemaForTool(t,e),annotations:t.annotations,handler:this.createMcpToolHandler(t)})))}createToolHandler(t){return async a=>{const r=t.getInputSchema();if(r){const i=e.object(r).safeParse(a);if(!i.success)throw new Error(`Invalid arguments: ${i.error.message}`);return(await t.execute(i.data)).content}return(await t.execute()).content}}createMcpToolHandler(t){return async(a,r)=>{try{const i=t.getInputSchema();if(i){const o=e.object(i).safeParse(a);if(!o.success)throw new Error(`Invalid arguments: ${o.error.message}`);const n=await t.execute(o.data,r);return this.formatToolResult(n.content)}{const e=await t.execute(void 0,r);return this.formatToolResult(e.content)}}catch(e){return{content:[{type:"text",text:`Error: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}}}getSchemaForTool(t,r){const i=t.getInputSchema();if(i)return"json"===r?.schemaFormat?a(e.object(i)):i}formatToolResult(e){return"string"==typeof e?{content:[{type:"text",text:e}]}:{structuredContent:e,content:[{type:"text",text:JSON.stringify(e)}]}}handleToolError(e,t){return{content:[{type:"text",text:`Failed to execute tool ${t}: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}}export{Fy as DynamicToolManager,Ly as MondayAgentToolkit};
|
|
2325
|
+
`),r=await this.mondayApi.request(a);return r.__type?{content:{message:"Type details retrieved",data:{name:r.__type.name,kind:r.__type.kind,description:r.__type.description??null,fields:r.__type.fields??[],inputFields:r.__type.inputFields??[],interfaces:r.__type.interfaces??[],enumValues:r.__type.enumValues??[],possibleTypes:r.__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 Ei{constructor(){super(...arguments),this.name="create_custom_activity",this.type=jr.WRITE,this.annotations=Ti({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return df}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(jc,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 Ei{constructor(){super(...arguments),this.name="create_notification",this.type=jr.WRITE,this.annotations=Ti({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 lf}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{await this.mondayApi.request(pf,t);return{content:{message:"Notification sent",user_id:e.user_id,text:e.text}}}catch(t){return{content:`Failed to send notification to user ${e.user_id}`}}}},class extends Ei{constructor(){super(...arguments),this.name="create_timeline_item",this.type=jr.WRITE,this.annotations=Ti({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return _f}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(Uc,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 Ei{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=jr.READ,this.annotations=Ti({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return $f}async executeInternal(e){const t=await this.mondayApi.request(Mc);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 Ei{constructor(){super(...arguments),this.name="read_docs",this.type=jr.READ,this.annotations=Ti({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. 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 $v}async executeInternal(e){return e.mode===kv?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,r;switch(this.sessionContext.metadata={...this.sessionContext.metadata,mode:e.mode??Av,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":r=e.ids}const i=e.include_blocks??!1,o=i?{blocksLimit:e.blocks_limit,blocksPage:e.blocks_page}:{},n={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:r,includeBlocks:i,...o};let s=await this.mondayApi.request(Ec,n);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:r,includeBlocks:i,...o};s=await this.mondayApi.request(Ec,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,n,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:r,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:kv,object_ids:[o]};try{const e={docId:o,since:a,until:r},n=await this.mondayApi.request(Sc,e);let s=n?.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:r,restoring_points:s}};const d=Math.min(i??10,10),p=s.slice(0,d+1),l=s.length>d,m=(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 r={docId:o,date:e.date,prevDate:a.date},i=await this.mondayApi.request(Nc,r);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:r,restoring_points:m,...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"}`}}}async fetchDocComments(e,t){try{const a={boardId:e,itemsLimit:100,updatesLimit:t},r=await this.mondayApi.request(Dc,a),i=r.boards?.[0]?.items_page?.items;if(!i)return[];const o=[];for(const e of i)if(e.updates&&0!==e.updates.length)for(const t of e.updates)o.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,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 o}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,r=!1,i=50,o,n){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(Bc,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 r&&e.object_id&&(t=await this.fetchDocComments(e.object_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!==n?{blocks_pagination:{current_page:n??1,limit:o??25,count:(e.blocks??[]).filter((e=>null!=e)).length,has_more_pages:(e.blocks??[]).length===(o??25)}}:{}},blocks_as_markdown:s,...r&&{comments:t}}}))),d=t.page||1,p=t.limit||25,l=s.length,m=l===p;return{content:{message:`Documents retrieved (${s.length})`,pagination:{current_page:d,limit:p,count:l,has_more_pages:m},data:s}}}},class extends Ei{constructor(){super(...arguments),this.name="workspace_info",this.type=jr.READ,this.annotations=Ti({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 Rv}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(qc,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const r=function(e,t){const{workspaces:a,boards:r,docs:i,folders:o}=e,n=a?.[0];if(!n)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=[];(r||[]).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:n.id,name:n.name,url:t?Sv(t,n.id):void 0,description:n.description||"",kind:n.kind||"",created_at:n.created_at||"",state:n.state||"",is_default_workspace:n.is_default_workspace||!1,owners_subscribers:(n.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 Ev(this.mondayApi));return{content:{message:"Workspace info retrieved",data:r}}}},class extends Ei{constructor(){super(...arguments),this.name="list_workspaces",this.type=jr.READ,this.annotations=Ti({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List all workspaces available to the user. Returns up to 500 workspaces with their ID, name, and description."}getInputSchema(){return Vv}async executeInternal(e){const t=e.searchTerm?1e4:e.limit,a=e.searchTerm?1:e.page;let r=null;if(e.searchTerm&&(r=xv(e.searchTerm),0===r.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const i=e=>({limit:t,page:a,membershipKind:e}),o=Fv(await this.mondayApi.request(Pv,i(tm.Member))),n=!Lv(o)||r&&!function(e,t){return t.some((t=>xv(t.name).includes(e)))}(r,o);let s=o;if(n){s=Fv(await this.mondayApi.request(Pv,i(tm.All)))}if(!Lv(s))return{content:{message:"No workspaces found.",data:[]}};const d=r&&s?.length<=Cv,p=function(e,t,a,r){if(!e||t.length<=Cv)return t;const i=(a-1)*r,o=i+r;return t.filter((t=>xv(t.name).includes(e))).slice(i,o)}(r,s,e.page,e.limit);if(!Lv(p))return{content:{message:"No workspaces found matching the search term. Try using the tool without a search term",data:[]}};const l=p.length===e.limit,m=await Ev(this.mondayApi),c=p.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:m&&e.id?Sv(m,e.id):void 0})));return{content:{message:"Workspaces retrieved",...d?{disclaimer:"Search term not applied - returning all workspaces. Perform the filtering manually."}:{},...l?{next_page:e.page+1}:{},data:c}}}},class extends Ei{constructor(){super(...arguments),this.name="create_doc",this.type=jr.WRITE,this.annotations=Ti({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)\n- item: Creates a document attached to an item (requires item_id, optional column_id)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }'}getInputSchema(){return Gv}async executeInternal(e){const t=Hv.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,r,i;if(a.type===qv.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||Yd.Public,folder_id:a.folder_id?.toString()}}},n=await this.mondayApi.request(Uv,o);t=n?.create_doc?.id??void 0,r=n?.create_doc?.object_id??void 0,i=n?.create_doc?.url??void 0}else if(a.type===qv.enum.item){const o={itemId:a.item_id.toString()},n=await this.mondayApi.request(jv,o),s=n.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===af.Doc));let l=a.column_id;if(!l)if(p)l=p.id;else{const e={boardId:d.toString(),columnType:af.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(Cc,e);if(l=t?.create_column?.id,!l)return{content:"Error: Failed to create doc column."}}const m={location:{board:{item_id:a.item_id.toString(),column_id:l}}},c=await this.mondayApi.request(Uv,m);if(t=c.create_doc?.id??void 0,r=c.create_doc?.object_id??void 0,i=c.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(Bv,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},n=await this.mondayApi.request(Mv,o),s=n?.add_content_to_doc_from_markdown?.success,d=n?.add_content_to_doc_from_markdown?.error;return s?(this.sessionContext.metadata={...this.sessionContext.metadata,location:e.location,...t&&{doc_id:t},...r&&{object_id:r}},{content:{message:"Document successfully created",doc_id:t,object_id:r,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 Ei{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=jr.WRITE,this.annotations=Ti({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 Yv}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(zv,{docId:[e.doc_id]});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(Qv,{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},r=await this.mondayApi.request(Wv,a);if(!r?.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:n}=r.add_content_to_doc_from_markdown;if(!i)return{content:`Error adding content to document: ${n||"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 Ei{constructor(){super(...arguments),this.name="update_doc",this.type=jr.WRITE,this.annotations=Ti({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_block: Remove any block. 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_block 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\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 Ug}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(Xv,{objectId:[e.object_id]}),r=a.docs?.[0];if(!r)return{content:`Error: No document found for object_id ${e.object_id}.`};t=r.id}const a=[];let r=null;for(let i=0;i<e.operations.length;i++){const o=e.operations[i];try{const r=await this.executeOperation(t,o,e.object_id);a.push(`- [OK] ${o.operation_type}${r?`: ${r}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";a.push(`- [FAILED] ${o.operation_type}: ${t}`),r=i;break}}const i=null!==r?r:e.operations.length,o=e.operations.length,n=`Completed ${i}/${o} operation${1===o?"":"s"} on doc ${t}.`;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t},{content:`${n}\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_block":return this.executeDeleteBlock(t.block_id);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},r=await this.mondayApi.request(Kv,a);if(!r?.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 r={docId:e,markdown:t,afterBlockId:a},i=await this.mondayApi.request(Jv,r),o=i?.add_content_to_doc_from_markdown;if(!o?.success)throw new Error(o?.error||"Failed to add markdown content");const n=o.block_ids?.length??0;return`${n} block${1===n?"":"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:lg(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:lg(e.delta_format),language:e.language};case"list_item":return{deltaFormat:lg(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),r={blockId:e,content:JSON.stringify(a)},i=await this.mondayApi.request(Zv,r);if(!i?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,r){const i=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:pg(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:ng(e.alignment),direction:sg(e.direction)}};case"list_item":return{list_block:{delta_format:pg(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:pg(e.delta_format),text_block_type:Ll.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(r){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=r}const o={docId:e,afterBlockId:a,blocksInput:[i]},n=await this.mondayApi.request(og,o),s=n?.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(eg,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(tg,{docId:[e]}),r=a.docs?.[0];if(!r?.object_id)throw new Error(`Could not resolve object_id for doc ${e}`);return r.object_id}async resolveDocItemId(e){const t=await this.mondayApi.request(ag,{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(rg,{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,r,i,o,n,s){if((null!=n||null!=s)&&!o)throw new Error("selection_from and selection_length require block_id");if(null!=n!=(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!=n||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 m;if(i){const e=JSON.parse(i),t=wf.safeParse(e);if(!t.success)throw new Error(`Invalid mentions_list format: ${t.error.message}`);m=t.data}const c={itemId:l,body:a,parentId:r?.toString(),mentionsList:m},u=await this.mondayApi.request(ig,c);if(!u.create_update?.id)throw new Error("Failed to create comment: no update returned");const h=u.create_update.id,f=Number(h),v=r?`Reply to update ${r}`:"Comment";if(d.length>0){if(Number.isNaN(f))throw new Error(`${v} 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 r=t.find((e=>e.id===a));if(!r)throw new Error(`${v} created (update ID: ${h}) but block annotation failed: block ${a} not found in doc ${e}`);const i=r.content.deltaFormat;if(!i)throw new Error(`${v} 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(`${v} created (update ID: ${h}) but block annotation failed: block ${a} has an empty deltaFormat and cannot be annotated`);const d=n??0,p=s??o;if(d+p>o)throw new Error(`${v} 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=cg(i,f,d,p)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`${v} created (update ID: ${h}) but delta annotation failed for block ${a}: ${t}`)}const m={...r.content,deltaFormat:l},c=await this.mondayApi.request(Zv,{blockId:a,content:JSON.stringify(m)});if(!c?.update_doc_block)throw new Error(`${v} created (update ID: ${h}) but block annotation write returned no confirmation for block ${a}`)}}const g=d.length;return`${v} created${g>1?` across ${g} blocks`:1===g?" on block":""} (update ID: ${h})`}async executeReplaceBlock(e,t,a,r,i){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,r,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 Ei{constructor(){super(...arguments),this.name="update_workspace",this.type=jr.WRITE,this.annotations=Ti({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return Qg}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(Wg,t),r=await Ev(this.mondayApi),i=r?Sv(r,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 Ei{constructor(){super(...arguments),this.name="update_folder",this.type=jr.WRITE,this.annotations=Ti({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return Yg}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:r}=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?{position_is_after:r,position_object_id:t,position_object_type:a}:void 0},o=await this.mondayApi.request(zg,i);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends Ei{constructor(){super(...arguments),this.name="create_workspace",this.type=jr.WRITE,this.annotations=Ti({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return Jg}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(Kg,t),r=await Ev(this.mondayApi),i=r&&a.create_workspace?.id?Sv(r,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 Ei{constructor(){super(...arguments),this.name="create_folder",this.type=jr.WRITE,this.annotations=Ti({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return Zg}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(Xg,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 Ei{constructor(){super(...arguments),this.name="move_object",this.type=jr.WRITE,this.annotations=Ti({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 a_}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:r,position_is_after:i,parentFolderId:o,workspaceId:n,accountProductId:s}=e;if(!!a!=!!r)throw new Error("position_object_id and position_object_type must be provided together");const d={folderId:t,position:a?{position_is_after:i,position_object_id:a,position_object_type:r}:void 0,parentFolderId:o,workspaceId:n,accountProductId:s},p=await this.mondayApi.request(zg,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:r,position_is_after:i,parentFolderId:o,workspaceId:n,accountProductId:s}=e;if(!!a!=!!r)throw new Error("position_object_id and position_object_type must be provided together");const d={boardId:t,attributes:{position:a?{position_is_after:i,position_object_id:a,position_object_type:r}:void 0,folder_id:o,workspace_id:n,account_product_id:s}},p=await this.mondayApi.request(e_,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:r,position_is_after:i,parentFolderId:o,workspaceId:n,accountProductId:s}=e;if(!!a!=!!r)throw new Error("position_object_id and position_object_type must be provided together");const d={overviewId:t,attributes:{position:a?{position_is_after:i,position_object_id:a,position_object_type:r}:void 0,folder_id:o,workspace_id:n,account_product_id:s}},p=await this.mondayApi.request(t_,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 ml.Folder:return this.executeUpdateFolder(e);case ml.Board:return this.executeUpdateBoardHierarchy(e);case ml.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends Ei{constructor(){super(...arguments),this.name="create_dashboard",this.type=jr.WRITE,this.annotations=Ti({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 Hg}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(Mg,t);if(!a.create_dashboard)throw new Error("Failed to create dashboard");const r=a.create_dashboard;return{content:{message:`Dashboard ${r.id} successfully created`,dashboard_id:r.id,dashboard_name:r.name}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${t}`)}}},class extends Ei{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=jr.READ,this.annotations=Ti({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(Bg,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 r=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},r++}if(0===r)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:Xf}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends Ei{constructor(){super(...arguments),this.name="create_widget",this.type=jr.WRITE,this.annotations=Ti({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 Gg}async executeInternal(e){if(!e.settings)throw new Error("You must pass the settings parameter");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(qg,t);if(!a.create_widget)throw new Error("Failed to create widget");const r=a.create_widget;r.parent?.kind===Zl.Dashboard?r.parent.id:r.parent;return{content:{message:`Widget ${r.id} created`,widget_id:r.id,widget_name:r.name,dashboard_id:r.parent?.id}}}catch(t){const a=t instanceof Error?t.message:String(t);throw new Error(`Failed to create ${e.widget_kind} widget: ${a}`)}}},class extends Ei{constructor(){super(...arguments),this.name="board_insights",this.type=jr.READ,this.annotations=Ti({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 to understand the board metadata. 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 d_}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],r=new Set(e.aggregations.filter((e=>e.function===Rd.Label)).map((e=>e.columnId))),i=e.groupBy?.filter((e=>!r.has(e))).map((e=>({function:Rd.Label,columnId:e})))??[],o=e.aggregations.concat(i).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,n=t[o]||0;t[o]=n+1;const s=`${o}_${n}`;return n_.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:$d.Function,function:(r=e.function,i=e.columnId,{function:r,params:r===Rd.CountItems?[]:[{type:$d.Column,column:s_(i),as:i}]}),as:s}}var r,i;const o={type:$d.Column,column:s_(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:$d.Column,column:s_(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),r=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:Od.Table}}(e),o={query:{from:i,query:r,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},n=await this.mondayApi.request(r_,o),s=(n.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const r=e.value;if(!r)return void(t[a]=null);const i=r.result??r.value??null;t[a]=i})),t}));return s.length?{content:{message:"Board insights retrieved",board_name:n.boards?.[0]?.name,board_url:n.boards?.[0]?.url,data:s}}:{content:"No board insights found for the given query."}}},class extends Ei{constructor(){super(...arguments),this.name="search",this.type=jr.READ,this.annotations=Ti({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Search within monday.com platform. Can search for boards, documents, forms, folders.\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 workspaces, use list_workspaces tool.\nFor items and groups, use get_board_items_page tool.\nFor groups, use get_board_info tool.\nIMPORTANT: ids returned by this tool are prefixed with the type of the object (e.g doc-123, board-456, folder-789). When passing the ids to other tools, you need to remove the prefix and just pass the number.\n "}getInputSchema(){return v_}async executeInternal(e){if(e.searchType!==f_.FOLDERS&&e.searchTerm)try{return{content:{message:"Search results",data:(await this.searchWithDevEndpointAsync(e)).items}}}catch(e){Wh(e)}const t={[f_.BOARD]:this.searchBoardsAsync.bind(this),[f_.DOCUMENTS]:this.searchDocsAsync.bind(this),[f_.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!t)throw new Error(`Unsupported search type: ${e.searchType}`);const a=await t(e);return{content:{message:"Search results",disclaimer:a.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",data:a.items}}}async searchWithDevEndpointAsync(e){if(e.page>1)throw new Error("Pagination is not supported for search, increase the limit parameter instead");const t=e.workspaceIds?.map((e=>e.toString()));if(e.searchType===f_.BOARD)return this.searchBoardsWithDevEndpointAsync(e.searchTerm,e.limit,t);if(e.searchType===f_.DOCUMENTS)return this.searchDocsWithDevEndpointAsync(e.searchTerm,e.limit,t);throw new Error(`Unsupported search type for dev endpoint: ${e.searchType}`)}async searchBoardsWithDevEndpointAsync(e,t,a){const r={query:e,limit:t,workspaceIds:a};return{items:(await this.mondayApi.request(c_,r,{versionOverride:"dev",timeout:Hh})).search.boards.results.map((e=>({id:h_.BOARD+e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url}))),wasFiltered:!0}}async searchDocsWithDevEndpointAsync(e,t,a){const r={query:e,limit:t,workspaceIds:a};return{items:(await this.mondayApi.request(u_,r,{versionOverride:"dev",timeout:Hh})).search.docs.results.map((e=>({id:h_.DOCUMENT+e.indexed_data.id,title:e.indexed_data.name}))),wasFiltered:!0}}async searchFoldersAsync(e){const t={...this.getPagingParamsForSearch(e,100),workspace_ids:e.workspaceIds?.map((e=>e.toString()))};t.workspace_ids??=[],0===t.workspace_ids.length&&Gh(new Error("Searching for folders require specifying workspace ids"),"search folders");const a=await this.mondayApi.request(m_,t),r=this.searchAndVirtuallyPaginate(e,a.folders||[],(e=>e.name));return{items:r.items.map((e=>({id:h_.FOLDER+e.id,title:e.name}))),wasFiltered:r.wasFiltered}}async searchDocsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(l_,t),r=this.searchAndVirtuallyPaginate(e,a.docs||[],(e=>e.name));return{items:r.items.map((e=>({id:h_.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:r.wasFiltered}}async searchBoardsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(p_,t),r=this.searchAndVirtuallyPaginate(e,a.boards||[],(e=>e.name));return{items:r.items.map((e=>({id:h_.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:r.wasFiltered}}getPagingParamsForSearch(e,t=1e3){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?Math.min(1e3,t):e.limit}}searchAndVirtuallyPaginate(e,t,a){if(t.length<=20)return{items:t,wasFiltered:!1};const r=xv(e.searchTerm??""),i=(e.page-1)*e.limit,o=i+e.limit;return{items:t.filter((e=>xv(a(e)).includes(r))).slice(i,o),wasFiltered:!0}}},class extends Ei{constructor(){super(...arguments),this.name="get_user_context",this.type=jr.READ,this.annotations=Ti({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information, account information, and their relevant items (boards, 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 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(S_,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};const r=await this.fetchFavorites(t||[]),i=this.extractRelevantBoards(a),o=this.extractRelevantPeople(a),{account:n,...s}=e;return{content:{message:"User context",...{user:s,account:n?{tier:n.tier,active_members_count:n.active_members_count,is_during_trial:n.is_during_trial,products:n.products?.filter(Boolean).map((e=>({kind:e.kind,tier:e.tier})))??[]}:null,favorites:r,relevantBoards:i,relevantPeople:o}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const r={};for(const e of a)r[N_[e]]=t[e];const i=await this.mondayApi.request(D_,r),o=[];for(const e of a){const t=A_[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}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 Ei{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=jr.WRITE,this.annotations=Ti({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 I_}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(b_,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends Ei{constructor(){super(...arguments),this.name="get_assets",this.type=jr.READ,this.annotations=Ti({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 E_}async executeInternal(e){const t=await this.mondayApi.request(T_,{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 Ei{constructor(){super(...arguments),this.name="get_notetaker_meetings",this.type=jr.READ,this.annotations=Ti({title:"Get Notetaker Meetings",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve notetaker meetings with optional detailed fields. Use include_summary, include_topics, include_action_items, and include_transcript flags to control which details are returned. Use access to filter by meeting access level (OWN, SHARED_WITH_ME, SHARED_WITH_ACCOUNT, ALL). Defaults to OWN. Supports filtering by ids, search term, and cursor-based pagination."}getInputSchema(){return O_}async executeInternal(e){const t={access:e.access};e.ids&&e.ids.length>0&&(t.ids=e.ids),e.search&&(t.search=e.search);const a={limit:e.limit,cursor:e.cursor||void 0,filters:t,includeSummary:e.include_summary,includeTopics:e.include_topics,includeActionItems:e.include_action_items,includeTranscript:e.include_transcript},r=await this.mondayApi.request(k_,a,{versionOverride:"2026-04"}),i=r.notetaker?.meetings;if(!i?.meetings||0===i.meetings.length)return{content:"No notetaker meetings found matching the specified criteria."};return{content:{message:"Meetings retrieved",data:{meetings:i.meetings,pagination:{has_next_page:i.page_info?.has_next_page??!1,cursor:i.page_info?.cursor??null,count:i.meetings.length}}}}}},class extends Ei{constructor(){super(...arguments),this.name="create_view",this.type=jr.WRITE,this.annotations=Ti({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\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 _u}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort},a=await this.mondayApi.request(gu,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 Ei{constructor(){super(...arguments),this.name="undo_action",this.type=jr.WRITE,this.annotations=Ti({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 R_}async executeInternal(e){return await this.mondayApi.request($_,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}},class extends Ei{constructor(){super(...arguments),this.name="get_object_schemas",this.type=jr.READ,this.annotations=Ti({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)."}getInputSchema(){return Kc}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(Yc,t)).get_object_schemas??[];return{content:{message:`Retrieved ${a.length} object schema(s)`,schemas:a}}}},class extends Ei{constructor(){super(...arguments),this.name="create_object_schema",this.type=jr.WRITE,this.annotations=Ti({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."}getInputSchema(){return Xc}async executeInternal(e){const t={name:e.name,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(Jc,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 Ei{constructor(){super(...arguments),this.name="update_object_schema",this.type=jr.WRITE,this.annotations=Ti({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 eu}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 Ei{constructor(){super(...arguments),this.name="delete_object_schema",this.type=jr.WRITE,this.annotations=Ti({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 au}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(tu,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 Ei{constructor(){super(...arguments),this.name="delete_object_schema_columns",this.type=jr.WRITE,this.annotations=Ti({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."}getInputSchema(){return iu}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(ru,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 Ei{constructor(){super(...arguments),this.name="manage_object_schema_board_connection",this.type=jr.WRITE,this.annotations=Ti({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 su}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(ou,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(nu,t)).detach_boards_from_object_schema??[],r=a.filter((e=>e.success)).length,i=a.filter((e=>!e.success));return{content:{message:`${r} board(s) successfully detached`,results:a,...i.length>0&&{failures:i}}}}}},class extends Ei{constructor(){super(...arguments),this.name="manage_object_schema_columns",this.type=jr.WRITE,this.annotations=Ti({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 first to understand valid defaults per column type. update: modifies existing columns. Each entry must include column_id. 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 uu}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},r=await this.mondayApi.request(du,a);return{content:{message:`Columns successfully added to object schema "${r.create_object_schema_columns?.name}"`,schema_id:r.create_object_schema_columns?.id,schema_name:r.create_object_schema_columns?.name,revision:r.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(pu,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 Ei{constructor(){super(...arguments),this.name="set_object_schema_column_active_state",this.type=jr.WRITE,this.annotations=Ti({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. 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 fu}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={deactivate:dp.Deactivate,reactivate:dp.Reactivate},a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnId:e.columnId,action:t[e.action]},r=await this.mondayApi.request(hu,a);return{content:{message:`Column successfully ${e.action}d on object schema "${r.set_object_schema_column_active_state?.name}"`,schema_id:r.set_object_schema_column_active_state?.id,schema_name:r.set_object_schema_column_active_state?.name,revision:r.set_object_schema_column_active_state?.revision}}}},class extends Ei{constructor(){super(...arguments),this.name="link_board_items_workflow",this.type=jr.READ,this.annotations=Ti({title:"Link Board Items Workflow",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'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 C_}async executeInternal(e){return{content:P_}}},class extends Ei{constructor(){super(...arguments),this.name="fetch_file_content",this.type=jr.READ,this.annotations=Ti({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 H_}async executeInternal(e){const{item_id:t,column_id:a,file_name:r,offset:i=0}=e,o=await this.mondayApi.request(x_,{itemId:[t],columnId:[a]}),n=o?.items?.[0]?.assets;if(!n||0===n.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(n.map((e=>Q_(e,i,r))))}}}},class extends Ei{constructor(){super(...arguments),this.name="get_agent",this.type=jr.READ,this.annotations=Ti({title:"Get monday Platform Agent(s)",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Fetch one or more personal/custom agents on the monday.com platform.\n\nmonday platform agents are user-built work orchestrators and executors that live on the monday.com platform — each has a profile (name, role, avatar), a goal, and an execution plan in markdown describing capabilities and operating principles. Agents in state ACTIVE can be triggered to perform automated work on monday boards. They are NOT local LangChain or MCP agents — they are managed entities on the monday.com platform owned by a specific user.\n\nTerminology note: users might ask for "agent" in natural language (for example: "create me an agent"), but in this API context this refers to monday personal/custom agents.\n\nAgent state in get_agent results is one of ACTIVE, INACTIVE, ARCHIVED, or FAILED. DELETED agents are filtered from these queries — DELETED only appears as the return value of delete_agent. Agent kind is one of PERSONAL, ACCOUNT_LEVEL, or EXTERNAL.\n\nPass id to fetch one specific agent by its unique identifier. Omit id to list every non-deleted personal agent owned by the authenticated user. An empty list means the user owns no agents, which is not an error.\n\nUSAGE EXAMPLES:\n- Fetch one agent: { "id": "42" }\n- List all my agents: {}'}getInputSchema(){return ey}async executeInternal(e){if(void 0!==e.id)try{const{agent:t}=await this.mondayApi.request(Y_,{id:e.id},{versionOverride:"dev"});return t?{content:{message:"monday platform agent",agent:t}}:{content:`monday platform agent ${e.id} not found, or the authenticated user does not have access to it.`}}catch(e){Gh(e,"get monday platform agent")}try{const{agents:e}=await this.mondayApi.request(K_,{},{versionOverride:"dev"}),t=e??[];return{content:{message:"monday platform agents owned by the authenticated user",count:t.length,agents:t}}}catch(e){Gh(e,"list monday platform agents")}}},class extends Ei{constructor(){super(...arguments),this.name="create_agent",this.type=jr.WRITE,this.annotations=Ti({title:"Create monday Platform Agent",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a personal/custom agent on the monday.com platform. See get_agent for what a monday platform agent is.\n\nTerminology note: users might ask for "agent" in natural language (for example: "create me an agent"), but in this API context this refers to monday personal/custom agents.\n\nTwo modes:\n- Prompt mode (recommended): pass prompt (and optional agent_model) and the platform generates profile + goal + plan via AI.\n- Manual mode: omit prompt and pass any of name/role/role_description/user_prompt to create a blank agent profile quickly.\n\nDo not mix prompt with manual profile fields in one request.\n\nCreated agents start in state INACTIVE and must be activated before they can be triggered. Instruct the user to activate from the monday.com agent settings UI.\n\ncreated_at and updated_at are null in the response — call get_agent with the returned id afterward to fetch them.\n\nUSAGE EXAMPLES:\n- AI-generated: { "prompt": "Run my daily standup — collect status updates, summarize blockers, and post recap every weekday at 9am." }\n- Blank/manual: { "name": "Standup Bot", "role": "Project Manager", "gender": "female" }\n- Blank/defaults: {}'}getInputSchema(){return ty}async executeInternal(e){const t=void 0!==e.prompt,a=void 0!==e.name||void 0!==e.role||void 0!==e.role_description||void 0!==e.avatar_url||void 0!==e.gender||void 0!==e.background_color||void 0!==e.user_prompt;if(t&&a)throw new Error("create_agent accepts either prompt mode or manual mode. Do not pass prompt together with manual profile fields.");if(!t&&void 0!==e.agent_model)throw new Error("agent_model can only be used when prompt is provided.");if(!t)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},r=await this.mondayApi.request(X_,a,{versionOverride:"dev"});if(!r.create_blank_agent?.id)throw new Error("monday platform agent creation returned no id");return{content:{message:`monday platform agent ${r.create_blank_agent.id} created in state INACTIVE — user must activate it from the monday.com UI before it can be triggered`,agent:r.create_blank_agent}}}catch(e){Gh(e,"create blank monday platform agent")}try{const t={input:{prompt:e.prompt,agent_model:e.agent_model}},a=await this.mondayApi.request(J_,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 — user must activate it from the monday.com UI before it can be triggered`,agent:a.create_agent}}}catch(e){Gh(e,"create monday platform agent")}}},class extends Ei{constructor(){super(...arguments),this.name="delete_agent",this.type=jr.WRITE,this.annotations=Ti({title:"Delete monday Platform Agent",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Permanently delete a personal/custom agent on the monday.com platform. Removes the agent and all of its versions. The agent stops appearing in get_agent results and can no longer be triggered. This action cannot be undone. Only the agent owner can delete it.\n\nTerminology note: users might ask for "agent" in natural language (for example: "delete my standup agent"), but in this API context this refers to monday personal/custom agents.\n\nVERIFY BEFORE DELETING: When the user refers to an agent by name or description (e.g. "delete my standup bot"), call get_agent (no id) first to list all the user\'s agents and confirm the correct id. Do not infer ids — pick the matching agent by inspecting profile.name / role / goal.\n\nUSAGE EXAMPLE:\n{ "id": "42" }'}getInputSchema(){return ay}async executeInternal(e){try{const t={id:e.id},a=await this.mondayApi.request(Z_,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){Gh(e,"delete monday platform agent")}}}];var Ly;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(Ly||(Ly={}));const Vy=(e,t)=>{let a=[];t?.mode===Ly.APPS?a=[...Ii]:t?.mode!==Ly.API&&t?.mode||(a=[...Fy,...xy]);const r=a.map((t=>((e,t)=>e.prototype instanceof Ei?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof ei?new e(t.apiToken):new e)(t,e)));return r.filter((e=>{if(!t)return e.type!==jr.ALL_API;if(t.mode===Ly.API&&"only"===t.enableDynamicApiTools)return e.type===jr.ALL_API;let a=!1;return t.mode===Ly.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===jr.ALL_API),t.readOnlyMode&&(a=a||e.type!==jr.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))};class jy{constructor(){this.dynamicTools=new Map}registerTool(e,t){const a=e.enabledByDefault??!0,r=a;this.dynamicTools.set(e.name,{instance:e,mcpTool:t,enabled:r,enabledByDefault:a}),a||t.disable()}enableTool(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabled||(t.mcpTool.enable(),t.enabled=!0),!0)}disableTool(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabled&&(t.mcpTool.disable(),t.enabled=!1),!0)}isToolEnabled(e){const t=this.dynamicTools.get(e);return!!t&&t.enabled}isToolEnabledByDefault(e){const t=this.dynamicTools.get(e);return!t||t.enabledByDefault}getToolsStatus(){const e={};return this.dynamicTools.forEach(((t,a)=>{e[a]=t.enabled})),e}getDynamicToolNames(){return Array.from(this.dynamicTools.keys())}getDetailedToolsStatus(){const e={};return this.dynamicTools.forEach(((t,a)=>{e[a]={enabled:t.enabled,enabledByDefault:t.enabledByDefault}})),e}resetToolToDefault(e){const t=this.dynamicTools.get(e);return!!t&&(t.enabledByDefault&&!t.enabled?(t.mcpTool.enable(),t.enabled=!0,!0):!(!t.enabledByDefault&&t.enabled)||(t.mcpTool.disable(),t.enabled=!1,!0))}getAllDynamicTools(){return this.dynamicTools}clear(){this.dynamicTools.clear()}}class Uy extends Pr{constructor(e){super({name:"monday.com",version:"1.0.0"},{capabilities:{tools:{listChanged:!0}}}),this.dynamicToolManager=new jy,this.toolInstances=[],this.managementTool=null,this.mondayApiClient=this.createApiClient(e),this.mondayApiToken=e.mondayApiToken,this.context={...e.context,apiVersion:e.mondayApiVersion??Xr},this.registerTools(e)}createApiClient(e){return new r({token:e.mondayApiToken,apiVersion:e.mondayApiVersion??Xr,endpoint:e.mondayApiEndpoint,requestConfig:{...e.mondayApiRequestConfig,headers:{...e.mondayApiRequestConfig?.headers||{},"user-agent":"monday-api-mcp"}}})}registerTools(e){try{this.toolInstances=this.initializeTools(e),this.toolInstances.forEach((e=>this.registerSingleTool(e))),!0===e.toolsConfiguration?.enableToolManager&&this.registerManagementTool()}catch(e){throw new Error(`Failed to initialize Monday Agent Toolkit: ${e instanceof Error?e.message:String(e)}`)}}registerManagementTool(){const e=new iy;e.setToolkitManager(this.dynamicToolManager),this.managementTool=e,this.registerSingleTool(this.managementTool)}initializeTools(e){const t={apiClient:this.mondayApiClient,apiToken:this.mondayApiToken,context:this.context};return Vy(t,e.toolsConfiguration)}registerSingleTool(t){const a=t.getInputSchema(),r=this.registerTool(t.name,{...t,title:t.annotations?.title,description:t.getDescription(),inputSchema:a,annotations:t.annotations},(async(r,i)=>{try{let i;if(a){const o=e.object(a).safeParse(r);if(!o.success)throw new Error(`Invalid arguments: ${o.error.message}`);i=await t.execute(o.data)}else i=await t.execute();return this.formatToolResult(i.content)}catch(e){return this.handleToolError(e,t.name)}}));this.dynamicToolManager.registerTool(t,r)}enableTool(e){return this.dynamicToolManager.enableTool(e)}disableTool(e){return this.dynamicToolManager.disableTool(e)}isToolEnabled(e){return this.dynamicToolManager.isToolEnabled(e)}getToolsStatus(){return this.dynamicToolManager.getToolsStatus()}getDynamicToolNames(){return this.dynamicToolManager.getDynamicToolNames()}getServer(){return this}getTools(e){const t=[...this.toolInstances];return this.managementTool&&t.push(this.managementTool),t.map((t=>({name:t.name,description:t.getDescription(),schema:this.getSchemaForTool(t,e),annotations:t.annotations,handler:this.createToolHandler(t)})))}getToolsForMcp(e){const t=[...this.toolInstances];return this.managementTool&&t.push(this.managementTool),t.map((t=>({name:t.name,description:t.getDescription(),schema:this.getSchemaForTool(t,e),annotations:t.annotations,handler:this.createMcpToolHandler(t)})))}createToolHandler(t){return async a=>{const r=t.getInputSchema();if(r){const i=e.object(r).safeParse(a);if(!i.success)throw new Error(`Invalid arguments: ${i.error.message}`);return(await t.execute(i.data)).content}return(await t.execute()).content}}createMcpToolHandler(t){return async(a,r)=>{try{const i=t.getInputSchema();if(i){const o=e.object(i).safeParse(a);if(!o.success)throw new Error(`Invalid arguments: ${o.error.message}`);const n=await t.execute(o.data,r);return this.formatToolResult(n.content)}{const e=await t.execute(void 0,r);return this.formatToolResult(e.content)}}catch(e){return{content:[{type:"text",text:`Error: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}}}getSchemaForTool(t,r){const i=t.getInputSchema();if(i)return"json"===r?.schemaFormat?a(e.object(i)):i}formatToolResult(e){return"string"==typeof e?{content:[{type:"text",text:e}]}:{structuredContent:e,content:[{type:"text",text:JSON.stringify(e)}]}}handleToolError(e,t){return{content:[{type:"text",text:`Failed to execute tool ${t}: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}}export{jy as DynamicToolManager,Uy as MondayAgentToolkit};
|
|
2297
2326
|
//# sourceMappingURL=index.js.map
|