Skip to content
Open
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 @@ -217,9 +217,11 @@ collection - fields - update; // Update a custom field
collections - items - create - item - live; // Create items
collections - items - update - items - live; // Update items
collections - items - list - items; // List collection items
collections - items - get - item; // Get a specific collection item
collections - items - create - item; // Create collection items (staged)
collections - items - update - items; // Update collection items (staged)
collections - items - publish - items; // Publish collection items
collections - items - delete - item; // Delete a collection item
```

### Custom Code
Expand Down
33 changes: 33 additions & 0 deletions src/tools/cms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,39 @@ export function registerCmsTools(
}
);

// GET https://api.webflow.com/v2/collections/:collection_id/items/:item_id
server.tool(
"collections_items_get_item",
"Get a specific item from a CMS collection by its ID.",
{
collection_id: z
.string()
.describe("Unique identifier for the Collection."),
item_id: z
.string()
.describe("Unique identifier for the Item."),
cmsLocaleId: z
.string()
.optional()
.describe("Unique identifier for the locale of the CMS Item."),
},
async ({ collection_id, item_id, cmsLocaleId }) => {
try {
const response = await getClient().collections.items.getItem(
collection_id,
item_id,
{
cmsLocaleId,
},
requestOptions
);
return formatResponse(response);
} catch (error) {
return formatErrorResponse(error);
}
}
);

// POST https://api.webflow.com/v2/collections/:collection_id/items
server.tool(
"collections_items_create_item",
Expand Down