clickup_get_list_custom_fields
Retrieve all custom fields available for a ClickUp list to configure and manage task attributes programmatically.
Instructions
Get all accessible custom fields for a list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | ClickUp list ID |
Implementation Reference
- Defines the MCP tool 'clickup_get_list_custom_fields' including its input schema, description, and handler function that calls the CustomFieldService to fetch custom fields for a given list ID and returns the JSON response.const getListCustomFieldsTool = defineTool((z) => ({ name: "clickup_get_list_custom_fields", description: "Get all accessible custom fields for a list", inputSchema: { list_id: z.string().describe("ClickUp list ID"), }, handler: async (input) => { const { list_id } = input; const response = await customFieldService.getListCustomFields(list_id); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }, }));
- The core helper method in CustomFieldService that makes the API request to ClickUp's /list/{listId}/field endpoint to retrieve custom fields.async getListCustomFields( listId: string ): Promise<{ fields: ClickUpCustomField[] }> { return this.request<{ fields: ClickUpCustomField[] }>( `/list/${listId}/field` ); }
- src/index.ts:89-91 (registration)Registers all tools, including 'clickup_get_list_custom_fields', with the MCP server by iterating over the tools array and calling server.tool() for each.tools.forEach((tool) => { server.tool(tool.name, tool.description, tool.inputSchema, tool.handler); });
- src/index.ts:22-26 (registration)Imports the getListCustomFieldsTool from the custom-field controller to include it in the MCP tools list.import { getListCustomFieldsTool, setCustomFieldValueTool, setCustomFieldValueByCustomIdTool, } from "./controllers/custom-field.controller";
- Input schema definition for the tool, specifying the required 'list_id' parameter.inputSchema: { list_id: z.string().describe("ClickUp list ID"), },