Skip to main content
Glama
cobanov

teslamate-mcp

get_battery_health_summary

Retrieve battery health status and statistics for Tesla vehicles from TeslaMate data, enabling monitoring of battery condition and performance metrics.

Instructions

Get the battery health summary for each car. Provides current battery health status and statistics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • main.py:22-28 (handler)
    Factory that creates the handler function for the tool, which executes the associated SQL query ('battery_health_summary.sql') synchronously using the database manager.
    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:31-39 (registration)
    Dynamically creates and registers the tool handler for 'get_battery_health_summary' (and others) with the FastMCP server.
    # Register all tools from definitions 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:37-41 (registration)
    ToolDefinition that registers 'get_battery_health_summary' with its description and SQL file path.
    ToolDefinition( name="get_battery_health_summary", description="Get the battery health summary for each car. Provides current battery health status and statistics.", sql_file="battery_health_summary.sql", ),
  • Handler function for predefined tools in the remote HTTP server, which loads the ToolDefinition and executes the SQL query 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 )
  • Defines the input schema (empty object, no parameters) and registers the tool in the list_tools() for the remote server.
    for tool_def in TOOL_DEFINITIONS: tools.append( types.Tool( name=tool_def.name, description=tool_def.description, inputSchema={"type": "object", "properties": {}}, ) )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cobanov/teslamate-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server