Skip to content

Commit 247696f

Browse files
refactor: apply safe api lint cleanup
1 parent cd76bd5 commit 247696f

14 files changed

Lines changed: 535 additions & 265 deletions

File tree

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1+
"""Async status tools."""
2+
13
import logging
2-
logging.getLogger(__name__).debug("module loaded")
3-
from fastmcp import Context
44
from typing import Any
5+
6+
from fastmcp import Context # pylint: disable=import-error
7+
58
from ..mcp_core import mcp
69
from ..memory_store import get_callback_result
710

811
logger = logging.getLogger(__name__)
12+
logger.debug("module loaded")
13+
914

1015
@mcp.tool
1116
async def check_async_status(request_id: str, ctx: Context) -> Any:
1217
"""Show the last status of an async request
1318
Args:
1419
request_id: required, returned by an async downgraded request to the mcp server
1520
"""
21+
del ctx
1622
return get_callback_result(request_id)
Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,37 @@
1+
"""Automotive tools."""
2+
3+
# MCP tool names and parameter names intentionally mirror the public API.
4+
# pylint: disable=invalid-name,redefined-builtin
5+
16
import logging
2-
logging.getLogger(__name__).debug("module loaded")
3-
from fastmcp import Context
47
from typing import Any
8+
9+
from fastmcp import Context # pylint: disable=import-error
10+
511
from ..mcp_core import make_api_call, mcp
612
from ..memory_store import OPENAPI_HOST_PREFIX
713

814
logger = logging.getLogger(__name__)
15+
logger.debug("module loaded")
16+
917

1018
@mcp.tool
11-
async def check_license_plate(countryCode: str, type: str, licensePlate: str, ctx: Context) -> Any:
12-
"""Retrieve informations about type=car,bike,insurance,mot from a countryCode=IT,FR,UK,DE,PT,ES and a licensePlate.
13-
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
19+
async def check_license_plate(
20+
countryCode: str, type: str, licensePlate: str, ctx: Context
21+
) -> Any:
22+
"""Retrieve vehicle data for a supported country and plate.
23+
24+
Available combinations:
25+
IT-car, IT-bike, IT-insurance, FR-car, FR-bike, UK-car, UK-bike,
26+
UK-mot, PT-car, PT-insurance, ES-car, ES-bike.
27+
1428
Args:
1529
countryCode: required, 2 digit country code (IT|FR|UK|DE|PT|ES)
1630
type: required, type of information needed (car|bike|insurance|mot)
1731
licensePlate: required, the license plate to check
1832
"""
19-
url = f"https://{OPENAPI_HOST_PREFIX}automotive.openapi.com/{countryCode}-{type}/{licensePlate}"
33+
url = (
34+
f"https://{OPENAPI_HOST_PREFIX}automotive.openapi.com/"
35+
f"{countryCode}-{type}/{licensePlate}"
36+
)
2037
return make_api_call(ctx, "GET", url)

src/openapi_mcp_sdk/apis/cap.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
"""Italian postal code and municipality tools."""
2+
3+
# MCP tool names and parameter names intentionally mirror the public API.
4+
# pylint: disable=invalid-name
5+
16
import logging
2-
logging.getLogger(__name__).debug("module loaded")
3-
from fastmcp import Context
47
from typing import Any
8+
9+
from fastmcp import Context # pylint: disable=import-error
10+
511
from ..mcp_core import make_api_call, mcp
612
from ..memory_store import OPENAPI_HOST_PREFIX
713

814
logger = logging.getLogger(__name__)
15+
logger.debug("module loaded")
16+
917

1018
@mcp.tool
1119
async def get_IT_regions_list(ctx: Context) -> Any:
@@ -15,6 +23,7 @@ async def get_IT_regions_list(ctx: Context) -> Any:
1523
url = f"https://{OPENAPI_HOST_PREFIX}cap.openapi.it/regioni"
1624
return make_api_call(ctx, "GET", url)
1725

26+
1827
@mcp.tool
1928
async def get_IT_provinces_list(ctx: Context) -> Any:
2029
"""
@@ -23,6 +32,7 @@ async def get_IT_provinces_list(ctx: Context) -> Any:
2332
url = f"https://{OPENAPI_HOST_PREFIX}cap.openapi.it/province"
2433
return make_api_call(ctx, "GET", url)
2534

35+
2636
@mcp.tool
2737
async def get_IT_metropolitan_cities_list(ctx: Context) -> Any:
2838
"""
@@ -31,6 +41,7 @@ async def get_IT_metropolitan_cities_list(ctx: Context) -> Any:
3141
url = f"https://{OPENAPI_HOST_PREFIX}cap.openapi.it/citta_metropolitane"
3242
return make_api_call(ctx, "GET", url)
3343

44+
3445
@mcp.tool
3546
async def get_suppressed_italian_municipalities(ctx: Context) -> Any:
3647
"""
@@ -39,6 +50,7 @@ async def get_suppressed_italian_municipalities(ctx: Context) -> Any:
3950
url = f"https://{OPENAPI_HOST_PREFIX}cap.openapi.it/comuni_soppressi"
4051
return make_api_call(ctx, "GET", url)
4152

53+
4254
@mcp.tool
4355
async def find_IT_istat_by_comune_name(comune: str, ctx: Context) -> Any:
4456
"""
@@ -48,6 +60,7 @@ async def find_IT_istat_by_comune_name(comune: str, ctx: Context) -> Any:
4860
params = {"comune": comune}
4961
return make_api_call(ctx, "GET", url, params=params)
5062

63+
5164
@mcp.tool
5265
async def find_IT_municipality_by_istat(istatCode: str, ctx: Context) -> Any:
5366
"""
@@ -76,6 +89,7 @@ async def find_IT_municipality_by_istat(istatCode: str, ctx: Context) -> Any:
7689
url = f"https://{OPENAPI_HOST_PREFIX}cap.openapi.it/comuni_advance/{istatCode}"
7790
return make_api_call(ctx, "GET", url)
7891

92+
7993
@mcp.tool
8094
async def find_IT_municipalities_by_zip(zip_code: str, ctx: Context) -> Any:
8195
"""

0 commit comments

Comments
 (0)