Skip to main content
Glama
cobanov

teslamate-mcp

get_software_update_history

Retrieve detailed software update history for Tesla vehicles connected to the teslamate-mcp server. Track updates, versions, and timestamps for comprehensive vehicle maintenance and performance analysis.

Instructions

Get the software update history for each car.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool definition including name, description, and path to the SQL file containing the query logic.
    ToolDefinition( name="get_software_update_history", description="Get the software update history for each car. Tracks firmware updates and version changes over time.", sql_file="software_update_history.sql", ),
  • main.py:31-39 (registration)
    Dynamically creates and registers the tool handler for 'get_software_update_history' (and all tools) with the MCP server using FastMCP.
    # 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)
  • main.py:22-28 (handler)
    Factory function that creates the specific handler for the tool, which executes the SQL query from the tool's sql_file.
    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
  • Core handler logic: loads SQL from file and executes the query on the TeslaMate database.
    def execute_query_sync(self, sql_file_path: str) -> List[Dict[str, Any]]: """Execute SQL query synchronously""" sql_query = self.read_sql_file(sql_file_path) with psycopg.connect(self.connection_string, row_factory=dict_row) as conn: with conn.cursor() as cur: cur.execute(sql_query) return cur.fetchall()
  • main_remote.py:179-186 (registration)
    Registers the tool schema in the list_tools method for the remote HTTP MCP 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