Skip to main content
Glama

collections_items_list_items

Retrieve CMS collection items with filtering, sorting, and pagination options to manage content efficiently.

Instructions

List items in a CMS collection with optional filtering and sorting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_idYesUnique identifier for the Collection.
cmsLocaleIdNoUnique identifier for the locale of the CMS Item.
limitNoMaximum number of records to be returned (max limit: 100)
offsetNoOffset used for pagination if the results have more than limit records.
nameNoName of the field.
slugNoURL structure of the Item in your site. Note: Updates to an item slug will break all links referencing the old slug.
sortByNoField to sort the items by. Allowed values: lastPublished, name, slug.
sortOrderNoOrder to sort the items by. Allowed values: asc, desc.

Implementation Reference

  • Registers the 'collections_items_list_items' MCP tool, defining its input schema, title, description, and handler function.
    server.registerTool( "collections_items_list_items", { title: "List Collection Items", description: "List items in a CMS collection with optional filtering and sorting.", inputSchema: z.object({ collection_id: z .string() .describe("Unique identifier for the Collection."), cmsLocaleId: z .string() .optional() .describe("Unique identifier for the locale of the CMS Item."), limit: z .number() .optional() .describe( "Maximum number of records to be returned (max limit: 100)" ), offset: z .number() .optional() .describe( "Offset used for pagination if the results have more than limit records." ), name: z.string().optional().describe("Name of the field."), slug: z .string() .optional() .describe( "URL structure of the Item in your site. Note: Updates to an item slug will break all links referencing the old slug." ), sortBy: WebflowCollectionsItemsListItemsRequestSortBySchema, sortOrder: WebflowCollectionsItemsListItemsRequestSortOrderSchema, }), }, async ({ collection_id, cmsLocaleId, offset, limit, name, slug, sortBy, sortOrder, }) => { try { const response = await getClient().collections.items.listItems( collection_id, { cmsLocaleId, offset, limit, name, slug, sortBy, sortOrder, }, requestOptions ); return formatResponse(response); } catch (error) { return formatErrorResponse(error); } } );
  • The handler function that invokes the Webflow API to list items in a collection with provided filters, sorting, and pagination.
    async ({ collection_id, cmsLocaleId, offset, limit, name, slug, sortBy, sortOrder, }) => { try { const response = await getClient().collections.items.listItems( collection_id, { cmsLocaleId, offset, limit, name, slug, sortBy, sortOrder, }, requestOptions ); return formatResponse(response); } catch (error) { return formatErrorResponse(error); } }
  • Zod schema defining the allowed sort order values ('asc', 'desc') for the tool input.
    export const WebflowCollectionsItemsListItemsRequestSortOrderSchema = z .enum(["asc", "desc"]) .optional() .describe("Order to sort the items by. Allowed values: asc, desc.");
  • Zod schema defining the allowed sort by fields ('lastPublished', 'name', 'slug') for the tool input.
    export const WebflowCollectionsItemsListItemsRequestSortBySchema = z .enum(["lastPublished", "name", "slug"]) .optional() .describe( "Field to sort the items by. Allowed values: lastPublished, name, slug." );

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/webflow/mcp-server'

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