Skip to main content
Glama
sakce

Monday.com MCP Server

by sakce

monday-list-subitems-in-items

Retrieve all sub-items linked to specified Monday.com items using the MCP server to organize and manage board data efficiently.

Instructions

List all Sub-items of a list of Monday.com Items

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemIdsYes

Implementation Reference

  • Core handler function that builds and executes a GraphQL query to fetch subitems for the given item IDs using the MondayClient, formats the response as JSON text content.
    async def handle_monday_list_subitems_in_items(
        itemIds: list[str],
        monday_client: MondayClient,
    ) -> list[types.TextContent]:
        formatted_item_ids = ", ".join(itemIds)
        get_subitems_in_item_query = f"""query
            {{
                items (ids: [{formatted_item_ids}]) {{
                    subitems {{
                        id
                        name
                        parent_item {{
                            id
                        }}
                        updates {{
                            id
                            body
                        }}
                        column_values {{
                            id
                            text
                            value
                        }}
                    }}
                }}
            }}"""
        response = monday_client.custom._query(get_subitems_in_item_query)
    
        return [
            types.TextContent(
                type="text",
                text=f"Sub-items of Monday.com items {itemIds}: {json.dumps(response)}",
            )
        ]
  • MCP tool registration using @mcp.tool() decorator. Defines the tool name 'monday_list_subitems_in_items', input schema (itemIds: List[str]), docstring description, and calls the core handler.
    @mcp.tool()
    async def monday_list_subitems_in_items(itemIds: List[str]) -> str:
        """List all Sub-items of a list of Monday.com Items.
    
        Args:
            itemIds: List of Monday.com Item IDs to get sub-items for.
        """
        try:
            client = get_monday_client()
            result = await handle_monday_list_subitems_in_items(itemIds, client)
            return result[0].text
        except Exception as e:
            return f"Error listing sub-items: {e}"
  • Import of the handler function from item.py into fastmcp_server.py, necessary for tool registration.
    from mcp_server_monday.item import (
        handle_monday_archive_item,
        handle_monday_create_item,
        handle_monday_create_update_on_item,
        handle_monday_delete_item,
        handle_monday_get_item_by_id,
        handle_monday_get_item_updates,
        handle_monday_list_items_in_groups,
        handle_monday_list_subitems_in_items,
        handle_monday_move_item_to_group,
        handle_monday_update_item,
    )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sakce/mcp-server-monday'

If you have feedback or need assistance with the MCP directory API, please join our Discord server