Skip to content

Commit 5873bdd

Browse files
committed
examples
1 parent 4027141 commit 5873bdd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def get_settings() -> str:
294294
# Form-style query expansion examples using RFC 6570 URI templates
295295

296296

297-
@mcp.resource("articles://{article_id}/view{?format,lang}")
297+
@mcp.resource("articles://{article_id}/view")
298298
def view_article(article_id: str, format: str = "html", lang: str = "en") -> str:
299299
"""View an article with optional format and language selection.
300300
@@ -313,7 +313,7 @@ def view_article(article_id: str, format: str = "html", lang: str = "en") -> str
313313
return content
314314

315315

316-
@mcp.resource("search://query/{search_term}{?page,limit,category,sort}")
316+
@mcp.resource("search://query/{search_term}")
317317
def search_content(
318318
search_term: str, page: int = 1, limit: int = 10, category: str = "all", sort: str = "relevance"
319319
) -> str:
@@ -336,7 +336,7 @@ def search_content(
336336
return results
337337

338338

339-
@mcp.resource("users://{user_id}/profile{?include_private,format}")
339+
@mcp.resource("users://{user_id}/profile")
340340
def get_user_profile(user_id: str, include_private: bool = False, format: str = "summary") -> str:
341341
"""Get user profile with optional private data and format selection.
342342
@@ -358,7 +358,7 @@ def get_user_profile(user_id: str, include_private: bool = False, format: str =
358358
return str(profile_data)
359359

360360

361-
@mcp.resource("api://weather/{location}{?units,lang,include_forecast,days}")
361+
@mcp.resource("api://weather/{location}")
362362
def get_weather_data(
363363
location: str, units: str = "metric", lang: str = "en", include_forecast: bool = False, days: int = 5
364364
) -> str:

examples/snippets/servers/basic_resource.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def get_settings() -> str:
2323
# Form-style query expansion examples using RFC 6570 URI templates
2424

2525

26-
@mcp.resource("articles://{article_id}/view{?format,lang}")
26+
@mcp.resource("articles://{article_id}/view")
2727
def view_article(article_id: str, format: str = "html", lang: str = "en") -> str:
2828
"""View an article with optional format and language selection.
2929
@@ -42,7 +42,7 @@ def view_article(article_id: str, format: str = "html", lang: str = "en") -> str
4242
return content
4343

4444

45-
@mcp.resource("search://query/{search_term}{?page,limit,category,sort}")
45+
@mcp.resource("search://query/{search_term}")
4646
def search_content(
4747
search_term: str, page: int = 1, limit: int = 10, category: str = "all", sort: str = "relevance"
4848
) -> str:
@@ -65,7 +65,7 @@ def search_content(
6565
return results
6666

6767

68-
@mcp.resource("users://{user_id}/profile{?include_private,format}")
68+
@mcp.resource("users://{user_id}/profile")
6969
def get_user_profile(user_id: str, include_private: bool = False, format: str = "summary") -> str:
7070
"""Get user profile with optional private data and format selection.
7171
@@ -87,7 +87,7 @@ def get_user_profile(user_id: str, include_private: bool = False, format: str =
8787
return str(profile_data)
8888

8989

90-
@mcp.resource("api://weather/{location}{?units,lang,include_forecast,days}")
90+
@mcp.resource("api://weather/{location}")
9191
def get_weather_data(
9292
location: str, units: str = "metric", lang: str = "en", include_forecast: bool = False, days: int = 5
9393
) -> str:

0 commit comments

Comments
 (0)