-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathautomotive.py
More file actions
37 lines (28 loc) · 1.11 KB
/
automotive.py
File metadata and controls
37 lines (28 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""Automotive tools."""
# MCP tool names and parameter names intentionally mirror the public API.
# pylint: disable=invalid-name,redefined-builtin
import logging
from typing import Any
from fastmcp import Context # pylint: disable=import-error
from ..mcp_core import make_api_call, mcp
from ..memory_store import OPENAPI_HOST_PREFIX
logger = logging.getLogger(__name__)
logger.debug("module loaded")
@mcp.tool
async def check_license_plate(
countryCode: str, type: str, licensePlate: str, ctx: Context
) -> Any:
"""Retrieve vehicle data for a supported country and plate.
Available combinations:
IT-car, IT-bike, IT-insurance, FR-car, FR-bike, UK-car, UK-bike,
UK-mot, PT-car, PT-insurance, ES-car, ES-bike.
Args:
countryCode: required, 2 digit country code (IT|FR|UK|DE|PT|ES)
type: required, type of information needed (car|bike|insurance|mot)
licensePlate: required, the license plate to check
"""
url = (
f"https://{OPENAPI_HOST_PREFIX}automotive.openapi.com/"
f"{countryCode}-{type}/{licensePlate}"
)
return make_api_call(ctx, "GET", url)