mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-28 02:10:38 +02:00
Add empty parens to docs
This commit is contained in:
parent
38f5da1a61
commit
b3f80c5374
21 changed files with 82 additions and 82 deletions
|
|
@ -66,7 +66,7 @@ from fastmcp import FastMCP
|
|||
|
||||
mcp = FastMCP("MyServer")
|
||||
|
||||
@mcp.tool
|
||||
@mcp.tool()
|
||||
def hello(name: str) -> str:
|
||||
return f"Hello, {name}!"
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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}!"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue