Skip to content

Commit 7ef974d

Browse files
GuyHadasRomKadriashaneer
authored
Form Questions Manager + Update Form Tool (mondaycom#68)
* feat(agent-toolkit): add createForm mutation and related tools - Introduced CreateFormTool to facilitate form creation. - Added createForm GraphQL mutation to handle form creation requests. - Updated package.json to include @mondaydotcomorg/workforms-contracts dependency. - Enhanced GraphQL types to support the new mutation. * feat(agent-toolkit): document WorkForms operations in GraphQL queries - Added comments to clarify the purpose of the WorkForms operations section. - Introduced createForm mutation for creating new monday forms (API version 2025-10). * feat(agent-toolkit): add GetForm query and related tools - Introduced GetFormTool for fetching forms by token. - Added getForm GraphQL query to retrieve detailed form information. - Updated GraphQL types to include GetFormQuery and its variables. * refactor(agent-toolkit): remove deprecated form tools and update dependencies - Deleted CreateFormTool and GetFormTool as part of the refactor. - Removed @mondaydotcomorg/workforms-contracts dependency from package.json. - Updated import paths for GraphQL types to reflect new structure. * refactor(agent-toolkit): update import paths for form tools - Moved CreateFormTool and GetFormTool imports to the workforms-tools directory. - Cleaned up import statements to reflect the new structure. * refactor(agent-toolkit): reorganize form tool imports - Updated import paths for CreateFormTool and GetFormTool to reflect their new location in the workforms-tools directory. - Ensured all relevant tools are correctly exported from the updated structure. * docs(agent-toolkit): update README to include WorkForms operations - Added documentation for CreateFormTool and GetFormTool under WorkForms Operations section. - Enhanced clarity on the toolkit's capabilities for managing forms in monday.com. * refactor(agent-toolkit): update GraphQL import paths for form tools - Changed import paths for CreateFormTool and GetFormTool to use the new workforms.graphql file. - Removed the old queries.graphql file references to streamline the codebase. * feat(agent-toolkit): add form question management operations - Introduced mutations for creating, updating, and deleting form questions in the GraphQL API. - Updated the Form interface to include operations for managing questions. - Enhanced GraphQL types to support new question management functionalities. - Added FormQuestionsEditorTool to facilitate question editing within forms. * refactor(agent-toolkit): streamline form tools and schemas - Consolidated form tool schemas into a dedicated file for better organization. - Updated CreateFormTool, FormQuestionsEditorTool, and GetFormTool to utilize the new schema imports. - Enhanced the FormQuestionsEditorTool to improve variable handling during question operations. - Corrected GraphQL description labels for clarity in form question types. * feat(agent-toolkit): enhance question schema with optional title field - Added an optional title field to the base question schema for improved flexibility. - Simplified the createQuestionSchema by removing the validation function, streamlining the schema definition. - Updated the formQuestionsEditorToolSchema to reference the baseQuestionSchema for question updates. * feat(agent-toolkit): enhance question schema with optional title field - Added an optional title field to the base question schema for improved flexibility. - Simplified the create and update question schemas by removing redundant title definitions. - Updated the formQuestionsEditorToolSchema to reference the base question schema directly for question updates. * feat(agent-toolkit): enhance form question operations with improved validation and schema updates - Updated the formQuestionsEditorToolSchema to include optional questionId and question fields for better flexibility. - Enhanced validation for create, update, and delete operations to ensure required fields are provided. - Improved GraphQL descriptions to clarify requirements for question operations. - Refactored input handling in FormQuestionsEditorTool to streamline question management processes. * refactor(agent-toolkit): update FormQuestionsEditorTool and schemas for improved type handling - Refactored FormQuestionsEditorTool to utilize specific input and output types based on formQuestionsEditorToolSchema. - Updated import paths for GraphQL types to reflect the new directory structure. - Enhanced getInputSchema method to return the correct schema type, improving type safety and clarity. * refactor(agent-toolkit): rename GraphQL mutations for form question operations - Updated mutation names for creating and updating form questions to follow a consistent naming convention. - Changed `create_question` to `create_form_question` and `update_question` to `update_form_question` for clarity and alignment with other operations. * refactor(agent-toolkit): remove labelLimitCount from form question settings - Eliminated the labelLimitCount field from the form question settings in GraphQL schemas and related files. - Updated GraphQL descriptions to clarify the requirements for select-type questions. - Adjusted the question schema and GraphQL operations to reflect the removal of this field, streamlining the question management process. * refactor(agent-toolkit): clarify GraphQL descriptions for select-type questions - Updated the description for selectOptions in GraphQL to enhance clarity on when options are required for creating select-type questions. - Ensured consistency in language to improve understanding of the question creation process. * feat(agent-toolkit): add UpdateFormTool and related GraphQL operations - Introduced UpdateFormTool to facilitate form updates, including title, description, and question management. - Added GraphQL mutations for updating form properties and settings, enhancing the toolkit's capabilities for form management. - Updated schemas and types to support the new update operations, ensuring consistency and clarity in the API. - Enhanced GraphQL descriptions to provide detailed information on the new update functionalities. * refactor(agent-toolkit): streamline GraphQL descriptions and remove unused fields - Consolidated and clarified GraphQL descriptions for various query and mutation types to enhance readability and understanding. - Removed the `labelLimitCount` field from the `FormQuestionSettings` type, simplifying the schema and focusing on essential properties. - Updated related GraphQL schemas and types to ensure consistency and clarity across the toolkit. * refactor(agent-toolkit): update form question operations and schemas for clarity and consistency - Renamed `FormQuestionsOperation` to `FormQuestionActions` for improved clarity in action handling. - Updated the `formQuestionsEditorToolSchema` to reflect the new action naming and enhance type safety. - Enhanced GraphQL descriptions to include new actions for form updates, including tag management and question operations. - Streamlined the `UpdateFormTool` to support various form update actions, improving overall functionality and user experience. * feat(agent-toolkit): enhance UpdateFormTool with new update functionalities - Added support for updating form appearance, accessibility, features, question order, and header through new GraphQL mutations. - Improved validation by ensuring required fields are checked before performing updates, enhancing user experience. - Updated GraphQL descriptions to clarify the requirements for each update action, providing better guidance for users. - Refactored schemas to include new input types and structures for the added functionalities, ensuring consistency across the toolkit. * refactor(agent-toolkit): standardize enum values for logo properties and remove unused logo URL field - Updated enum values for LogoSize, LogoPosition, BackgroundType, Direction, Format, Alignment, and FontSize to use PascalCase for consistency. - Removed the optional logo URL field from the logoSchema to streamline the schema and focus on essential properties. * feat(agent-toolkit): add new form submission features to GraphQL schema - Introduced new fields `allowResubmit`, `showSuccessImage`, `allowEditSubmission`, and `allowViewSubmission` to enhance form submission capabilities. - Updated the GraphQL schema to support these new features, improving the flexibility and user experience of form submissions. * Bump minor version * refactor(agent-toolkit): remove deprecated form tools and schemas - Deleted obsolete tools: CreateFormTool, FormQuestionsEditorTool, GetFormTool, UpdateFormTool, and associated schemas to streamline the agent toolkit. - This cleanup enhances maintainability and focuses on current functionalities, ensuring a more efficient codebase. * refactor(agent-toolkit): improve UpdateFormTool action handling and documentation - Enhanced the `getDescription` method to clarify that form update actions must be executed one at a time using the correct "action" input. - Refactored action handling by introducing a map of action handlers, simplifying the `executeInternal` method and improving code readability. - Removed the deprecated `updateForm` method to streamline the tool's functionality. * refactor(agent-toolkit): remove unused field from updateFormSettings mutation - Eliminated the `isInternal` field from the `features` object in the `updateFormSettings` mutation to streamline the GraphQL schema and focus on relevant properties. * feat(agent-toolkit): introduce reusable GraphQL fragments for form questions and features - Added new GraphQL fragments for `QuestionBasic`, `QuestionOptions`, `QuestionSettings`, `QuestionComplete`, `FormFeatures`, `FormAppearance`, `FormAccessibility`, and `FormTag` to reduce duplication in queries and mutations. - Updated existing queries and mutations to utilize these fragments, enhancing maintainability and readability of the GraphQL schema. - Improved the `GetFormQuery` and related mutations to streamline data retrieval and updates for form-related operations. * refactor(agent-toolkit): update GraphQL schema types for consistency and clarity - Changed field types from `Int` and `Float` to `ID` for `workspace_id`, `board_ids`, `board_folder_id`, and related fields in the `createDashboard` and `createForm` mutations to ensure type consistency across the schema. - Updated the `createFormToolSchema` to reflect these type changes, enhancing the clarity and maintainability of the form creation process. - Added new `ArticleBlock` type to the GraphQL schema, providing a structured representation of article content blocks with relevant fields for better data handling. * refactor(agent-toolkit): update GraphQL schema types for dashboard creation - Changed field types for `workspace_id` and `board_folder_id` from `ID` to `Int` for better alignment with expected data types. - Updated `board_ids` type from `[ID!]` to `[String!]` to enhance flexibility in handling board identifiers. - These changes improve type consistency and clarity in the `createDashboard` mutation. * fix(agent-toolkit): add missing newline at end of package.json - Added a newline at the end of the package.json file to adhere to standard file formatting practices. * refactor(agent-toolkit): update GraphQL schema types for dashboard mutation - Changed `workspace_id` and `board_folder_id` types from `ID` to `Int` for improved type accuracy. - Updated `board_ids` type from `[ID!]` to `[String!]` to allow for more flexible board identifier handling. - These modifications enhance type consistency and clarity in the `createDashboard` mutation. * refactor(agent-toolkit): update GraphQL schema types for dashboard mutation - Changed `workspace_id`, `board_ids`, and `board_folder_id` types from `Int` to `ID` for improved type accuracy and consistency. - These modifications enhance clarity and maintainability in the `createDashboard` mutation. * refactor(agent-toolkit): ensure string type for container IDs in dashboard and widget tools - Updated `workspace_id` and `board_folder_id` in `createDashboardTool` to be strings for consistency. - Changed `parent_container_id` in `createWidgetTool` to a string type to align with expected data formats. - These modifications enhance type consistency across the dashboard and widget creation processes. * refactor(agent-toolkit): simplify dashboard tool schema definition - Consolidated the definition of `name` and `board_folder_id` fields in `createDashboardToolSchema` for improved readability. - These changes enhance the clarity of the schema while maintaining the required validation rules. * refactor(agent-toolkit): enhance GraphQL descriptions for form updates - Updated descriptions for `questionId`, `tag`, `features`, `appearance`, and `accessibility` to clarify their requirements during form updates. - These changes improve the documentation and usability of the GraphQL API for form-related operations. * refactor(agent-toolkit): modularize GraphQL operations for form tools - Refactored the `FormQuestionsEditorTool` and `UpdateFormTool` classes to delegate GraphQL operations to dedicated helper classes (`FormQuestionsEditorToolHelpers` and `UpdateFormToolHelpers`). - This change enhances code organization and maintainability by separating concerns and reducing complexity within the main tool classes. - Action handlers for form question and update operations have been streamlined, improving readability and facilitating future enhancements. * feat(agent-toolkit): add mutations for creating and updating folders and workspaces - Introduced `CreateFolderMutation` and `UpdateFolderMutation` types to handle folder creation and updates. - Added `UpdateWorkspaceMutation` type for updating workspace attributes. - Enhanced GraphQL schema with new mutation variables for better folder and workspace management. * Update packages/agent-toolkit/package.json * Update packages/agent-toolkit/src/core/tools/platform-api-tools/workforms-tools/form-questions-editor-tool/index.ts * Update packages/agent-toolkit/src/core/tools/platform-api-tools/workforms-tools/update-form-tool/index.ts * Update packages/agent-toolkit/src/core/tools/platform-api-tools/workforms-tools/utils/update-form-tool-helpers.ts Co-authored-by: Shanee Radzewsky <[email protected]> * Update packages/agent-toolkit/src/core/tools/platform-api-tools/workforms-tools/utils/update-form-tool-helpers.ts Co-authored-by: Shanee Radzewsky <[email protected]> * Update packages/agent-toolkit/src/core/tools/platform-api-tools/workforms-tools/workforms.consts.ts Co-authored-by: Shanee Radzewsky <[email protected]> * Enhance UpdateFormTool description with specific action inputs for form updates * Add FormQuestionsEditorTool to README and enhance UpdateFormTool description --------- Co-authored-by: RomKadria <[email protected]> Co-authored-by: Shanee Radzewsky <[email protected]>
1 parent 8c08cce commit 7ef974d

File tree

19 files changed

+1416
-225
lines changed

19 files changed

+1416
-225
lines changed

packages/agent-toolkit/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ The toolkit includes several pre-built tools for common monday.com operations, o
3838
### WorkForms Operations
3939
- `CreateFormTool` - Create a monday.com form
4040
- `GetFormTool` - Get a form by its token, found in the form's URL
41+
- `UpdateFormTool` - Update a monday.com form, including updating the form's feature settings, appearance settings, accessibility settings, title, description, question order, form tags, and form password
42+
- `FormQuestionsEditorTool` - Create, update, or delete a question in a monday.com form
4143

4244
### Account Operations
4345
- `GetUsersTool` - Get users, can be filtered by name or partial name

packages/agent-toolkit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mondaydotcomorg/agent-toolkit",
3-
"version": "2.14.0",
3+
"version": "2.15.0",
44
"description": "monday.com agent toolkit",
55
"exports": {
66
"./mcp": {

packages/agent-toolkit/src/core/tools/platform-api-tools/dashboard-tools/create-dashboard-tool.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import { ToolInputType, ToolOutputType, ToolType } from '../../../tool';
99
import { BaseMondayApiTool, createMondayApiAnnotations } from '../base-monday-api-tool';
1010

1111
export const createDashboardToolSchema = {
12-
name: z
13-
.string()
14-
.min(1, 'Dashboard name is required')
15-
.describe('Human-readable dashboard title (UTF-8 chars)'),
12+
name: z.string().min(1, 'Dashboard name is required').describe('Human-readable dashboard title (UTF-8 chars)'),
1613
workspace_id: z
1714
.string()
1815
.describe('ID of the workspace that will own the dashboard'),
@@ -25,7 +22,9 @@ export const createDashboardToolSchema = {
2522
board_folder_id: z
2623
.string()
2724
.optional()
28-
.describe('Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)'),
25+
.describe(
26+
'Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)',
27+
),
2928
};
3029

3130
export class CreateDashboardTool extends BaseMondayApiTool<typeof createDashboardToolSchema, never> {
@@ -59,10 +58,10 @@ export class CreateDashboardTool extends BaseMondayApiTool<typeof createDashboar
5958
// Prepare GraphQL variables
6059
const variables: CreateDashboardMutationVariables = {
6160
name: input.name,
62-
workspace_id: input.workspace_id,
61+
workspace_id: input.workspace_id.toString(),
6362
board_ids: input.board_ids,
6463
kind: input.kind,
65-
board_folder_id: input.board_folder_id,
64+
board_folder_id: input.board_folder_id?.toString(),
6665
};
6766

6867
// Execute the GraphQL mutation

packages/agent-toolkit/src/core/tools/platform-api-tools/dashboard-tools/create-widget-tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class CreateWidgetTool extends BaseMondayApiTool<typeof createWidgetToolS
6666
const variables: CreateWidgetMutationVariables = {
6767
parent: {
6868
kind: input.parent_container_type,
69-
id: input.parent_container_id,
69+
id: input.parent_container_id.toString(),
7070
},
7171
kind: input.widget_kind,
7272
name: input.widget_name,

packages/agent-toolkit/src/core/tools/platform-api-tools/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { BaseMondayApiToolConstructor } from './base-monday-api-tool';
33
import { ChangeItemColumnValuesTool } from './change-item-column-values-tool';
44
import { CreateBoardTool } from './create-board-tool';
55
import { CreateFormTool } from './workforms-tools/create-form-tool';
6+
import { FormQuestionsEditorTool } from './workforms-tools/form-questions-editor-tool';
7+
import { UpdateFormTool } from './workforms-tools/update-form-tool';
68
import { GetFormTool } from './workforms-tools/get-form-tool';
79
import { CreateColumnTool } from './create-column-tool';
810
import { CreateCustomActivityTool } from './create-custom-activity-tool';
@@ -50,7 +52,9 @@ export const allGraphqlApiTools: BaseMondayApiToolConstructor[] = [
5052
MoveItemToGroupTool,
5153
CreateBoardTool,
5254
CreateFormTool,
55+
UpdateFormTool,
5356
GetFormTool,
57+
FormQuestionsEditorTool,
5458
CreateColumnTool,
5559
CreateGroupTool,
5660
DeleteColumnTool,
@@ -80,7 +84,9 @@ export * from './all-monday-api-tool';
8084
export * from './change-item-column-values-tool';
8185
export * from './create-board-tool';
8286
export * from './workforms-tools/create-form-tool';
87+
export * from './workforms-tools/update-form-tool';
8388
export * from './workforms-tools/get-form-tool';
89+
export * from './workforms-tools/form-questions-editor-tool';
8490
export * from './create-column-tool';
8591
export * from './create-group/create-group-tool';
8692
export * from './create-custom-activity-tool';

packages/agent-toolkit/src/core/tools/platform-api-tools/workforms-tools/create-form-tool.ts renamed to packages/agent-toolkit/src/core/tools/platform-api-tools/workforms-tools/create-form-tool/index.ts

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,8 @@
1-
import { z } from 'zod';
2-
import {
3-
BoardKind,
4-
CreateFormMutation,
5-
CreateFormMutationVariables,
6-
} from '../../../../monday-graphql/generated/graphql';
7-
import { createForm } from './workforms.graphql';
8-
import { ToolInputType, ToolOutputType, ToolType } from '../../../tool';
9-
import { BaseMondayApiTool, createMondayApiAnnotations } from '../base-monday-api-tool';
10-
import { GraphQLDescriptions } from './workforms.consts';
11-
12-
export const createFormToolSchema = {
13-
destination_workspace_id: z.number().describe(GraphQLDescriptions.form.args.destinationWorkspaceId),
14-
destination_folder_id: z.number().optional().describe(GraphQLDescriptions.form.args.destinationFolderId),
15-
destination_folder_name: z.string().optional().describe(GraphQLDescriptions.form.args.destinationFolderName),
16-
board_kind: z.nativeEnum(BoardKind).optional().describe(GraphQLDescriptions.form.args.boardKind),
17-
destination_name: z.string().optional().describe(GraphQLDescriptions.form.args.destinationName),
18-
board_owner_ids: z.array(z.number()).optional().describe(GraphQLDescriptions.form.args.boardOwnerIds),
19-
board_owner_team_ids: z.array(z.number()).optional().describe(GraphQLDescriptions.form.args.boardOwnerTeamIds),
20-
board_subscriber_ids: z.array(z.number()).optional().describe(GraphQLDescriptions.form.args.boardSubscriberIds),
21-
board_subscriber_teams_ids: z
22-
.array(z.number())
23-
.optional()
24-
.describe(GraphQLDescriptions.form.args.boardSubscriberTeamsIds),
25-
};
1+
import { CreateFormMutation, CreateFormMutationVariables } from '../../../../../monday-graphql/generated/graphql';
2+
import { createForm } from '../workforms.graphql';
3+
import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool';
4+
import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool';
5+
import { createFormToolSchema } from './schema';
266

277
export class CreateFormTool extends BaseMondayApiTool<typeof createFormToolSchema, never> {
288
name = 'create_form';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { z } from 'zod';
2+
import { GraphQLDescriptions } from '../workforms.consts';
3+
import { BoardKind } from '../../../../../monday-graphql/generated/graphql';
4+
5+
export const createFormToolSchema = {
6+
destination_workspace_id: z.string().describe(GraphQLDescriptions.form.args.destinationWorkspaceId),
7+
destination_folder_id: z.string().optional().describe(GraphQLDescriptions.form.args.destinationFolderId),
8+
destination_folder_name: z.string().optional().describe(GraphQLDescriptions.form.args.destinationFolderName),
9+
board_kind: z.nativeEnum(BoardKind).optional().describe(GraphQLDescriptions.form.args.boardKind),
10+
destination_name: z.string().optional().describe(GraphQLDescriptions.form.args.destinationName),
11+
board_owner_ids: z.array(z.string()).optional().describe(GraphQLDescriptions.form.args.boardOwnerIds),
12+
board_owner_team_ids: z.array(z.string()).optional().describe(GraphQLDescriptions.form.args.boardOwnerTeamIds),
13+
board_subscriber_ids: z.array(z.string()).optional().describe(GraphQLDescriptions.form.args.boardSubscriberIds),
14+
board_subscriber_teams_ids: z
15+
.array(z.string())
16+
.optional()
17+
.describe(GraphQLDescriptions.form.args.boardSubscriberTeamsIds),
18+
};
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool';
2+
import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool';
3+
import { FormQuestionActions } from '../workforms.types';
4+
import { formQuestionsEditorToolSchema } from './schema';
5+
import { FormQuestionsEditorToolHelpers } from '../utils/form-questions-editor-tool-helpers';
6+
7+
export class FormQuestionsEditorTool extends BaseMondayApiTool<typeof formQuestionsEditorToolSchema, never> {
8+
name = 'form_questions_editor';
9+
type = ToolType.WRITE;
10+
annotations = createMondayApiAnnotations({
11+
title: 'Form Questions Editor',
12+
readOnlyHint: false,
13+
destructiveHint: true,
14+
idempotentHint: false,
15+
});
16+
17+
private helpers = new FormQuestionsEditorToolHelpers(this.mondayApi);
18+
19+
private readonly actionHandlers = new Map<
20+
FormQuestionActions,
21+
(input: ToolInputType<typeof formQuestionsEditorToolSchema>) => Promise<ToolOutputType<never>>
22+
>([
23+
[FormQuestionActions.Delete, this.helpers.deleteQuestion.bind(this.helpers)],
24+
[FormQuestionActions.Update, this.helpers.updateQuestion.bind(this.helpers)],
25+
[FormQuestionActions.Create, this.helpers.createQuestion.bind(this.helpers)],
26+
]);
27+
28+
getDescription(): string {
29+
return 'Create, update, or delete a question in a monday.com form';
30+
}
31+
32+
getInputSchema(): typeof formQuestionsEditorToolSchema {
33+
return formQuestionsEditorToolSchema;
34+
}
35+
36+
protected async executeInternal(
37+
input: ToolInputType<typeof formQuestionsEditorToolSchema>,
38+
): Promise<ToolOutputType<never>> {
39+
const handler = this.actionHandlers.get(input.action);
40+
41+
if (!handler) {
42+
return {
43+
content: `Unknown action: ${input.action}`,
44+
};
45+
}
46+
47+
return await handler(input);
48+
}
49+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import { z } from 'zod';
2+
import { GraphQLDescriptions } from '../workforms.consts';
3+
import { FormQuestionActions } from '../workforms.types';
4+
import {
5+
FormQuestionSelectDisplay,
6+
FormQuestionSelectOrderByOptions,
7+
FormQuestionType,
8+
FormQuestionPrefillSources,
9+
} from '../../../../../monday-graphql/generated/graphql';
10+
11+
const questionSchema = z.object({
12+
type: z.nativeEnum(FormQuestionType).describe(GraphQLDescriptions.question.properties.type),
13+
title: z.string().describe(GraphQLDescriptions.question.properties.title).optional(),
14+
description: z.string().describe(GraphQLDescriptions.question.properties.description).optional(),
15+
visible: z.boolean().describe(GraphQLDescriptions.question.properties.visible).optional(),
16+
required: z.boolean().describe(GraphQLDescriptions.question.properties.required).optional(),
17+
options: z
18+
.array(
19+
z.object({
20+
label: z.string().describe(GraphQLDescriptions.question.properties.selectOptionsLabel),
21+
}),
22+
)
23+
.describe(GraphQLDescriptions.question.properties.selectOptions)
24+
.optional(),
25+
settings: z
26+
.object({
27+
checkedByDefault: z
28+
.boolean()
29+
.describe(GraphQLDescriptions.questionSettings.properties.checkedByDefault)
30+
.optional(),
31+
defaultCurrentDate: z
32+
.boolean()
33+
.describe(GraphQLDescriptions.questionSettings.properties.defaultCurrentDate)
34+
.optional(),
35+
display: z
36+
.nativeEnum(FormQuestionSelectDisplay)
37+
.describe(GraphQLDescriptions.questionSettings.properties.display)
38+
.optional(),
39+
includeTime: z.boolean().describe(GraphQLDescriptions.questionSettings.properties.includeTime).optional(),
40+
locationAutofilled: z
41+
.boolean()
42+
.describe(GraphQLDescriptions.questionSettings.properties.locationAutofilled)
43+
.optional(),
44+
optionsOrder: z
45+
.nativeEnum(FormQuestionSelectOrderByOptions)
46+
.describe(GraphQLDescriptions.questionSettings.properties.optionsOrder)
47+
.optional(),
48+
prefixAutofilled: z
49+
.boolean()
50+
.describe(GraphQLDescriptions.questionSettings.properties.prefixAutofilled)
51+
.optional(),
52+
prefixPredefined: z
53+
.object({
54+
enabled: z.boolean().describe(GraphQLDescriptions.questionSettings.properties.prefixPredefinedEnabled),
55+
prefix: z
56+
.string()
57+
.describe(GraphQLDescriptions.questionSettings.properties.prefixPredefinedPrefix)
58+
.optional(),
59+
})
60+
.describe(GraphQLDescriptions.questionSettings.properties.prefixPredefined)
61+
.optional(),
62+
skipValidation: z.boolean().describe(GraphQLDescriptions.questionSettings.properties.skipValidation).optional(),
63+
prefill: z
64+
.object({
65+
enabled: z.boolean().describe(GraphQLDescriptions.questionSettings.properties.prefillEnabled),
66+
lookup: z.string().describe(GraphQLDescriptions.questionSettings.properties.prefillLookup).optional(),
67+
source: z
68+
.nativeEnum(FormQuestionPrefillSources)
69+
.describe(GraphQLDescriptions.questionSettings.properties.prefillSource)
70+
.optional(),
71+
})
72+
.describe(GraphQLDescriptions.questionSettings.properties.prefill)
73+
.optional(),
74+
})
75+
.optional(),
76+
});
77+
78+
export const formQuestionsEditorToolSchema = {
79+
action: z.nativeEnum(FormQuestionActions).describe(GraphQLDescriptions.question.actions.type),
80+
formToken: z.string().describe(GraphQLDescriptions.commonArgs.formToken),
81+
questionId: z.string().describe(GraphQLDescriptions.commonArgs.questionId).optional(),
82+
question: questionSchema.describe(GraphQLDescriptions.question.actions.question).optional(),
83+
};

packages/agent-toolkit/src/core/tools/platform-api-tools/workforms-tools/get-form-tool.ts renamed to packages/agent-toolkit/src/core/tools/platform-api-tools/workforms-tools/get-form-tool/index.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import { z } from 'zod';
2-
import { GetFormQuery, GetFormQueryVariables } from '../../../../monday-graphql/generated/graphql';
3-
import { getForm } from './workforms.graphql';
4-
import { ToolInputType, ToolOutputType, ToolType } from '../../../tool';
5-
import { BaseMondayApiTool, createMondayApiAnnotations } from '../base-monday-api-tool';
6-
import { GraphQLDescriptions } from './workforms.consts';
7-
8-
export const getFormToolSchema = {
9-
formToken: z.string().describe(GraphQLDescriptions.commonArgs.formToken),
10-
};
2+
import { GetFormQuery, GetFormQueryVariables } from '../../../../../monday-graphql/generated/graphql';
3+
import { getForm } from '../workforms.graphql';
4+
import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool';
5+
import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool';
6+
import { getFormToolSchema } from './schema';
117

128
export class GetFormTool extends BaseMondayApiTool<typeof getFormToolSchema, never> {
139
name = 'get_form';

0 commit comments

Comments
 (0)