Skip to content

Commit 465543b

Browse files
committed
style: fix ruff lint docstring rules
1 parent 41fb32d commit 465543b

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

examples/snippets/clients/client_with_authorization.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Example: MCP client with a pre-execution authorization callback.
1+
"""Example: MCP client with a pre-execution authorization callback.
32
43
This example shows how to build a tool-execution loop that evaluates
54
every tool call against an authorization policy before execution.
@@ -20,7 +19,6 @@
2019
from mcp import ClientSession, StdioServerParameters
2120
from mcp.client.stdio import stdio_client
2221

23-
2422
# ---------------------------------------------------------------------------
2523
# Authorization layer
2624
# ---------------------------------------------------------------------------
@@ -45,8 +43,7 @@ class AuthResult:
4543

4644

4745
def default_policy(request: AuthRequest) -> AuthResult:
48-
"""
49-
A simple policy function that decides whether a tool call should
46+
"""A simple policy function that decides whether a tool call should
5047
be allowed, denied, or held for approval.
5148
5249
Replace or extend this function with your own logic — for example,
@@ -74,8 +71,7 @@ async def authorized_call_tool(
7471
arguments: dict[str, Any],
7572
policy=default_policy,
7673
) -> Any:
77-
"""
78-
Evaluate the authorization policy before calling a tool.
74+
"""Evaluate the authorization policy before calling a tool.
7975
Only executes the tool if the decision is ALLOW.
8076
"""
8177
request = AuthRequest(tool_name=tool_name, arguments=arguments)

0 commit comments

Comments
 (0)