Skip to main content
Glama
cobanov

teslamate-mcp

get_most_visited_locations

Retrieve frequently visited locations for Tesla vehicles, showing visit counts and durations to analyze driving patterns.

Instructions

Get the most visited locations for each car. Shows frequently visited places with visit counts and durations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:22-28 (handler)
    Factory that dynamically creates the handler function for the "get_most_visited_locations" tool (and others), which executes the SQL query from the specified file 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
  • src/tools.py:82-86 (registration)
    ToolDefinition that provides the name, description, and SQL file path for the "get_most_visited_locations" tool, used during dynamic registration.
    ToolDefinition(
        name="get_most_visited_locations",
        description="Get the most visited locations for each car. Shows frequently visited places with visit counts and durations.",
        sql_file="most_visited_locations.sql",
    ),
  • main.py:32-39 (registration)
    Dynamic registration code that instantiates the handler for "get_most_visited_locations" using its ToolDefinition and registers it with the FastMCP server.
    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)
  • Defines the input schema (empty object, no parameters) for the "get_most_visited_locations" tool (and other predefined tools) in the list_tools implementation for HTTP server.
    for tool_def in TOOL_DEFINITIONS:
        tools.append(
            types.Tool(
                name=tool_def.name,
                description=tool_def.description,
                inputSchema={"type": "object", "properties": {}},
            )
        )
  • Helper method invoked by the tool handler to load the SQL from "most_visited_locations.sql" and execute it against 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 for behavioral disclosure. It mentions output content ('frequently visited places with visit counts and durations') but doesn't cover critical aspects like whether this requires authentication, rate limits, data freshness, or how 'most visited' is calculated (e.g., time range, threshold). For a tool with no annotation coverage, this leaves significant gaps.

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 two concise sentences that efficiently convey the core functionality and output details. Every word earns its place: the first sentence states the purpose, and the second elaborates on the output format. No wasted text or redundancy.

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 zero parameters, 100% schema coverage, and an output schema exists, the description doesn't need to explain parameters or return values. However, as a data retrieval tool with no annotations, it should ideally mention behavioral aspects like authentication needs or data scope (e.g., time range). The description is minimally adequate but lacks context for safe, effective use.

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, and schema description coverage is 100%, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing instead on what the tool returns. A baseline of 4 is applied for zero-parameter tools when the schema is fully descriptive.

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 most visited locations for each car' specifies the verb (get) and resource (most visited locations per car). It distinguishes from siblings by focusing on location visitation patterns rather than charging, efficiency, or other metrics. However, it doesn't explicitly differentiate from potential location-related siblings like 'get_charging_by_location'.

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, or compare to sibling tools that might overlap in scope (like 'get_charging_by_location' for location data). The agent must infer usage from the purpose alone.

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