We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dshanklin-bv/mcp-pizza'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
"""
MCP tool handlers for store operations
"""
from mcp.types import TextContent
from mcpizza.models.params import StoreSearchParams, StoreInfoParams
from mcpizza.services import store_service
from mcpizza.logger import interaction_logger
async def handle_find_stores(params: StoreSearchParams) -> list[TextContent]:
"""Find nearby Domino's stores"""
try:
stores = store_service.find_stores(params.query)
if not stores:
return [TextContent(
type="text",
text=f"No stores found near '{params.query}'"
)]
result = f"π Found {len(stores)} store(s) near '{params.query}':\n\n"
for store in stores:
status = "β
OPEN" if store['is_open'] else "β CLOSED"
result += f"**Store #{store['id']}** {status}\n"
result += f" π {store['address']}\n"
result += f" π {store['phone']}\n\n"
return [TextContent(type="text", text=result)]
except Exception as e:
return [TextContent(
type="text",
text=f"Error finding stores: {str(e)}"
)]
async def handle_get_store_info(params: StoreInfoParams) -> list[TextContent]:
"""Get detailed store information"""
try:
info = store_service.get_store_info(params.store_id)
result = f"πͺ Store #{info['id']} Details:\n\n"
result += f"π Address: {info['address']}\n"
result += f"π Phone: {info['phone']}\n"
result += f"π Hours: {info['hours']}\n"
result += f"Status: {'β
OPEN' if info['is_open'] else 'β CLOSED'}\n"
result += f"Delivery: {'β
Available' if info['is_delivery_store'] else 'β Carryout only'}\n"
return [TextContent(type="text", text=result)]
except Exception as e:
return [TextContent(
type="text",
text=f"Error getting store info: {str(e)}"
)]