Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ Our MCP server provides a rich set of tools that give AI assistants the ability
| | delete_column | Remove a column from a board |
| **Account Operations** | get_users_by_name | Retrieve user information by name or partial name |
| | list_users_and_teams | Retrieve user or team's details by id, name or by searching the account |
| **WorkForms Operations** | create_form | Create a new monday.com form |
| | get_form | Get a form by its token |

## 🔮 Dynamic API Tools (Beta)

Expand Down
4 changes: 4 additions & 0 deletions packages/agent-toolkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ The toolkit includes several pre-built tools for common monday.com operations, o
- `CreateColumnTool` - Create a new column in a monday.com board
- `DeleteColumnTool` - Delete a column from a monday.com board

Comment thread
GuyHadas marked this conversation as resolved.
### WorkForms Operations
- `CreateFormTool` - Create a monday.com form
- `GetFormTool` - Get a form by its token, found in the form's URL

### Account Operations
- `GetUsersTool` - Get users, can be filtered by name or partial name
- `ListUsersAndTeams` - Get users or teams, either by ids, names or by searching the account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { AllMondayApiTool } from './all-monday-api-tool';
import { BaseMondayApiToolConstructor } from './base-monday-api-tool';
import { ChangeItemColumnValuesTool } from './change-item-column-values-tool';
import { CreateBoardTool } from './create-board-tool';
import { CreateFormTool } from './workforms-tools/create-form-tool';
import { GetFormTool } from './workforms-tools/get-form-tool';
import { CreateColumnTool } from './create-column-tool';
import { CreateCustomActivityTool } from './create-custom-activity-tool';
import { CreateItemTool } from './create-item-tool';
Expand Down Expand Up @@ -42,6 +44,8 @@ export const allGraphqlApiTools: BaseMondayApiToolConstructor[] = [
ChangeItemColumnValuesTool,
MoveItemToGroupTool,
CreateBoardTool,
CreateFormTool,
GetFormTool,
CreateColumnTool,
DeleteColumnTool,
AllMondayApiTool,
Expand All @@ -65,6 +69,8 @@ export const allGraphqlApiTools: BaseMondayApiToolConstructor[] = [
export * from './all-monday-api-tool';
export * from './change-item-column-values-tool';
export * from './create-board-tool';
export * from './workforms-tools/create-form-tool';
export * from './workforms-tools/get-form-tool';
export * from './create-column-tool';
export * from './create-custom-activity-tool';
export * from './create-item-tool';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { z } from 'zod';
import {
BoardKind,
CreateFormMutation,
CreateFormMutationVariables,
} from '../../../../monday-graphql/generated/graphql';
import { createForm } from './workforms.graphql';
import { ToolInputType, ToolOutputType, ToolType } from '../../../tool';
import { BaseMondayApiTool, createMondayApiAnnotations } from '../base-monday-api-tool';
import { GraphQLDescriptions } from './workforms.consts';

export const createFormToolSchema = {
destination_workspace_id: z.number().describe(GraphQLDescriptions.form.args.destinationWorkspaceId),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be of type string, if in the gql its number this should change. I know someone from your team plans to change it to type ID (for all the IDS)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is dependent on the use_template mutation so we copy the exact types they use as well. When they switch to IDs we will too

destination_folder_id: z.number().optional().describe(GraphQLDescriptions.form.args.destinationFolderId),
destination_folder_name: z.string().optional().describe(GraphQLDescriptions.form.args.destinationFolderName),
board_kind: z.nativeEnum(BoardKind).optional().describe(GraphQLDescriptions.form.args.boardKind),
destination_name: z.string().optional().describe(GraphQLDescriptions.form.args.destinationName),
board_owner_ids: z.array(z.number()).optional().describe(GraphQLDescriptions.form.args.boardOwnerIds),
board_owner_team_ids: z.array(z.number()).optional().describe(GraphQLDescriptions.form.args.boardOwnerTeamIds),
board_subscriber_ids: z.array(z.number()).optional().describe(GraphQLDescriptions.form.args.boardSubscriberIds),
board_subscriber_teams_ids: z
.array(z.number())
.optional()
.describe(GraphQLDescriptions.form.args.boardSubscriberTeamsIds),
};

export class CreateFormTool extends BaseMondayApiTool<typeof createFormToolSchema, never> {
Comment thread
GuyHadas marked this conversation as resolved.
name = 'create_form';
type = ToolType.WRITE;
annotations = createMondayApiAnnotations({
title: 'Create Form',
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
});

getDescription(): string {
Comment thread
GuyHadas marked this conversation as resolved.
return 'Create a monday.com form. This will create a new form as well as a new board for which the form’s responses will be stored. The returned board_id is the ID of the board that was created while the returned formToken can be used for all future queries and mutations to continue editing the form.';
}

getInputSchema(): typeof createFormToolSchema {
return createFormToolSchema;
}

protected async executeInternal(input: ToolInputType<typeof createFormToolSchema>): Promise<ToolOutputType<never>> {
const variables: CreateFormMutationVariables = {
destination_workspace_id: input.destination_workspace_id,
destination_folder_id: input.destination_folder_id,
destination_folder_name: input.destination_folder_name,
board_kind: input.board_kind,
destination_name: input.destination_name,
board_owner_ids: input.board_owner_ids,
board_owner_team_ids: input.board_owner_team_ids,
board_subscriber_ids: input.board_subscriber_ids,
board_subscriber_teams_ids: input.board_subscriber_teams_ids,
};

const res = await this.mondayApi.request<CreateFormMutation>(createForm, variables);

return {
content: `Form created successfully. Board ID: ${res.create_form?.boardId}, Token: ${res.create_form?.token}`,
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { z } from 'zod';
import { GetFormQuery, GetFormQueryVariables } from '../../../../monday-graphql/generated/graphql';
import { getForm } from './workforms.graphql';
import { ToolInputType, ToolOutputType, ToolType } from '../../../tool';
import { BaseMondayApiTool, createMondayApiAnnotations } from '../base-monday-api-tool';
import { GraphQLDescriptions } from './workforms.consts';

export const getFormToolSchema = {
formToken: z.string().describe(GraphQLDescriptions.commonArgs.formToken),
};

export class GetFormTool extends BaseMondayApiTool<typeof getFormToolSchema, never> {
name = 'get_form';
type = ToolType.READ;
annotations = createMondayApiAnnotations({
title: 'Get Form',
readOnlyHint: true,
destructiveHint: false,
});

getDescription(): string {
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 token is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the token is abc123def456ghi789.';
Comment thread
GuyHadas marked this conversation as resolved.
}

getInputSchema(): typeof getFormToolSchema {
return getFormToolSchema;
}

protected async executeInternal(input: ToolInputType<typeof getFormToolSchema>): Promise<ToolOutputType<never>> {
const variables: GetFormQueryVariables = {
formToken: input.formToken,
};

const res = await this.mondayApi.request<GetFormQuery>(getForm, variables);

if (!res.form) {
return {
content: `Form with token ${input.formToken} not found or you don't have access to it.`,
};
}

return {
content: `The form with the token ${input.formToken} is: ${JSON.stringify(res.form, null, 2)}`,
};
}
}
Loading