add_blog
Create and publish new blog posts to the MCP Blog API by providing title and content.
Instructions
Add a new blog to the mock API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | ||
| body | Yes |
Implementation Reference
- main.py:28-32 (handler)The add_blog tool handler function, decorated with @mcp.tool(), which sends a POST request to add a new blog post with title and body to the mock API.@mcp.tool() def add_blog(title: str, body: str): """Add a new blog to the mock API.""" response = httpx.post(mock_api_url, json={'title': title, 'body': body}) return response.json()