From c70ac4284ddc8a04d83ae5cadcc89c1080fef50f Mon Sep 17 00:00:00 2001 From: zzstoatzz Date: Sun, 22 Jun 2025 23:10:54 -0500 Subject: [PATCH] allow config limit --- examples/atproto_mcp/src/atproto_mcp/server.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/examples/atproto_mcp/src/atproto_mcp/server.py b/examples/atproto_mcp/src/atproto_mcp/server.py index c503a4a09..9dff13895 100644 --- a/examples/atproto_mcp/src/atproto_mcp/server.py +++ b/examples/atproto_mcp/src/atproto_mcp/server.py @@ -35,9 +35,13 @@ def atproto_status() -> ProfileInfo: @atproto_mcp.resource("atproto://timeline") -def get_timeline() -> TimelineResult: +def get_timeline( + limit: Annotated[ + int, Field(default=10, ge=1, le=100, description="Number of results to return") + ] = 10, +) -> TimelineResult: """Get the authenticated user's timeline feed.""" - return _atproto.fetch_timeline(10) + return _atproto.fetch_timeline(limit) @atproto_mcp.resource("atproto://search/{query}") @@ -52,9 +56,13 @@ def search_posts( @atproto_mcp.resource("atproto://notifications") -def get_notifications() -> NotificationsResult: +def get_notifications( + limit: Annotated[ + int, Field(default=10, ge=1, le=100, description="Number of results to return") + ] = 10, +) -> NotificationsResult: """Get recent notifications for the authenticated user.""" - return _atproto.fetch_notifications(10) + return _atproto.fetch_notifications(limit) # Tools - actions that modify state