get_tire_pressure_weekly_trends
Monitor weekly tire pressure trends to track changes and patterns for each vehicle, helping identify potential issues or maintenance needs.
Instructions
Get the tire pressure weekly trends for each car. Monitors tire pressure changes and patterns by week.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:22-29 (handler)Factory function that creates the core handler logic for the get_tire_pressure_weekly_trends tool (and all others), which reads the SQL file and executes it synchronously using the DatabaseManager.def create_tool_handler(sql_file: str): """Factory function to create tool handlers""" def handler() -> List[Dict[str, Any]]: return db_manager.execute_query_sync(sql_file) return handler
- main.py:32-38 (registration)Registration loop that dynamically creates and registers the handler for get_tire_pressure_weekly_trends (and all predefined tools) with the FastMCP server.for tool_def in TOOL_DEFINITIONS: tool_func = create_tool_handler(tool_def.sql_file) tool_func.__doc__ = tool_def.description tool_func.__name__ = tool_def.name # Register the tool with the MCP server mcp.tool()(tool_func)
- src/tools.py:92-96 (registration)ToolDefinition registration for get_tire_pressure_weekly_trends, specifying the name, description, and SQL query file.ToolDefinition( name="get_tire_pressure_weekly_trends", description="Get the tire pressure weekly trends for each car. Monitors tire pressure changes and patterns by week.", sql_file="tire_pressure_weekly_trend.sql", ),
- main_remote.py:118-127 (handler)Async handler function for executing predefined tools like get_tire_pressure_weekly_trends in the remote HTTP MCP server, using get_tool_by_name to fetch the SQL file and execute asynchronously.async def execute_predefined_tool(tool_name: str) -> List[Dict[str, Any]]: """Execute a predefined tool by name""" if not app_context: raise RuntimeError("Application context not initialized") tool = get_tool_by_name(tool_name) return await app_context.db_manager.execute_query_async( tool.sql_file, app_context.db_pool )
- main_remote.py:178-185 (schema)Registration and schema definition loop for list_tools() in remote server, defining empty input schema for get_tire_pressure_weekly_trends (no parameters required).# Add all predefined tools for tool_def in TOOL_DEFINITIONS: tools.append( types.Tool( name=tool_def.name, description=tool_def.description, inputSchema={"type": "object", "properties": {}}, )