get_contentful_posts
Fetch blog posts from Contentful CMS to extract content and generate AI-powered summaries for analysis.
Instructions
Fetch posts directly from Contentful CMS (if configured)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Implementation Reference
- src/v2_ai_mcp/main.py:43-58 (handler)Actual implementation logic for fetching Contentful posts.
def _get_contentful_posts(limit: int = 10): """Fetch posts directly from Contentful (if configured)""" if not os.getenv("CONTENTFUL_SPACE_ID") or not os.getenv("CONTENTFUL_ACCESS_TOKEN"): return { "error": "Contentful not configured. Set CONTENTFUL_SPACE_ID and CONTENTFUL_ACCESS_TOKEN environment variables." } try: from .contentful_client import fetch_contentful_posts return fetch_contentful_posts( content_type=os.getenv("CONTENTFUL_CONTENT_TYPE", "blogPost"), limit=limit ) except Exception as e: return {"error": f"Error fetching from Contentful: {str(e)}"} - src/v2_ai_mcp/main.py:99-102 (registration)Registration of the 'get_contentful_posts' tool via FastMCP.
@mcp.tool() def get_contentful_posts(limit: int = 10): """Fetch posts directly from Contentful CMS (if configured)""" return _get_contentful_posts(limit)