Tools Reference β
Complete reference for all Cosmic MCP tools with examples and use cases.
π¦ Object Tools β
list_objects
β
Lists objects from your Cosmic bucket with filtering and pagination.
Parameters:
type_slug
(optional): Filter by object type (e.g., "posts", "pages")limit
(optional): Maximum objects to return (default: 100, max: 1000)skip
(optional): Number of objects to skip for pagination (default: 0)sort
(optional): Sort field and direction (default: "-created_at")status
(optional): Filter by status ("published", "draft", "any")locale
(optional): Filter by locale code
Examples:
// Get all published blog posts
{
"type_slug": "posts",
"status": "published",
"limit": 10
}
// Get draft pages for review
{
"type_slug": "pages",
"status": "draft",
"sort": "modified_at"
}
// Paginate through all content
{
"limit": 50,
"skip": 100,
"sort": "-created_at"
}
AI Prompt Examples:
- "List the 5 most recent published blog posts"
- "Show me all draft content that needs review"
- "Get all pages sorted by title alphabetically"
get_object
β
Retrieves a specific object by ID or slug.
Parameters:
id
(optional): Object ID to retrieveslug
(optional): Object slug to retrievetype_slug
(required with slug): Object type when using sluglocale
(optional): Locale code to retrieve
Examples:
// Get by ID
{
"id": "64f8a123b456c789"
}
// Get by slug
{
"slug": "my-first-post",
"type_slug": "posts"
}
// Get localized content
{
"slug": "about-us",
"type_slug": "pages",
"locale": "es"
}
AI Prompt Examples:
- "Get the blog post with slug 'getting-started-guide'"
- "Show me the about page content"
- "Find the product with ID '64f8a123b456c789'"
create_object
β
Creates a new object in your Cosmic bucket.
Parameters:
title
(required): Object titletype_slug
(required): Object type slugslug
(optional): Custom slug (auto-generated if not provided)content
(optional): Object content (HTML or Markdown)status
(optional): Object status ("published" or "draft", default: "draft")metadata
(optional): Custom fields objectlocale
(optional): Locale code
Examples:
// Create a blog post
{
"title": "Getting Started with Cosmic CMS",
"type_slug": "posts",
"content": "<h1>Welcome to Cosmic!</h1><p>This is my first post...</p>",
"status": "published",
"metadata": {
"seo_title": "Getting Started Guide",
"meta_description": "Learn how to use Cosmic CMS",
"tags": ["tutorial", "cosmic", "cms"],
"featured_image": "https://cosmic-s3.imgix.net/image.jpg",
"author": "John Doe"
}
}
// Create a product page
{
"title": "Wireless Headphones Pro",
"type_slug": "products",
"slug": "wireless-headphones-pro",
"status": "draft",
"metadata": {
"price": 199.99,
"category": "Electronics",
"description": "Premium wireless headphones with noise cancellation",
"features": ["Noise Cancellation", "30hr Battery", "Quick Charge"],
"in_stock": true
}
}
AI Prompt Examples:
- "Create a new blog post about React best practices"
- "Draft a product page for our new laptop model"
- "Make a landing page for our AI consulting service"
update_object
β
Updates an existing object in your Cosmic bucket.
Parameters:
id
(optional): Object ID to updateslug
(optional): Object slug to updatetype_slug
(required with slug): Object type when using slugtitle
(optional): Updated titlecontent
(optional): Updated contentstatus
(optional): Updated statusmetadata
(optional): Updated metadatalocale
(optional): Locale code
Examples:
// Update content and publish
{
"slug": "my-draft-post",
"type_slug": "posts",
"content": "<h1>Updated Content</h1><p>This post has been revised...</p>",
"status": "published"
}
// Update metadata only
{
"id": "64f8a123b456c789",
"metadata": {
"tags": ["updated", "featured"],
"last_modified": "2024-01-15"
}
}
AI Prompt Examples:
- "Update the 'about-us' page to include our new team members"
- "Change the status of all draft posts to published"
- "Add SEO metadata to the 'react-tutorial' blog post"
delete_object
β
Deletes an object from your Cosmic bucket.
Parameters:
id
(optional): Object ID to deleteslug
(optional): Object slug to deletetype_slug
(required with slug): Object type when using slug
Examples:
// Delete by ID
{
"id": "64f8a123b456c789"
}
// Delete by slug
{
"slug": "old-post",
"type_slug": "posts"
}
AI Prompt Examples:
- "Delete the blog post with slug 'outdated-tutorial'"
- "Remove all test content from my bucket"
- "Delete the product page for discontinued items"
search_objects
β
Searches objects using text search across content and metadata.
Parameters:
query
(required): Search query texttype_slug
(optional): Limit search to specific object typelimit
(optional): Maximum results (default: 100, max: 1000)locale
(optional): Search within specific locale
Examples:
// Search all content
{
"query": "artificial intelligence machine learning",
"limit": 20
}
// Search specific content type
{
"query": "React tutorial",
"type_slug": "posts",
"limit": 10
}
// Search with locale
{
"query": "productos tecnologΓa",
"type_slug": "products",
"locale": "es"
}
AI Prompt Examples:
- "Search for all content about 'JavaScript frameworks'"
- "Find blog posts mentioning 'Next.js' or 'React'"
- "Search products containing 'wireless' or 'bluetooth'"
π Object Type Tools β
list_object_types
β
Lists all object types (content types) in your Cosmic bucket.
Parameters: None
Examples:
{}
AI Prompt Examples:
- "Show me all content types in my bucket"
- "What types of content can I create?"
- "List all available object types"
πΌοΈ Media Tools β
upload_media
β
Uploads media files to your Cosmic bucket.
Parameters:
file_data
(required): Base64 encoded file datafilename
(required): Name of the file including extensionfolder
(optional): Folder path to upload to
Examples:
{
"file_data": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...",
"filename": "hero-image.jpg",
"folder": "blog-images"
}
AI Prompt Examples:
- "Upload this image to the 'hero-images' folder"
- "Save this logo file to the media library"
- "Upload screenshots to the 'documentation' folder"
list_media
β
Lists media files in your Cosmic bucket.
Parameters:
limit
(optional): Maximum media items to return (default: 100, max: 1000)skip
(optional): Number of items to skip for pagination (default: 0)folder
(optional): Filter by folder path
Examples:
// List all media
{
"limit": 50
}
// List media in specific folder
{
"folder": "blog-images",
"limit": 20
}
// Paginate through media
{
"limit": 25,
"skip": 50
}
AI Prompt Examples:
- "Show me all images in the media library"
- "List files in the 'products' folder"
- "Get all media files uploaded this month"
delete_media
β
Deletes a media file from your Cosmic bucket.
Parameters:
id
(required): Media file ID to delete
Examples:
{
"id": "64f8a123b456c789"
}
AI Prompt Examples:
- "Delete the unused hero image from last month"
- "Remove all test images from the media library"
- "Clean up old product photos"
π― Common Use Cases β
Content Management Workflow β
Content Planning
"List all content types β Create content calendar β Draft new posts"
Content Creation
"Create draft β Add content β Upload media β Update with media β Publish"
Content Maintenance
"Search old content β Update outdated info β Optimize SEO β Republish"
E-commerce Setup β
Product Catalog
"Create product type β Add products β Upload product images β Set up categories"
Content Marketing
"Create blog posts β Add product references β Upload lifestyle images"
Multi-language Sites β
- Content Localization
"Create content in default locale β Translate β Create localized versions"
π§ Advanced Tips β
Batch Operations β
Use AI prompts to perform operations on multiple objects:
- "Update all draft posts to add review tags"
- "Delete all test content"
- "Publish all reviewed articles"
Content Analysis β
Leverage AI to analyze your content:
- "Analyze my content themes and suggest new topics"
- "Review SEO metadata across all posts"
- "Identify content gaps in my blog"
Workflow Automation β
Create content workflows:
- "Set up a weekly content review process"
- "Create a content approval workflow"
- "Automate content publishing schedules"
π Related Documentation β
- AI Assistant Prompts - Example prompts for AI assistants
- MCP Client Setup - How to configure MCP clients
- Configuration - Server configuration options