Add empty parens to docs

This commit is contained in:
Jeremiah Lowin 2025-06-04 17:39:57 -04:00
commit b3f80c5374
21 changed files with 82 additions and 82 deletions

View file

@ -66,7 +66,7 @@ from fastmcp import FastMCP
mcp = FastMCP("MyServer")
@mcp.tool
@mcp.tool()
def hello(name: str) -> str:
return f"Hello, {name}!"

View file

@ -28,7 +28,7 @@ from fastmcp import FastMCP
mcp = FastMCP()
class MyClass:
@mcp.tool # This won't work correctly
@mcp.tool() # This won't work correctly
def add(self, x, y):
return x + y
@ -83,7 +83,7 @@ mcp = FastMCP()
class MyClass:
@classmethod
@mcp.tool # This won't work correctly
@mcp.tool() # This won't work correctly
def from_string(cls, s):
return cls(s)
```
@ -122,7 +122,7 @@ mcp = FastMCP()
class MyClass:
@staticmethod
@mcp.tool # This works!
@mcp.tool() # This works!
def utility(x, y):
return x + y

View file

@ -25,7 +25,7 @@ from starlette.requests import Request
mcp = FastMCP(name="HTTP Request Demo")
@mcp.tool
@mcp.tool()
async def user_agent_info() -> dict:
"""Return information about the user agent."""
# Get the HTTP request
@ -58,7 +58,7 @@ from fastmcp.server.dependencies import get_http_headers
mcp = FastMCP(name="Headers Demo")
@mcp.tool
@mcp.tool()
async def safe_header_info() -> dict:
"""Safely get header information without raising errors."""
# Get headers (returns empty dict if no request context)

View file

@ -22,7 +22,7 @@ from fastmcp import FastMCP, Client
def mcp_server():
server = FastMCP("TestServer")
@server.tool
@server.tool()
def greet(name: str) -> str:
return f"Hello, {name}!"