Skip to main content
Glama
Leanware-io

ClickUp MCP Integration

by Leanware-io

clickup_set_custom_field_value_by_custom_id

Update custom field values on ClickUp tasks using their custom IDs to maintain accurate task data and workflow automation.

Instructions

Set a value for a custom field on a task using the task's custom ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
custom_idYesClickUp custom task ID
custom_field_idYesCustom field ID
valueYesValue to set for the custom field. Type depends on the custom field type.

Implementation Reference

  • The handler function that executes the core logic of the MCP tool by calling the service method with destructured input parameters and formatting the response.
    handler: async (input) => {
      const { custom_id, custom_field_id, value } = input;
      const response = await customFieldService.setCustomFieldValueByCustomId(
        custom_id,
        custom_field_id,
        value
      );
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    },
  • Zod-based input schema defining the parameters: custom_id (string), custom_field_id (string), and value (union of common types).
    inputSchema: {
      custom_id: z.string().describe("ClickUp custom task ID"),
      custom_field_id: z.string().describe("Custom field ID"),
      value: z
        .union([
          z.string(),
          z.number(),
          z.boolean(),
          z.array(z.unknown()),
          z.record(z.unknown()),
        ])
        .describe(
          "Value to set for the custom field. Type depends on the custom field type."
        ),
    },
  • src/index.ts:23-50 (registration)
    Imports the tool from the controller and includes it in the array of tools that are registered to the MCP server.
      getListCustomFieldsTool,
      setCustomFieldValueTool,
      setCustomFieldValueByCustomIdTool,
    } from "./controllers/custom-field.controller";
    import { getListAssigneesTool } from "./controllers/assignee.controller";
    
    const tools = [
      // Task tools
      getTaskByCustomIdTool,
      getTaskTool,
      createTaskTool,
      updateTaskTool,
      updateTaskByCustomIdTool,
    
      // Space tools
      getSpacesTool,
    
      // Folder tools
      getFoldersTool,
    
      // List tools
      getListsTool,
      createListTool,
    
      // Custom Field tools
      getListCustomFieldsTool,
      setCustomFieldValueTool,
      setCustomFieldValueByCustomIdTool,
  • Helper service method that makes the POST request to the ClickUp API endpoint to set the custom field value using the task's custom ID.
    async setCustomFieldValueByCustomId(
      customId: string,
      customFieldId: string,
      value: any
    ): Promise<{ field: ClickUpCustomField }> {
      return this.request<{ field: ClickUpCustomField }>(
        `/task/${customId}/field/${customFieldId}?custom_task_ids=true&team_id=${this.workspaceId}`,
        {
          method: "POST",
          body: JSON.stringify({ value }),
        }
      );
    }

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/Leanware-io/clickup-mcp-server'

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