search_blogs
Search for blogs by title to find relevant content from the MCP Blog API service.
Instructions
Search for blogs by title using the mock API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Implementation Reference
- main.py:22-26 (handler)The handler function for the 'search_blogs' tool, decorated with @mcp.tool() which also serves as registration. It fetches blogs matching the provided query string from the mock API via HTTP GET request with 'title' parameter and returns the JSON response.@mcp.tool() def search_blogs(query: str): """Search for blogs by title using the mock API.""" response = httpx.get(mock_api_url, params={'title': query}) return response.json()