Skip to main content
Glama
cobanov

teslamate-mcp

get_all_charging_sessions_summary

Retrieve comprehensive charging session summaries for Tesla vehicles, including total sessions, energy consumption, and cost statistics from TeslaMate data.

Instructions

Get the summary of all charging sessions for each car. Returns charging statistics including total sessions, energy consumed, and costs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Defines the tool's metadata: name, description, and the SQL file containing the query logic for get_all_charging_sessions_summary.
    ToolDefinition(
        name="get_all_charging_sessions_summary",
        description="Get the summary of all charging sessions for each car. Returns charging statistics including total sessions, energy consumed, and costs.",
        sql_file="all_charging_sessions_summary.sql",
    ),
  • main.py:31-39 (registration)
    Registers the handler for get_all_charging_sessions_summary (via loop over TOOL_DEFINITIONS) with the FastMCP server for local/STDIO transport.
    # 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 associated SQL query synchronously.
    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 execution logic: reads SQL from file and executes the query on the TeslaMate database, returning results.
    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:178-186 (registration)
    Registers get_all_charging_sessions_summary in the list_tools() method for the remote/HTTP MCP server.
    # 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": {}},
            )
        )
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the return content (charging statistics) but lacks details on permissions, rate limits, data freshness, or error handling. For a tool with no annotations, this is a significant gap in transparency, though it does specify what data is returned.

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

Conciseness5/5

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

The description is highly concise and front-loaded, consisting of two sentences that directly state the purpose and return value without any fluff. Every sentence earns its place by providing essential information efficiently, making it easy for an agent to parse quickly.

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 relatively complete. It explains what the tool does and what it returns, which is sufficient for a simple read operation. However, it could improve by adding more behavioral context, such as data scope or limitations, to fully compensate for the lack of annotations.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate, but it could have mentioned any implicit filters or defaults. Since there are no parameters, a baseline of 4 is applied, as the description doesn't need to compensate for schema gaps.

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 summary of all charging sessions for each car' specifies the verb (get) and resource (charging sessions summary), and distinguishes it from siblings like get_charging_by_location or get_daily_battery_usage_patterns. However, it doesn't explicitly differentiate from all siblings, such as get_total_distance_and_efficiency, which might also involve summaries.

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 any prerequisites, exclusions, or specific contexts, such as comparing it to get_charging_by_location for location-based data or get_daily_battery_usage_patterns for time-based insights. This leaves the agent without clear usage instructions.

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