Skip to main content
Glama
cobanov

teslamate-mcp

get_current_car_status

Retrieve real-time vehicle status including location, battery level, and state for each car from your TeslaMate database.

Instructions

Get the current car status for each car. Returns real-time vehicle status including location, battery level, and state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • src/tools.py:47-51 (registration)
    Registration of the 'get_current_car_status' tool in the TOOL_DEFINITIONS list, specifying its name, description, and the SQL file containing the query logic.
    ToolDefinition(
        name="get_current_car_status",
        description="Get the current car status for each car. Returns real-time vehicle status including location, battery level, and state.",
        sql_file="current_car_status.sql",
    ),
  • main.py:22-29 (handler)
    Factory that creates the handler function for 'get_current_car_status', which executes the associated SQL query 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 registers the handler for 'get_current_car_status' (and all tools) with the MCP server using the tool decorator.
    # 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)
  • Handler for executing predefined tools including 'get_current_car_status' in the remote HTTP server by retrieving the tool definition and running its 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
        )
  • Core helper function that implements the tool logic by reading the SQL file and executing the query on the 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()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'real-time vehicle status' and lists data types (location, battery level, state), but doesn't disclose behavioral traits like rate limits, authentication needs, data freshness, or whether it returns all cars or requires filtering. For a tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the core purpose, and the second adds key details about return values. Both sentences earn their place by clarifying scope and data types. It could be slightly more structured by explicitly separating purpose from output details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 0 parameters, 100% schema coverage, and an output schema exists, the description is reasonably complete. It explains what the tool does and hints at return values, though it could better address behavioral aspects like real-time constraints. The output schema likely covers return details, reducing the need for extensive description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add parameter semantics beyond the schema, but with no parameters, a baseline score of 4 is appropriate as there's nothing to compensate for.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get the current car status for each car' specifies the verb (get) and resource (car status). It distinguishes from siblings by focusing on real-time status rather than historical summaries or specific metrics like battery degradation or charging sessions. However, it doesn't explicitly contrast with 'get_basic_car_information', which might overlap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, timing considerations (e.g., real-time vs. cached data), or compare to siblings like 'get_basic_car_information' or 'get_total_distance_and_efficiency'. Usage is implied by the real-time focus but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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