search_books_by_title
Find books in the Bookstore MCP Server by entering a title query to locate specific publications from the inventory.
Instructions
Search books by title.
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_query": "<title_query>"
},
"name": "search_books_by_title"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title_query | Yes |
Implementation Reference
- src/bookstore_mcp/server.py:40-44 (handler)The main handler function for the 'search_books_by_title' MCP tool. It uses a @mcp.tool() decorator for registration and schema inference from type hints and docstring. Filters books by title substring match (case-insensitive).
@mcp.tool() def search_books_by_title(title_query: str): """Search books by title.""" books = load_books() return [book for book in books if title_query.lower() in book["title"].lower()]