Skip to main content
Glama
cobanov

teslamate-mcp

get_unusual_power_consumption

Identify anomalies in vehicle power consumption to detect potential issues by analyzing TeslaMate data for unusual usage patterns.

Instructions

Get the unusual power consumption for each car. Identifies anomalies in power usage that might indicate issues.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:22-28 (handler)
    Factory function that creates the core handler for the tool. The inner 'handler' function executes the SQL query from 'unusual_power_consumption.sql' using the database manager 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
  • main.py:32-38 (registration)
    Registers the handler for 'get_unusual_power_consumption' (and all tools) with the FastMCP server using stdio transport by dynamically creating and decorating the tool function.
    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)
  • src/tools.py:102-106 (registration)
    ToolDefinition entry that registers 'get_unusual_power_consumption' with its description and the SQL file containing the query logic.
    ToolDefinition(
        name="get_unusual_power_consumption",
        description="Get the unusual power consumption for each car. Identifies anomalies in power usage that might indicate issues.",
        sql_file="unusual_power_consumption.sql",
    ),
  • Async handler function for predefined tools including 'get_unusual_power_consumption' in the remote HTTP MCP server. Retrieves the tool definition and executes the 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
        )
  • Defines the input schema (empty object, parameterless tool) and registers the tool description in the list_tools endpoint for the remote 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 states the tool 'Get[s]' data and identifies anomalies, implying a read-only operation, but doesn't clarify aspects like whether it requires authentication, how anomalies are defined (e.g., thresholds, algorithms), rate limits, or what 'unusual' means contextually. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 clear sentences that directly state the tool's function and added value (anomaly identification). Every word earns its place without redundancy or fluff, 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.

Completeness3/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 (so return values are documented elsewhere), the description is minimally adequate. It explains what the tool does but lacks details on behavioral traits (e.g., how anomalies are detected) and usage context. For a diagnostic tool with no annotations, it should provide more guidance on interpretation or limitations to be fully complete.

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 there's no need for parameter documentation in the description. The description appropriately avoids discussing parameters, focusing instead on the tool's purpose. A baseline of 4 is applied as it doesn't add unnecessary param info, but it doesn't reach 5 since it doesn't enhance schema understanding (which is already complete).

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 with a specific verb ('Get') and resource ('unusual power consumption for each car'), and adds context about identifying anomalies. It distinguishes itself from siblings by focusing on power consumption anomalies rather than summaries, averages, or other metrics. However, it doesn't explicitly differentiate from all possible siblings (e.g., 'get_battery_health_summary' might overlap in detecting issues).

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 identifying anomalies 'that might indicate issues,' which implies a diagnostic context, but doesn't specify prerequisites, timing, or compare it to other tools like 'get_battery_health_summary' or 'get_current_car_status' that might also flag problems. Without explicit when-to-use or when-not-to-use instructions, the agent must infer usage.

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