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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"title": "<title>",
"body": "<body>"
},
"name": "add_blog"
}
}Input 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()