add_blog
Create and publish new blog posts by submitting title and content to the MCP Blog API service.
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 handler function for the 'add_blog' tool. It uses the @mcp.tool() decorator for registration and implements the logic to POST a new blog (title and body) to the mock API endpoint, returning the JSON response.@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()