chore: add D212 lint rule to enforce Google-style docstrings (#1892)
This commit is contained in:
parent
df039bf97c
commit
d41d0c0128
1 changed files with 452 additions and 925 deletions
|
|
@ -1,5 +1,4 @@
|
|||
"""
|
||||
Shared validation functions for server requests.
|
||||
"""Shared validation functions for server requests.
|
||||
|
||||
This module provides validation logic for sampling and elicitation requests
|
||||
that is shared across normal and task-augmented code paths.
|
||||
|
|
@ -17,8 +16,7 @@ from mcp.types import (
|
|||
|
||||
|
||||
def check_sampling_tools_capability(client_caps: ClientCapabilities | None) -> bool:
|
||||
"""
|
||||
Check if the client supports sampling tools capability.
|
||||
"""Check if the client supports sampling tools capability.
|
||||
|
||||
Args:
|
||||
client_caps: The client's declared capabilities
|
||||
|
|
@ -40,8 +38,7 @@ def validate_sampling_tools(
|
|||
tools: list[Tool] | None,
|
||||
tool_choice: ToolChoice | None,
|
||||
) -> None:
|
||||
"""
|
||||
Validate that the client supports sampling tools if tools are being used.
|
||||
"""Validate that the client supports sampling tools if tools are being used.
|
||||
|
||||
Args:
|
||||
client_caps: The client's declared capabilities
|
||||
|
|
@ -62,8 +59,7 @@ def validate_sampling_tools(
|
|||
|
||||
|
||||
def validate_tool_use_result_messages(messages: list[SamplingMessage]) -> None:
|
||||
"""
|
||||
Validate tool_use/tool_result message structure per SEP-1577.
|
||||
"""Validate tool_use/tool_result message structure per SEP-1577.
|
||||
|
||||
This validation ensures:
|
||||
1. Messages with tool_result content contain ONLY tool_result content
|
||||
|
|
|
|||
Loading…
Reference in a new issue