Support for http request injection propagation to tools (#816)
This commit is contained in:
parent
532b1176f9
commit
70014a2bbb
1 changed files with 413 additions and 35 deletions
|
|
@ -6,7 +6,7 @@ from typing import TYPE_CHECKING, Any
|
|||
from mcp.server.fastmcp.exceptions import ToolError
|
||||
from mcp.server.fastmcp.tools.base import Tool
|
||||
from mcp.server.fastmcp.utilities.logging import get_logger
|
||||
from mcp.shared.context import LifespanContextT
|
||||
from mcp.shared.context import LifespanContextT, RequestT
|
||||
from mcp.types import ToolAnnotations
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -65,7 +65,7 @@ class ToolManager:
|
|||
self,
|
||||
name: str,
|
||||
arguments: dict[str, Any],
|
||||
context: Context[ServerSessionT, LifespanContextT] | None = None,
|
||||
context: Context[ServerSessionT, LifespanContextT, RequestT] | None = None,
|
||||
) -> Any:
|
||||
"""Call a tool by name with arguments."""
|
||||
tool = self.get_tool(name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue