2222 SourcesFetcher ,
2323)
2424from dbt_mcp .discovery .param_descriptions import (
25+ DISCOVERY_PROJECT_ID_DESCRIPTION ,
2526 MACRO_INCLUDE_DEFAULT_DBT_PACKAGES ,
2627 MACRO_PACKAGE_NAMES ,
2728 MACRO_RETURN_PACKAGE_NAMES_ONLY ,
2829 MODEL_PERF_INCLUDE_TESTS ,
2930 MODEL_PERF_NUM_RUNS ,
30- PROJECT_ID_FIELD ,
3131 SOURCE_NAMES_FILTER ,
3232 SOURCE_UNIQUE_IDS_FILTER ,
3333)
@@ -123,7 +123,7 @@ def __init__(
123123)
124124async def get_mart_models (
125125 context : MultiProjectDiscoveryToolContext ,
126- project_id : int = PROJECT_ID_FIELD ,
126+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
127127) -> list [dict ]:
128128 config = await context .config_provider .get_config (project_id = project_id )
129129 mart_models = await context .models_fetcher .fetch_models (
@@ -142,7 +142,7 @@ async def get_mart_models(
142142)
143143async def get_all_models (
144144 context : MultiProjectDiscoveryToolContext ,
145- project_id : int = PROJECT_ID_FIELD ,
145+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
146146) -> list [dict ]:
147147 # TODO: push code into fetchers
148148 config = await context .config_provider .get_config (project_id = project_id )
@@ -158,7 +158,7 @@ async def get_all_models(
158158)
159159async def get_model_details (
160160 context : MultiProjectDiscoveryToolContext ,
161- project_id : int = PROJECT_ID_FIELD ,
161+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
162162 name : str | None = NAME_FIELD ,
163163 unique_id : str | None = UNIQUE_ID_FIELD ,
164164) -> list [dict ]:
@@ -180,7 +180,7 @@ async def get_model_details(
180180)
181181async def get_model_parents (
182182 context : MultiProjectDiscoveryToolContext ,
183- project_id : int = PROJECT_ID_FIELD ,
183+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
184184 name : str | None = NAME_FIELD ,
185185 unique_id : str | None = UNIQUE_ID_FIELD ,
186186) -> list [dict ]:
@@ -199,7 +199,7 @@ async def get_model_parents(
199199)
200200async def get_model_children (
201201 context : MultiProjectDiscoveryToolContext ,
202- project_id : int = PROJECT_ID_FIELD ,
202+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
203203 name : str | None = NAME_FIELD ,
204204 unique_id : str | None = UNIQUE_ID_FIELD ,
205205) -> list [dict ]:
@@ -218,7 +218,7 @@ async def get_model_children(
218218)
219219async def get_model_health (
220220 context : MultiProjectDiscoveryToolContext ,
221- project_id : int = PROJECT_ID_FIELD ,
221+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
222222 name : str | None = NAME_FIELD ,
223223 unique_id : str | None = UNIQUE_ID_FIELD ,
224224) -> list [dict ]:
@@ -239,7 +239,7 @@ async def get_model_health(
239239)
240240async def get_model_performance (
241241 context : MultiProjectDiscoveryToolContext ,
242- project_id : int = PROJECT_ID_FIELD ,
242+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
243243 name : str | None = NAME_FIELD ,
244244 unique_id : str | None = UNIQUE_ID_FIELD ,
245245 num_runs : int = Field (
@@ -272,7 +272,7 @@ async def get_model_performance(
272272)
273273async def get_lineage (
274274 context : MultiProjectDiscoveryToolContext ,
275- project_id : int = PROJECT_ID_FIELD ,
275+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
276276 unique_id : str = UNIQUE_ID_REQUIRED_FIELD ,
277277 types : list [LineageResourceType ] | None = TYPES_FIELD ,
278278 depth : int = DEPTH_FIELD ,
@@ -292,7 +292,7 @@ async def get_lineage(
292292)
293293async def get_exposures (
294294 context : MultiProjectDiscoveryToolContext ,
295- project_id : int = PROJECT_ID_FIELD ,
295+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
296296) -> list [dict ]:
297297 config = await context .config_provider .get_config (project_id = project_id )
298298 return await context .exposures_fetcher .fetch_exposures (config = config )
@@ -307,7 +307,7 @@ async def get_exposures(
307307)
308308async def get_exposure_details (
309309 context : MultiProjectDiscoveryToolContext ,
310- project_id : int = PROJECT_ID_FIELD ,
310+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
311311 name : str | None = NAME_FIELD ,
312312 unique_id : str | None = UNIQUE_ID_FIELD ,
313313) -> list [dict ]:
@@ -329,7 +329,7 @@ async def get_exposure_details(
329329)
330330async def get_all_sources (
331331 context : MultiProjectDiscoveryToolContext ,
332- project_id : int = PROJECT_ID_FIELD ,
332+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
333333 source_names : Annotated [
334334 list [str ] | None , Field (description = SOURCE_NAMES_FILTER )
335335 ] = None ,
@@ -352,7 +352,7 @@ async def get_all_sources(
352352)
353353async def get_source_details (
354354 context : MultiProjectDiscoveryToolContext ,
355- project_id : int = PROJECT_ID_FIELD ,
355+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
356356 name : str | None = NAME_FIELD ,
357357 unique_id : str | None = UNIQUE_ID_FIELD ,
358358) -> list [dict ]:
@@ -374,7 +374,7 @@ async def get_source_details(
374374)
375375async def get_all_macros (
376376 context : MultiProjectDiscoveryToolContext ,
377- project_id : int = PROJECT_ID_FIELD ,
377+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
378378 package_names : Annotated [
379379 list [str ] | None , Field (description = MACRO_PACKAGE_NAMES )
380380 ] = None ,
@@ -403,7 +403,7 @@ async def get_all_macros(
403403)
404404async def get_macro_details (
405405 context : MultiProjectDiscoveryToolContext ,
406- project_id : int = PROJECT_ID_FIELD ,
406+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
407407 name : str | None = NAME_FIELD ,
408408 unique_id : str | None = UNIQUE_ID_FIELD ,
409409) -> list [dict ]:
@@ -425,7 +425,7 @@ async def get_macro_details(
425425)
426426async def get_seed_details (
427427 context : MultiProjectDiscoveryToolContext ,
428- project_id : int = PROJECT_ID_FIELD ,
428+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
429429 name : str | None = NAME_FIELD ,
430430 unique_id : str | None = UNIQUE_ID_FIELD ,
431431) -> list [dict ]:
@@ -447,7 +447,7 @@ async def get_seed_details(
447447)
448448async def get_semantic_model_details (
449449 context : MultiProjectDiscoveryToolContext ,
450- project_id : int = PROJECT_ID_FIELD ,
450+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
451451 name : str | None = NAME_FIELD ,
452452 unique_id : str | None = UNIQUE_ID_FIELD ,
453453) -> list [dict ]:
@@ -469,7 +469,7 @@ async def get_semantic_model_details(
469469)
470470async def get_snapshot_details (
471471 context : MultiProjectDiscoveryToolContext ,
472- project_id : int = PROJECT_ID_FIELD ,
472+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
473473 name : str | None = NAME_FIELD ,
474474 unique_id : str | None = UNIQUE_ID_FIELD ,
475475) -> list [dict ]:
@@ -491,7 +491,7 @@ async def get_snapshot_details(
491491)
492492async def get_test_details (
493493 context : MultiProjectDiscoveryToolContext ,
494- project_id : int = PROJECT_ID_FIELD ,
494+ project_id : Annotated [ int , Field ( description = DISCOVERY_PROJECT_ID_DESCRIPTION )] ,
495495 name : str | None = NAME_FIELD ,
496496 unique_id : str | None = UNIQUE_ID_FIELD ,
497497) -> list [dict ]:
0 commit comments