Skip to main content
Glama
cobanov

teslamate-mcp

get_charging_by_location

Analyze Tesla vehicle charging patterns and statistics grouped by location to understand charging behavior and optimize energy usage.

Instructions

Get the charging by location for each car. Shows charging patterns and statistics grouped by location.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • ToolDefinition specifying the name, description, and SQL query file for the get_charging_by_location tool.
    ToolDefinition(
        name="get_charging_by_location",
        description="Get the charging by location for each car. Shows charging patterns and statistics grouped by location.",
        sql_file="charging_by_location.sql",
    ),
  • main.py:22-28 (handler)
    Factory function that creates the anonymous handler executed when the tool is called, which runs the SQL query corresponding to the tool.
    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 handler function for get_charging_by_location (and all tools) with the FastMCP server using mcp.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)
  • Core helper method invoked by the tool handler to load and execute the SQL query from 'charging_by_location.sql' file and return results as list of dicts.
    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?

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool returns ('charging patterns and statistics grouped by location') but doesn't disclose whether this is a read-only operation, whether it requires authentication, rate limits, data freshness, or error conditions. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 concise with two sentences that each add value. The first sentence states the core purpose, and the second adds context about what's shown. There's no wasted verbiage or repetition. However, it could be slightly more front-loaded by combining the two ideas more tightly.

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

Completeness3/5

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

Given that the tool has no parameters, has an output schema (which handles return values), and relatively simple functionality, the description is reasonably complete. It explains what data is retrieved and how it's organized. However, for a tool with no annotations, it should ideally provide more behavioral context about the operation's characteristics and limitations.

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 zero parameters with 100% schema description coverage, so the baseline is 4. The description doesn't need to explain parameters since none exist, and it appropriately focuses on what the tool returns rather than parameter semantics.

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 charging by location for each car' specifies the verb (get) and resource (charging by location). It distinguishes from siblings by focusing on location-based charging patterns rather than summaries, efficiency, or other metrics. However, it doesn't explicitly differentiate from 'get_most_visited_locations' which might overlap conceptually.

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 mentions 'Shows charging patterns and statistics grouped by location' but doesn't indicate when this is preferable to other charging-related tools like 'get_all_charging_sessions_summary' or location-related tools like 'get_most_visited_locations'. No explicit when/when-not statements or alternative recommendations are provided.

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